|
@@ -19,11 +19,9 @@
|
|
package com.l2jserver.gameserver.model.actor.instance;
|
|
package com.l2jserver.gameserver.model.actor.instance;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.concurrent.Future;
|
|
|
|
import java.util.logging.Logger;
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
import com.l2jserver.Config;
|
|
import com.l2jserver.Config;
|
|
-import com.l2jserver.gameserver.ThreadPoolManager;
|
|
|
|
import com.l2jserver.gameserver.ai.CtrlIntention;
|
|
import com.l2jserver.gameserver.ai.CtrlIntention;
|
|
import com.l2jserver.gameserver.ai.L2AttackableAI;
|
|
import com.l2jserver.gameserver.ai.L2AttackableAI;
|
|
import com.l2jserver.gameserver.enums.InstanceType;
|
|
import com.l2jserver.gameserver.enums.InstanceType;
|
|
@@ -46,22 +44,6 @@ public class L2GuardInstance extends L2Attackable
|
|
{
|
|
{
|
|
private static Logger _log = Logger.getLogger(L2GuardInstance.class.getName());
|
|
private static Logger _log = Logger.getLogger(L2GuardInstance.class.getName());
|
|
|
|
|
|
- private static final int RETURN_INTERVAL = 60000;
|
|
|
|
-
|
|
|
|
- private Future<?> _returnTask;
|
|
|
|
-
|
|
|
|
- public class ReturnTask implements Runnable
|
|
|
|
- {
|
|
|
|
- @Override
|
|
|
|
- public void run()
|
|
|
|
- {
|
|
|
|
- if (getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)
|
|
|
|
- {
|
|
|
|
- returnHome();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Constructor of L2GuardInstance (use L2Character and L2NpcInstance constructor).<br>
|
|
* Constructor of L2GuardInstance (use L2Character and L2NpcInstance constructor).<br>
|
|
* <B><U> Actions</U> :</B>
|
|
* <B><U> Actions</U> :</B>
|
|
@@ -100,20 +82,6 @@ public class L2GuardInstance extends L2Attackable
|
|
return attacker instanceof L2MonsterInstance;
|
|
return attacker instanceof L2MonsterInstance;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * Notify the L2GuardInstance to return to its home location (AI_INTENTION_MOVE_TO) and clear its _aggroList.
|
|
|
|
- */
|
|
|
|
- @Override
|
|
|
|
- public void returnHome()
|
|
|
|
- {
|
|
|
|
- if (!isInsideRadius(getSpawn(), 150, false, false))
|
|
|
|
- {
|
|
|
|
- clearAggroList();
|
|
|
|
-
|
|
|
|
- getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, getSpawn().getLocation());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Set the home location of its L2GuardInstance.
|
|
* Set the home location of its L2GuardInstance.
|
|
*/
|
|
*/
|
|
@@ -123,11 +91,6 @@ public class L2GuardInstance extends L2Attackable
|
|
setIsNoRndWalk(true);
|
|
setIsNoRndWalk(true);
|
|
super.onSpawn();
|
|
super.onSpawn();
|
|
|
|
|
|
- if ((_returnTask == null) && !isWalker())
|
|
|
|
- {
|
|
|
|
- _returnTask = ThreadPoolManager.getInstance().scheduleAiAtFixedRate(new ReturnTask(), RETURN_INTERVAL, RETURN_INTERVAL + Rnd.nextInt(60000));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// check the region where this mob is, do not activate the AI if region is inactive.
|
|
// check the region where this mob is, do not activate the AI if region is inactive.
|
|
L2WorldRegion region = L2World.getInstance().getRegion(getX(), getY());
|
|
L2WorldRegion region = L2World.getInstance().getRegion(getX(), getY());
|
|
if ((region != null) && (!region.isActive()))
|
|
if ((region != null) && (!region.isActive()))
|