Prevent thinking in non active regions.
This commit is contained in:
@@ -339,6 +339,12 @@ public class L2AttackableAI extends L2CharacterAI
|
||||
@Override
|
||||
public void changeIntention(CtrlIntention intention, Object arg0, Object arg1)
|
||||
{
|
||||
// Prevent thinking in non active regions.
|
||||
if (!_actor.isInActiveRegion())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((intention == AI_INTENTION_IDLE) || (intention == AI_INTENTION_ACTIVE))
|
||||
{
|
||||
// Check if actor is not dead
|
||||
|
@@ -34,8 +34,6 @@ import com.l2jmobius.gameserver.templates.chars.L2NpcTemplate;
|
||||
*/
|
||||
public final class L2GrandBossInstance extends L2MonsterInstance
|
||||
{
|
||||
private static final int BOSS_MAINTENANCE_INTERVAL = 20000;
|
||||
|
||||
/**
|
||||
* Constructor for L2GrandBossInstance. This represent all grandbosses.
|
||||
* @param objectId ID of the instance
|
||||
@@ -46,12 +44,6 @@ public final class L2GrandBossInstance extends L2MonsterInstance
|
||||
super(objectId, template);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaintenanceInterval()
|
||||
{
|
||||
return BOSS_MAINTENANCE_INTERVAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doDie(L2Character killer)
|
||||
{
|
||||
@@ -122,7 +114,7 @@ public final class L2GrandBossInstance extends L2MonsterInstance
|
||||
}
|
||||
|
||||
_minionList.maintainMinions();
|
||||
}, 60000, getMaintenanceInterval());
|
||||
}, 60000, 20000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -41,7 +41,6 @@ import com.l2jmobius.gameserver.util.MinionList;
|
||||
*/
|
||||
public class L2MonsterInstance extends L2Attackable
|
||||
{
|
||||
private static final int MONSTER_MAINTENANCE_INTERVAL = 1000;
|
||||
protected final MinionList _minionList;
|
||||
protected ScheduledFuture<?> _minionMaintainTask = null;
|
||||
|
||||
@@ -151,21 +150,12 @@ public class L2MonsterInstance extends L2Attackable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the maintenance interval.
|
||||
* @return the maintenance interval
|
||||
*/
|
||||
protected int getMaintenanceInterval()
|
||||
{
|
||||
return MONSTER_MAINTENANCE_INTERVAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawn all minions at a regular interval.
|
||||
*/
|
||||
protected void manageMinions()
|
||||
{
|
||||
_minionMaintainTask = ThreadPool.schedule(() -> _minionList.spawnMinions(), getMaintenanceInterval());
|
||||
_minionMaintainTask = ThreadPool.schedule(() -> _minionList.spawnMinions(), 1000);
|
||||
}
|
||||
|
||||
public void callMinions()
|
||||
|
@@ -34,7 +34,6 @@ import com.l2jmobius.gameserver.templates.chars.L2NpcTemplate;
|
||||
*/
|
||||
public final class L2RaidBossInstance extends L2MonsterInstance
|
||||
{
|
||||
private static final int RAIDBOSS_MAINTENANCE_INTERVAL = 20000; // 20 sec
|
||||
private RaidBossSpawnManager.StatusEnum _raidStatus;
|
||||
|
||||
/**
|
||||
@@ -60,12 +59,6 @@ public final class L2RaidBossInstance extends L2MonsterInstance
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaintenanceInterval()
|
||||
{
|
||||
return RAIDBOSS_MAINTENANCE_INTERVAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doDie(L2Character killer)
|
||||
{
|
||||
@@ -135,7 +128,7 @@ public final class L2RaidBossInstance extends L2MonsterInstance
|
||||
}
|
||||
|
||||
_minionList.maintainMinions();
|
||||
}, 60000, getMaintenanceInterval());
|
||||
}, 60000, 20000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user