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);
}
}
}