Thread: Pi, Ice barrage doesn't aggro npc's

Results 1 to 3 of 3
  1. #1 Pi, Ice barrage doesn't aggro npc's 
    Registered Member
    Join Date
    Feb 2017
    Posts
    4
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Hello, I really need some help with this one as I'm kinda new with coding and have been stuck on this for sometime now.
    So what is happening is when I cast ice barrage or any Aoe spell I only aggro the Npc I attack and the others just take damage and freeze from ice barrage once that has worn off they carry on walking about like normal. The npc's effected by the damage will hit you once if you're close enough to them but only once.
    I've enabled Npc and player multi zones and I'm running on Hybird PvP base and I'm very happy as this is the last thing I need to fix with combat. Ill also link a video of the problem!
    P.S I'm sorry for wanting a spoonfeed on this

    Video:


    My code for barrage:

    Code:
    	public void multiSpellEffectNPC(int npcId, int damage) {					
    		switch(c.MAGIC_SPELLS[c.oldSpellId][0]) {
    			case 12871:
    			case 12891:
    				if (Server.npcHandler.npcs[npcId].freezeTimer < 33) {
    					Server.npcHandler.npcs[npcId].freezeTimer = getFreezeTime();
    
    				}
    			break;
    
    		}	
    	}
    
    public boolean checkMultiBarrageReqsNPC(int i) {
    		if(Server.npcHandler.npcs[i] == null) {
    		return false;
    		} else {
    			return true;
    		}
    	}
    
    public void appendMultiBarrageNPC(int npcId, boolean splashed) {
    		if (Server.npcHandler.npcs[npcId] != null) {
    
    			NPC n = (NPC)Server.npcHandler.npcs[npcId];
    			if (n.isDead)
    				return;
    			if (checkMultiBarrageReqsNPC(npcId)) {
    				c.barrageCount++;
    				Server.npcHandler.npcs[npcId].underAttackBy = c.playerId;
    				Server.npcHandler.npcs[npcId].underAttack = true;
    				if (Misc.random(mageAtk()) > Misc.random(mageDef()) && !c.magicFailed) {
    					if(getEndGfxHeight() == 100){ // end GFX
    						n.gfx100(c.MAGIC_SPELLS[c.oldSpellId][5]);
    					} else {
    						n.gfx0(c.MAGIC_SPELLS[c.oldSpellId][5]);
    					}
    					int damage = Misc.random(c.MAGIC_SPELLS[c.oldSpellId][6]);
    					if (Server.npcHandler.npcs[npcId].HP - damage < 0) { 
    						damage = Server.npcHandler.npcs[npcId].HP;
    					}		
    					c.getPA().addSkillXP((c.MAGIC_SPELLS[c.oldSpellId][7] + damage*Config.MAGIC_EXP_RATE), 6); 
    					c.getPA().addSkillXP((c.MAGIC_SPELLS[c.oldSpellId][7] + damage*Config.MAGIC_EXP_RATE/3), 3);
    					Server.npcHandler.npcs[npcId].handleHitMask(damage);
    					Server.npcHandler.npcs[npcId].dealDamage(damage);
    					c.totalPlayerDamageDealt += damage;
    					multiSpellEffectNPC(npcId, damage);
    				} else {
    					n.gfx100(85);
    				}			
    			}		
    		}
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Check what is making a npc aggro (aka method) and apply it in your codes.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2017
    Posts
    4
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by arch337 View Post
    Check what is making a npc aggro (aka method) and apply it in your codes.
    Thanks, I've fixed it! just needed to add

    Code:
    				Server.npcHandler.npcs[npcId].killerId = c.playerId;
    I have repped you good sir!
    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. [PI] Ice Barrage orb
    By Hellobuddyhowareyou in forum Help
    Replies: 22
    Last Post: 08-03-2011, 01:50 PM
  2. [PI] Ice barrage orb...
    By Hellobuddyhowareyou in forum Help
    Replies: 16
    Last Post: 05-23-2011, 10:11 PM
  3. [PI] Ice Barrage [PI]
    By Kickyamom in forum Help
    Replies: 26
    Last Post: 03-01-2011, 10:28 PM
  4. [pi] ice barrage as skillcape emote
    By Mark in forum Help
    Replies: 14
    Last Post: 09-30-2010, 04:49 PM
  5. [pi] ice barrage as skillcape emote
    By Mickt3 in forum Help
    Replies: 9
    Last Post: 09-30-2010, 04:39 PM
Tags for this Thread

View Tag Cloud

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