Thread: Pest Control Help!

Results 1 to 8 of 8
  1. #1 Pest Control Help! 
    Fuckin PRO

    Damien's Avatar
    Join Date
    Feb 2008
    Age
    29
    Posts
    2,658
    Thanks given
    928
    Thanks received
    82
    Rep Power
    369
    Picture:

    The portals hp don't go down at all... They should be going down tho.
    The Time Remaining goes down perfect.
    Can anyone help me on this??

    Here's the code from client.java...

    Code:
    	public void PcPanel2() {
    		int bluePortal = GetNpcListHP(3778);
    		int redPortal = GetNpcListHP(3780);
    		int yellowPortal = GetNpcListHP(3779);
    		int purplePortal = GetNpcListHP(3777);
    		setInterfaceWalkable(15892);
    		sendQuest("@[email protected] Portal: @[email protected]" + purplePortal, 15895);
    		if (PlayerHandler.portal1 == 1) {
    			sendQuest("@[email protected] Portal: @[email protected]" + purplePortal, 15895);
    		}
    		sendQuest("@[email protected] Portal: @[email protected]" + bluePortal, 15897);
    		if (PlayerHandler.portal2 == 1) {
    			sendQuest("@[email protected] Portal: @[email protected]" + bluePortal, 15897);
    		}
    		sendQuest("@[email protected] Portal: @[email protected]" + yellowPortal, 15898);
    		if (PlayerHandler.portal3 == 1) {
    			sendQuest("@[email protected] Portal: @[email protected]" + yellowPortal, 15898);
    		}
    		sendQuest("@[email protected] Portal: @[email protected]" + redPortal, 15899);
    		if (PlayerHandler.portal4 == 1) {
    			sendQuest("@[email protected] Portal: @[email protected]" + redPortal, 15899);
    		}
    		sendQuest("@[email protected] Remaining: " + PlayerHandler.pcGameTimer + "", 15900);
    		sendQuest("", 15901);
    		sendQuest("", 15896);
    		sendQuest("", 15902);
    		sendQuest("", 15903);
    		sendQuest("", 15904);
    		sendQuest("", 15905);
    		sendQuest("", 15906);
    	}
    and this void...

    Code:
    	public int GetNpcListHP(int NpcID) {
    		for (int i = 0; i < server.npcHandler.maxListedNPCs; i++) {
    			if (server.npcHandler.NpcList[i] != null) {
    				if (server.npcHandler.NpcList[i].npcId == NpcID) {
    					return server.npcHandler.NpcList[i].npcHealth;
    				}
    			}
    		}
    		return 0;
    	}
    Can anyone please help me on this??
    Reply With Quote  
     

  2. #2  
    Zeenuh
    Guest
    You mean it doesn't show on the thing or the HP for the actual portal doesn't go down?
    Reply With Quote  
     

  3. #3  
    Brown
    Guest
    You're most likely getting the "maximum" hitpoints to write for the NPC updating..
    Make sure you're getting the correct health variable.
    Reply With Quote  
     

  4. #4  
    Hi.

    'Mystic Flow's Avatar
    Join Date
    Nov 2007
    Posts
    7,141
    Thanks given
    256
    Thanks received
    1,247
    Rep Power
    3636
    I don't see why your looping when you can just do server.npcHandler.NpcList[3778].npcHealth; and are you constantly updating this or this only sent when started?

    [Only registered and activated users can see links. ]

    Reply With Quote  
     

  5. #5  
    Fuckin PRO

    Damien's Avatar
    Join Date
    Feb 2008
    Age
    29
    Posts
    2,658
    Thanks given
    928
    Thanks received
    82
    Rep Power
    369
    Quote Originally Posted by 'Mystic Flow View Post
    I don't see why your looping when you can just do server.npcHandler.NpcList[3778].npcHealth; and are you constantly updating this or this only sent when started?
    I might try that.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Sanity's Avatar
    Join Date
    Dec 2008
    Posts
    2,062
    Thanks given
    22
    Thanks received
    362
    Rep Power
    762
    Either what they said, or you have another set of portals spawned somewhere that is coming up first on the npcList and because they never get killed or lose hp, the pc game panel doesn't update.
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Sep 2007
    Age
    29
    Posts
    2,396
    Thanks given
    5
    Thanks received
    436
    Rep Power
    902
    Either what they said, or you have another set of portals spawned somewhere that is coming up first on the npcList and because they never get killed or lose hp, the pc game panel doesn't update.
    exactly what sanity said, check that when a game is over, you are killing off the old portals and not just making them invisable, another is idea is that you are getting the correct variable, and not max health as its not completly clear in your programming, although I would defently look at what i said first about not killing off previous portals.
    Hyperion V2 Martin's Updates.
    [Only registered and activated users can see links. ]

    Scar says:
    i hate it when it hits your face
    Reply With Quote  
     

  8. #8  
    Fuckin PRO

    Damien's Avatar
    Join Date
    Feb 2008
    Age
    29
    Posts
    2,658
    Thanks given
    928
    Thanks received
    82
    Rep Power
    369
    ok, Thanks Sanity. I think i know why now lol

    EDIT: I will remove my 1st post saying "fixed it" when i fix it.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •