From 1086d053e3eeec72b57519a89b3bf69a9e58a906 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment Date: Fri, 6 Sep 2024 08:21:55 +0300 Subject: [PATCH] Adjustments for Nornil's Garden. Thanks to emptyslash. --- .../game/data/instances/NornilsGarden.xml | 2 +- .../NornilsGarden/NornilsGarden.java | 27 +++++-------------- .../quests/Q00182_NewRecruits/32138-00b.html | 2 +- .../Q00182_NewRecruits.java | 2 +- .../game/data/instances/NornilsGarden.xml | 2 +- .../NornilsGarden/NornilsGarden.java | 27 +++++-------------- .../quests/Q00182_NewRecruits/32138-00b.html | 2 +- .../Q00182_NewRecruits.java | 2 +- 8 files changed, 18 insertions(+), 48 deletions(-) diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/instances/NornilsGarden.xml b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/instances/NornilsGarden.xml index 7090e5ae2e..589d9b20a2 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/instances/NornilsGarden.xml +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/instances/NornilsGarden.xml @@ -1,5 +1,5 @@ - + diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java index 228726b819..3dcf3f2211 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java @@ -74,8 +74,8 @@ public class NornilsGarden extends AbstractInstance private static final int TEMPLATE_ID = 11; private static final int DURATION_TIME = 70; private static final int EMPTY_DESTROY_TIME = 5; - private static final int INSTANCE_LEVEL_MIN = 18; - private static final int INSTANCE_LEVEL_MAX = 22; + private static final int INSTANCE_LEVEL_MIN = 17; + private static final int INSTANCE_LEVEL_MAX = 21; private static final int[][] AUTO_GATES = { // Warriors gate @@ -227,17 +227,6 @@ public class NornilsGarden extends AbstractInstance super.teleportPlayer(player, loc, instanceId); } - private void exitInstance(Player player) - { - final InstanceWorld inst = InstanceManager.getInstance().getWorld(player); - if (inst instanceof NornilsWorld) - { - final NornilsWorld world = ((NornilsWorld) inst); - world.removeAllowed(player); - teleportPlayer(player, EXIT_PPL, 0); - } - } - private final synchronized String enterInstance(Npc npc, Player player) { final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); @@ -274,7 +263,7 @@ public class NornilsGarden extends AbstractInstance final NornilsWorld newWorld = new NornilsWorld(); final Instance instance = InstanceManager.getInstance().createDynamicInstance(TEMPLATE_ID); newWorld.setInstance(instance); - InstanceManager.getInstance().addWorld(world); + InstanceManager.getInstance().addWorld(newWorld); instance.setExitLoc(new Location(player)); instance.setAllowSummon(false); instance.setDuration(DURATION_TIME * 60000); @@ -503,13 +492,9 @@ public class NornilsGarden extends AbstractInstance } else if ((npc.getId() == 32258) && event.equalsIgnoreCase("exit")) { - try + if (player.getInstanceId() > 0) { - exitInstance(player); - } - catch (Exception e) - { - // Not Important. + super.teleportPlayer(player, EXIT_PPL, 0); } } else if (CommonUtil.contains(FINAL_GATES, npc.getId())) @@ -523,7 +508,7 @@ public class NornilsGarden extends AbstractInstance int correct = st.getInt("correct"); correct++; st.set("correct", String.valueOf(correct)); - htmltext = npc.getId() + "-0" + correct + 2 + ".html"; + htmltext = npc.getId() + "-0" + Integer.sum(correct, 2) + ".html"; } else if (event.equalsIgnoreCase("check")) { diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/32138-00b.html b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/32138-00b.html index 57af92b762..cff29c6976 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/32138-00b.html +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/32138-00b.html @@ -1,4 +1,4 @@ Hierarch Kekropus:
We are looking for foreigners that can help the youth of our race. Do you know anyone who would be suitable?
-(Only non-Kamael characters between level 18 and 20 who have not completed their first class transfer may embark on this quest.) +(Only non-Kamael characters between level 17 and 21 who have not completed their first class transfer may embark on this quest.) \ No newline at end of file diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java index 34a5e05f20..a51489a7c8 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java @@ -92,7 +92,7 @@ public class Q00182_NewRecruits extends Quest { htmltext = "32138-00.html"; } - else if ((level >= 17) && (level <= 21) && (player.getClassId().getId() == 0)) + else if ((level >= 17) && (level <= 21) && (player.getClassId().level() == 0)) { htmltext = "32138-01.htm"; } diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/instances/NornilsGarden.xml b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/instances/NornilsGarden.xml index 7090e5ae2e..589d9b20a2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/instances/NornilsGarden.xml +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/instances/NornilsGarden.xml @@ -1,5 +1,5 @@ - + diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java index cc0c978196..ce77d1da2f 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/instances/NornilsGarden/NornilsGarden.java @@ -74,8 +74,8 @@ public class NornilsGarden extends AbstractInstance private static final int TEMPLATE_ID = 11; private static final int DURATION_TIME = 70; private static final int EMPTY_DESTROY_TIME = 5; - private static final int INSTANCE_LEVEL_MIN = 18; - private static final int INSTANCE_LEVEL_MAX = 22; + private static final int INSTANCE_LEVEL_MIN = 17; + private static final int INSTANCE_LEVEL_MAX = 21; private static final int[][] AUTO_GATES = { // Warriors gate @@ -227,17 +227,6 @@ public class NornilsGarden extends AbstractInstance super.teleportPlayer(player, loc, instanceId); } - private void exitInstance(Player player) - { - final InstanceWorld inst = InstanceManager.getInstance().getWorld(player); - if (inst instanceof NornilsWorld) - { - final NornilsWorld world = ((NornilsWorld) inst); - world.removeAllowed(player); - teleportPlayer(player, EXIT_PPL, 0); - } - } - private final synchronized String enterInstance(Npc npc, Player player) { final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); @@ -274,7 +263,7 @@ public class NornilsGarden extends AbstractInstance final NornilsWorld newWorld = new NornilsWorld(); final Instance instance = InstanceManager.getInstance().createDynamicInstance(TEMPLATE_ID); newWorld.setInstance(instance); - InstanceManager.getInstance().addWorld(world); + InstanceManager.getInstance().addWorld(newWorld); instance.setExitLoc(new Location(player)); instance.setAllowSummon(false); instance.setDuration(DURATION_TIME * 60000); @@ -503,13 +492,9 @@ public class NornilsGarden extends AbstractInstance } else if ((npc.getId() == 32258) && event.equalsIgnoreCase("exit")) { - try + if (player.getInstanceId() > 0) { - exitInstance(player); - } - catch (Exception e) - { - // Not Important. + super.teleportPlayer(player, EXIT_PPL, 0); } } else if (CommonUtil.contains(FINAL_GATES, npc.getId())) @@ -523,7 +508,7 @@ public class NornilsGarden extends AbstractInstance int correct = st.getInt("correct"); correct++; st.set("correct", String.valueOf(correct)); - htmltext = npc.getId() + "-0" + correct + 2 + ".html"; + htmltext = npc.getId() + "-0" + Integer.sum(correct, 2) + ".html"; } else if (event.equalsIgnoreCase("check")) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/32138-00b.html b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/32138-00b.html index 57af92b762..cff29c6976 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/32138-00b.html +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/32138-00b.html @@ -1,4 +1,4 @@ Hierarch Kekropus:
We are looking for foreigners that can help the youth of our race. Do you know anyone who would be suitable?
-(Only non-Kamael characters between level 18 and 20 who have not completed their first class transfer may embark on this quest.) +(Only non-Kamael characters between level 17 and 21 who have not completed their first class transfer may embark on this quest.) \ No newline at end of file diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java index 34a5e05f20..a51489a7c8 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/quests/Q00182_NewRecruits/Q00182_NewRecruits.java @@ -92,7 +92,7 @@ public class Q00182_NewRecruits extends Quest { htmltext = "32138-00.html"; } - else if ((level >= 17) && (level <= 21) && (player.getClassId().getId() == 0)) + else if ((level >= 17) && (level <= 21) && (player.getClassId().level() == 0)) { htmltext = "32138-01.htm"; }