From 5d1e8973b129bbcb74710a46146f99c2566a4409 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 14 Feb 2016 22:25:27 +0000 Subject: [PATCH] Incubator of Evil initial commit. --- .../game/data/instances/IncubatorOfEvil.xml | 125 +++- .../instances/IncubatorOfEvil/33170-1.htm | 4 + .../instances/IncubatorOfEvil/33170-2.htm | 4 + .../instances/IncubatorOfEvil/33170-3.htm | 4 + .../instances/IncubatorOfEvil/33170-4.htm | 4 + .../instances/IncubatorOfEvil/33170-5.htm | 5 + .../instances/IncubatorOfEvil/33171-1.htm | 4 + .../instances/IncubatorOfEvil/33171-2.htm | 4 + .../instances/IncubatorOfEvil/33172-1.htm | 4 + .../instances/IncubatorOfEvil/33172-2.htm | 4 + .../instances/IncubatorOfEvil/33173-1.htm | 4 + .../instances/IncubatorOfEvil/33173-2.htm | 4 + .../instances/IncubatorOfEvil/33174-1.htm | 4 + .../instances/IncubatorOfEvil/33174-2.htm | 4 + .../instances/IncubatorOfEvil/33414-1.htm | 3 + .../instances/IncubatorOfEvil/33415-1.htm | 3 + .../IncubatorOfEvil/IncubatorOfEvil.java | 568 +++++++++++++++++- .../KartiasLabyrinth/KartiasLabyrinth.java | 12 +- .../dist/game/data/stats/npcs/27400-27499.xml | 12 +- .../dist/game/data/stats/npcs/33100-33199.xml | 10 +- .../dist/game/data/stats/npcs/33400-33499.xml | 4 +- .../gameserver/ai/npc/FighterAI.java} | 8 +- .../gameserver/ai/npc/HealerAI.java} | 8 +- 23 files changed, 756 insertions(+), 50 deletions(-) create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-1.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-2.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-3.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-4.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-5.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33171-1.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33171-2.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33172-1.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33172-2.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33173-1.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33173-2.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33174-1.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33174-2.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33414-1.htm create mode 100644 trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33415-1.htm rename trunk/{dist/game/data/scripts/instances/KartiasLabyrinth/AI/Fighter.java => java/com/l2jmobius/gameserver/ai/npc/FighterAI.java} (90%) rename trunk/{dist/game/data/scripts/instances/KartiasLabyrinth/AI/Healer.java => java/com/l2jmobius/gameserver/ai/npc/HealerAI.java} (90%) diff --git a/trunk/dist/game/data/instances/IncubatorOfEvil.xml b/trunk/dist/game/data/instances/IncubatorOfEvil.xml index d7d94babc3..08baa0d03d 100644 --- a/trunk/dist/game/data/instances/IncubatorOfEvil.xml +++ b/trunk/dist/game/data/instances/IncubatorOfEvil.xml @@ -1,12 +1,8 @@ - + - - - - @@ -19,5 +15,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-1.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-1.htm new file mode 100644 index 0000000000..7dafbcc18a --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-1.htm @@ -0,0 +1,4 @@ +Aden Vanguard Captain Adolph:
+As Shilen grows in power, more monsters will emerge from here. We can't just let this happen without fighting back!
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-2.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-2.htm new file mode 100644 index 0000000000..a89c6f4b95 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-2.htm @@ -0,0 +1,4 @@ +Aden Vanguard Captain Adolph:
+You've caught me resting after a particularly tough battle. So, you're the soldier Orven has sent? Good! You can help my squad with that never-ending stream of monsters. Got any questions?
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-3.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-3.htm new file mode 100644 index 0000000000..0b0cbe6a71 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-3.htm @@ -0,0 +1,4 @@ +Aden Vanguard Captain Adolph:
+See my subordinates there? They are elite veterans who have known many victories. Two of them will wait here, while you, me, and the other two enter the enemy base.
+Go and talk to my squad and pick out two you'd like to have at your side. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-4.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-4.htm new file mode 100644 index 0000000000..fc1f5338a8 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-4.htm @@ -0,0 +1,4 @@ +Officer Barton:
+Not to brag, but a star soldier such as myself can make the difference between winning and losing.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-5.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-5.htm new file mode 100644 index 0000000000..bf2efd3819 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33170-5.htm @@ -0,0 +1,5 @@ +Aden Vanguard Captain Adolph:
+I see you've chosen strong allies. +This battle will be fierce, and if you see me go down, do not hesitate to run. We can't afford to lose any more people, and if that happens, you will need time to regroup.Now, I hope you're ready to take this fight to the enemy, because we're going into their base.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33171-1.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33171-1.htm new file mode 100644 index 0000000000..6ee6a19e74 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33171-1.htm @@ -0,0 +1,4 @@ +Priest Alice:
+Even the strongest soldier will fall if they cannot be healed in battle. My healing power will lead us to victory.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33171-2.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33171-2.htm new file mode 100644 index 0000000000..1aa28a1370 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33171-2.htm @@ -0,0 +1,4 @@ +Priest Alice:
+Do you need my help? I can heal, and provide support in combat.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33172-1.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33172-1.htm new file mode 100644 index 0000000000..dd108af2af --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33172-1.htm @@ -0,0 +1,4 @@ +Officer Barton:
+Not to brag, but a star soldier such as myself can make the difference between winning and losing.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33172-2.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33172-2.htm new file mode 100644 index 0000000000..620b372a29 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33172-2.htm @@ -0,0 +1,4 @@ +Officer Barton:
+You need my help? Well, you look like a capable sort. I need someone like you to watch my back.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33173-1.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33173-1.htm new file mode 100644 index 0000000000..e0b92b148a --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33173-1.htm @@ -0,0 +1,4 @@ +Sniper Hayuk:
+If you can defeat your enemy before they get close, you can annihilate their forces without incurring any damage to your own team. Heh! That there is what's called strategy!
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33173-2.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33173-2.htm new file mode 100644 index 0000000000..ee5d5270b5 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33173-2.htm @@ -0,0 +1,4 @@ +Sniper Hayuk:
+Do you need my help? Of course! I will cover your back! You can trust me.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33174-1.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33174-1.htm new file mode 100644 index 0000000000..d879f4a8f4 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33174-1.htm @@ -0,0 +1,4 @@ +Magus Eliyah:
+The Ivory Tower's magic is much too powerful for these monsters. We have no need to skulk on the sidelines!
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33174-2.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33174-2.htm new file mode 100644 index 0000000000..64dc07ccb4 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33174-2.htm @@ -0,0 +1,4 @@ +Magus Eliyah:
+You need my help? Well, if you protect me from the monsters, I suppose I can help.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33414-1.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33414-1.htm new file mode 100644 index 0000000000..bd2b43b239 --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33414-1.htm @@ -0,0 +1,3 @@ +Van Archer:
+We're the strong, the proud, the vanguard of Aden! We're accepting applications... we really could use a second trombone for the marching band. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33415-1.htm b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33415-1.htm new file mode 100644 index 0000000000..191527413c --- /dev/null +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/33415-1.htm @@ -0,0 +1,3 @@ +Van Infantry:
+We're the strong, the proud, the vanguard of Aden! We're accepting applications... we really could use a second trombone for the marching band. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/IncubatorOfEvil.java b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/IncubatorOfEvil.java index 1d9e9176b8..40feb1b944 100644 --- a/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/IncubatorOfEvil.java +++ b/trunk/dist/game/data/scripts/instances/IncubatorOfEvil/IncubatorOfEvil.java @@ -16,12 +16,23 @@ */ package instances.IncubatorOfEvil; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +import com.l2jmobius.Config; +import com.l2jmobius.gameserver.ThreadPoolManager; +import com.l2jmobius.gameserver.ai.npc.FighterAI; import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance; import com.l2jmobius.gameserver.model.instancezone.InstanceWorld; import com.l2jmobius.gameserver.model.quest.QuestState; +import com.l2jmobius.gameserver.network.NpcStringId; +import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; import instances.AbstractInstance; import quests.Q10341_DayOfDestinyHumansFate.Q10341_DayOfDestinyHumansFate; @@ -32,33 +43,57 @@ import quests.Q10345_DayOfDestinyDwarfsFate.Q10345_DayOfDestinyDwarfsFate; import quests.Q10346_DayOfDestinyKamaelsFate.Q10346_DayOfDestinyKamaelsFate; /** - * Incubator of Evil Instance Zone.
- * TODO: Implement this! + * Incubator of Evil Instance Zone. * @author Mobius */ public final class IncubatorOfEvil extends AbstractInstance { // NPCs - private static final int OFFICER = 19155; + private static final int ADOLPH = 33170; + private static final int ALICE = 33171; + private static final int BARTON = 33172; + private static final int HAYUK = 33173; + private static final int ELIYAH = 33174; + private static final int ARCHER = 33414; + private static final int INFANTRY = 33415; + // Monsters + private static final int FINAL_BOSS = 27425; + private static final List MONSTERS = new ArrayList<>(); + static + { + MONSTERS.add(27430); + MONSTERS.add(27431); + MONSTERS.add(27432); + MONSTERS.add(27433); + MONSTERS.add(27434); + } + // Rewards + private static final int SOE = 736; // Locations private static final Location START_LOC = new Location(56180, -172898, -7952); - @SuppressWarnings("unused") private static final Location FIGHT_LOC = new Location(56177, -175627, -7952); - @SuppressWarnings("unused") - private static final Location EXIT_LOC = new Location(185798, 20400, -3345); // Misc private static final int TEMPLATE_ID = 185; - protected class IOE extends InstanceWorld + class IOEWorld extends InstanceWorld { + L2QuestGuardInstance adolph = null; + L2QuestGuardInstance alice = null; + L2QuestGuardInstance barton = null; + L2QuestGuardInstance hayuk = null; + L2QuestGuardInstance eliyah = null; + int selectionCount = 0; + final List savedSpawns = new CopyOnWriteArrayList<>(); } public IncubatorOfEvil() { super(IncubatorOfEvil.class.getSimpleName()); - addStartNpc(OFFICER); - addTalkId(OFFICER); - addFirstTalkId(OFFICER); + addStartNpc(ADOLPH); + addTalkId(ADOLPH, BARTON, HAYUK, ELIYAH, ALICE); + addFirstTalkId(ADOLPH, BARTON, HAYUK, ELIYAH, ALICE, ARCHER, INFANTRY); + addKillId(MONSTERS); + addKillId(FINAL_BOSS); } @Override @@ -66,28 +101,460 @@ public final class IncubatorOfEvil extends AbstractInstance { if (event.equals("enter_instance")) { - if (getPlayerQuestState(player) == null) + final QuestState qs = getPlayerQuestState(player); + if ((qs == null) || (qs.getCond() < 4) || qs.isCond(13)) { return null; } - enterInstance(player, new IOE(), "IncubatorOfEvil.xml", TEMPLATE_ID); + qs.setCond(5, true); + enterInstance(player, new IOEWorld(), "IncubatorOfEvil.xml", TEMPLATE_ID); return null; } final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player); - if ((tmpworld == null) || !(tmpworld instanceof IOE)) + if ((tmpworld == null) || !(tmpworld instanceof IOEWorld)) { return null; } - @SuppressWarnings("unused") - final IOE world = (IOE) tmpworld; + final IOEWorld world = (IOEWorld) tmpworld; + String htmltext = null; switch (event) { - + case "33170-5.htm": + { + htmltext = event; + break; + } + case "33170-3.htm": + { + final QuestState qs = getPlayerQuestState(player); + if ((qs != null) && qs.isCond(5)) + { + qs.setCond(6, true); + htmltext = event; + } + break; + } + case "select_alice": + { + htmltext = addVanguard(player, ALICE); + break; + } + case "select_barton": + { + htmltext = addVanguard(player, BARTON); + break; + } + case "select_hayuk": + { + htmltext = addVanguard(player, HAYUK); + break; + } + case "select_eliyah": + { + htmltext = addVanguard(player, ELIYAH); + break; + } + case "start_battle": + { + if (world.selectionCount == 2) + { + final QuestState qs = getPlayerQuestState(player); + if ((qs != null) && qs.isCond(7)) + { + world.setStatus(1); + qs.setCond(8, true); + teleportPlayer(player, FIGHT_LOC, world.getInstanceId(), false); + + if (world.adolph != null) + { + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.adolph), 1000); + } + if (world.alice != null) + { + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.alice), 1000); + } + if (world.barton != null) + { + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.barton), 1000); + } + if (world.hayuk != null) + { + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.hayuk), 1000); + } + if (world.eliyah != null) + { + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.eliyah), 1000); + } + + final List archers = spawnGroup("archers", world.getInstanceId()); + for (L2Npc spawn : archers) + { + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((L2QuestGuardInstance) spawn)), 1000); + } + final List infantry = spawnGroup("infantry", world.getInstanceId()); + for (L2Npc spawn : infantry) + { + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((L2QuestGuardInstance) spawn)), 1000); + } + + world.savedSpawns.addAll(spawnGroup("wave1", world.getInstanceId())); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + + startQuestTimer("checkStatus", 5000, null, player, true); + } + } + break; + } + case "checkStatus": + { + // Check if finished. + if (world.getStatus() > 13) + { + final QuestState qs = getPlayerQuestState(player); + if (qs != null) + { + rewardItems(player, SOE, 1); + qs.setCond(13, true); + } + // 5 minute exit timer. + InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(Config.INSTANCE_FINISH_TIME); + InstanceManager.getInstance().getInstance(world.getInstanceId()).setEmptyDestroyTime(0); + // Stop quest timer. + cancelQuestTimers("checkStatus"); + return null; + } + // Remove monsters killed by guards. + for (L2Npc spawn : world.savedSpawns) + { + if (spawn.isDead()) + { + world.savedSpawns.remove(spawn); + + if (spawn.getId() == FINAL_BOSS) + { + for (L2Npc monster : world.savedSpawns) + { + monster.deleteMe(); + } + world.incStatus(); + } + } + } + // Act according to world status. + switch (world.getStatus()) + { + case 1: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave2", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 2: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave3", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 3: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave4", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 4: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave5", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 5: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave6", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 6: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave7", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 7: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave8", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 8: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave9", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 9: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave10", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 10: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave11", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 11: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave12", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 12: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + world.savedSpawns.addAll(spawnGroup("wave13", world.getInstanceId())); + showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF); + for (L2Npc spawn : world.savedSpawns) + { + addAttackDesire(spawn, player); + } + } + break; + } + case 13: + { + if (world.savedSpawns.isEmpty()) + { + world.incStatus(); + } + break; + } + } + break; + } + } + return htmltext; + } + + @Override + public String onTalk(L2Npc npc, L2PcInstance player) + { + final QuestState qs = getPlayerQuestState(player); + if (qs == null) + { + return null; + } + String htmltext = getNoQuestMsg(player); + switch (npc.getId()) + { + case ADOLPH: + { + switch (qs.getCond()) + { + case 5: + { + htmltext = "33170-2.htm"; + break; + } + case 6: + { + htmltext = "33170-3.htm"; + break; + } + } + break; + } + case ALICE: + case BARTON: + case HAYUK: + case ELIYAH: + { + switch (qs.getCond()) + { + case 6: + { + htmltext = npc.getId() + "-2.htm"; + break; + } + } + break; + } + } + return htmltext; + } + + @Override + public String onFirstTalk(L2Npc npc, L2PcInstance player) + { + final QuestState qs = getPlayerQuestState(player); + if (qs == null) + { + return null; } - return super.onAdvEvent(event, npc, player); + switch (npc.getId()) + { + case ADOLPH: + { + switch (qs.getCond()) + { + case 4: + case 5: + case 6: + { + return "33170-1.htm"; + } + case 7: + { + return "33170-4.htm"; + } + } + break; + } + case ALICE: + case BARTON: + case HAYUK: + case ELIYAH: + { + switch (qs.getCond()) + { + case 4: + case 5: + case 6: + { + return npc.getId() + "-1.htm"; + } + // case 8: ? + } + break; + } + case ARCHER: + case INFANTRY: + { + return npc.getId() + "-1.htm"; + } + } + + return null; + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(killer); + if ((world == null) || !(world instanceof IOEWorld)) + { + return null; + } + + ((IOEWorld) world).savedSpawns.remove(npc); + + if (npc.getId() == FINAL_BOSS) + { + for (L2Npc monster : ((IOEWorld) world).savedSpawns) + { + monster.deleteMe(); + } + ((IOEWorld) world).incStatus(); + } + + return super.onKill(npc, killer, isSummon); } @Override @@ -95,7 +562,7 @@ public final class IncubatorOfEvil extends AbstractInstance { if (firstEntrance) { - world.setStatus(1); + world.setStatus(0); world.addAllowed(player.getObjectId()); } teleportPlayer(player, START_LOC, world.getInstanceId()); @@ -139,4 +606,69 @@ public final class IncubatorOfEvil extends AbstractInstance } return qs; } + + private String addVanguard(L2PcInstance player, int addedNpcId) + { + final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); + if ((world == null) || !(world instanceof IOEWorld) || (world.getStatus() > 1) // + || (player.getTarget() == null) || !player.getTarget().isNpc() || (((L2Npc) player.getTarget()).getId() != addedNpcId)) + { + return null; + } + + switch (addedNpcId) + { + case ALICE: + { + ((L2Character) player.getTarget()).deleteMe(); + ((IOEWorld) world).selectionCount++; + ((IOEWorld) world).alice = (L2QuestGuardInstance) addSpawn(ALICE, FIGHT_LOC, true, 0, false, world.getInstanceId()); + break; + } + case BARTON: + { + ((L2Character) player.getTarget()).deleteMe(); + ((IOEWorld) world).selectionCount++; + ((IOEWorld) world).barton = (L2QuestGuardInstance) addSpawn(BARTON, FIGHT_LOC, true, 0, false, world.getInstanceId()); + break; + } + case HAYUK: + { + ((L2Character) player.getTarget()).deleteMe(); + ((IOEWorld) world).selectionCount++; + ((IOEWorld) world).hayuk = (L2QuestGuardInstance) addSpawn(HAYUK, FIGHT_LOC, true, 0, false, world.getInstanceId()); + break; + } + case ELIYAH: + { + ((L2Character) player.getTarget()).deleteMe(); + ((IOEWorld) world).selectionCount++; + ((IOEWorld) world).eliyah = (L2QuestGuardInstance) addSpawn(ELIYAH, FIGHT_LOC, true, 0, false, world.getInstanceId()); + break; + } + } + if (((IOEWorld) world).selectionCount == 2) + { + ((IOEWorld) world).adolph = (L2QuestGuardInstance) addSpawn(ADOLPH, FIGHT_LOC, true, 0, false, world.getInstanceId()); + final QuestState qs = getPlayerQuestState(player); + if ((qs != null) && qs.isCond(6)) + { + qs.setCond(7, true); + } + // Remove remaining vanguards. + for (L2Character ch : player.getKnownList().getKnownCharactersInRadius(500)) + { + if (ch.isNpc() && (((L2Npc) ch).getId() != ADOLPH)) + { + ch.deleteMe(); + } + } + } + return null; + } + + private void showScreenMessage(L2PcInstance player, NpcStringId stringId) + { + player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 10000, false, null, stringId, null)); + } } \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java index 5ddee1a187..9736d2ee49 100644 --- a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java +++ b/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/KartiasLabyrinth.java @@ -23,6 +23,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import com.l2jmobius.Config; import com.l2jmobius.gameserver.ThreadPoolManager; +import com.l2jmobius.gameserver.ai.npc.FighterAI; import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.actor.L2Character; @@ -38,7 +39,6 @@ import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; import com.l2jmobius.gameserver.util.Util; import instances.AbstractInstance; -import instances.KartiasLabyrinth.AI.Fighter; import quests.Q00494_IncarnationOfGreedZellakaGroup.Q00494_IncarnationOfGreedZellakaGroup; import quests.Q00495_IncarnationOfJealousyPellineGroup.Q00495_IncarnationOfJealousyPellineGroup; import quests.Q00496_IncarnationOfGluttonyKaliosGroup.Q00496_IncarnationOfGluttonyKaliosGroup; @@ -831,23 +831,23 @@ public final class KartiasLabyrinth extends AbstractInstance } if (((KartiaWorld) world).adolph != null) { - ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).adolph), 1000); + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).adolph), 1000); } if (((KartiaWorld) world).barton != null) { - ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).barton), 1000); + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).barton), 1000); } if (((KartiaWorld) world).hayuk != null) { - ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).hayuk), 1000); + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).hayuk), 1000); } if (((KartiaWorld) world).eliyah != null) { - ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).eliyah), 1000); + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).eliyah), 1000); } if (((KartiaWorld) world).elise != null) { - ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).elise), 1000); + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).elise), 1000); } ((KartiaWorld) world).savedSpawns.addAll(spawnGroup("wave1", world.getInstanceId())); startQuestTimer("checkStatus", 5000, null, player, true); diff --git a/trunk/dist/game/data/stats/npcs/27400-27499.xml b/trunk/dist/game/data/stats/npcs/27400-27499.xml index 2150147f80..dad13e4854 100644 --- a/trunk/dist/game/data/stats/npcs/27400-27499.xml +++ b/trunk/dist/game/data/stats/npcs/27400-27499.xml @@ -660,7 +660,7 @@ - + UNDEAD @@ -800,7 +800,7 @@ - + UNDEAD @@ -827,7 +827,7 @@ - + UNDEAD @@ -854,7 +854,7 @@ - + UNDEAD @@ -881,7 +881,7 @@ - + UNDEAD @@ -909,7 +909,7 @@ - + UNDEAD diff --git a/trunk/dist/game/data/stats/npcs/33100-33199.xml b/trunk/dist/game/data/stats/npcs/33100-33199.xml index e2306c3603..6dce71c343 100644 --- a/trunk/dist/game/data/stats/npcs/33100-33199.xml +++ b/trunk/dist/game/data/stats/npcs/33100-33199.xml @@ -1670,7 +1670,7 @@ - + HUMAN @@ -1696,7 +1696,7 @@ - + HUMAN @@ -1722,7 +1722,7 @@ - + ORC @@ -1748,7 +1748,7 @@ - + ELF @@ -1774,7 +1774,7 @@ - + HUMAN diff --git a/trunk/dist/game/data/stats/npcs/33400-33499.xml b/trunk/dist/game/data/stats/npcs/33400-33499.xml index a3d72f0712..cc938a0708 100644 --- a/trunk/dist/game/data/stats/npcs/33400-33499.xml +++ b/trunk/dist/game/data/stats/npcs/33400-33499.xml @@ -337,7 +337,7 @@ - + HUMAN @@ -361,7 +361,7 @@ - + HUMAN diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/AI/Fighter.java b/trunk/java/com/l2jmobius/gameserver/ai/npc/FighterAI.java similarity index 90% rename from trunk/dist/game/data/scripts/instances/KartiasLabyrinth/AI/Fighter.java rename to trunk/java/com/l2jmobius/gameserver/ai/npc/FighterAI.java index 3a6f75b0bd..ec346c6c18 100644 --- a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/AI/Fighter.java +++ b/trunk/java/com/l2jmobius/gameserver/ai/npc/FighterAI.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package instances.KartiasLabyrinth.AI; +package com.l2jmobius.gameserver.ai.npc; import com.l2jmobius.gameserver.ThreadPoolManager; import com.l2jmobius.gameserver.ai.CtrlIntention; @@ -29,13 +29,13 @@ import com.l2jmobius.util.Rnd; /** * @author Mobius */ -public final class Fighter implements Runnable +public final class FighterAI implements Runnable { private L2PcInstance _player; private final L2QuestGuardInstance _guard; private int _followRange = 150; - public Fighter(L2PcInstance player, L2QuestGuardInstance guard) + public FighterAI(L2PcInstance player, L2QuestGuardInstance guard) { _player = player; _guard = guard; @@ -64,7 +64,7 @@ public final class Fighter implements Runnable { return; } - ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(_player, _guard), _guard.isInCombat() ? 1000 : 3000); + ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(_player, _guard), _guard.isInCombat() ? 1000 : 3000); // Guard is occupied. Use skills logic. if (_guard.isInCombat()) diff --git a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/AI/Healer.java b/trunk/java/com/l2jmobius/gameserver/ai/npc/HealerAI.java similarity index 90% rename from trunk/dist/game/data/scripts/instances/KartiasLabyrinth/AI/Healer.java rename to trunk/java/com/l2jmobius/gameserver/ai/npc/HealerAI.java index a9d7846d00..4a6da9504d 100644 --- a/trunk/dist/game/data/scripts/instances/KartiasLabyrinth/AI/Healer.java +++ b/trunk/java/com/l2jmobius/gameserver/ai/npc/HealerAI.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package instances.KartiasLabyrinth.AI; +package com.l2jmobius.gameserver.ai.npc; import com.l2jmobius.gameserver.ThreadPoolManager; import com.l2jmobius.gameserver.ai.CtrlIntention; @@ -29,13 +29,13 @@ import com.l2jmobius.util.Rnd; /** * @author Mobius */ -final class Healer implements Runnable +public final class HealerAI implements Runnable { private L2PcInstance _player; private final L2QuestGuardInstance _guard; private int _followRange = 200; - public Healer(L2PcInstance player, L2QuestGuardInstance guard) + public HealerAI(L2PcInstance player, L2QuestGuardInstance guard) { _player = player; _guard = guard; @@ -64,7 +64,7 @@ final class Healer implements Runnable { return; } - ThreadPoolManager.getInstance().scheduleGeneral(new Healer(_player, _guard), _guard.isInCombat() ? 1000 : 3000); + ThreadPoolManager.getInstance().scheduleGeneral(new HealerAI(_player, _guard), _guard.isInCombat() ? 1000 : 3000); // Guard is occupied. Use skills logic. if (_guard.isInCombat())