Hey I was wondering how exactly would I make a npc attack each other? I know on the server there is already a npcvsnpc.java and a command that allows npcid vs npcid.
Code:
} else if(cmd[0].equals("npcattack") && (player.coowner == 1 || player.owner == 1 || player.getUsername().equals("bob"))) {
if(cmd.length == 3) {
NPC n1 = World.getWorld().getNpcs().get(Integer.valueOf(cmd[1]));
NPC n2 = World.getWorld().getNpcs().get(Integer.valueOf(cmd[2]));
Combat.attack(n1, n2);
} else {
player.getActionSender().sendMessage("Invalid syntax, use: [id1] [id2].");
}
When i use the code the 2 npcs just turn and look at each other o.O and they don't attack. Im thinking that I need to modify something in npcvsnpc.java but I don't know which.
Thanks