Monster teleport to spawn.
This commit is contained in:
@@ -686,7 +686,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
|
|
||||||
L2Character originalAttackTarget = getAttackTarget();
|
L2Character originalAttackTarget = getAttackTarget();
|
||||||
// Check if target is dead or if timeout is expired to stop this attack
|
// Check if target is dead or if timeout is expired to stop this attack
|
||||||
if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead() || ((_attackTimeout < GameTimeController.getInstance().getGameTicks()) && npc.canStopAttackByTime()))
|
if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead())
|
||||||
{
|
{
|
||||||
// Stop hating this target after the attack timeout or if target is dead
|
// Stop hating this target after the attack timeout or if target is dead
|
||||||
if (originalAttackTarget != null)
|
if (originalAttackTarget != null)
|
||||||
@@ -701,6 +701,21 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((_attackTimeout < GameTimeController.getInstance().getGameTicks()) && npc.canStopAttackByTime())
|
||||||
|
{
|
||||||
|
// Set the AI Intention to AI_INTENTION_ACTIVE
|
||||||
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
|
|
||||||
|
npc.setWalking();
|
||||||
|
|
||||||
|
// Monster teleport to spawn
|
||||||
|
if (npc.isMonster() && (npc.getSpawn() != null))
|
||||||
|
{
|
||||||
|
npc.teleToLocation(npc.getSpawn(), false);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final int collision = npc.getTemplate().getCollisionRadius();
|
final int collision = npc.getTemplate().getCollisionRadius();
|
||||||
|
|
||||||
// Handle all L2Object of its Faction inside the Faction Range
|
// Handle all L2Object of its Faction inside the Faction Range
|
||||||
|
Reference in New Issue
Block a user