Skip to content

Instantly share code, notes, and snippets.

@Pandragon
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pandragon/9614666 to your computer and use it in GitHub Desktop.
Save Pandragon/9614666 to your computer and use it in GitHub Desktop.
### Eclipse Workspace Patch 1.0
#P L2J_Server_BETA
Index: java/com/l2jserver/gameserver/ai/L2AttackableAI.java
===================================================================
--- java/com/l2jserver/gameserver/ai/L2AttackableAI.java (revision 6577)
+++ java/com/l2jserver/gameserver/ai/L2AttackableAI.java (working copy)
@@ -723,7 +723,7 @@
L2Character originalAttackTarget = getAttackTarget();
// Check if target is dead or if timeout is expired to stop this attack
- 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
if (originalAttackTarget != null)
@@ -738,6 +738,21 @@
return;
}
+ if (_attackTimeout < GameTimeController.getInstance().getGameTicks())
+ {
+ // 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();
// Handle all L2Object of its Faction inside the Faction Range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment