Addition of Instance getAliveNpcCount methods.

This commit is contained in:
MobiusDevelopment
2021-12-25 23:04:14 +00:00
parent 9e7f8fbba7
commit 33b35efb3c
196 changed files with 2052 additions and 1317 deletions

View File

@@ -258,7 +258,7 @@ public class BalokWarzone extends AbstractInstance
final Instance world = npc.getInstanceWorld();
if (npc == _balok)
{
if (world.getAliveNpcs(BALOK).isEmpty())
if (world.getAliveNpcCount(BALOK) == 0)
{
world.getAliveNpcs(MINION, HELL_DISCIPLE, HELLS_GATE).forEach(guard -> guard.doDie(null));
world.removeNpcs();

View File

@@ -104,7 +104,7 @@ public class TautiWarzone extends AbstractInstance
for (Player member : world.getPlayers())
{
member.teleToLocation(TAUTI_TELEPORT, world);
if (world.getAliveNpcs(TAUTI_EXTREME).isEmpty() && world.getAliveNpcs(TAUTI_EXTREME_AXE).isEmpty())
if ((world.getAliveNpcCount(TAUTI_EXTREME) == 0) && (world.getAliveNpcCount(TAUTI_EXTREME_AXE) == 0))
{
startQuestTimer("PLAY_OPENING_B_MOVIE", 5000, null, member, false);
}
@@ -120,7 +120,7 @@ public class TautiWarzone extends AbstractInstance
case "SPAWN_TAUTI":
{
final Instance world = npc.getInstanceWorld();
if (world.getAliveNpcs(TAUTI_EXTREME).isEmpty() && world.getAliveNpcs(TAUTI_EXTREME_AXE).isEmpty())
if ((world.getAliveNpcCount(TAUTI_EXTREME) == 0) && (world.getAliveNpcCount(TAUTI_EXTREME_AXE) == 0))
{
world.spawnGroup("boss");
}

View File

@@ -193,7 +193,7 @@ public class CommandPost extends AbstractInstance
}
case 1:
{
if (world.getAliveNpcs(FIRST_FLOOR).isEmpty())
if (world.getAliveNpcCount(FIRST_FLOOR) == 0)
{
showOnScreenMsg(world, NpcStringId.THE_TELEPORT_GATE_TO_THE_2ND_FLOOR_HAS_BEEN_ACTIVATED, ExShowScreenMessage.TOP_CENTER, 2000, true);
world.getNpc(GEORK).teleToLocation(GEORK_FLOOR_2_SPAWN);
@@ -269,7 +269,7 @@ public class CommandPost extends AbstractInstance
}
case 4:
{
if (world.getAliveNpcs().size() == 19)
if (world.getAliveNpcCount() == 19)
{
for (Npc monster : world.getNpcsOfGroup("group_2"))
{
@@ -285,7 +285,7 @@ public class CommandPost extends AbstractInstance
}
case 5:
{
if (world.getAliveNpcs().size() == 14)
if (world.getAliveNpcCount() == 14)
{
for (Npc monster : world.getNpcsOfGroup("group_3"))
{
@@ -301,7 +301,7 @@ public class CommandPost extends AbstractInstance
}
case 6:
{
if (world.getAliveNpcs().size() == 8)
if (world.getAliveNpcCount() == 8)
{
for (Npc monster : world.getNpcsOfGroup("group_4"))
{
@@ -317,7 +317,7 @@ public class CommandPost extends AbstractInstance
}
case 7:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
showOnScreenMsg(world, NpcStringId.THE_TELEPORT_GATE_TO_THE_3RD_FLOOR_HAS_BEEN_ACTIVATED, ExShowScreenMessage.TOP_CENTER, 2000, true);
world.getNpc(GEORK).deleteMe();

View File

@@ -165,7 +165,7 @@ public class CrystalCavernsCoralGarden extends AbstractInstance
showOnScreenMsg(instance, NpcStringId.GOLEM_ENTERED_THE_REQUIRED_ZONE, ExShowScreenMessage.MIDDLE_CENTER, 5000);
npc.deleteMe();
if (instance.getAliveNpcs(GOLEM_1, GOLEM_2).isEmpty())
if (instance.getAliveNpcCount(GOLEM_1, GOLEM_2) == 0)
{
instance.openCloseDoor(BOSS_DOOR_ID, true);

View File

@@ -213,7 +213,7 @@ public class CrystalCavernsEmeraldSquare extends AbstractInstance
case VERIDAN_WEALTHY:
case VERIDAN_ARMED:
{
if (instance.getAliveNpcs(VERIDAN_NORMAL, VERIDAN_WISE, VERIDAN_WEALTHY, VERIDAN_ARMED).isEmpty())
if (instance.getAliveNpcCount(VERIDAN_NORMAL, VERIDAN_WISE, VERIDAN_WEALTHY, VERIDAN_ARMED) == 0)
{
instance.finishInstance();
}

View File

@@ -290,7 +290,7 @@ public class DarkCloudMansion extends AbstractInstance
{
case 0: // Start room
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
world.setStatus(1);
world.spawnGroup("hall");
@@ -300,7 +300,7 @@ public class DarkCloudMansion extends AbstractInstance
}
case 1: // Hall
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
world.setStatus(2);
world.spawnGroup("roomA");
@@ -310,7 +310,7 @@ public class DarkCloudMansion extends AbstractInstance
}
case 2: // Room A - cleared
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
world.setStatus(3);
world.spawnGroup("roomAClear");
@@ -320,7 +320,7 @@ public class DarkCloudMansion extends AbstractInstance
}
case 3: // Hall
{
if (world.getAliveNpcs(BELETH_SUBORDINATE).isEmpty())
if (world.getAliveNpcCount(BELETH_SUBORDINATE) == 0)
{
world.setStatus(4);
world.openCloseDoor(ROOM_B_DOOR, true);
@@ -336,7 +336,7 @@ public class DarkCloudMansion extends AbstractInstance
}
case 5: // Hall
{
if (world.getAliveNpcs(BELETH_SUBORDINATE).isEmpty())
if (world.getAliveNpcCount(BELETH_SUBORDINATE) == 0)
{
world.setStatus(6);
world.spawnGroup("roomC");
@@ -346,7 +346,7 @@ public class DarkCloudMansion extends AbstractInstance
}
case 6: // Room C
{
if (world.getAliveNpcs(BELETH_SUBORDINATE).isEmpty())
if (world.getAliveNpcCount(BELETH_SUBORDINATE) == 0)
{
world.setStatus(7);
world.spawnGroup("roomD");

View File

@@ -671,7 +671,7 @@ public class DimensionalWrap extends AbstractInstance
}
}
if (world.getAliveNpcs(MONSTERS).isEmpty() && world.getParameters().getBoolean("ThirdWave", false))
if ((world.getAliveNpcCount(MONSTERS) == 0) && world.getParameters().getBoolean("ThirdWave", false))
{
if (worldState == 20)
{

View File

@@ -172,7 +172,7 @@ public class EtinaHelperAliber extends AbstractNpcAI
instance.despawnGroup("BARRICADES_1");
}
}
else if (!instance.getNpcsOfGroup("BARRICADES_2").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_1).isEmpty() && instance.getNpcsOfGroup("BARRICADES_1").isEmpty())
else if (!instance.getNpcsOfGroup("BARRICADES_2").isEmpty() && (instance.getAliveNpcCount(CORRIDOR_MOBS_1) == 0) && instance.getNpcsOfGroup("BARRICADES_1").isEmpty())
{
aliber.setRunning();
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[1]);
@@ -191,7 +191,7 @@ public class EtinaHelperAliber extends AbstractNpcAI
instance.despawnGroup("BARRICADES_2");
}
}
else if (!instance.getNpcsOfGroup("BARRICADES_3").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_2).isEmpty() && instance.getNpcsOfGroup("BARRICADES_2").isEmpty())
else if (!instance.getNpcsOfGroup("BARRICADES_3").isEmpty() && (instance.getAliveNpcCount(CORRIDOR_MOBS_2) == 0) && instance.getNpcsOfGroup("BARRICADES_2").isEmpty())
{
aliber.setRunning();
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[2]);
@@ -210,7 +210,7 @@ public class EtinaHelperAliber extends AbstractNpcAI
instance.despawnGroup("BARRICADES_3");
}
}
else if (!instance.getNpcsOfGroup("BARRICADES_4").isEmpty() && instance.getAliveNpcs(CORRIDOR_MOBS_3).isEmpty() && instance.getNpcsOfGroup("BARRICADES_3").isEmpty())
else if (!instance.getNpcsOfGroup("BARRICADES_4").isEmpty() && (instance.getAliveNpcCount(CORRIDOR_MOBS_3) == 0) && instance.getNpcsOfGroup("BARRICADES_3").isEmpty())
{
aliber.setRunning();
aliber.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, SKILL_CAST_LOCATIONS[3]);

View File

@@ -187,20 +187,20 @@ public class EtisVanEtinaSolo extends AbstractInstance
final Monster monsterCheck = getRandomEntry(World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 2500));
if (monsterCheck == null)
{
if (!world.getNpcsOfGroup("BARRICADES_2").isEmpty() && world.getAliveNpcs(CORRIDOR_MOBS_1).isEmpty() && world.getNpcsOfGroup("BARRICADES_1").isEmpty())
if (!world.getNpcsOfGroup("BARRICADES_2").isEmpty() && (world.getAliveNpcCount(CORRIDOR_MOBS_1) == 0) && world.getNpcsOfGroup("BARRICADES_1").isEmpty())
{
world.getParameters().set("BARRICADE_DESTROYED", false);
}
else if (!world.getNpcsOfGroup("BARRICADES_3").isEmpty() && world.getAliveNpcs(CORRIDOR_MOBS_2).isEmpty() && world.getNpcsOfGroup("BARRICADES_2").isEmpty())
else if (!world.getNpcsOfGroup("BARRICADES_3").isEmpty() && (world.getAliveNpcCount(CORRIDOR_MOBS_2) == 0) && world.getNpcsOfGroup("BARRICADES_2").isEmpty())
{
world.getParameters().set("BARRICADE_DESTROYED", false);
}
else if (!world.getNpcsOfGroup("BARRICADES_4").isEmpty() && world.getAliveNpcs(CORRIDOR_MOBS_3).isEmpty() && world.getNpcsOfGroup("BARRICADES_3").isEmpty())
else if (!world.getNpcsOfGroup("BARRICADES_4").isEmpty() && (world.getAliveNpcCount(CORRIDOR_MOBS_3) == 0) && world.getNpcsOfGroup("BARRICADES_3").isEmpty())
{
world.getParameters().set("BARRICADE_DESTROYED", false);
}
}
if (!mobs1 && world.getNpcsOfGroup("BARRICADES_1").isEmpty() && !world.getNpcsOfGroup("BARRICADES_2").isEmpty() && world.getAliveNpcs(CORRIDOR_MOBS_1).isEmpty())
if (!mobs1 && world.getNpcsOfGroup("BARRICADES_1").isEmpty() && !world.getNpcsOfGroup("BARRICADES_2").isEmpty() && (world.getAliveNpcCount(CORRIDOR_MOBS_1) == 0))
{
world.spawnGroup("CORRIDOR_MOBS_1");
world.getNpcsOfGroup("CORRIDOR_MOBS_1").forEach(mob ->
@@ -212,7 +212,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
});
world.getParameters().set("CORRIDOR_MOBS_1_SPAWNED", true);
}
if (!mobs2 && world.getNpcsOfGroup("BARRICADES_2").isEmpty() && !world.getNpcsOfGroup("BARRICADES_3").isEmpty() && world.getAliveNpcs(CORRIDOR_MOBS_2).isEmpty())
if (!mobs2 && world.getNpcsOfGroup("BARRICADES_2").isEmpty() && !world.getNpcsOfGroup("BARRICADES_3").isEmpty() && (world.getAliveNpcCount(CORRIDOR_MOBS_2) == 0))
{
world.spawnGroup("CORRIDOR_MOBS_2");
world.getNpcsOfGroup("CORRIDOR_MOBS_2").forEach(mob ->
@@ -224,7 +224,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
});
world.getParameters().set("CORRIDOR_MOBS_2_SPAWNED", true);
}
if (!mobs3 && world.getNpcsOfGroup("BARRICADES_3").isEmpty() && !world.getNpcsOfGroup("BARRICADES_4").isEmpty() && world.getAliveNpcs(CORRIDOR_MOBS_3).isEmpty())
if (!mobs3 && world.getNpcsOfGroup("BARRICADES_3").isEmpty() && !world.getNpcsOfGroup("BARRICADES_4").isEmpty() && (world.getAliveNpcCount(CORRIDOR_MOBS_3) == 0))
{
world.spawnGroup("CORRIDOR_MOBS_3");
world.getNpcsOfGroup("CORRIDOR_MOBS_3").forEach(mob ->
@@ -236,7 +236,7 @@ public class EtisVanEtinaSolo extends AbstractInstance
});
world.getParameters().set("CORRIDOR_MOBS_3_SPAWNED", true);
}
if (!mobs4 && world.getNpcsOfGroup("BARRICADES_4").isEmpty() && world.getAliveNpcs(CORRIDOR_MOBS_4).isEmpty())
if (!mobs4 && world.getNpcsOfGroup("BARRICADES_4").isEmpty() && (world.getAliveNpcCount(CORRIDOR_MOBS_4) == 0))
{
world.spawnGroup("CORRIDOR_MOBS_4");
world.spawnGroup("PARAGON");
@@ -255,14 +255,14 @@ public class EtisVanEtinaSolo extends AbstractInstance
}
npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.YOU_CAN_T_DEFEAT_PARAGON_WHILE_PARAGON_S_MINIONS_ARE_ALIVE, ExShowScreenMessage.TOP_CENTER, 7000, true));
}
if (world.getNpcsOfGroup("BARRICADES_4").isEmpty() && world.getAliveNpcs(CORRIDOR_MOBS_4).isEmpty() && (world.getNpc(PARAGON) != null) && world.getNpc(PARAGON).isInvul())
if (world.getNpcsOfGroup("BARRICADES_4").isEmpty() && (world.getAliveNpcCount(CORRIDOR_MOBS_4) == 0) && (world.getNpc(PARAGON) != null) && world.getNpc(PARAGON).isInvul())
{
world.getNpc(PARAGON).setInvul(false);
world.getNpc(PARAGON).getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.INVINCIBILITY);
showOnScreenMsg(world, NpcStringId.PARAGON_IS_NO_LONGER_INVINCIBLE, ExShowScreenMessage.TOP_CENTER, 7000, true);
world.getNpc(LEONA_BLACKBIRD).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TODAY_IS_THE_DAY_THAT_I_WILL_ENTER);
}
if ((world.getStatus() == 1) && world.getNpcsOfGroup("BARRICADES_4").isEmpty() && (world.getAliveNpcs(PARAGON).isEmpty()))
if ((world.getStatus() == 1) && world.getNpcsOfGroup("BARRICADES_4").isEmpty() && (world.getAliveNpcCount(PARAGON) == 0))
{
startQuestTimer("openInnerDoors", 5000, null, player);
cancelQuestTimer("checkProgress", npc, player);
@@ -594,28 +594,28 @@ public class EtisVanEtinaSolo extends AbstractInstance
}
else if (CommonUtil.contains(CORRIDOR_MOBS_1, npc.getId()))
{
if (world.getAliveNpcs(CORRIDOR_MOBS_1).isEmpty())
if (world.getAliveNpcCount(CORRIDOR_MOBS_1) == 0)
{
world.getParameters().set("BARRICADE_DESTROYED", false);
}
}
else if (CommonUtil.contains(CORRIDOR_MOBS_2, npc.getId()))
{
if (world.getAliveNpcs(CORRIDOR_MOBS_2).isEmpty())
if (world.getAliveNpcCount(CORRIDOR_MOBS_2) == 0)
{
world.getParameters().set("BARRICADE_DESTROYED", false);
}
}
else if (CommonUtil.contains(CORRIDOR_MOBS_3, npc.getId()))
{
if (world.getAliveNpcs(CORRIDOR_MOBS_3).isEmpty())
if (world.getAliveNpcCount(CORRIDOR_MOBS_3) == 0)
{
world.getParameters().set("BARRICADE_DESTROYED", false);
}
}
else if (CommonUtil.contains(CORRIDOR_MOBS_4, npc.getId()))
{
if (world.getAliveNpcs(CORRIDOR_MOBS_4).isEmpty())
if (world.getAliveNpcCount(CORRIDOR_MOBS_4) == 0)
{
world.getNpc(PARAGON).setInvul(false);
world.getNpc(PARAGON).getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.INVINCIBILITY);

View File

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

View File

@@ -139,7 +139,7 @@ public class FortressOfTheDead extends AbstractInstance
{
if (npc.getId() == VAMPIRIC_SOLDIER)
{
if (world.getAliveNpcs(VAMPIRIC_SOLDIER).isEmpty())
if (world.getAliveNpcCount(VAMPIRIC_SOLDIER) == 0)
{
startQuestTimer("vampire_dead", 180, npc, player);
}

View File

@@ -188,7 +188,7 @@ public class Fortuna extends AbstractInstance
}
case 1:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(2);
world.spawnGroup("fortuna_2");
@@ -198,7 +198,7 @@ public class Fortuna extends AbstractInstance
}
case 2:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(3);
world.spawnGroup("fortuna_3");
@@ -208,7 +208,7 @@ public class Fortuna extends AbstractInstance
}
case 3:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(4);
world.spawnGroup("fortuna_4");
@@ -219,7 +219,7 @@ public class Fortuna extends AbstractInstance
}
case 4:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(5);
world.spawnGroup("fortuna_5");
@@ -229,7 +229,7 @@ public class Fortuna extends AbstractInstance
}
case 5:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(6);
world.spawnGroup("fortuna_6");
@@ -240,7 +240,7 @@ public class Fortuna extends AbstractInstance
}
case 6:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(7);
world.spawnGroup("fortuna_7");
@@ -250,7 +250,7 @@ public class Fortuna extends AbstractInstance
}
case 7:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(8);
world.spawnGroup("fortuna_8");
@@ -260,7 +260,7 @@ public class Fortuna extends AbstractInstance
}
case 8:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(9);
world.spawnGroup("fortuna_9");
@@ -270,7 +270,7 @@ public class Fortuna extends AbstractInstance
}
case 9:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(10);
world.spawnGroup("fortuna_10");
@@ -281,7 +281,7 @@ public class Fortuna extends AbstractInstance
}
case 10:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
startQuestTimer("boss_1_pause", 30000, npc, null);
}
@@ -293,7 +293,7 @@ public class Fortuna extends AbstractInstance
}
case 11:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(12);
world.spawnGroup("fortuna_12");
@@ -303,7 +303,7 @@ public class Fortuna extends AbstractInstance
}
case 12:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(13);
world.spawnGroup("fortuna_13");
@@ -313,7 +313,7 @@ public class Fortuna extends AbstractInstance
}
case 13:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(14);
world.spawnGroup("fortuna_14");
@@ -323,7 +323,7 @@ public class Fortuna extends AbstractInstance
}
case 14:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(15);
world.spawnGroup("fortuna_15");
@@ -334,7 +334,7 @@ public class Fortuna extends AbstractInstance
}
case 15:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
startQuestTimer("boss_2_pause", 30000, npc, null);
}
@@ -346,7 +346,7 @@ public class Fortuna extends AbstractInstance
}
case 16:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(17);
world.spawnGroup("fortuna_17");
@@ -356,7 +356,7 @@ public class Fortuna extends AbstractInstance
}
case 17:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(18);
world.spawnGroup("fortuna_18");
@@ -367,7 +367,7 @@ public class Fortuna extends AbstractInstance
}
case 18:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
startQuestTimer("boss_3_pause", 30000, npc, null);
}
@@ -379,7 +379,7 @@ public class Fortuna extends AbstractInstance
}
case 19:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(20);
world.spawnGroup("fortuna_20");
@@ -390,7 +390,7 @@ public class Fortuna extends AbstractInstance
}
case 20:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(21);
world.spawnGroup("fortuna_21");
@@ -400,7 +400,7 @@ public class Fortuna extends AbstractInstance
}
case 21:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(22);
world.spawnGroup("fortuna_22");
@@ -411,7 +411,7 @@ public class Fortuna extends AbstractInstance
}
case 22:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
startQuestTimer("boss_4_pause", 30000, npc, null);
}
@@ -423,7 +423,7 @@ public class Fortuna extends AbstractInstance
}
case 23:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(24);
world.spawnGroup("fortuna_24");
@@ -433,7 +433,7 @@ public class Fortuna extends AbstractInstance
}
case 24:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
world.setStatus(25);
world.spawnGroup("fortuna_25");
@@ -444,7 +444,7 @@ public class Fortuna extends AbstractInstance
}
case 25:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
startQuestTimer("boss_5_pause", 30000, npc, null);
showOnScreenMsg(world, NpcStringId.DARKNESS_SWALLOW_EVERYTHING_AWAY, ExShowScreenMessage.TOP_CENTER, 10000, true);
@@ -457,7 +457,7 @@ public class Fortuna extends AbstractInstance
}
case 26:
{
if (world.getAliveNpcs().size() == 1)
if (world.getAliveNpcCount() == 1)
{
startQuestTimer("boss_6_pause", 30000, npc, null);
showOnScreenMsg(world, NpcStringId.I_NOW_HAVE_TO_GO_AND_HANDLE_IT, ExShowScreenMessage.TOP_CENTER, 10000, true);

View File

@@ -367,7 +367,7 @@ public 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(MINI_BOSSES).isEmpty())
else if (param.getBoolean("CONTINUE_AFTER_KILL", false) && (instance.getAliveNpcCount(MINI_BOSSES) == 0))
{
param.set("CONTINUE_AFTER_KILL", false);
getTimers().addTimer("CALL_PROGRESS", 5000, n -> manageProgressInInstance(instance));
@@ -377,7 +377,7 @@ public class KartiasLabyrinth extends AbstractInstance
private void manageWaves(Instance instance)
{
if ((instance != null) && instance.getAliveNpcs(MONSTERS).isEmpty())
if ((instance != null) && (instance.getAliveNpcCount(MONSTERS) == 0))
{
getTimers().cancelTimers("NEXT_WAVE_DELAY");
getTimers().cancelTimers("MONITOR_WAVE");

View File

@@ -101,7 +101,7 @@ public class KastiaExceptional extends AbstractInstance
}
case 1:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_2, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(2);
@@ -112,7 +112,7 @@ public class KastiaExceptional extends AbstractInstance
}
case 2:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_3, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(3);
@@ -123,7 +123,7 @@ public class KastiaExceptional extends AbstractInstance
}
case 3:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_4, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(4);
@@ -134,7 +134,7 @@ public class KastiaExceptional extends AbstractInstance
}
case 4:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_5, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(5);
@@ -145,7 +145,7 @@ public class KastiaExceptional extends AbstractInstance
}
case 5:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_6, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(6);
@@ -156,7 +156,7 @@ public class KastiaExceptional extends AbstractInstance
}
case 6:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_7, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(7);
@@ -167,7 +167,7 @@ public class KastiaExceptional extends AbstractInstance
}
case 7:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_LV4_PACK);

