I recently tried adding custom attacks to a certain NPC, these attacks are range and magic based but I have a slight problem with them.
The range attack works fine, yet the magic attack (ice barrage) starts at the middle of the character not at the bottom.
Code:
case 189:
Client c = (Client) Server.playerHandler.players[npcs[i].oldIndex];
random = Misc.random(2);
if (random == 0) {
npcs[i].attackType = 1; //magic
npcs[i].endGfx = 369;
//npcs[i].projectileId = 369;
c.freezeTimer = 30;
c.frozenBy = c.playerId;
c.stopMovement();
c.getCombat().resetPlayerAttack();
c.sendMessage("You have been frozen.");
npcs[i].forcedText = "You can't escape now!";
npcs[i].forcedChatRequired = true;
npcs[i].updateRequired = true;
} else if (random == 1);
npcs[i].attackType = 2; //RANGE
npcs[i].endGfx = 24;
//npcs[i].projectileId = 24;
break;
I also have another problem with the npc crashing the server, this mainly happens when walking away from the npc while it is shooting/using magic at me.