sp.setLoc(guard_spawn_loc);
sp.setReflection(actor.getReflection());
NpcInstance guard = sp.doSpawn(true);
Location runLoc = new Location(run[1], run[2], run[3]);
guard.setRunning();
DefaultAI ai = (DefaultAI) guard.getAI();
ai.addTaskMove(runLoc, true);
ai.setGlobalAggro(0);
Creature hated = actor.getAggroList().getRandomHated();
if (hated != null)
{
guard.getAggroList().addDamageHate(hated, 0, Rnd.get(1, 100));
ai.setAttackTimeout(getMaxAttackTimeout() + System.currentTimeMillis());
ai.setAttackTarget(hated);
ai.changeIntention(CtrlIntention.AI_INTENTION_ATTACK, hated, null);
ai.addTaskAttack(hated);
}
}
catch (Exception e)
{
e.printStackTrace();