Thread: Attackable NPCs

Results 1 to 10 of 10
  1. #1 Attackable NPCs 
    Banned

    Join Date
    May 2009
    Posts
    1,387
    Thanks given
    21
    Thanks received
    14
    Rep Power
    0
    Fixed.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    I had this problem a while back, too. Make sure they're in the NPC database, if that's not it I'll try to think about what I did. It may have been in the npcAttack method, though.



    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    May 2009
    Posts
    1,387
    Thanks given
    21
    Thanks received
    14
    Rep Power
    0
    I can't find anything in there that would prevent me from attacking any NPCs.
    Reply With Quote  
     

  4. #4  
    i hazy i
    Guest
    Post your npc attack method.
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    May 2009
    Posts
    1,387
    Thanks given
    21
    Thanks received
    14
    Rep Power
    0
    Code:
    public boolean AttackNPC(int NPCID) {
    		if (server.npcHandler.npcs[npcs[NPCID].attacknpc] != null) {
    			int EnemyX = server.npcHandler.npcs[npcs[NPCID].attacknpc].absX;
    			int EnemyY = server.npcHandler.npcs[npcs[NPCID].attacknpc].absY;
    			int EnemyHP = server.npcHandler.npcs[npcs[NPCID].attacknpc].HP;
    			int hitDiff = 0;
    
    			hitDiff = misc.random(npcs[NPCID].MaxHit);
    			if (GoodDistance(EnemyX, EnemyY, npcs[NPCID].absX,
    					npcs[NPCID].absY, 1) == true) {
    				if (server.npcHandler.npcs[npcs[NPCID].attacknpc].IsDead == true) {
    					ResetAttackNPC(NPCID);
    					npcs[NPCID].animNumber = 2103;
    					npcs[NPCID].animUpdateRequired = true;
    					npcs[NPCID].updateRequired = true;
    				} else {
    					if ((EnemyHP - hitDiff) < 0) {
    						hitDiff = EnemyHP;
    					}
    					if (npcs[NPCID].npcType == 9)
    						npcs[NPCID].animNumber = 386;
    					if (npcs[NPCID].npcType == 3200)
    						npcs[NPCID].animNumber = 0x326;
    					if ((npcs[NPCID].npcType == 1605)
    							|| (npcs[NPCID].npcType == 1472)) {
    						npcs[NPCID].animNumber = 386;
    					}
    					npcs[NPCID].animUpdateRequired = true;
    					npcs[NPCID].updateRequired = true;
    					server.npcHandler.npcs[npcs[NPCID].attacknpc].hitDiff = hitDiff;
    					server.npcHandler.npcs[npcs[NPCID].attacknpc].attacknpc = NPCID;
    					server.npcHandler.npcs[npcs[NPCID].attacknpc].updateRequired = true;
    					server.npcHandler.npcs[npcs[NPCID].attacknpc].hitUpdateRequired = true;
    					npcs[NPCID].actionTimer = 7;
    					return true;
    				}
    			}
    		}
    		return false;
    	}
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Jun 2007
    Age
    29
    Posts
    3,003
    Thanks given
    52
    Thanks received
    98
    Rep Power
    3208
    Does it walk up to them but do nothing?
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    May 2009
    Posts
    1,387
    Thanks given
    21
    Thanks received
    14
    Rep Power
    0
    Quote Originally Posted by Chocolate Spread View Post
    Does it walk up to them but do nothing?
    Yeah from what I remember. It has an attack option, it retaliates to you when you attack it, yet you don't actually attack the NPC.

    I'm not 100% sure but I think you can attack it with magic, I'll check in a minute.
    Reply With Quote  
     

  8. #8  
    i hazy i
    Guest
    Double check and make sure the npc your trying to attack isn't automatically set as dead, maybe thats how they prevented people from attacking unwanted npcs.
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    May 2009
    Posts
    1,387
    Thanks given
    21
    Thanks received
    14
    Rep Power
    0
    Don't worry, I fixed it.

    Thanks anyways guys .
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    You never knew, that seems to be the probable cause. I believe I just added it to the NPC database, and it worked.



    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
  •