From e23fb9f6e66a0b684f460c6e64172cbe3f2ac391 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 17 May 2020 02:33:02 +0000 Subject: [PATCH] Fixed and improved Dimensional Wrap. --- .../game/data/instances/DimensionalWrap.xml | 118 ++++++------ .../DimensionalWrap/DimensionalWrap.java | 175 +++++++++--------- .../game/data/instances/DimensionalWrap.xml | 118 ++++++------ .../DimensionalWrap/DimensionalWrap.java | 175 +++++++++--------- .../game/data/instances/DimensionalWrap.xml | 118 ++++++------ .../DimensionalWrap/DimensionalWrap.java | 175 +++++++++--------- .../game/data/instances/DimensionalWrap.xml | 118 ++++++------ .../DimensionalWrap/DimensionalWrap.java | 175 +++++++++--------- .../game/data/instances/DimensionalWrap.xml | 118 ++++++------ .../DimensionalWrap/DimensionalWrap.java | 175 +++++++++--------- .../game/data/instances/DimensionalWrap.xml | 118 ++++++------ .../DimensionalWrap/DimensionalWrap.java | 175 +++++++++--------- .../game/data/instances/DimensionalWrap.xml | 118 ++++++------ .../DimensionalWrap/DimensionalWrap.java | 175 +++++++++--------- .../game/data/instances/DimensionalWrap.xml | 118 ++++++------ .../DimensionalWrap/DimensionalWrap.java | 175 +++++++++--------- 16 files changed, 1176 insertions(+), 1168 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/instances/DimensionalWrap.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/instances/DimensionalWrap.xml index cc6a07c02f..7d6656c334 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/instances/DimensionalWrap.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/instances/DimensionalWrap.xml @@ -199,7 +199,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -494,7 +494,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -729,7 +729,7 @@ - + @@ -769,7 +769,7 @@ - + @@ -796,9 +796,9 @@ - + - + @@ -852,9 +852,9 @@ - + - + @@ -927,7 +927,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1169,7 +1169,7 @@ - + @@ -1201,9 +1201,9 @@ - + - + @@ -1275,7 +1275,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1349,7 +1349,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1457,7 +1457,7 @@ - + @@ -1489,7 +1489,7 @@ - + @@ -1515,7 +1515,7 @@ - + @@ -1549,7 +1549,7 @@ - + @@ -1574,7 +1574,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1701,7 +1701,7 @@ - + @@ -1713,7 +1713,7 @@ - + @@ -1774,7 +1774,7 @@ - + @@ -1794,7 +1794,7 @@ - + @@ -1843,11 +1843,11 @@ - + - + @@ -1906,7 +1906,7 @@ - + @@ -1918,7 +1918,7 @@ - + @@ -1982,7 +1982,7 @@ - + @@ -2058,7 +2058,7 @@ - + @@ -2085,7 +2085,7 @@ - + @@ -2131,7 +2131,7 @@ - + @@ -2170,7 +2170,7 @@ - + @@ -2202,7 +2202,7 @@ - + @@ -2228,7 +2228,7 @@ - + @@ -2265,7 +2265,7 @@ - + @@ -2344,7 +2344,7 @@ - + @@ -2428,9 +2428,9 @@ - + - + @@ -2504,7 +2504,7 @@ - + @@ -2552,7 +2552,7 @@ - + @@ -2587,7 +2587,7 @@ - + @@ -2616,7 +2616,7 @@ - + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java index 4be98f5b35..0ad3e53c5b 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java @@ -51,7 +51,7 @@ public class DimensionalWrap extends AbstractInstance private static final int RESED = 33974; private static final int EINSTER = 33975; // Monsters - private static final int DEMINSIONAL_INVISIBLE_FRAGMENT = 19564; + private static final int DIMENSIONAL_INVISIBLE_FRAGMENT = 19564; private static final int SALAMANDRA_GENERATOR = 19563; private static final int SALAMANDRA_GENERATOR_DUMMY = 19480; private static final int DIMENSIONAL_SALAMANDRA = 23466; @@ -110,7 +110,7 @@ public class DimensionalWrap extends AbstractInstance addTalkId(EINSTER); addKillId(MONSTERS); addKillId(ABYSSAL_MAKKUM); - addSpawnId(SALAMANDRA_GENERATOR, DEMINSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR_DUMMY); + addSpawnId(DIMENSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR, SALAMANDRA_GENERATOR_DUMMY); addFirstTalkId(EINSTER); } @@ -303,13 +303,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 5) { world.setStatus(5); @@ -321,6 +314,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FIRST_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_11_f": @@ -341,13 +341,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 10) { world.setStatus(10); @@ -359,6 +352,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(SECOND_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_16_f": @@ -379,13 +379,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 15) { world.setStatus(15); @@ -397,6 +390,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(THIRD_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_21_f": @@ -417,13 +417,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 20) { world.setStatus(20); @@ -435,6 +428,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(TELEPORTS, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_26_f": @@ -455,13 +455,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 25) { world.setStatus(25); @@ -473,6 +466,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FOURTH_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "jump_location": @@ -505,6 +505,7 @@ public class DimensionalWrap extends AbstractInstance } }); } + startQuestTimer(event, event.equals("SALAMANDRA_SPAWN") ? 25000 : 20000, npc, player); break; } case "START_STAGE": @@ -518,7 +519,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.setStatus(world.getStatus() + 1); + world.incStatus(); world.setParameter("worldState", world.getStatus()); world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_WARP_LV_S1, ExShowScreenMessage.TOP_CENTER, 10000, true, String.valueOf(world.getStatus()))); startQuestTimer("FIRST_SPAWN", 1500, null, world.getFirstPlayer()); @@ -539,7 +540,7 @@ public class DimensionalWrap extends AbstractInstance world.spawnGroup(worldState + "_first_spawn"); world.spawnGroup(worldState + "_trap_spawn"); startQuestTimer("SECOND_SPAWN", 40000, null, world.getFirstPlayer()); - startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer(), true); + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "DEBUFF_TASK": @@ -575,6 +576,7 @@ public class DimensionalWrap extends AbstractInstance skill.applyEffects(p, p); } } + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "SECOND_SPAWN": @@ -595,7 +597,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_thred_spawn"); + world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_third_spawn"); break; } case "CHANGE_LOCATION": @@ -614,30 +616,6 @@ public class DimensionalWrap extends AbstractInstance startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1430), null, world.getFirstPlayer()); break; } - case "SWITCH_STAGE": - { - if (player == null) - { - return null; - } - final Instance world = player.getInstanceWorld(); - if (!isInInstance(world)) - { - return null; - } - if (world.getAliveNpcs(MONSTERS).isEmpty()) - { - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); - world.broadcastPacket(new Earthquake(player, 50, 5)); - world.openCloseDoor(world.getTemplateParameters().getInt(world.getParameters().getInt("worldState", 0) + "_st_door"), true); - clean(world.getFirstPlayer()); - if (world.getParameters().getInt("worldState", 0) < 35) - { - startQuestTimer("NEXT_STAGE", 5000, null, world.getFirstPlayer()); - } - } - break; - } case "NEXT_STAGE": { if (player == null) @@ -651,7 +629,7 @@ public class DimensionalWrap extends AbstractInstance } world.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_SECONDS_HAVE_BEEN_ADDED_TO_THE_INSTANCED_ZONE_DURATION, ExShowScreenMessage.TOP_CENTER, 5000, true, String.valueOf(180))); world.setDuration((int) ((world.getRemainingTime() / 60000) + 3)); - startQuestTimer("START_STAGE", 8000, null, world.getFirstPlayer()); + startQuestTimer("START_STAGE", 10000, null, world.getFirstPlayer()); for (Npc n : world.getAliveNpcs()) { if (n.getId() != EINSTER) @@ -671,23 +649,40 @@ public class DimensionalWrap extends AbstractInstance final Instance world = npc.getInstanceWorld(); if (isInInstance(world)) { - if (CommonUtil.contains(MONSTERS, npc.getId()) && (getRandom(100) < world.getParameters().getDouble("chance", 0))) + final int worldState = world.getParameters().getInt("worldState", 0); + if (CommonUtil.contains(MONSTERS, npc.getId()) && (worldState < 35)) { - final int worldState = world.getParameters().getInt("worldState", 0); - if (worldState < 9) + if (getRandom(100) < world.getParameters().getDouble("chance", 0)) { - addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState < 9) + { + addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if ((worldState >= 9) && (worldState < 20)) + { + addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if (worldState >= 20) + { + addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } } - else if ((worldState >= 9) && (worldState < 20)) + + if (world.getAliveNpcs(MONSTERS).isEmpty() && world.getParameters().getBoolean("ThirdWave", false)) { - addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); - } - else if (worldState >= 20) - { - addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState == 20) + { + world.setParameter("20thThirdWaveFinished", true); + } + world.setParameter("ThirdWave", false); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); + world.broadcastPacket(new Earthquake(killer, 50, 5)); + world.openCloseDoor(world.getTemplateParameters().getInt(worldState + "_st_door"), true); + clean(world.getFirstPlayer()); + startQuestTimer("NEXT_STAGE", 7000, null, world.getFirstPlayer()); } } else if (npc.getId() == ABYSSAL_MAKKUM) @@ -704,9 +699,16 @@ public class DimensionalWrap extends AbstractInstance public String onFirstTalk(Npc npc, PlayerInstance player) { final Instance world = npc.getInstanceWorld(); - if (isInInstance(world) && (world.getParameters().getInt("worldState", 0) == 20)) + if (isInInstance(world)) { - return "33975-04.html"; + if (world.getParameters().getInt("worldState", 0) >= 20) + { + if (!world.getParameters().getBoolean("20thThirdWaveFinished", false)) + { + return "33975-02.html"; + } + return "33975-04.html"; + } } return "33975.html"; } @@ -721,18 +723,18 @@ public class DimensionalWrap extends AbstractInstance { case SALAMANDRA_GENERATOR: { - startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer()); startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1300), null, world.getFirstPlayer()); break; } case SALAMANDRA_GENERATOR_DUMMY: { - startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer()); break; } - case DEMINSIONAL_INVISIBLE_FRAGMENT: + case DIMENSIONAL_INVISIBLE_FRAGMENT: { - startQuestTimer("SWITCH_STAGE", 5000, null, world.getFirstPlayer(), true); + world.setParameter("ThirdWave", true); break; } } @@ -772,9 +774,8 @@ public class DimensionalWrap extends AbstractInstance protected void clean(PlayerInstance player) { - cancelQuestTimer("SWITCH_STAGE", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); cancelQuestTimer("CHANGE_LOCATION", null, player); cancelQuestTimer("DEBUFF_TASK", null, player); } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/instances/DimensionalWrap.xml b/L2J_Mobius_2.5_Underground/dist/game/data/instances/DimensionalWrap.xml index cc6a07c02f..7d6656c334 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/instances/DimensionalWrap.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/instances/DimensionalWrap.xml @@ -199,7 +199,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -494,7 +494,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -729,7 +729,7 @@ - + @@ -769,7 +769,7 @@ - + @@ -796,9 +796,9 @@ - + - + @@ -852,9 +852,9 @@ - + - + @@ -927,7 +927,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1169,7 +1169,7 @@ - + @@ -1201,9 +1201,9 @@ - + - + @@ -1275,7 +1275,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1349,7 +1349,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1457,7 +1457,7 @@ - + @@ -1489,7 +1489,7 @@ - + @@ -1515,7 +1515,7 @@ - + @@ -1549,7 +1549,7 @@ - + @@ -1574,7 +1574,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1701,7 +1701,7 @@ - + @@ -1713,7 +1713,7 @@ - + @@ -1774,7 +1774,7 @@ - + @@ -1794,7 +1794,7 @@ - + @@ -1843,11 +1843,11 @@ - + - + @@ -1906,7 +1906,7 @@ - + @@ -1918,7 +1918,7 @@ - + @@ -1982,7 +1982,7 @@ - + @@ -2058,7 +2058,7 @@ - + @@ -2085,7 +2085,7 @@ - + @@ -2131,7 +2131,7 @@ - + @@ -2170,7 +2170,7 @@ - + @@ -2202,7 +2202,7 @@ - + @@ -2228,7 +2228,7 @@ - + @@ -2265,7 +2265,7 @@ - + @@ -2344,7 +2344,7 @@ - + @@ -2428,9 +2428,9 @@ - + - + @@ -2504,7 +2504,7 @@ - + @@ -2552,7 +2552,7 @@ - + @@ -2587,7 +2587,7 @@ - + @@ -2616,7 +2616,7 @@ - + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java index 4be98f5b35..0ad3e53c5b 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java @@ -51,7 +51,7 @@ public class DimensionalWrap extends AbstractInstance private static final int RESED = 33974; private static final int EINSTER = 33975; // Monsters - private static final int DEMINSIONAL_INVISIBLE_FRAGMENT = 19564; + private static final int DIMENSIONAL_INVISIBLE_FRAGMENT = 19564; private static final int SALAMANDRA_GENERATOR = 19563; private static final int SALAMANDRA_GENERATOR_DUMMY = 19480; private static final int DIMENSIONAL_SALAMANDRA = 23466; @@ -110,7 +110,7 @@ public class DimensionalWrap extends AbstractInstance addTalkId(EINSTER); addKillId(MONSTERS); addKillId(ABYSSAL_MAKKUM); - addSpawnId(SALAMANDRA_GENERATOR, DEMINSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR_DUMMY); + addSpawnId(DIMENSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR, SALAMANDRA_GENERATOR_DUMMY); addFirstTalkId(EINSTER); } @@ -303,13 +303,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 5) { world.setStatus(5); @@ -321,6 +314,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FIRST_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_11_f": @@ -341,13 +341,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 10) { world.setStatus(10); @@ -359,6 +352,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(SECOND_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_16_f": @@ -379,13 +379,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 15) { world.setStatus(15); @@ -397,6 +390,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(THIRD_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_21_f": @@ -417,13 +417,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 20) { world.setStatus(20); @@ -435,6 +428,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(TELEPORTS, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_26_f": @@ -455,13 +455,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 25) { world.setStatus(25); @@ -473,6 +466,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FOURTH_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "jump_location": @@ -505,6 +505,7 @@ public class DimensionalWrap extends AbstractInstance } }); } + startQuestTimer(event, event.equals("SALAMANDRA_SPAWN") ? 25000 : 20000, npc, player); break; } case "START_STAGE": @@ -518,7 +519,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.setStatus(world.getStatus() + 1); + world.incStatus(); world.setParameter("worldState", world.getStatus()); world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_WARP_LV_S1, ExShowScreenMessage.TOP_CENTER, 10000, true, String.valueOf(world.getStatus()))); startQuestTimer("FIRST_SPAWN", 1500, null, world.getFirstPlayer()); @@ -539,7 +540,7 @@ public class DimensionalWrap extends AbstractInstance world.spawnGroup(worldState + "_first_spawn"); world.spawnGroup(worldState + "_trap_spawn"); startQuestTimer("SECOND_SPAWN", 40000, null, world.getFirstPlayer()); - startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer(), true); + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "DEBUFF_TASK": @@ -575,6 +576,7 @@ public class DimensionalWrap extends AbstractInstance skill.applyEffects(p, p); } } + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "SECOND_SPAWN": @@ -595,7 +597,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_thred_spawn"); + world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_third_spawn"); break; } case "CHANGE_LOCATION": @@ -614,30 +616,6 @@ public class DimensionalWrap extends AbstractInstance startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1430), null, world.getFirstPlayer()); break; } - case "SWITCH_STAGE": - { - if (player == null) - { - return null; - } - final Instance world = player.getInstanceWorld(); - if (!isInInstance(world)) - { - return null; - } - if (world.getAliveNpcs(MONSTERS).isEmpty()) - { - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); - world.broadcastPacket(new Earthquake(player, 50, 5)); - world.openCloseDoor(world.getTemplateParameters().getInt(world.getParameters().getInt("worldState", 0) + "_st_door"), true); - clean(world.getFirstPlayer()); - if (world.getParameters().getInt("worldState", 0) < 35) - { - startQuestTimer("NEXT_STAGE", 5000, null, world.getFirstPlayer()); - } - } - break; - } case "NEXT_STAGE": { if (player == null) @@ -651,7 +629,7 @@ public class DimensionalWrap extends AbstractInstance } world.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_SECONDS_HAVE_BEEN_ADDED_TO_THE_INSTANCED_ZONE_DURATION, ExShowScreenMessage.TOP_CENTER, 5000, true, String.valueOf(180))); world.setDuration((int) ((world.getRemainingTime() / 60000) + 3)); - startQuestTimer("START_STAGE", 8000, null, world.getFirstPlayer()); + startQuestTimer("START_STAGE", 10000, null, world.getFirstPlayer()); for (Npc n : world.getAliveNpcs()) { if (n.getId() != EINSTER) @@ -671,23 +649,40 @@ public class DimensionalWrap extends AbstractInstance final Instance world = npc.getInstanceWorld(); if (isInInstance(world)) { - if (CommonUtil.contains(MONSTERS, npc.getId()) && (getRandom(100) < world.getParameters().getDouble("chance", 0))) + final int worldState = world.getParameters().getInt("worldState", 0); + if (CommonUtil.contains(MONSTERS, npc.getId()) && (worldState < 35)) { - final int worldState = world.getParameters().getInt("worldState", 0); - if (worldState < 9) + if (getRandom(100) < world.getParameters().getDouble("chance", 0)) { - addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState < 9) + { + addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if ((worldState >= 9) && (worldState < 20)) + { + addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if (worldState >= 20) + { + addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } } - else if ((worldState >= 9) && (worldState < 20)) + + if (world.getAliveNpcs(MONSTERS).isEmpty() && world.getParameters().getBoolean("ThirdWave", false)) { - addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); - } - else if (worldState >= 20) - { - addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState == 20) + { + world.setParameter("20thThirdWaveFinished", true); + } + world.setParameter("ThirdWave", false); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); + world.broadcastPacket(new Earthquake(killer, 50, 5)); + world.openCloseDoor(world.getTemplateParameters().getInt(worldState + "_st_door"), true); + clean(world.getFirstPlayer()); + startQuestTimer("NEXT_STAGE", 7000, null, world.getFirstPlayer()); } } else if (npc.getId() == ABYSSAL_MAKKUM) @@ -704,9 +699,16 @@ public class DimensionalWrap extends AbstractInstance public String onFirstTalk(Npc npc, PlayerInstance player) { final Instance world = npc.getInstanceWorld(); - if (isInInstance(world) && (world.getParameters().getInt("worldState", 0) == 20)) + if (isInInstance(world)) { - return "33975-04.html"; + if (world.getParameters().getInt("worldState", 0) >= 20) + { + if (!world.getParameters().getBoolean("20thThirdWaveFinished", false)) + { + return "33975-02.html"; + } + return "33975-04.html"; + } } return "33975.html"; } @@ -721,18 +723,18 @@ public class DimensionalWrap extends AbstractInstance { case SALAMANDRA_GENERATOR: { - startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer()); startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1300), null, world.getFirstPlayer()); break; } case SALAMANDRA_GENERATOR_DUMMY: { - startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer()); break; } - case DEMINSIONAL_INVISIBLE_FRAGMENT: + case DIMENSIONAL_INVISIBLE_FRAGMENT: { - startQuestTimer("SWITCH_STAGE", 5000, null, world.getFirstPlayer(), true); + world.setParameter("ThirdWave", true); break; } } @@ -772,9 +774,8 @@ public class DimensionalWrap extends AbstractInstance protected void clean(PlayerInstance player) { - cancelQuestTimer("SWITCH_STAGE", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); cancelQuestTimer("CHANGE_LOCATION", null, player); cancelQuestTimer("DEBUFF_TASK", null, player); } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/instances/DimensionalWrap.xml b/L2J_Mobius_3.0_Helios/dist/game/data/instances/DimensionalWrap.xml index cc6a07c02f..7d6656c334 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/instances/DimensionalWrap.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/instances/DimensionalWrap.xml @@ -199,7 +199,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -494,7 +494,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -729,7 +729,7 @@ - + @@ -769,7 +769,7 @@ - + @@ -796,9 +796,9 @@ - + - + @@ -852,9 +852,9 @@ - + - + @@ -927,7 +927,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1169,7 +1169,7 @@ - + @@ -1201,9 +1201,9 @@ - + - + @@ -1275,7 +1275,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1349,7 +1349,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1457,7 +1457,7 @@ - + @@ -1489,7 +1489,7 @@ - + @@ -1515,7 +1515,7 @@ - + @@ -1549,7 +1549,7 @@ - + @@ -1574,7 +1574,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1701,7 +1701,7 @@ - + @@ -1713,7 +1713,7 @@ - + @@ -1774,7 +1774,7 @@ - + @@ -1794,7 +1794,7 @@ - + @@ -1843,11 +1843,11 @@ - + - + @@ -1906,7 +1906,7 @@ - + @@ -1918,7 +1918,7 @@ - + @@ -1982,7 +1982,7 @@ - + @@ -2058,7 +2058,7 @@ - + @@ -2085,7 +2085,7 @@ - + @@ -2131,7 +2131,7 @@ - + @@ -2170,7 +2170,7 @@ - + @@ -2202,7 +2202,7 @@ - + @@ -2228,7 +2228,7 @@ - + @@ -2265,7 +2265,7 @@ - + @@ -2344,7 +2344,7 @@ - + @@ -2428,9 +2428,9 @@ - + - + @@ -2504,7 +2504,7 @@ - + @@ -2552,7 +2552,7 @@ - + @@ -2587,7 +2587,7 @@ - + @@ -2616,7 +2616,7 @@ - + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java index 4be98f5b35..0ad3e53c5b 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java @@ -51,7 +51,7 @@ public class DimensionalWrap extends AbstractInstance private static final int RESED = 33974; private static final int EINSTER = 33975; // Monsters - private static final int DEMINSIONAL_INVISIBLE_FRAGMENT = 19564; + private static final int DIMENSIONAL_INVISIBLE_FRAGMENT = 19564; private static final int SALAMANDRA_GENERATOR = 19563; private static final int SALAMANDRA_GENERATOR_DUMMY = 19480; private static final int DIMENSIONAL_SALAMANDRA = 23466; @@ -110,7 +110,7 @@ public class DimensionalWrap extends AbstractInstance addTalkId(EINSTER); addKillId(MONSTERS); addKillId(ABYSSAL_MAKKUM); - addSpawnId(SALAMANDRA_GENERATOR, DEMINSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR_DUMMY); + addSpawnId(DIMENSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR, SALAMANDRA_GENERATOR_DUMMY); addFirstTalkId(EINSTER); } @@ -303,13 +303,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 5) { world.setStatus(5); @@ -321,6 +314,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FIRST_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_11_f": @@ -341,13 +341,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 10) { world.setStatus(10); @@ -359,6 +352,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(SECOND_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_16_f": @@ -379,13 +379,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 15) { world.setStatus(15); @@ -397,6 +390,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(THIRD_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_21_f": @@ -417,13 +417,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 20) { world.setStatus(20); @@ -435,6 +428,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(TELEPORTS, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_26_f": @@ -455,13 +455,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 25) { world.setStatus(25); @@ -473,6 +466,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FOURTH_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "jump_location": @@ -505,6 +505,7 @@ public class DimensionalWrap extends AbstractInstance } }); } + startQuestTimer(event, event.equals("SALAMANDRA_SPAWN") ? 25000 : 20000, npc, player); break; } case "START_STAGE": @@ -518,7 +519,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.setStatus(world.getStatus() + 1); + world.incStatus(); world.setParameter("worldState", world.getStatus()); world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_WARP_LV_S1, ExShowScreenMessage.TOP_CENTER, 10000, true, String.valueOf(world.getStatus()))); startQuestTimer("FIRST_SPAWN", 1500, null, world.getFirstPlayer()); @@ -539,7 +540,7 @@ public class DimensionalWrap extends AbstractInstance world.spawnGroup(worldState + "_first_spawn"); world.spawnGroup(worldState + "_trap_spawn"); startQuestTimer("SECOND_SPAWN", 40000, null, world.getFirstPlayer()); - startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer(), true); + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "DEBUFF_TASK": @@ -575,6 +576,7 @@ public class DimensionalWrap extends AbstractInstance skill.applyEffects(p, p); } } + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "SECOND_SPAWN": @@ -595,7 +597,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_thred_spawn"); + world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_third_spawn"); break; } case "CHANGE_LOCATION": @@ -614,30 +616,6 @@ public class DimensionalWrap extends AbstractInstance startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1430), null, world.getFirstPlayer()); break; } - case "SWITCH_STAGE": - { - if (player == null) - { - return null; - } - final Instance world = player.getInstanceWorld(); - if (!isInInstance(world)) - { - return null; - } - if (world.getAliveNpcs(MONSTERS).isEmpty()) - { - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); - world.broadcastPacket(new Earthquake(player, 50, 5)); - world.openCloseDoor(world.getTemplateParameters().getInt(world.getParameters().getInt("worldState", 0) + "_st_door"), true); - clean(world.getFirstPlayer()); - if (world.getParameters().getInt("worldState", 0) < 35) - { - startQuestTimer("NEXT_STAGE", 5000, null, world.getFirstPlayer()); - } - } - break; - } case "NEXT_STAGE": { if (player == null) @@ -651,7 +629,7 @@ public class DimensionalWrap extends AbstractInstance } world.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_SECONDS_HAVE_BEEN_ADDED_TO_THE_INSTANCED_ZONE_DURATION, ExShowScreenMessage.TOP_CENTER, 5000, true, String.valueOf(180))); world.setDuration((int) ((world.getRemainingTime() / 60000) + 3)); - startQuestTimer("START_STAGE", 8000, null, world.getFirstPlayer()); + startQuestTimer("START_STAGE", 10000, null, world.getFirstPlayer()); for (Npc n : world.getAliveNpcs()) { if (n.getId() != EINSTER) @@ -671,23 +649,40 @@ public class DimensionalWrap extends AbstractInstance final Instance world = npc.getInstanceWorld(); if (isInInstance(world)) { - if (CommonUtil.contains(MONSTERS, npc.getId()) && (getRandom(100) < world.getParameters().getDouble("chance", 0))) + final int worldState = world.getParameters().getInt("worldState", 0); + if (CommonUtil.contains(MONSTERS, npc.getId()) && (worldState < 35)) { - final int worldState = world.getParameters().getInt("worldState", 0); - if (worldState < 9) + if (getRandom(100) < world.getParameters().getDouble("chance", 0)) { - addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState < 9) + { + addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if ((worldState >= 9) && (worldState < 20)) + { + addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if (worldState >= 20) + { + addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } } - else if ((worldState >= 9) && (worldState < 20)) + + if (world.getAliveNpcs(MONSTERS).isEmpty() && world.getParameters().getBoolean("ThirdWave", false)) { - addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); - } - else if (worldState >= 20) - { - addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState == 20) + { + world.setParameter("20thThirdWaveFinished", true); + } + world.setParameter("ThirdWave", false); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); + world.broadcastPacket(new Earthquake(killer, 50, 5)); + world.openCloseDoor(world.getTemplateParameters().getInt(worldState + "_st_door"), true); + clean(world.getFirstPlayer()); + startQuestTimer("NEXT_STAGE", 7000, null, world.getFirstPlayer()); } } else if (npc.getId() == ABYSSAL_MAKKUM) @@ -704,9 +699,16 @@ public class DimensionalWrap extends AbstractInstance public String onFirstTalk(Npc npc, PlayerInstance player) { final Instance world = npc.getInstanceWorld(); - if (isInInstance(world) && (world.getParameters().getInt("worldState", 0) == 20)) + if (isInInstance(world)) { - return "33975-04.html"; + if (world.getParameters().getInt("worldState", 0) >= 20) + { + if (!world.getParameters().getBoolean("20thThirdWaveFinished", false)) + { + return "33975-02.html"; + } + return "33975-04.html"; + } } return "33975.html"; } @@ -721,18 +723,18 @@ public class DimensionalWrap extends AbstractInstance { case SALAMANDRA_GENERATOR: { - startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer()); startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1300), null, world.getFirstPlayer()); break; } case SALAMANDRA_GENERATOR_DUMMY: { - startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer()); break; } - case DEMINSIONAL_INVISIBLE_FRAGMENT: + case DIMENSIONAL_INVISIBLE_FRAGMENT: { - startQuestTimer("SWITCH_STAGE", 5000, null, world.getFirstPlayer(), true); + world.setParameter("ThirdWave", true); break; } } @@ -772,9 +774,8 @@ public class DimensionalWrap extends AbstractInstance protected void clean(PlayerInstance player) { - cancelQuestTimer("SWITCH_STAGE", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); cancelQuestTimer("CHANGE_LOCATION", null, player); cancelQuestTimer("DEBUFF_TASK", null, player); } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/instances/DimensionalWrap.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/instances/DimensionalWrap.xml index cc6a07c02f..7d6656c334 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/instances/DimensionalWrap.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/instances/DimensionalWrap.xml @@ -199,7 +199,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -494,7 +494,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -729,7 +729,7 @@ - + @@ -769,7 +769,7 @@ - + @@ -796,9 +796,9 @@ - + - + @@ -852,9 +852,9 @@ - + - + @@ -927,7 +927,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1169,7 +1169,7 @@ - + @@ -1201,9 +1201,9 @@ - + - + @@ -1275,7 +1275,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1349,7 +1349,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1457,7 +1457,7 @@ - + @@ -1489,7 +1489,7 @@ - + @@ -1515,7 +1515,7 @@ - + @@ -1549,7 +1549,7 @@ - + @@ -1574,7 +1574,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1701,7 +1701,7 @@ - + @@ -1713,7 +1713,7 @@ - + @@ -1774,7 +1774,7 @@ - + @@ -1794,7 +1794,7 @@ - + @@ -1843,11 +1843,11 @@ - + - + @@ -1906,7 +1906,7 @@ - + @@ -1918,7 +1918,7 @@ - + @@ -1982,7 +1982,7 @@ - + @@ -2058,7 +2058,7 @@ - + @@ -2085,7 +2085,7 @@ - + @@ -2131,7 +2131,7 @@ - + @@ -2170,7 +2170,7 @@ - + @@ -2202,7 +2202,7 @@ - + @@ -2228,7 +2228,7 @@ - + @@ -2265,7 +2265,7 @@ - + @@ -2344,7 +2344,7 @@ - + @@ -2428,9 +2428,9 @@ - + - + @@ -2504,7 +2504,7 @@ - + @@ -2552,7 +2552,7 @@ - + @@ -2587,7 +2587,7 @@ - + @@ -2616,7 +2616,7 @@ - + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java index 4be98f5b35..0ad3e53c5b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java @@ -51,7 +51,7 @@ public class DimensionalWrap extends AbstractInstance private static final int RESED = 33974; private static final int EINSTER = 33975; // Monsters - private static final int DEMINSIONAL_INVISIBLE_FRAGMENT = 19564; + private static final int DIMENSIONAL_INVISIBLE_FRAGMENT = 19564; private static final int SALAMANDRA_GENERATOR = 19563; private static final int SALAMANDRA_GENERATOR_DUMMY = 19480; private static final int DIMENSIONAL_SALAMANDRA = 23466; @@ -110,7 +110,7 @@ public class DimensionalWrap extends AbstractInstance addTalkId(EINSTER); addKillId(MONSTERS); addKillId(ABYSSAL_MAKKUM); - addSpawnId(SALAMANDRA_GENERATOR, DEMINSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR_DUMMY); + addSpawnId(DIMENSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR, SALAMANDRA_GENERATOR_DUMMY); addFirstTalkId(EINSTER); } @@ -303,13 +303,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 5) { world.setStatus(5); @@ -321,6 +314,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FIRST_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_11_f": @@ -341,13 +341,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 10) { world.setStatus(10); @@ -359,6 +352,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(SECOND_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_16_f": @@ -379,13 +379,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 15) { world.setStatus(15); @@ -397,6 +390,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(THIRD_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_21_f": @@ -417,13 +417,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 20) { world.setStatus(20); @@ -435,6 +428,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(TELEPORTS, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_26_f": @@ -455,13 +455,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 25) { world.setStatus(25); @@ -473,6 +466,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FOURTH_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "jump_location": @@ -505,6 +505,7 @@ public class DimensionalWrap extends AbstractInstance } }); } + startQuestTimer(event, event.equals("SALAMANDRA_SPAWN") ? 25000 : 20000, npc, player); break; } case "START_STAGE": @@ -518,7 +519,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.setStatus(world.getStatus() + 1); + world.incStatus(); world.setParameter("worldState", world.getStatus()); world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_WARP_LV_S1, ExShowScreenMessage.TOP_CENTER, 10000, true, String.valueOf(world.getStatus()))); startQuestTimer("FIRST_SPAWN", 1500, null, world.getFirstPlayer()); @@ -539,7 +540,7 @@ public class DimensionalWrap extends AbstractInstance world.spawnGroup(worldState + "_first_spawn"); world.spawnGroup(worldState + "_trap_spawn"); startQuestTimer("SECOND_SPAWN", 40000, null, world.getFirstPlayer()); - startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer(), true); + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "DEBUFF_TASK": @@ -575,6 +576,7 @@ public class DimensionalWrap extends AbstractInstance skill.applyEffects(p, p); } } + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "SECOND_SPAWN": @@ -595,7 +597,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_thred_spawn"); + world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_third_spawn"); break; } case "CHANGE_LOCATION": @@ -614,30 +616,6 @@ public class DimensionalWrap extends AbstractInstance startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1430), null, world.getFirstPlayer()); break; } - case "SWITCH_STAGE": - { - if (player == null) - { - return null; - } - final Instance world = player.getInstanceWorld(); - if (!isInInstance(world)) - { - return null; - } - if (world.getAliveNpcs(MONSTERS).isEmpty()) - { - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); - world.broadcastPacket(new Earthquake(player, 50, 5)); - world.openCloseDoor(world.getTemplateParameters().getInt(world.getParameters().getInt("worldState", 0) + "_st_door"), true); - clean(world.getFirstPlayer()); - if (world.getParameters().getInt("worldState", 0) < 35) - { - startQuestTimer("NEXT_STAGE", 5000, null, world.getFirstPlayer()); - } - } - break; - } case "NEXT_STAGE": { if (player == null) @@ -651,7 +629,7 @@ public class DimensionalWrap extends AbstractInstance } world.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_SECONDS_HAVE_BEEN_ADDED_TO_THE_INSTANCED_ZONE_DURATION, ExShowScreenMessage.TOP_CENTER, 5000, true, String.valueOf(180))); world.setDuration((int) ((world.getRemainingTime() / 60000) + 3)); - startQuestTimer("START_STAGE", 8000, null, world.getFirstPlayer()); + startQuestTimer("START_STAGE", 10000, null, world.getFirstPlayer()); for (Npc n : world.getAliveNpcs()) { if (n.getId() != EINSTER) @@ -671,23 +649,40 @@ public class DimensionalWrap extends AbstractInstance final Instance world = npc.getInstanceWorld(); if (isInInstance(world)) { - if (CommonUtil.contains(MONSTERS, npc.getId()) && (getRandom(100) < world.getParameters().getDouble("chance", 0))) + final int worldState = world.getParameters().getInt("worldState", 0); + if (CommonUtil.contains(MONSTERS, npc.getId()) && (worldState < 35)) { - final int worldState = world.getParameters().getInt("worldState", 0); - if (worldState < 9) + if (getRandom(100) < world.getParameters().getDouble("chance", 0)) { - addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState < 9) + { + addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if ((worldState >= 9) && (worldState < 20)) + { + addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if (worldState >= 20) + { + addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } } - else if ((worldState >= 9) && (worldState < 20)) + + if (world.getAliveNpcs(MONSTERS).isEmpty() && world.getParameters().getBoolean("ThirdWave", false)) { - addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); - } - else if (worldState >= 20) - { - addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState == 20) + { + world.setParameter("20thThirdWaveFinished", true); + } + world.setParameter("ThirdWave", false); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); + world.broadcastPacket(new Earthquake(killer, 50, 5)); + world.openCloseDoor(world.getTemplateParameters().getInt(worldState + "_st_door"), true); + clean(world.getFirstPlayer()); + startQuestTimer("NEXT_STAGE", 7000, null, world.getFirstPlayer()); } } else if (npc.getId() == ABYSSAL_MAKKUM) @@ -704,9 +699,16 @@ public class DimensionalWrap extends AbstractInstance public String onFirstTalk(Npc npc, PlayerInstance player) { final Instance world = npc.getInstanceWorld(); - if (isInInstance(world) && (world.getParameters().getInt("worldState", 0) == 20)) + if (isInInstance(world)) { - return "33975-04.html"; + if (world.getParameters().getInt("worldState", 0) >= 20) + { + if (!world.getParameters().getBoolean("20thThirdWaveFinished", false)) + { + return "33975-02.html"; + } + return "33975-04.html"; + } } return "33975.html"; } @@ -721,18 +723,18 @@ public class DimensionalWrap extends AbstractInstance { case SALAMANDRA_GENERATOR: { - startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer()); startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1300), null, world.getFirstPlayer()); break; } case SALAMANDRA_GENERATOR_DUMMY: { - startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer()); break; } - case DEMINSIONAL_INVISIBLE_FRAGMENT: + case DIMENSIONAL_INVISIBLE_FRAGMENT: { - startQuestTimer("SWITCH_STAGE", 5000, null, world.getFirstPlayer(), true); + world.setParameter("ThirdWave", true); break; } } @@ -772,9 +774,8 @@ public class DimensionalWrap extends AbstractInstance protected void clean(PlayerInstance player) { - cancelQuestTimer("SWITCH_STAGE", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); cancelQuestTimer("CHANGE_LOCATION", null, player); cancelQuestTimer("DEBUFF_TASK", null, player); } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/instances/DimensionalWrap.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/instances/DimensionalWrap.xml index cc6a07c02f..7d6656c334 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/instances/DimensionalWrap.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/instances/DimensionalWrap.xml @@ -199,7 +199,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -494,7 +494,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -729,7 +729,7 @@ - + @@ -769,7 +769,7 @@ - + @@ -796,9 +796,9 @@ - + - + @@ -852,9 +852,9 @@ - + - + @@ -927,7 +927,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1169,7 +1169,7 @@ - + @@ -1201,9 +1201,9 @@ - + - + @@ -1275,7 +1275,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1349,7 +1349,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1457,7 +1457,7 @@ - + @@ -1489,7 +1489,7 @@ - + @@ -1515,7 +1515,7 @@ - + @@ -1549,7 +1549,7 @@ - + @@ -1574,7 +1574,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1701,7 +1701,7 @@ - + @@ -1713,7 +1713,7 @@ - + @@ -1774,7 +1774,7 @@ - + @@ -1794,7 +1794,7 @@ - + @@ -1843,11 +1843,11 @@ - + - + @@ -1906,7 +1906,7 @@ - + @@ -1918,7 +1918,7 @@ - + @@ -1982,7 +1982,7 @@ - + @@ -2058,7 +2058,7 @@ - + @@ -2085,7 +2085,7 @@ - + @@ -2131,7 +2131,7 @@ - + @@ -2170,7 +2170,7 @@ - + @@ -2202,7 +2202,7 @@ - + @@ -2228,7 +2228,7 @@ - + @@ -2265,7 +2265,7 @@ - + @@ -2344,7 +2344,7 @@ - + @@ -2428,9 +2428,9 @@ - + - + @@ -2504,7 +2504,7 @@ - + @@ -2552,7 +2552,7 @@ - + @@ -2587,7 +2587,7 @@ - + @@ -2616,7 +2616,7 @@ - + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java index bfddfc60b4..4e90c10f43 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java @@ -51,7 +51,7 @@ public class DimensionalWrap extends AbstractInstance private static final int RESED = 33974; private static final int EINSTER = 33975; // Monsters - private static final int DEMINSIONAL_INVISIBLE_FRAGMENT = 19564; + private static final int DIMENSIONAL_INVISIBLE_FRAGMENT = 19564; private static final int SALAMANDRA_GENERATOR = 19563; private static final int SALAMANDRA_GENERATOR_DUMMY = 19480; private static final int DIMENSIONAL_SALAMANDRA = 23466; @@ -110,7 +110,7 @@ public class DimensionalWrap extends AbstractInstance addTalkId(EINSTER); addKillId(MONSTERS); addKillId(ABYSSAL_MAKKUM); - addSpawnId(SALAMANDRA_GENERATOR, DEMINSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR_DUMMY); + addSpawnId(DIMENSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR, SALAMANDRA_GENERATOR_DUMMY); addFirstTalkId(EINSTER); } @@ -303,13 +303,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 5) { world.setStatus(5); @@ -321,6 +314,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FIRST_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_11_f": @@ -341,13 +341,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 10) { world.setStatus(10); @@ -359,6 +352,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(SECOND_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_16_f": @@ -379,13 +379,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 15) { world.setStatus(15); @@ -397,6 +390,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(THIRD_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_21_f": @@ -417,13 +417,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 20) { world.setStatus(20); @@ -435,6 +428,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(TELEPORTS, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_26_f": @@ -455,13 +455,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 25) { world.setStatus(25); @@ -473,6 +466,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FOURTH_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "jump_location": @@ -505,6 +505,7 @@ public class DimensionalWrap extends AbstractInstance } }); } + startQuestTimer(event, event.equals("SALAMANDRA_SPAWN") ? 25000 : 20000, npc, player); break; } case "START_STAGE": @@ -518,7 +519,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.setStatus(world.getStatus() + 1); + world.incStatus(); world.setParameter("worldState", world.getStatus()); world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_WARP_LV_S1, ExShowScreenMessage.TOP_CENTER, 10000, true, String.valueOf(world.getStatus()))); startQuestTimer("FIRST_SPAWN", 1500, null, world.getFirstPlayer()); @@ -539,7 +540,7 @@ public class DimensionalWrap extends AbstractInstance world.spawnGroup(worldState + "_first_spawn"); world.spawnGroup(worldState + "_trap_spawn"); startQuestTimer("SECOND_SPAWN", 40000, null, world.getFirstPlayer()); - startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer(), true); + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "DEBUFF_TASK": @@ -575,6 +576,7 @@ public class DimensionalWrap extends AbstractInstance skill.applyEffects(p, p); } } + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "SECOND_SPAWN": @@ -595,7 +597,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_thred_spawn"); + world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_third_spawn"); break; } case "CHANGE_LOCATION": @@ -614,30 +616,6 @@ public class DimensionalWrap extends AbstractInstance startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1430), null, world.getFirstPlayer()); break; } - case "SWITCH_STAGE": - { - if (player == null) - { - return null; - } - final Instance world = player.getInstanceWorld(); - if (!isInInstance(world)) - { - return null; - } - if (world.getAliveNpcs(MONSTERS).isEmpty()) - { - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); - world.broadcastPacket(new Earthquake(player, 50, 5)); - world.openCloseDoor(world.getTemplateParameters().getInt(world.getParameters().getInt("worldState", 0) + "_st_door"), true); - clean(world.getFirstPlayer()); - if (world.getParameters().getInt("worldState", 0) < 35) - { - startQuestTimer("NEXT_STAGE", 5000, null, world.getFirstPlayer()); - } - } - break; - } case "NEXT_STAGE": { if (player == null) @@ -651,7 +629,7 @@ public class DimensionalWrap extends AbstractInstance } world.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_SECONDS_HAVE_BEEN_ADDED_TO_THE_INSTANCE_ZONE_DURATION, ExShowScreenMessage.TOP_CENTER, 5000, true, String.valueOf(180))); world.setDuration((int) ((world.getRemainingTime() / 60000) + 3)); - startQuestTimer("START_STAGE", 8000, null, world.getFirstPlayer()); + startQuestTimer("START_STAGE", 10000, null, world.getFirstPlayer()); for (Npc n : world.getAliveNpcs()) { if (n.getId() != EINSTER) @@ -671,23 +649,40 @@ public class DimensionalWrap extends AbstractInstance final Instance world = npc.getInstanceWorld(); if (isInInstance(world)) { - if (CommonUtil.contains(MONSTERS, npc.getId()) && (getRandom(100) < world.getParameters().getDouble("chance", 0))) + final int worldState = world.getParameters().getInt("worldState", 0); + if (CommonUtil.contains(MONSTERS, npc.getId()) && (worldState < 35)) { - final int worldState = world.getParameters().getInt("worldState", 0); - if (worldState < 9) + if (getRandom(100) < world.getParameters().getDouble("chance", 0)) { - addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState < 9) + { + addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if ((worldState >= 9) && (worldState < 20)) + { + addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if (worldState >= 20) + { + addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } } - else if ((worldState >= 9) && (worldState < 20)) + + if (world.getAliveNpcs(MONSTERS).isEmpty() && world.getParameters().getBoolean("ThirdWave", false)) { - addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); - } - else if (worldState >= 20) - { - addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState == 20) + { + world.setParameter("20thThirdWaveFinished", true); + } + world.setParameter("ThirdWave", false); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); + world.broadcastPacket(new Earthquake(killer, 50, 5)); + world.openCloseDoor(world.getTemplateParameters().getInt(worldState + "_st_door"), true); + clean(world.getFirstPlayer()); + startQuestTimer("NEXT_STAGE", 7000, null, world.getFirstPlayer()); } } else if (npc.getId() == ABYSSAL_MAKKUM) @@ -704,9 +699,16 @@ public class DimensionalWrap extends AbstractInstance public String onFirstTalk(Npc npc, PlayerInstance player) { final Instance world = npc.getInstanceWorld(); - if (isInInstance(world) && (world.getParameters().getInt("worldState", 0) == 20)) + if (isInInstance(world)) { - return "33975-04.html"; + if (world.getParameters().getInt("worldState", 0) >= 20) + { + if (!world.getParameters().getBoolean("20thThirdWaveFinished", false)) + { + return "33975-02.html"; + } + return "33975-04.html"; + } } return "33975.html"; } @@ -721,18 +723,18 @@ public class DimensionalWrap extends AbstractInstance { case SALAMANDRA_GENERATOR: { - startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer()); startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1300), null, world.getFirstPlayer()); break; } case SALAMANDRA_GENERATOR_DUMMY: { - startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer()); break; } - case DEMINSIONAL_INVISIBLE_FRAGMENT: + case DIMENSIONAL_INVISIBLE_FRAGMENT: { - startQuestTimer("SWITCH_STAGE", 5000, null, world.getFirstPlayer(), true); + world.setParameter("ThirdWave", true); break; } } @@ -772,9 +774,8 @@ public class DimensionalWrap extends AbstractInstance protected void clean(PlayerInstance player) { - cancelQuestTimer("SWITCH_STAGE", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); cancelQuestTimer("CHANGE_LOCATION", null, player); cancelQuestTimer("DEBUFF_TASK", null, player); } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/instances/DimensionalWrap.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/instances/DimensionalWrap.xml index cc6a07c02f..7d6656c334 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/instances/DimensionalWrap.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/instances/DimensionalWrap.xml @@ -199,7 +199,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -494,7 +494,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -729,7 +729,7 @@ - + @@ -769,7 +769,7 @@ - + @@ -796,9 +796,9 @@ - + - + @@ -852,9 +852,9 @@ - + - + @@ -927,7 +927,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1169,7 +1169,7 @@ - + @@ -1201,9 +1201,9 @@ - + - + @@ -1275,7 +1275,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1349,7 +1349,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1457,7 +1457,7 @@ - + @@ -1489,7 +1489,7 @@ - + @@ -1515,7 +1515,7 @@ - + @@ -1549,7 +1549,7 @@ - + @@ -1574,7 +1574,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1701,7 +1701,7 @@ - + @@ -1713,7 +1713,7 @@ - + @@ -1774,7 +1774,7 @@ - + @@ -1794,7 +1794,7 @@ - + @@ -1843,11 +1843,11 @@ - + - + @@ -1906,7 +1906,7 @@ - + @@ -1918,7 +1918,7 @@ - + @@ -1982,7 +1982,7 @@ - + @@ -2058,7 +2058,7 @@ - + @@ -2085,7 +2085,7 @@ - + @@ -2131,7 +2131,7 @@ - + @@ -2170,7 +2170,7 @@ - + @@ -2202,7 +2202,7 @@ - + @@ -2228,7 +2228,7 @@ - + @@ -2265,7 +2265,7 @@ - + @@ -2344,7 +2344,7 @@ - + @@ -2428,9 +2428,9 @@ - + - + @@ -2504,7 +2504,7 @@ - + @@ -2552,7 +2552,7 @@ - + @@ -2587,7 +2587,7 @@ - + @@ -2616,7 +2616,7 @@ - + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java index bfddfc60b4..4e90c10f43 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java @@ -51,7 +51,7 @@ public class DimensionalWrap extends AbstractInstance private static final int RESED = 33974; private static final int EINSTER = 33975; // Monsters - private static final int DEMINSIONAL_INVISIBLE_FRAGMENT = 19564; + private static final int DIMENSIONAL_INVISIBLE_FRAGMENT = 19564; private static final int SALAMANDRA_GENERATOR = 19563; private static final int SALAMANDRA_GENERATOR_DUMMY = 19480; private static final int DIMENSIONAL_SALAMANDRA = 23466; @@ -110,7 +110,7 @@ public class DimensionalWrap extends AbstractInstance addTalkId(EINSTER); addKillId(MONSTERS); addKillId(ABYSSAL_MAKKUM); - addSpawnId(SALAMANDRA_GENERATOR, DEMINSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR_DUMMY); + addSpawnId(DIMENSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR, SALAMANDRA_GENERATOR_DUMMY); addFirstTalkId(EINSTER); } @@ -303,13 +303,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 5) { world.setStatus(5); @@ -321,6 +314,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FIRST_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_11_f": @@ -341,13 +341,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 10) { world.setStatus(10); @@ -359,6 +352,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(SECOND_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_16_f": @@ -379,13 +379,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 15) { world.setStatus(15); @@ -397,6 +390,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(THIRD_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_21_f": @@ -417,13 +417,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 20) { world.setStatus(20); @@ -435,6 +428,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(TELEPORTS, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_26_f": @@ -455,13 +455,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 25) { world.setStatus(25); @@ -473,6 +466,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FOURTH_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "jump_location": @@ -505,6 +505,7 @@ public class DimensionalWrap extends AbstractInstance } }); } + startQuestTimer(event, event.equals("SALAMANDRA_SPAWN") ? 25000 : 20000, npc, player); break; } case "START_STAGE": @@ -518,7 +519,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.setStatus(world.getStatus() + 1); + world.incStatus(); world.setParameter("worldState", world.getStatus()); world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_WARP_LV_S1, ExShowScreenMessage.TOP_CENTER, 10000, true, String.valueOf(world.getStatus()))); startQuestTimer("FIRST_SPAWN", 1500, null, world.getFirstPlayer()); @@ -539,7 +540,7 @@ public class DimensionalWrap extends AbstractInstance world.spawnGroup(worldState + "_first_spawn"); world.spawnGroup(worldState + "_trap_spawn"); startQuestTimer("SECOND_SPAWN", 40000, null, world.getFirstPlayer()); - startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer(), true); + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "DEBUFF_TASK": @@ -575,6 +576,7 @@ public class DimensionalWrap extends AbstractInstance skill.applyEffects(p, p); } } + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "SECOND_SPAWN": @@ -595,7 +597,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_thred_spawn"); + world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_third_spawn"); break; } case "CHANGE_LOCATION": @@ -614,30 +616,6 @@ public class DimensionalWrap extends AbstractInstance startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1430), null, world.getFirstPlayer()); break; } - case "SWITCH_STAGE": - { - if (player == null) - { - return null; - } - final Instance world = player.getInstanceWorld(); - if (!isInInstance(world)) - { - return null; - } - if (world.getAliveNpcs(MONSTERS).isEmpty()) - { - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); - world.broadcastPacket(new Earthquake(player, 50, 5)); - world.openCloseDoor(world.getTemplateParameters().getInt(world.getParameters().getInt("worldState", 0) + "_st_door"), true); - clean(world.getFirstPlayer()); - if (world.getParameters().getInt("worldState", 0) < 35) - { - startQuestTimer("NEXT_STAGE", 5000, null, world.getFirstPlayer()); - } - } - break; - } case "NEXT_STAGE": { if (player == null) @@ -651,7 +629,7 @@ public class DimensionalWrap extends AbstractInstance } world.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_SECONDS_HAVE_BEEN_ADDED_TO_THE_INSTANCE_ZONE_DURATION, ExShowScreenMessage.TOP_CENTER, 5000, true, String.valueOf(180))); world.setDuration((int) ((world.getRemainingTime() / 60000) + 3)); - startQuestTimer("START_STAGE", 8000, null, world.getFirstPlayer()); + startQuestTimer("START_STAGE", 10000, null, world.getFirstPlayer()); for (Npc n : world.getAliveNpcs()) { if (n.getId() != EINSTER) @@ -671,23 +649,40 @@ public class DimensionalWrap extends AbstractInstance final Instance world = npc.getInstanceWorld(); if (isInInstance(world)) { - if (CommonUtil.contains(MONSTERS, npc.getId()) && (getRandom(100) < world.getParameters().getDouble("chance", 0))) + final int worldState = world.getParameters().getInt("worldState", 0); + if (CommonUtil.contains(MONSTERS, npc.getId()) && (worldState < 35)) { - final int worldState = world.getParameters().getInt("worldState", 0); - if (worldState < 9) + if (getRandom(100) < world.getParameters().getDouble("chance", 0)) { - addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState < 9) + { + addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if ((worldState >= 9) && (worldState < 20)) + { + addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if (worldState >= 20) + { + addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } } - else if ((worldState >= 9) && (worldState < 20)) + + if (world.getAliveNpcs(MONSTERS).isEmpty() && world.getParameters().getBoolean("ThirdWave", false)) { - addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); - } - else if (worldState >= 20) - { - addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState == 20) + { + world.setParameter("20thThirdWaveFinished", true); + } + world.setParameter("ThirdWave", false); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); + world.broadcastPacket(new Earthquake(killer, 50, 5)); + world.openCloseDoor(world.getTemplateParameters().getInt(worldState + "_st_door"), true); + clean(world.getFirstPlayer()); + startQuestTimer("NEXT_STAGE", 7000, null, world.getFirstPlayer()); } } else if (npc.getId() == ABYSSAL_MAKKUM) @@ -704,9 +699,16 @@ public class DimensionalWrap extends AbstractInstance public String onFirstTalk(Npc npc, PlayerInstance player) { final Instance world = npc.getInstanceWorld(); - if (isInInstance(world) && (world.getParameters().getInt("worldState", 0) == 20)) + if (isInInstance(world)) { - return "33975-04.html"; + if (world.getParameters().getInt("worldState", 0) >= 20) + { + if (!world.getParameters().getBoolean("20thThirdWaveFinished", false)) + { + return "33975-02.html"; + } + return "33975-04.html"; + } } return "33975.html"; } @@ -721,18 +723,18 @@ public class DimensionalWrap extends AbstractInstance { case SALAMANDRA_GENERATOR: { - startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer()); startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1300), null, world.getFirstPlayer()); break; } case SALAMANDRA_GENERATOR_DUMMY: { - startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer()); break; } - case DEMINSIONAL_INVISIBLE_FRAGMENT: + case DIMENSIONAL_INVISIBLE_FRAGMENT: { - startQuestTimer("SWITCH_STAGE", 5000, null, world.getFirstPlayer(), true); + world.setParameter("ThirdWave", true); break; } } @@ -772,9 +774,8 @@ public class DimensionalWrap extends AbstractInstance protected void clean(PlayerInstance player) { - cancelQuestTimer("SWITCH_STAGE", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); cancelQuestTimer("CHANGE_LOCATION", null, player); cancelQuestTimer("DEBUFF_TASK", null, player); } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/instances/DimensionalWrap.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/instances/DimensionalWrap.xml index cc6a07c02f..7d6656c334 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/instances/DimensionalWrap.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/instances/DimensionalWrap.xml @@ -199,7 +199,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -494,7 +494,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -729,7 +729,7 @@ - + @@ -769,7 +769,7 @@ - + @@ -796,9 +796,9 @@ - + - + @@ -852,9 +852,9 @@ - + - + @@ -927,7 +927,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1169,7 +1169,7 @@ - + @@ -1201,9 +1201,9 @@ - + - + @@ -1275,7 +1275,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1349,7 +1349,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1457,7 +1457,7 @@ - + @@ -1489,7 +1489,7 @@ - + @@ -1515,7 +1515,7 @@ - + @@ -1549,7 +1549,7 @@ - + @@ -1574,7 +1574,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1701,7 +1701,7 @@ - + @@ -1713,7 +1713,7 @@ - + @@ -1774,7 +1774,7 @@ - + @@ -1794,7 +1794,7 @@ - + @@ -1843,11 +1843,11 @@ - + - + @@ -1906,7 +1906,7 @@ - + @@ -1918,7 +1918,7 @@ - + @@ -1982,7 +1982,7 @@ - + @@ -2058,7 +2058,7 @@ - + @@ -2085,7 +2085,7 @@ - + @@ -2131,7 +2131,7 @@ - + @@ -2170,7 +2170,7 @@ - + @@ -2202,7 +2202,7 @@ - + @@ -2228,7 +2228,7 @@ - + @@ -2265,7 +2265,7 @@ - + @@ -2344,7 +2344,7 @@ - + @@ -2428,9 +2428,9 @@ - + - + @@ -2504,7 +2504,7 @@ - + @@ -2552,7 +2552,7 @@ - + @@ -2587,7 +2587,7 @@ - + @@ -2616,7 +2616,7 @@ - + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java index 4be98f5b35..0ad3e53c5b 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java @@ -51,7 +51,7 @@ public class DimensionalWrap extends AbstractInstance private static final int RESED = 33974; private static final int EINSTER = 33975; // Monsters - private static final int DEMINSIONAL_INVISIBLE_FRAGMENT = 19564; + private static final int DIMENSIONAL_INVISIBLE_FRAGMENT = 19564; private static final int SALAMANDRA_GENERATOR = 19563; private static final int SALAMANDRA_GENERATOR_DUMMY = 19480; private static final int DIMENSIONAL_SALAMANDRA = 23466; @@ -110,7 +110,7 @@ public class DimensionalWrap extends AbstractInstance addTalkId(EINSTER); addKillId(MONSTERS); addKillId(ABYSSAL_MAKKUM); - addSpawnId(SALAMANDRA_GENERATOR, DEMINSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR_DUMMY); + addSpawnId(DIMENSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR, SALAMANDRA_GENERATOR_DUMMY); addFirstTalkId(EINSTER); } @@ -303,13 +303,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 5) { world.setStatus(5); @@ -321,6 +314,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FIRST_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_11_f": @@ -341,13 +341,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 10) { world.setStatus(10); @@ -359,6 +352,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(SECOND_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_16_f": @@ -379,13 +379,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 15) { world.setStatus(15); @@ -397,6 +390,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(THIRD_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_21_f": @@ -417,13 +417,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 20) { world.setStatus(20); @@ -435,6 +428,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(TELEPORTS, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_26_f": @@ -455,13 +455,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 25) { world.setStatus(25); @@ -473,6 +466,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FOURTH_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "jump_location": @@ -505,6 +505,7 @@ public class DimensionalWrap extends AbstractInstance } }); } + startQuestTimer(event, event.equals("SALAMANDRA_SPAWN") ? 25000 : 20000, npc, player); break; } case "START_STAGE": @@ -518,7 +519,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.setStatus(world.getStatus() + 1); + world.incStatus(); world.setParameter("worldState", world.getStatus()); world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_WARP_LV_S1, ExShowScreenMessage.TOP_CENTER, 10000, true, String.valueOf(world.getStatus()))); startQuestTimer("FIRST_SPAWN", 1500, null, world.getFirstPlayer()); @@ -539,7 +540,7 @@ public class DimensionalWrap extends AbstractInstance world.spawnGroup(worldState + "_first_spawn"); world.spawnGroup(worldState + "_trap_spawn"); startQuestTimer("SECOND_SPAWN", 40000, null, world.getFirstPlayer()); - startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer(), true); + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "DEBUFF_TASK": @@ -575,6 +576,7 @@ public class DimensionalWrap extends AbstractInstance skill.applyEffects(p, p); } } + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "SECOND_SPAWN": @@ -595,7 +597,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_thred_spawn"); + world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_third_spawn"); break; } case "CHANGE_LOCATION": @@ -614,30 +616,6 @@ public class DimensionalWrap extends AbstractInstance startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1430), null, world.getFirstPlayer()); break; } - case "SWITCH_STAGE": - { - if (player == null) - { - return null; - } - final Instance world = player.getInstanceWorld(); - if (!isInInstance(world)) - { - return null; - } - if (world.getAliveNpcs(MONSTERS).isEmpty()) - { - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); - world.broadcastPacket(new Earthquake(player, 50, 5)); - world.openCloseDoor(world.getTemplateParameters().getInt(world.getParameters().getInt("worldState", 0) + "_st_door"), true); - clean(world.getFirstPlayer()); - if (world.getParameters().getInt("worldState", 0) < 35) - { - startQuestTimer("NEXT_STAGE", 5000, null, world.getFirstPlayer()); - } - } - break; - } case "NEXT_STAGE": { if (player == null) @@ -651,7 +629,7 @@ public class DimensionalWrap extends AbstractInstance } world.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_SECONDS_HAVE_BEEN_ADDED_TO_THE_INSTANCED_ZONE_DURATION, ExShowScreenMessage.TOP_CENTER, 5000, true, String.valueOf(180))); world.setDuration((int) ((world.getRemainingTime() / 60000) + 3)); - startQuestTimer("START_STAGE", 8000, null, world.getFirstPlayer()); + startQuestTimer("START_STAGE", 10000, null, world.getFirstPlayer()); for (Npc n : world.getAliveNpcs()) { if (n.getId() != EINSTER) @@ -671,23 +649,40 @@ public class DimensionalWrap extends AbstractInstance final Instance world = npc.getInstanceWorld(); if (isInInstance(world)) { - if (CommonUtil.contains(MONSTERS, npc.getId()) && (getRandom(100) < world.getParameters().getDouble("chance", 0))) + final int worldState = world.getParameters().getInt("worldState", 0); + if (CommonUtil.contains(MONSTERS, npc.getId()) && (worldState < 35)) { - final int worldState = world.getParameters().getInt("worldState", 0); - if (worldState < 9) + if (getRandom(100) < world.getParameters().getDouble("chance", 0)) { - addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState < 9) + { + addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if ((worldState >= 9) && (worldState < 20)) + { + addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if (worldState >= 20) + { + addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } } - else if ((worldState >= 9) && (worldState < 20)) + + if (world.getAliveNpcs(MONSTERS).isEmpty() && world.getParameters().getBoolean("ThirdWave", false)) { - addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); - } - else if (worldState >= 20) - { - addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState == 20) + { + world.setParameter("20thThirdWaveFinished", true); + } + world.setParameter("ThirdWave", false); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); + world.broadcastPacket(new Earthquake(killer, 50, 5)); + world.openCloseDoor(world.getTemplateParameters().getInt(worldState + "_st_door"), true); + clean(world.getFirstPlayer()); + startQuestTimer("NEXT_STAGE", 7000, null, world.getFirstPlayer()); } } else if (npc.getId() == ABYSSAL_MAKKUM) @@ -704,9 +699,16 @@ public class DimensionalWrap extends AbstractInstance public String onFirstTalk(Npc npc, PlayerInstance player) { final Instance world = npc.getInstanceWorld(); - if (isInInstance(world) && (world.getParameters().getInt("worldState", 0) == 20)) + if (isInInstance(world)) { - return "33975-04.html"; + if (world.getParameters().getInt("worldState", 0) >= 20) + { + if (!world.getParameters().getBoolean("20thThirdWaveFinished", false)) + { + return "33975-02.html"; + } + return "33975-04.html"; + } } return "33975.html"; } @@ -721,18 +723,18 @@ public class DimensionalWrap extends AbstractInstance { case SALAMANDRA_GENERATOR: { - startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer()); startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1300), null, world.getFirstPlayer()); break; } case SALAMANDRA_GENERATOR_DUMMY: { - startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer()); break; } - case DEMINSIONAL_INVISIBLE_FRAGMENT: + case DIMENSIONAL_INVISIBLE_FRAGMENT: { - startQuestTimer("SWITCH_STAGE", 5000, null, world.getFirstPlayer(), true); + world.setParameter("ThirdWave", true); break; } } @@ -772,9 +774,8 @@ public class DimensionalWrap extends AbstractInstance protected void clean(PlayerInstance player) { - cancelQuestTimer("SWITCH_STAGE", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); cancelQuestTimer("CHANGE_LOCATION", null, player); cancelQuestTimer("DEBUFF_TASK", null, player); } diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/instances/DimensionalWrap.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/instances/DimensionalWrap.xml index cc6a07c02f..7d6656c334 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/instances/DimensionalWrap.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/instances/DimensionalWrap.xml @@ -199,7 +199,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -494,7 +494,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -729,7 +729,7 @@ - + @@ -769,7 +769,7 @@ - + @@ -796,9 +796,9 @@ - + - + @@ -852,9 +852,9 @@ - + - + @@ -927,7 +927,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1073,7 +1073,7 @@ - + @@ -1144,7 +1144,7 @@ - + @@ -1169,7 +1169,7 @@ - + @@ -1201,9 +1201,9 @@ - + - + @@ -1275,7 +1275,7 @@ - + @@ -1316,7 +1316,7 @@ - + @@ -1349,7 +1349,7 @@ - + @@ -1416,7 +1416,7 @@ - + @@ -1457,7 +1457,7 @@ - + @@ -1489,7 +1489,7 @@ - + @@ -1515,7 +1515,7 @@ - + @@ -1549,7 +1549,7 @@ - + @@ -1574,7 +1574,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1671,7 +1671,7 @@ - + @@ -1701,7 +1701,7 @@ - + @@ -1713,7 +1713,7 @@ - + @@ -1774,7 +1774,7 @@ - + @@ -1794,7 +1794,7 @@ - + @@ -1843,11 +1843,11 @@ - + - + @@ -1906,7 +1906,7 @@ - + @@ -1918,7 +1918,7 @@ - + @@ -1982,7 +1982,7 @@ - + @@ -2058,7 +2058,7 @@ - + @@ -2085,7 +2085,7 @@ - + @@ -2131,7 +2131,7 @@ - + @@ -2170,7 +2170,7 @@ - + @@ -2202,7 +2202,7 @@ - + @@ -2228,7 +2228,7 @@ - + @@ -2265,7 +2265,7 @@ - + @@ -2344,7 +2344,7 @@ - + @@ -2428,9 +2428,9 @@ - + - + @@ -2504,7 +2504,7 @@ - + @@ -2552,7 +2552,7 @@ - + @@ -2587,7 +2587,7 @@ - + @@ -2616,7 +2616,7 @@ - + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java index 4ff7b656c8..453b248d92 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/DimensionalWrap/DimensionalWrap.java @@ -51,7 +51,7 @@ public class DimensionalWrap extends AbstractInstance private static final int RESED = 33974; private static final int EINSTER = 33975; // Monsters - private static final int DEMINSIONAL_INVISIBLE_FRAGMENT = 19564; + private static final int DIMENSIONAL_INVISIBLE_FRAGMENT = 19564; private static final int SALAMANDRA_GENERATOR = 19563; private static final int SALAMANDRA_GENERATOR_DUMMY = 19480; private static final int DIMENSIONAL_SALAMANDRA = 23466; @@ -110,7 +110,7 @@ public class DimensionalWrap extends AbstractInstance addTalkId(EINSTER); addKillId(MONSTERS); addKillId(ABYSSAL_MAKKUM); - addSpawnId(SALAMANDRA_GENERATOR, DEMINSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR_DUMMY); + addSpawnId(DIMENSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR, SALAMANDRA_GENERATOR_DUMMY); addFirstTalkId(EINSTER); } @@ -303,13 +303,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 5) { world.setStatus(5); @@ -321,6 +314,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FIRST_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_11_f": @@ -341,13 +341,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 10) { world.setStatus(10); @@ -359,6 +352,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(SECOND_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_16_f": @@ -379,13 +379,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 15) { world.setStatus(15); @@ -397,6 +390,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(THIRD_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_21_f": @@ -417,13 +417,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 20) { world.setStatus(20); @@ -435,6 +428,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(TELEPORTS, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "send_26_f": @@ -455,13 +455,6 @@ public class DimensionalWrap extends AbstractInstance htmltext = "33975-05.html"; break; } - for (Npc n : world.getAliveNpcs()) - { - if (n.getId() != EINSTER) - { - n.deleteMe(); - } - } if (world.getStatus() < 25) { world.setStatus(25); @@ -473,6 +466,13 @@ public class DimensionalWrap extends AbstractInstance { pl.teleToLocation(FOURTH_TELEPORT, world.getTemplateId()); } + for (Npc n : world.getAliveNpcs()) + { + if (n.getId() != EINSTER) + { + n.deleteMe(); + } + } break; } case "jump_location": @@ -505,6 +505,7 @@ public class DimensionalWrap extends AbstractInstance } }); } + startQuestTimer(event, event.equals("SALAMANDRA_SPAWN") ? 25000 : 20000, npc, player); break; } case "START_STAGE": @@ -518,7 +519,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.setStatus(world.getStatus() + 1); + world.incStatus(); world.setParameter("worldState", world.getStatus()); world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_WARP_LV_S1, ExShowScreenMessage.TOP_CENTER, 10000, true, String.valueOf(world.getStatus()))); startQuestTimer("FIRST_SPAWN", 1500, null, world.getFirstPlayer()); @@ -539,7 +540,7 @@ public class DimensionalWrap extends AbstractInstance world.spawnGroup(worldState + "_first_spawn"); world.spawnGroup(worldState + "_trap_spawn"); startQuestTimer("SECOND_SPAWN", 40000, null, world.getFirstPlayer()); - startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer(), true); + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "DEBUFF_TASK": @@ -575,6 +576,7 @@ public class DimensionalWrap extends AbstractInstance skill.applyEffects(p, p); } } + startQuestTimer("DEBUFF_TASK", 10000, null, world.getFirstPlayer()); break; } case "SECOND_SPAWN": @@ -595,7 +597,7 @@ public class DimensionalWrap extends AbstractInstance { return null; } - world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_thred_spawn"); + world.spawnGroup(world.getParameters().getInt("worldState", 0) + "_third_spawn"); break; } case "CHANGE_LOCATION": @@ -614,30 +616,6 @@ public class DimensionalWrap extends AbstractInstance startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1430), null, world.getFirstPlayer()); break; } - case "SWITCH_STAGE": - { - if (player == null) - { - return null; - } - final Instance world = player.getInstanceWorld(); - if (!isInInstance(world)) - { - return null; - } - if (world.getAliveNpcs(MONSTERS).isEmpty()) - { - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); - world.broadcastPacket(new Earthquake(player, 50, 5)); - world.openCloseDoor(world.getTemplateParameters().getInt(world.getParameters().getInt("worldState", 0) + "_st_door"), true); - clean(world.getFirstPlayer()); - if (world.getParameters().getInt("worldState", 0) < 35) - { - startQuestTimer("NEXT_STAGE", 5000, null, world.getFirstPlayer()); - } - } - break; - } case "NEXT_STAGE": { if (player == null) @@ -651,7 +629,7 @@ public class DimensionalWrap extends AbstractInstance } world.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_SECONDS_HAVE_BEEN_ADDED_TO_THE_INSTANCE_ZONE_DURATION, ExShowScreenMessage.TOP_CENTER, 5000, true, String.valueOf(180))); world.setDuration((int) ((world.getRemainingTime() / 60000) + 3)); - startQuestTimer("START_STAGE", 8000, null, world.getFirstPlayer()); + startQuestTimer("START_STAGE", 10000, null, world.getFirstPlayer()); for (Npc n : world.getAliveNpcs()) { if (n.getId() != EINSTER) @@ -671,23 +649,40 @@ public class DimensionalWrap extends AbstractInstance final Instance world = npc.getInstanceWorld(); if (isInInstance(world)) { - if (CommonUtil.contains(MONSTERS, npc.getId()) && (getRandom(100) < world.getParameters().getDouble("chance", 0))) + final int worldState = world.getParameters().getInt("worldState", 0); + if (CommonUtil.contains(MONSTERS, npc.getId()) && (worldState < 35)) { - final int worldState = world.getParameters().getInt("worldState", 0); - if (worldState < 9) + if (getRandom(100) < world.getParameters().getDouble("chance", 0)) { - addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState < 9) + { + addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if ((worldState >= 9) && (worldState < 20)) + { + addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } + else if (worldState >= 20) + { + addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + } } - else if ((worldState >= 9) && (worldState < 20)) + + if (world.getAliveNpcs(MONSTERS).isEmpty() && world.getParameters().getBoolean("ThirdWave", false)) { - addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); - } - else if (worldState >= 20) - { - addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId()); - world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true)); + if (worldState == 20) + { + world.setParameter("20thThirdWaveFinished", true); + } + world.setParameter("ThirdWave", false); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true)); + world.broadcastPacket(new Earthquake(killer, 50, 5)); + world.openCloseDoor(world.getTemplateParameters().getInt(worldState + "_st_door"), true); + clean(world.getFirstPlayer()); + startQuestTimer("NEXT_STAGE", 7000, null, world.getFirstPlayer()); } } else if (npc.getId() == ABYSSAL_MAKKUM) @@ -704,9 +699,16 @@ public class DimensionalWrap extends AbstractInstance public String onFirstTalk(Npc npc, PlayerInstance player) { final Instance world = npc.getInstanceWorld(); - if (isInInstance(world) && (world.getParameters().getInt("worldState", 0) == 20)) + if (isInInstance(world)) { - return "33975-04.html"; + if (world.getParameters().getInt("worldState", 0) >= 20) + { + if (!world.getParameters().getBoolean("20thThirdWaveFinished", false)) + { + return "33975-02.html"; + } + return "33975-04.html"; + } } return "33975.html"; } @@ -721,18 +723,18 @@ public class DimensionalWrap extends AbstractInstance { case SALAMANDRA_GENERATOR: { - startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, world.getFirstPlayer()); startQuestTimer("CHANGE_LOCATION", 60000 - (world.getParameters().getInt("worldState", 0) * 1300), null, world.getFirstPlayer()); break; } case SALAMANDRA_GENERATOR_DUMMY: { - startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer(), true); + startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, world.getFirstPlayer()); break; } - case DEMINSIONAL_INVISIBLE_FRAGMENT: + case DIMENSIONAL_INVISIBLE_FRAGMENT: { - startQuestTimer("SWITCH_STAGE", 5000, null, world.getFirstPlayer(), true); + world.setParameter("ThirdWave", true); break; } } @@ -772,9 +774,8 @@ public class DimensionalWrap extends AbstractInstance protected void clean(PlayerInstance player) { - cancelQuestTimer("SWITCH_STAGE", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN", null, player); - // cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN", null, player); + cancelQuestTimer("SALAMANDRA_SPAWN_DUMMY", null, player); cancelQuestTimer("CHANGE_LOCATION", null, player); cancelQuestTimer("DEBUFF_TASK", null, player); }