Monsters teleport back to spawn.
This commit is contained in:
@@ -827,11 +827,15 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
|
||||
// Check if target is dead or if timeout is expired to stop this attack
|
||||
final L2Character originalAttackTarget = getAttackTarget();
|
||||
if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead() || (_attackTimeout < GameTimeController.getInstance().getGameTicks()))
|
||||
if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead())
|
||||
{
|
||||
// Stop hating this target after the attack timeout or if target is dead
|
||||
npc.stopHating(originalAttackTarget);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attackTimeout < GameTimeController.getInstance().getGameTicks())
|
||||
{
|
||||
// Set the AI Intention to AI_INTENTION_ACTIVE
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
|
||||
@@ -839,6 +843,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
{
|
||||
npc.setWalking();
|
||||
}
|
||||
|
||||
// Monster teleport to spawn
|
||||
if (npc.isMonster() && (npc.getSpawn() != null))
|
||||
{
|
||||
npc.teleToLocation(npc.getSpawn(), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user