View File

@@ -101,7 +101,7 @@ public class KastiaExtreme extends AbstractInstance
}
case 1:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_2, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(2);
@@ -112,7 +112,7 @@ public class KastiaExtreme extends AbstractInstance
}
case 2:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_3, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(3);
@@ -123,7 +123,7 @@ public class KastiaExtreme extends AbstractInstance
}
case 3:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_4, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(4);
@@ -134,7 +134,7 @@ public class KastiaExtreme extends AbstractInstance
}
case 4:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_5, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(5);
@@ -145,7 +145,7 @@ public class KastiaExtreme extends AbstractInstance
}
case 5:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_6, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(6);
@@ -156,7 +156,7 @@ public class KastiaExtreme extends AbstractInstance
}
case 6:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_7, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(7);
@@ -167,7 +167,7 @@ public class KastiaExtreme extends AbstractInstance
}
case 7:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_LV5_PACK);

View File

@@ -101,7 +101,7 @@ public class KastiaHard extends AbstractInstance
}
case 1:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_2, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(2);
@@ -112,7 +112,7 @@ public class KastiaHard extends AbstractInstance
}
case 2:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_3, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(3);
@@ -123,7 +123,7 @@ public class KastiaHard extends AbstractInstance
}
case 3:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_4, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(4);
@@ -134,7 +134,7 @@ public class KastiaHard extends AbstractInstance
}
case 4:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_5, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(5);
@@ -145,7 +145,7 @@ public class KastiaHard extends AbstractInstance
}
case 5:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_6, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(6);
@@ -156,7 +156,7 @@ public class KastiaHard extends AbstractInstance
}
case 6:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_7, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(7);
@@ -167,7 +167,7 @@ public class KastiaHard extends AbstractInstance
}
case 7:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_LARGE_PACK);

View File

@@ -101,7 +101,7 @@ public class KastiaLow extends AbstractInstance
}
case 1:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_2, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(2);
@@ -112,7 +112,7 @@ public class KastiaLow extends AbstractInstance
}
case 2:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_3, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(3);
@@ -123,7 +123,7 @@ public class KastiaLow extends AbstractInstance
}
case 3:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_4, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(4);
@@ -134,7 +134,7 @@ public class KastiaLow extends AbstractInstance
}
case 4:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_5, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(5);
@@ -145,7 +145,7 @@ public class KastiaLow extends AbstractInstance
}
case 5:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_6, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(6);
@@ -156,7 +156,7 @@ public class KastiaLow extends AbstractInstance
}
case 6:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_7, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(7);
@@ -167,7 +167,7 @@ public class KastiaLow extends AbstractInstance
}
case 7:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_SMALL_PACK);

View File

@@ -101,7 +101,7 @@ public class KastiaMedium extends AbstractInstance
}
case 1:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_2, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(2);
@@ -112,7 +112,7 @@ public class KastiaMedium extends AbstractInstance
}
case 2:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_3, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(3);
@@ -123,7 +123,7 @@ public class KastiaMedium extends AbstractInstance
}
case 3:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_4, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(4);
@@ -134,7 +134,7 @@ public class KastiaMedium extends AbstractInstance
}
case 4:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_5, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(5);
@@ -145,7 +145,7 @@ public class KastiaMedium extends AbstractInstance
}
case 5:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_6, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(6);
@@ -156,7 +156,7 @@ public class KastiaMedium extends AbstractInstance
}
case 6:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
showOnScreenMsg(world, NpcStringId.STAGE_7, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(7);
@@ -167,7 +167,7 @@ public class KastiaMedium extends AbstractInstance
}
case 7:
{
if (world.getAliveNpcs().isEmpty())
if (world.getAliveNpcCount() == 0)
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_MEDIUM_PACK);

View File

@@ -181,7 +181,7 @@ public class KrofinNest extends AbstractInstance
}
case 1:
{
if (world.getAliveNpcs(FIRST_AREA).isEmpty())
if (world.getAliveNpcCount(FIRST_AREA) == 0)
{
showOnScreenMsg(world, NpcStringId.THE_WATER_ENERGY_IS_NO_LONGER_ACTIVE_THE_WAY_IS_CLEAR, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(2);
@@ -193,7 +193,7 @@ public class KrofinNest extends AbstractInstance
}
case 2:
{
if (world.getAliveNpcs(SECOND_AREA).isEmpty())
if (world.getAliveNpcCount(SECOND_AREA) == 0)
{
showOnScreenMsg(world, NpcStringId.THE_WATER_ENERGY_IS_NO_LONGER_ACTIVE_THE_WAY_IS_CLEAR, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(3);
@@ -205,7 +205,7 @@ public class KrofinNest extends AbstractInstance
}
case 3:
{
if (world.getAliveNpcs(THIRD_AREA).isEmpty())
if (world.getAliveNpcCount(THIRD_AREA) == 0)
{
showOnScreenMsg(world, NpcStringId.THE_WATER_ENERGY_IS_NO_LONGER_ACTIVE_THE_WAY_IS_CLEAR, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(4);
@@ -217,7 +217,7 @@ public class KrofinNest extends AbstractInstance
}
case 4:
{
if (world.getAliveNpcs(FOURTH_AREA).isEmpty())
if (world.getAliveNpcCount(FOURTH_AREA) == 0)
{
showOnScreenMsg(world, NpcStringId.THE_WATER_ENERGY_IS_NO_LONGER_ACTIVE_THE_WAY_IS_CLEAR, ExShowScreenMessage.TOP_CENTER, 10000, true);
world.setStatus(5);
@@ -279,12 +279,12 @@ public class KrofinNest extends AbstractInstance
{
if (CommonUtil.contains(KROSHA_FIRST_FORM_MINIONS, npc.getId()))
{
if (world.getAliveNpcs(KROSHA_FIRST_FORM_MINIONS).isEmpty() && !kroshaFirstFormMinionsSpawnedTwice)
if ((world.getAliveNpcCount(KROSHA_FIRST_FORM_MINIONS) == 0) && !kroshaFirstFormMinionsSpawnedTwice)
{
world.getParameters().set("KROSHA_FIRST_FORM_MINIONS_SPAWNED_TWICE", true);
world.spawnGroup("KROSHA_FIRST_FORM_MINIONS");
}
else if (world.getAliveNpcs(KROSHA_FIRST_FORM_MINIONS).isEmpty() && kroshaFirstFormMinionsSpawnedTwice)
else if ((world.getAliveNpcCount(KROSHA_FIRST_FORM_MINIONS) == 0) && kroshaFirstFormMinionsSpawnedTwice)
{
world.despawnGroup("KROSHA_FIRST_FORM");
showOnScreenMsg(world, NpcStringId.QUEEN_KROSHA_HAS_DISAPPEARED, ExShowScreenMessage.TOP_CENTER, 7000, true);
@@ -293,7 +293,7 @@ public class KrofinNest extends AbstractInstance
}
else if (CommonUtil.contains(ENHANCED_MINIONS, npc.getId()))
{
if ((world.getAliveNpcs(ENHANCED_MINIONS).isEmpty()))
if (world.getAliveNpcCount(ENHANCED_MINIONS) == 0)
{
world.spawnGroup("KROSHA_FINAL_FORM");
showOnScreenMsg(world, NpcStringId.QUEEN_KROSHA_HAS_RETURNED_MORE_POWERFUL_THAN_EVER, ExShowScreenMessage.TOP_CENTER, 7000, true);

View File

@@ -435,7 +435,7 @@ public class StoryOfTauti extends AbstractInstance
case "clone_2":
{
world.spawnGroup("clone_2");
if (world.getAliveNpcs(NPC_1).size() < _count)
if (world.getAliveNpcCount(NPC_1) < _count)
{
startQuestTimer("clone_3", 500, npc, player);
}
@@ -444,7 +444,7 @@ public class StoryOfTauti extends AbstractInstance
case "clone_3":
{
world.spawnGroup("clone_3");
if (world.getAliveNpcs(NPC_1).size() < _count)
if (world.getAliveNpcCount(NPC_1) < _count)
{
startQuestTimer("clone_4", 500, npc, player);
}
@@ -453,7 +453,7 @@ public class StoryOfTauti extends AbstractInstance
case "clone_4":
{
world.spawnGroup("clone_4");
if (world.getAliveNpcs(NPC_1).size() < _count)
if (world.getAliveNpcCount(NPC_1) < _count)
{
startQuestTimer("clone_5", 500, npc, player);
}
@@ -462,7 +462,7 @@ public class StoryOfTauti extends AbstractInstance
case "clone_5":
{
world.spawnGroup("clone_5");
if (world.getAliveNpcs(NPC_1).size() < _count)
if (world.getAliveNpcCount(NPC_1) < _count)
{
startQuestTimer("clone_6", 500, npc, player);
}

View File

@@ -108,7 +108,7 @@ public class NornilsGarden extends AbstractInstance
}
case "stage1_1":
{
if (!npc.isDead() && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
if (!npc.isDead() && (world.getAliveNpcCount(ATTACABLE_MONSTERS) == 0))
{
world.spawnGroup("wave_1");
npc.setTargetable(true);
@@ -117,7 +117,7 @@ public class NornilsGarden extends AbstractInstance
}
case "stage2":
{
if (world.isStatus(5) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
if (world.isStatus(5) && (world.getAliveNpcCount(ATTACABLE_MONSTERS) == 0))
{
world.openCloseDoor(16200016, true);
cancelQuestTimer("stage2", npc, null);
@@ -127,7 +127,7 @@ public class NornilsGarden extends AbstractInstance
}
case "stage3":
{
if (world.isStatus(6) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
if (world.isStatus(6) && (world.getAliveNpcCount(ATTACABLE_MONSTERS) == 0))
{
world.openCloseDoor(16200201, true);
cancelQuestTimer("stage3", npc, null);
@@ -217,7 +217,7 @@ public class NornilsGarden extends AbstractInstance
}
case 1:
{
if ((npc.getId() == BOZ_STAGE2) && (world.getAliveNpcs(BOZ_STAGE2).size() < 6))
if ((npc.getId() == BOZ_STAGE2) && (world.getAliveNpcCount(BOZ_STAGE2) < 6))
{
world.spawnGroup("wave_2_1");
world.setStatus(2);
@@ -226,7 +226,7 @@ public class NornilsGarden extends AbstractInstance
}
case 2:
{
if ((npc.getId() == BOZ_STAGE2) && (world.getAliveNpcs(BOZ_STAGE2).size() < 5))
if ((npc.getId() == BOZ_STAGE2) && (world.getAliveNpcCount(BOZ_STAGE2) < 5))
{
world.spawnGroup("wave_2_2");
world.setStatus(3);
@@ -235,7 +235,7 @@ public class NornilsGarden extends AbstractInstance
}
case 3:
{
if ((npc.getId() == BOZ_STAGE2) && (world.getAliveNpcs(BOZ_STAGE2).size() < 4))
if ((npc.getId() == BOZ_STAGE2) && (world.getAliveNpcCount(BOZ_STAGE2) < 4))
{
world.spawnGroup("wave_2_3");
world.setStatus(4);
@@ -244,7 +244,7 @@ public class NornilsGarden extends AbstractInstance
}
case 4:
{
if ((npc.getId() == BOZ_STAGE2) && (world.getAliveNpcs(BOZ_STAGE2).size() < 3))
if ((npc.getId() == BOZ_STAGE2) && (world.getAliveNpcCount(BOZ_STAGE2) < 3))
{
world.spawnGroup("wave_2_4");
startQuestTimer("stage2", 15000, npc, null, true);