Thread: [PI] CycleEvent's for Firemaking

Results 1 to 2 of 2
  1. #1 [PI] CycleEvent's for Firemaking 
    Registered Member

    Join Date
    Sep 2008
    Posts
    4,833
    Thanks given
    894
    Thanks received
    1,439
    Rep Power
    2924
    Okay, first let me show you the code, This is Initilised at the top of the class,
    Code:
    private int fireCount = 0;
    This is the lightFire method, At this point i know that it is not going to walk one place X or Y, thats fine. & I know that it wont create ashes which is fine also, Im executing this method, and it seems to be never ending. And the fire is NOT De-spawning.

    My Idea for why the fire dosent despawn: GetX & GetY are updating to the players position and not where the fire was created.
    Any Ideas on this?
    Code:
    public void lightFire(int slot) {
    		if (c.duelStatus >= 5) {
    			c.sendMessage("Why am I trying to light a fire in the duel arena?");
    			return;
    		}	
    		if (c.playerLevel[c.playerFiremaking] >= level[slot]) {
    			if (c.getItems().playerHasItem(590) && c.getItems().playerHasItem(logs[slot])) {
    				if (System.currentTimeMillis() - lastLight > DELAY) {
    					c.startAnimation(733,0);
    					final int PosX = c.getX();
    					final int posY = c.getY();
    					c.getItems().deleteItem(logs[slot], c.getItems().getItemSlot(logs[slot]), 1);
    					c.getPA().addSkillXP(logs[slot] * Config.FIREMAKING_EXPERIENCE, c.playerFiremaking);
    					
    					CycleEventHandler.getSingleton().addEvent(1337, c, new CycleEvent() {
    			@Override
    			public void execute(CycleEventContainer container) {
    			if (fireCount == 0) {
    				c.getPA().checkObjectSpawn(2732, PosX, posY, 1, 10);
    			
    				fireCount = 0;
    				System.out.println("Constructing fire");
    			}
    			if (fireCount == 15) {
    			container.stop();
    			}
    			if (fireCount != 15 && fireCount != 0) {
    			fireCount++;
    			}
    			}
    			@Override
    			public void stop() {
    				c.getPA().checkObjectSpawn(-1, PosX, posY, 1, 10);
    				System.out.println("Destructing fire");
    			}
    		}, 1);
    					c.sendMessage("You light the fire.");
    					this.lastLight = System.currentTimeMillis();
    					resetAnim = true;
    				}
    			}
    		}	
    	}
    "Know thy self, know thy enemy. A thousand battles, a thousand victories." - Sun Tzu
    GitHub: https://github.com/Faris-Mckay
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Sep 2008
    Posts
    4,833
    Thanks given
    894
    Thanks received
    1,439
    Rep Power
    2924
    Bump
    "Know thy self, know thy enemy. A thousand battles, a thousand victories." - Sun Tzu
    GitHub: https://github.com/Faris-Mckay
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. firemaking
    By Andrew in forum Help
    Replies: 5
    Last Post: 12-19-2010, 10:48 PM
  2. firemaking little help
    By kopjekoffiee in forum Help
    Replies: 2
    Last Post: 12-09-2010, 01:05 AM
  3. [PI] - Firemaking
    By NewCoding in forum Help
    Replies: 2
    Last Post: 10-07-2010, 08:55 PM
  4. Firemaking, yes/no.
    By Kastro in forum Voting
    Replies: 6
    Last Post: 01-17-2010, 02:04 PM
  5. Firemaking
    By zezarak in forum Help
    Replies: 1
    Last Post: 05-05-2009, 04:53 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •