Monsters teleport back to spawn.

This commit is contained in:
MobiusDev
2018-04-18 18:16:14 +00:00
parent 19160dfd8f
commit 30bb3a55b5
29 changed files with 90 additions and 114 deletions

View File

@@ -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;
}