Thread: Need some NPC help. (Unkillable, doesnt hit player)

Results 1 to 6 of 6
  1. #1 Need some NPC help. (Unkillable, doesnt hit player) 
    Registered Member
    AndyJay's Avatar
    Join Date
    Jun 2008
    Posts
    1,285
    Thanks given
    38
    Thanks received
    48
    Rep Power
    84
    Fixed this.
    Reply With Quote  
     

  2. #2  
    Registered Member
    AndyJay's Avatar
    Join Date
    Jun 2008
    Posts
    1,285
    Thanks given
    38
    Thanks received
    48
    Rep Power
    84
    Bump!
    Reply With Quote  
     

  3. #3  
    Registered Member Glabay's Avatar
    Join Date
    Jul 2008
    Age
    31
    Posts
    1,212
    Thanks given
    141
    Thanks received
    55
    Discord
    View profile
    Rep Power
    455
    well to make them stop attacking back, for them npc you may want to make a return for them, so they won't be in combat, and to keep them from dieing just make something like oh idk


    Code:
     		for (int j = 0; j < trainingNpcs.length; ++j) {
    			if ((npcType == trainingNpcs[j]) && (currentHP <= 1)) {
    				currentHP = getMaxHP();
    				isDead = false;
    			}
    		}
    the array

    Code:
    		public int[] trainingNpcs = {*ADD_NPC_HERE!*};

    MaxHP

    Code:
    	int getMaxHP() {
    	    switch (npcType) {
                    case ##
                       return ##;
                       break;
    	    }
    	    return 0;
             }
    PI * 13.37 = 42
    There are 10 kinds of people; those who know Binary and those who don't
    Why programmers confuse Christmas and Halloween; Because 31 OCT = 25 DEC.
    Reply With Quote  
     

  4. #4  
    Registered Member
    AndyJay's Avatar
    Join Date
    Jun 2008
    Posts
    1,285
    Thanks given
    38
    Thanks received
    48
    Rep Power
    84
    Quote Originally Posted by glabay View Post
    well to make them stop attacking back, for them npc you may want to make a return for them, so they won't be in combat, and to keep them from dieing just make something like oh idk


    Code:
     		for (int j = 0; j < trainingNpcs.length; ++j) {
    			if ((npcType == trainingNpcs[j]) && (currentHP <= 1)) {
    				currentHP = getMaxHP();
    				isDead = false;
    			}
    		}
    the array

    Code:
    		public int[] trainingNpcs = {*ADD_NPC_HERE!*};

    MaxHP

    Code:
    	int getMaxHP() {
    	    switch (npcType) {
                    case ##
                       return ##;
                       break;
    	    }
    	    return 0;
             }
    Ty, I'll have a bash at this. I'm guessing I'd add this in the PlayeronNPC combat thingy?
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Jan 2008
    Posts
    2,345
    Thanks given
    20
    Thanks received
    575
    Rep Power
    1202
    Lol glabay, why would you do this shit, especially if it's wrong?
    Reply With Quote  
     

  6. #6  
    Registered Member
    AndyJay's Avatar
    Join Date
    Jun 2008
    Posts
    1,285
    Thanks given
    38
    Thanks received
    48
    Rep Power
    84
    Nvm guys I've done it now. Just use a if(npctype == 4474 etc, then make it reset the npcattack on the player and other stuff.
    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
  •