Fixed incorrect Instance getAliveNpcs count.

This commit is contained in:
MobiusDev
2016-12-19 18:23:15 +00:00
parent 106fdd6c93
commit 3b16d9b270
5 changed files with 7 additions and 7 deletions

View File

@@ -160,7 +160,7 @@ public final class ChamberOfProphecies extends AbstractInstance
npc.setIsRunning(true);
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
((L2Attackable) npc).setCanStopAttackByTime(false);
if (npc.isScriptValue(0) && ((world.getAliveNpcs(ATTACABLE_MONSTERS).size() < 2) || world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty()))
if (npc.isScriptValue(0) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);

View File

@@ -438,7 +438,7 @@ public final class EvilIncubator extends AbstractInstance
}
else if (waveId < 8)
{
if (world.getAliveNpcs(MONSTERS).size() <= 1)
if (world.getAliveNpcs(MONSTERS).isEmpty())
{
getTimers().addTimer("SPAWN_WAVE", 5000, e -> manageWaveSpawn(world));
}

View File

@@ -365,7 +365,7 @@ public final class KartiasLabyrinth extends AbstractInstance
instance.openCloseDoor(instance.getTemplateParameters().getInt("thirdDoorId"), true);
instance.setStatus(3); // Used for notify helper's AI
}
else if (param.getBoolean("CONTINUE_AFTER_KILL", false) && (instance.getAliveNpcs(MONSTERS).size() <= 1))
else if (param.getBoolean("CONTINUE_AFTER_KILL", false) && instance.getAliveNpcs(MONSTERS).isEmpty())
{
param.set("CONTINUE_AFTER_KILL", false);
getTimers().addTimer("CALL_PROGRESS", 5000, n -> manageProgressInInstance(instance));

View File

@@ -235,7 +235,7 @@ public final class MuseumDungeon extends AbstractInstance
{
final L2PcInstance player = world.getFirstPlayer();
final QuestState qs = player.getQuestState(Q10327_IntruderWhoWantsTheBookOfGiants.class.getSimpleName());
if ((qs != null) && qs.isCond(2) && (world.getAliveNpcs(THIEF).size() <= 1))
if ((qs != null) && qs.isCond(2) && world.getAliveNpcs(THIEF).isEmpty())
{
qs.setCond(3, true);
showOnScreenMsg(player, NpcStringId.TALK_TO_TOYRON_TO_RETURN_TO_THE_MUSEUM_LOBBY, ExShowScreenMessage.TOP_CENTER, 4500);