This snippet will show you how to add multi spells on NPCs (it may have a few bugs):
Add this import at the top of CombatAssistant:
Code:
import server.model.npcs.NPC;
Add these methods in CombatAssistant.java
Code:
public void multiSpellEffectNPC(int npcId, int damage) {
switch(c.MAGIC_SPELLS[c.oldSpellId][0]) {
case 12891:
case 12881:
if (Server.npcHandler.npcs[npcId].freezeTimer < -4) {
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);
}
}
}
}
Then, search for:
Code:
} else if (Server.npcHandler.npcs[i].npcType == 2881 || Server.npcHandler.npcs[i].npcType == 2882) {
damage = 0;
magicFailed = true;
}
Under that, add
Code:
for (int j = 0; j < Server.npcHandler.npcs.length; j++) {
if (Server.npcHandler.npcs[j] != null && Server.npcHandler.npcs[j].MaxHP > 0) {
int nX = Server.npcHandler.npcs[j].getX();
int nY = Server.npcHandler.npcs[j].getY();
int pX = Server.npcHandler.npcs[i].getX();
int pY = Server.npcHandler.npcs[i].getY();
if ((nX - pX == -1 || nX - pX == 0 || nX - pX == 1) && (nY - pY == -1 || nY - pY == 0 || nY - pY == 1)) {
if (multis() && Server.npcHandler.npcs[i].inMulti()) {
Client p = (Client) Server.playerHandler.players[c.playerId];
appendMultiBarrageNPC(j, c.magicFailed);
Server.npcHandler.attackPlayer(p, j);
}
}
}
}
Lastly, in NPC.java add:
Code:
public void dealDamage(int damage) {
if (damage > HP) {
damage = HP;
}
HP -= damage;
}
That should be it, tell me if I forgot any methods and I will post them ASAP.