From 68b1c4aa9e319055a3572be41348bb246ae0f381 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 30 Oct 2017 17:48:12 +0000 Subject: [PATCH] Basic Fortuna AI. Thanks Stayway. --- .../dist/game/data/html/default/32894-2.htm | 5 - .../dist/game/data/instances/Fortuna.xml | 347 ++++++++++++ .../instances/Fortuna}/32894-1.htm | 10 +- .../scripts/instances/Fortuna/32894-2.htm | 5 + .../scripts/instances/Fortuna/32894-3.htm | 4 + .../scripts/instances/Fortuna/32894-4.htm | 3 + .../scripts/instances/Fortuna/32894-5.htm | 3 + .../data/scripts/instances/Fortuna}/32894.htm | 8 +- .../scripts/instances/Fortuna/33153-1.htm | 5 + .../scripts/instances/Fortuna/33153-2.htm | 3 + .../data/scripts/instances/Fortuna/33153.htm | 5 + .../scripts/instances/Fortuna/Fortuna.java | 497 ++++++++++++++++++ .../Q10304_ForForgottenHeroes.java | 98 ++-- .../dist/game/data/html/default/32894-2.htm | 5 - .../dist/game/data/instances/Fortuna.xml | 347 ++++++++++++ .../scripts/instances/Fortuna}/32894-1.htm | 10 +- .../scripts/instances/Fortuna/32894-2.htm | 5 + .../scripts/instances/Fortuna/32894-3.htm | 4 + .../scripts/instances/Fortuna/32894-4.htm | 3 + .../scripts/instances/Fortuna/32894-5.htm | 3 + .../data/scripts/instances/Fortuna}/32894.htm | 8 +- .../scripts/instances/Fortuna/33153-1.htm | 5 + .../scripts/instances/Fortuna/33153-2.htm | 3 + .../data/scripts/instances/Fortuna/33153.htm | 5 + .../scripts/instances/Fortuna/Fortuna.java | 497 ++++++++++++++++++ .../Q10304_ForForgottenHeroes.java | 98 ++-- .../dist/game/data/html/default/32894-2.htm | 5 - .../dist/game/data/instances/Fortuna.xml | 347 ++++++++++++ .../scripts/instances/Fortuna}/32894-1.htm | 10 +- .../scripts/instances/Fortuna/32894-2.htm | 5 + .../scripts/instances/Fortuna/32894-3.htm | 4 + .../scripts/instances/Fortuna/32894-4.htm | 3 + .../scripts/instances/Fortuna/32894-5.htm | 3 + .../data/scripts/instances/Fortuna}/32894.htm | 8 +- .../scripts/instances/Fortuna/33153-1.htm | 5 + .../scripts/instances/Fortuna/33153-2.htm | 3 + .../data/scripts/instances/Fortuna/33153.htm | 5 + .../scripts/instances/Fortuna/Fortuna.java | 497 ++++++++++++++++++ .../Q10304_ForForgottenHeroes.java | 98 ++-- 39 files changed, 2793 insertions(+), 186 deletions(-) delete mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894-2.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/instances/Fortuna.xml rename L2J_Mobius_1.0_Ertheia/dist/game/data/{html/default => scripts/instances/Fortuna}/32894-1.htm (75%) create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-2.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-3.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-4.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-5.htm rename {L2J_Mobius_3.0_Helios/dist/game/data/html/default => L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna}/32894.htm (63%) create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153-1.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153-2.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153.htm create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/Fortuna.java delete mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894-2.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/instances/Fortuna.xml rename {L2J_Mobius_3.0_Helios/dist/game/data/html/default => L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna}/32894-1.htm (75%) create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-2.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-3.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-4.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-5.htm rename {L2J_Mobius_1.0_Ertheia/dist/game/data/html/default => L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna}/32894.htm (63%) create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153-1.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153-2.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153.htm create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/Fortuna.java delete mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894-2.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/instances/Fortuna.xml rename {L2J_Mobius_2.5_Underground/dist/game/data/html/default => L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna}/32894-1.htm (75%) create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-2.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-3.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-4.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-5.htm rename {L2J_Mobius_2.5_Underground/dist/game/data/html/default => L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna}/32894.htm (63%) create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153-1.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153-2.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153.htm create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/Fortuna.java diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894-2.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894-2.htm deleted file mode 100644 index 405e7fcc46..0000000000 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894-2.htm +++ /dev/null @@ -1,5 +0,0 @@ -Josephina's Companion Izael:
-You do understand that this is a place cursed by the gods, do you not?
- - - \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/instances/Fortuna.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/instances/Fortuna.xml new file mode 100644 index 0000000000..6724afda06 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/instances/Fortuna.xml @@ -0,0 +1,347 @@ + + + + diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894-1.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-1.htm similarity index 75% rename from L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894-1.htm rename to L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-1.htm index 084d79d41a..7483bfc56f 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894-1.htm +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-1.htm @@ -1,6 +1,6 @@ -Josephina's Companion Izael:
-Ah, an ill-omened place, indeed. Many ages ago, a group of heroes quarreled with their god,
-and they were cursed to wander forever in the form of vicious monsters who shun the light.
-Fortuna was the heroes' fortress, but it's become a place of darkness. Nobody who enters it can leave.
- +Josephina's Companion Izael:
+Ah, an ill-omened place, indeed. Many ages ago, a group of heroes quarreled with their god,
+and they were cursed to wander forever in the form of vicious monsters who shun the light.
+Fortuna was the heroes' fortress, but it's become a place of darkness. Nobody who enters it can leave.
+ \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-2.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-2.htm new file mode 100644 index 0000000000..00f3a735d8 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-2.htm @@ -0,0 +1,5 @@ +Josephina's Companion Izael:
+You do understand that this is a place cursed by the gods, do you not?
+ + + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-3.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-3.htm new file mode 100644 index 0000000000..dafbb545e3 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-3.htm @@ -0,0 +1,4 @@ +Josephina's Companion Izael:
+You don't look like you're powerful enough to face a god's curse yet.
+(You must be level 90 or above to start this quest.) + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-4.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-4.htm new file mode 100644 index 0000000000..2d9db2fa83 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-4.htm @@ -0,0 +1,3 @@ +Josephina's Companion Izael:
+The party leader must ask me while you are in a party. + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-5.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-5.htm new file mode 100644 index 0000000000..9660ad69c2 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894-5.htm @@ -0,0 +1,3 @@ +Josephina's Companion Izael:
+You mentioned a map, but there is no map. + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894.htm similarity index 63% rename from L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894.htm rename to L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894.htm index 1741984e54..9989fe8a64 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894.htm +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/32894.htm @@ -1,5 +1,5 @@ -Josephina's Companion Izael:
-You have traveled a long way. What brings you here to me?
- - +Josephina's Companion Izael:
+You have traveled a long way. What brings you here to me?
+ + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153-1.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153-1.htm new file mode 100644 index 0000000000..9175059ea1 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153-1.htm @@ -0,0 +1,5 @@ +Josephina's Companion Izael:
+When the power of darkness becomes stronger, the cursed ones will drive out all of the forgotten heroes who rest in this place.
+The forgotten heroes will only find true rest when the root of darkness has been pulled out. I beg of you. Can you help find eternal rest?
+ + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153-2.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153-2.htm new file mode 100644 index 0000000000..598377859a --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153-2.htm @@ -0,0 +1,3 @@ +Josephina's Companion Izael:
+I hope for many things. For your health, for my own eternal peace... + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153.htm b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153.htm new file mode 100644 index 0000000000..86ab23e2dd --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/33153.htm @@ -0,0 +1,5 @@ +Josephina's Companion Izael:
+There's a very dark force emanating from inside, a sensation of Decaying Darkness...?
+The forces that have been waking up must have made this worse.
+ + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/Fortuna.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/Fortuna.java new file mode 100644 index 0000000000..f98673c6c4 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/instances/Fortuna/Fortuna.java @@ -0,0 +1,497 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package instances.Fortuna; + +import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.instancezone.Instance; +import com.l2jmobius.gameserver.network.NpcStringId; +import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import instances.AbstractInstance; + +/** + * @author Mobius, Stayway + * @URL https://l2wiki.com/Fortuna + * @VIDEO https://www.youtube.com/watch?v=OeDVPu-STY4 + */ +public class Fortuna extends AbstractInstance +{ + // NPCs + private static final int ARCAN_IZAEL = 32894; + private static final int INSTANCE_IZAEL = 33153; + private static final int RON = 25825; + // Location + private static final Location RE_ENTRY_LOCATION = new Location(42104, -172712, -7980); + // Misc + private static final int TEMPLATE_ID = 179; + + public Fortuna() + { + super(TEMPLATE_ID); + addStartNpc(ARCAN_IZAEL, INSTANCE_IZAEL); + addFirstTalkId(ARCAN_IZAEL, INSTANCE_IZAEL); + addTalkId(ARCAN_IZAEL, INSTANCE_IZAEL); + addKillId(RON); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + switch (event) + { + case "32894-1.htm": + case "32894-2.htm": + case "33153-1.htm": + case "33153-2.htm": + { + return event; + } + case "request_enter_fortuna": + { + enterInstance(player, npc, TEMPLATE_ID); + if (player.getInstanceWorld() != null) + { + startQuestTimer("start_fortuna", 60000, player.getInstanceWorld().getNpc(INSTANCE_IZAEL), null); + } + return null; + } + case "request_re_enter_fortuna": + { + if (player.getParty() != null) + { + for (L2PcInstance member : player.getParty().getMembers()) + { + if ((member.getInstanceWorld() != null) && (member.getInstanceWorld().getTemplateId() == TEMPLATE_ID)) + { + player.teleToLocation(RE_ENTRY_LOCATION.getX(), RE_ENTRY_LOCATION.getY(), RE_ENTRY_LOCATION.getZ(), member.getInstanceWorld()); + break; + } + } + } + return null; + } + case "start_fortuna": + { + startQuestTimer("check_fortuna_status", 1000, npc, null); + return null; + } + case "boss_1_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(11); + world.spawnGroup("fortuna_11"); + showOnScreenMsg(world, NpcStringId.BLOODSUCKING_CREATURES_ABSORB_THE_LIGHT_AND_FILL_IT_INTO_DARKNESS, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_2_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(16); + world.spawnGroup("fortuna_16"); + showOnScreenMsg(world, NpcStringId.WE_NEED_A_LITTLE_MORE, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_3_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(19); + world.spawnGroup("fortuna_19"); + showOnScreenMsg(world, NpcStringId.BLOODSUCKING_CREATURES_WAKE_THE_SOLDIERS_NOW, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_4_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(23); + world.spawnGroup("fortuna_23"); + showOnScreenMsg(world, NpcStringId.DARKNESS_SWALLOW_EVERYTHING_AWAY, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_5_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(26); + world.spawnGroup("fortuna_26"); + showOnScreenMsg(world, NpcStringId.I_NOW_HAVE_TO_GO_AND_HANDLE_IT, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_6_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(27); + world.spawnGroup("fortuna_last_boss"); + showOnScreenMsg(world, NpcStringId.RON_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + return null; + } + case "check_fortuna_status": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + switch (world.getStatus()) + { + case 0: + { + world.setStatus(1); + world.spawnGroup("fortuna_1"); + showOnScreenMsg(world, NpcStringId.WHO_DARE_TO_INTERRUPT_OUR_REST, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 1: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(2); + world.spawnGroup("fortuna_2"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 2: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(3); + world.spawnGroup("fortuna_3"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 3: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(4); + world.spawnGroup("fortuna_4"); + showOnScreenMsg(world, NpcStringId.THOSE_WHO_CAME_HERE_LOOKING_FOR_CURSED_ONES_WELCOME, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + startQuestTimer("check_fortuna_status", 15000, npc, null); + break; + } + case 4: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(5); + world.spawnGroup("fortuna_5"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 5: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(6); + world.spawnGroup("fortuna_6"); + showOnScreenMsg(world, NpcStringId.LET_S_SEE_HOW_MUCH_YOU_CAN_ENDURE, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + startQuestTimer("check_fortuna_status", 15000, npc, null); + break; + } + case 6: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(7); + world.spawnGroup("fortuna_7"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 7: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(8); + world.spawnGroup("fortuna_8"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 8: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(9); + world.spawnGroup("fortuna_9"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 9: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(10); + world.spawnGroup("fortuna_10"); + showOnScreenMsg(world, NpcStringId.WEEPING_YUI_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 35000, npc, null); + break; + } + case 10: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_1_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 11: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(12); + world.spawnGroup("fortuna_12"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 12: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(13); + world.spawnGroup("fortuna_13"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 13: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(14); + world.spawnGroup("fortuna_14"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 14: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(15); + world.spawnGroup("fortuna_15"); + showOnScreenMsg(world, NpcStringId.ENRAGED_MASTER_KINEN_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 15: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_2_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 16: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(17); + world.spawnGroup("fortuna_17"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 17: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(18); + world.spawnGroup("fortuna_18"); + showOnScreenMsg(world, NpcStringId.MAGICAL_WARRIOR_KONYAR_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 18: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_3_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 19: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(20); + world.spawnGroup("fortuna_20"); + showOnScreenMsg(world, NpcStringId.THIS_IS_ONLY_THE_START, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 20: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(21); + world.spawnGroup("fortuna_21"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 21: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(22); + world.spawnGroup("fortuna_22"); + showOnScreenMsg(world, NpcStringId.SIR_LESYINDA_OF_THE_BLACK_SHADOW_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 22: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_4_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 23: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(24); + world.spawnGroup("fortuna_24"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 24: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(25); + world.spawnGroup("fortuna_25"); + showOnScreenMsg(world, NpcStringId.MUKSHU_THE_COWARD_AND_BLIND_HORNAFI_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 25: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_5_pause", 30000, npc, null); + showOnScreenMsg(world, NpcStringId.DARKNESS_SWALLOW_EVERYTHING_AWAY, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 26: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_6_pause", 30000, npc, null); + showOnScreenMsg(world, NpcStringId.I_NOW_HAVE_TO_GO_AND_HANDLE_IT, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + } + return null; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) + { + if (npc.getInstanceWorld() != null) + { + npc.getInstanceWorld().finishInstance(); + } + return super.onKill(npc, player, isSummon); + } + + @Override + public String onFirstTalk(L2Npc npc, L2PcInstance player) + { + return npc.getId() + ".htm"; + } + + public static void main(String[] args) + { + new Fortuna(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java index 6ddaa2c637..9875e14fbe 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java @@ -180,62 +180,64 @@ public class Q10304_ForForgottenHeroes extends Quest @Override public void actionForEachPlayer(L2PcInstance player, L2Npc npc, boolean isSummon) { - final QuestState qs = getQuestState(player, false); - int cond = qs.getCond(); - int npcId = npc.getId(); - if (player.isInsideRadius(npc, Config.ALT_PARTY_RANGE, true, true)) + if (qs != null) { - if ((npcId == YUI) && (cond == 2)) + int cond = qs.getCond(); + int npcId = npc.getId(); + if (player.isInsideRadius(npc, Config.ALT_PARTY_RANGE, true, true)) { - qs.setCond(3, true); - } - else if ((npcId == KINEN) && (cond == 3)) - { - qs.setCond(4, true); - } - else if ((npcId == KONYAR) && (cond == 4)) - { - qs.setCond(5, true); - } - else if ((npcId == LESYINDA) && (cond == 5)) - { - qs.setCond(6, true); - } - else if ((npcId == MAKSHU) && (cond == 6)) - { - int kills = qs.getInt(Integer.toString(MAKSHU)); - if (kills < 1) + if ((npcId == YUI) && (cond == 2)) { - kills++; - qs.set(Integer.toString(MAKSHU), kills); + qs.setCond(3, true); + } + else if ((npcId == KINEN) && (cond == 3)) + { + qs.setCond(4, true); + } + else if ((npcId == KONYAR) && (cond == 4)) + { + qs.setCond(5, true); + } + else if ((npcId == LESYINDA) && (cond == 5)) + { + qs.setCond(6, true); + } + else if ((npcId == MAKSHU) && (cond == 6)) + { + int kills = qs.getInt(Integer.toString(MAKSHU)); + if (kills < 1) + { + kills++; + qs.set(Integer.toString(MAKSHU), kills); + } + } + else if ((npcId == HORNAFI) && (cond == 6)) + { + int kills = qs.getInt(Integer.toString(HORNAFI)); + if (kills < 1) + { + kills++; + qs.set(Integer.toString(HORNAFI), kills); + } + } + else if ((npcId == YONTYMAK) && (cond == 7)) + { + qs.setCond(8); + } + else if ((npcId == RON) && (cond == 8)) + { + qs.setCond(8); } } - else if ((npcId == HORNAFI) && (cond == 6)) + final ExQuestNpcLogList log = new ExQuestNpcLogList(getId()); + log.addNpc(MAKSHU, qs.getInt(Integer.toString(MAKSHU))); + log.addNpc(HORNAFI, qs.getInt(Integer.toString(HORNAFI))); + qs.getPlayer().sendPacket(log); + if ((qs.getInt(Integer.toString(MAKSHU)) >= 1) && (qs.getInt(Integer.toString(HORNAFI)) >= 1)) { - int kills = qs.getInt(Integer.toString(HORNAFI)); - if (kills < 1) - { - kills++; - qs.set(Integer.toString(HORNAFI), kills); - } + qs.setCond(7, true); } - else if ((npcId == YONTYMAK) && (cond == 7)) - { - qs.setCond(8); - } - else if ((npcId == RON) && (cond == 8)) - { - qs.setCond(8); - } - } - final ExQuestNpcLogList log = new ExQuestNpcLogList(getId()); - log.addNpc(MAKSHU, qs.getInt(Integer.toString(MAKSHU))); - log.addNpc(HORNAFI, qs.getInt(Integer.toString(HORNAFI))); - qs.getPlayer().sendPacket(log); - if ((qs.getInt(Integer.toString(MAKSHU)) >= 1) && (qs.getInt(Integer.toString(HORNAFI)) >= 1)) - { - qs.setCond(7, true); } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894-2.htm b/L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894-2.htm deleted file mode 100644 index 405e7fcc46..0000000000 --- a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894-2.htm +++ /dev/null @@ -1,5 +0,0 @@ -Josephina's Companion Izael:
-You do understand that this is a place cursed by the gods, do you not?
- - - \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/instances/Fortuna.xml b/L2J_Mobius_2.5_Underground/dist/game/data/instances/Fortuna.xml new file mode 100644 index 0000000000..6724afda06 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/instances/Fortuna.xml @@ -0,0 +1,347 @@ + + + + diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894-1.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-1.htm similarity index 75% rename from L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894-1.htm rename to L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-1.htm index 084d79d41a..7483bfc56f 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894-1.htm +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-1.htm @@ -1,6 +1,6 @@ -Josephina's Companion Izael:
-Ah, an ill-omened place, indeed. Many ages ago, a group of heroes quarreled with their god,
-and they were cursed to wander forever in the form of vicious monsters who shun the light.
-Fortuna was the heroes' fortress, but it's become a place of darkness. Nobody who enters it can leave.
- +Josephina's Companion Izael:
+Ah, an ill-omened place, indeed. Many ages ago, a group of heroes quarreled with their god,
+and they were cursed to wander forever in the form of vicious monsters who shun the light.
+Fortuna was the heroes' fortress, but it's become a place of darkness. Nobody who enters it can leave.
+ \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-2.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-2.htm new file mode 100644 index 0000000000..00f3a735d8 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-2.htm @@ -0,0 +1,5 @@ +Josephina's Companion Izael:
+You do understand that this is a place cursed by the gods, do you not?
+ + + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-3.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-3.htm new file mode 100644 index 0000000000..dafbb545e3 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-3.htm @@ -0,0 +1,4 @@ +Josephina's Companion Izael:
+You don't look like you're powerful enough to face a god's curse yet.
+(You must be level 90 or above to start this quest.) + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-4.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-4.htm new file mode 100644 index 0000000000..2d9db2fa83 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-4.htm @@ -0,0 +1,3 @@ +Josephina's Companion Izael:
+The party leader must ask me while you are in a party. + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-5.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-5.htm new file mode 100644 index 0000000000..9660ad69c2 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894-5.htm @@ -0,0 +1,3 @@ +Josephina's Companion Izael:
+You mentioned a map, but there is no map. + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894.htm similarity index 63% rename from L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894.htm rename to L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894.htm index 1741984e54..9989fe8a64 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/html/default/32894.htm +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/32894.htm @@ -1,5 +1,5 @@ -Josephina's Companion Izael:
-You have traveled a long way. What brings you here to me?
- - +Josephina's Companion Izael:
+You have traveled a long way. What brings you here to me?
+ + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153-1.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153-1.htm new file mode 100644 index 0000000000..9175059ea1 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153-1.htm @@ -0,0 +1,5 @@ +Josephina's Companion Izael:
+When the power of darkness becomes stronger, the cursed ones will drive out all of the forgotten heroes who rest in this place.
+The forgotten heroes will only find true rest when the root of darkness has been pulled out. I beg of you. Can you help find eternal rest?
+ + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153-2.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153-2.htm new file mode 100644 index 0000000000..598377859a --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153-2.htm @@ -0,0 +1,3 @@ +Josephina's Companion Izael:
+I hope for many things. For your health, for my own eternal peace... + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153.htm new file mode 100644 index 0000000000..86ab23e2dd --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/33153.htm @@ -0,0 +1,5 @@ +Josephina's Companion Izael:
+There's a very dark force emanating from inside, a sensation of Decaying Darkness...?
+The forces that have been waking up must have made this worse.
+ + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/Fortuna.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/Fortuna.java new file mode 100644 index 0000000000..f98673c6c4 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/Fortuna/Fortuna.java @@ -0,0 +1,497 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package instances.Fortuna; + +import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.instancezone.Instance; +import com.l2jmobius.gameserver.network.NpcStringId; +import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import instances.AbstractInstance; + +/** + * @author Mobius, Stayway + * @URL https://l2wiki.com/Fortuna + * @VIDEO https://www.youtube.com/watch?v=OeDVPu-STY4 + */ +public class Fortuna extends AbstractInstance +{ + // NPCs + private static final int ARCAN_IZAEL = 32894; + private static final int INSTANCE_IZAEL = 33153; + private static final int RON = 25825; + // Location + private static final Location RE_ENTRY_LOCATION = new Location(42104, -172712, -7980); + // Misc + private static final int TEMPLATE_ID = 179; + + public Fortuna() + { + super(TEMPLATE_ID); + addStartNpc(ARCAN_IZAEL, INSTANCE_IZAEL); + addFirstTalkId(ARCAN_IZAEL, INSTANCE_IZAEL); + addTalkId(ARCAN_IZAEL, INSTANCE_IZAEL); + addKillId(RON); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + switch (event) + { + case "32894-1.htm": + case "32894-2.htm": + case "33153-1.htm": + case "33153-2.htm": + { + return event; + } + case "request_enter_fortuna": + { + enterInstance(player, npc, TEMPLATE_ID); + if (player.getInstanceWorld() != null) + { + startQuestTimer("start_fortuna", 60000, player.getInstanceWorld().getNpc(INSTANCE_IZAEL), null); + } + return null; + } + case "request_re_enter_fortuna": + { + if (player.getParty() != null) + { + for (L2PcInstance member : player.getParty().getMembers()) + { + if ((member.getInstanceWorld() != null) && (member.getInstanceWorld().getTemplateId() == TEMPLATE_ID)) + { + player.teleToLocation(RE_ENTRY_LOCATION.getX(), RE_ENTRY_LOCATION.getY(), RE_ENTRY_LOCATION.getZ(), member.getInstanceWorld()); + break; + } + } + } + return null; + } + case "start_fortuna": + { + startQuestTimer("check_fortuna_status", 1000, npc, null); + return null; + } + case "boss_1_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(11); + world.spawnGroup("fortuna_11"); + showOnScreenMsg(world, NpcStringId.BLOODSUCKING_CREATURES_ABSORB_THE_LIGHT_AND_FILL_IT_INTO_DARKNESS, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_2_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(16); + world.spawnGroup("fortuna_16"); + showOnScreenMsg(world, NpcStringId.WE_NEED_A_LITTLE_MORE, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_3_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(19); + world.spawnGroup("fortuna_19"); + showOnScreenMsg(world, NpcStringId.BLOODSUCKING_CREATURES_WAKE_THE_SOLDIERS_NOW, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_4_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(23); + world.spawnGroup("fortuna_23"); + showOnScreenMsg(world, NpcStringId.DARKNESS_SWALLOW_EVERYTHING_AWAY, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_5_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(26); + world.spawnGroup("fortuna_26"); + showOnScreenMsg(world, NpcStringId.I_NOW_HAVE_TO_GO_AND_HANDLE_IT, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_6_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(27); + world.spawnGroup("fortuna_last_boss"); + showOnScreenMsg(world, NpcStringId.RON_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + return null; + } + case "check_fortuna_status": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + switch (world.getStatus()) + { + case 0: + { + world.setStatus(1); + world.spawnGroup("fortuna_1"); + showOnScreenMsg(world, NpcStringId.WHO_DARE_TO_INTERRUPT_OUR_REST, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 1: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(2); + world.spawnGroup("fortuna_2"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 2: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(3); + world.spawnGroup("fortuna_3"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 3: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(4); + world.spawnGroup("fortuna_4"); + showOnScreenMsg(world, NpcStringId.THOSE_WHO_CAME_HERE_LOOKING_FOR_CURSED_ONES_WELCOME, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + startQuestTimer("check_fortuna_status", 15000, npc, null); + break; + } + case 4: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(5); + world.spawnGroup("fortuna_5"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 5: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(6); + world.spawnGroup("fortuna_6"); + showOnScreenMsg(world, NpcStringId.LET_S_SEE_HOW_MUCH_YOU_CAN_ENDURE, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + startQuestTimer("check_fortuna_status", 15000, npc, null); + break; + } + case 6: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(7); + world.spawnGroup("fortuna_7"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 7: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(8); + world.spawnGroup("fortuna_8"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 8: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(9); + world.spawnGroup("fortuna_9"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 9: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(10); + world.spawnGroup("fortuna_10"); + showOnScreenMsg(world, NpcStringId.WEEPING_YUI_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 35000, npc, null); + break; + } + case 10: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_1_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 11: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(12); + world.spawnGroup("fortuna_12"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 12: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(13); + world.spawnGroup("fortuna_13"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 13: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(14); + world.spawnGroup("fortuna_14"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 14: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(15); + world.spawnGroup("fortuna_15"); + showOnScreenMsg(world, NpcStringId.ENRAGED_MASTER_KINEN_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 15: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_2_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 16: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(17); + world.spawnGroup("fortuna_17"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 17: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(18); + world.spawnGroup("fortuna_18"); + showOnScreenMsg(world, NpcStringId.MAGICAL_WARRIOR_KONYAR_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 18: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_3_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 19: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(20); + world.spawnGroup("fortuna_20"); + showOnScreenMsg(world, NpcStringId.THIS_IS_ONLY_THE_START, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 20: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(21); + world.spawnGroup("fortuna_21"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 21: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(22); + world.spawnGroup("fortuna_22"); + showOnScreenMsg(world, NpcStringId.SIR_LESYINDA_OF_THE_BLACK_SHADOW_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 22: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_4_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 23: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(24); + world.spawnGroup("fortuna_24"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 24: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(25); + world.spawnGroup("fortuna_25"); + showOnScreenMsg(world, NpcStringId.MUKSHU_THE_COWARD_AND_BLIND_HORNAFI_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 25: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_5_pause", 30000, npc, null); + showOnScreenMsg(world, NpcStringId.DARKNESS_SWALLOW_EVERYTHING_AWAY, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 26: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_6_pause", 30000, npc, null); + showOnScreenMsg(world, NpcStringId.I_NOW_HAVE_TO_GO_AND_HANDLE_IT, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + } + return null; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) + { + if (npc.getInstanceWorld() != null) + { + npc.getInstanceWorld().finishInstance(); + } + return super.onKill(npc, player, isSummon); + } + + @Override + public String onFirstTalk(L2Npc npc, L2PcInstance player) + { + return npc.getId() + ".htm"; + } + + public static void main(String[] args) + { + new Fortuna(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java index 6ddaa2c637..9875e14fbe 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java @@ -180,62 +180,64 @@ public class Q10304_ForForgottenHeroes extends Quest @Override public void actionForEachPlayer(L2PcInstance player, L2Npc npc, boolean isSummon) { - final QuestState qs = getQuestState(player, false); - int cond = qs.getCond(); - int npcId = npc.getId(); - if (player.isInsideRadius(npc, Config.ALT_PARTY_RANGE, true, true)) + if (qs != null) { - if ((npcId == YUI) && (cond == 2)) + int cond = qs.getCond(); + int npcId = npc.getId(); + if (player.isInsideRadius(npc, Config.ALT_PARTY_RANGE, true, true)) { - qs.setCond(3, true); - } - else if ((npcId == KINEN) && (cond == 3)) - { - qs.setCond(4, true); - } - else if ((npcId == KONYAR) && (cond == 4)) - { - qs.setCond(5, true); - } - else if ((npcId == LESYINDA) && (cond == 5)) - { - qs.setCond(6, true); - } - else if ((npcId == MAKSHU) && (cond == 6)) - { - int kills = qs.getInt(Integer.toString(MAKSHU)); - if (kills < 1) + if ((npcId == YUI) && (cond == 2)) { - kills++; - qs.set(Integer.toString(MAKSHU), kills); + qs.setCond(3, true); + } + else if ((npcId == KINEN) && (cond == 3)) + { + qs.setCond(4, true); + } + else if ((npcId == KONYAR) && (cond == 4)) + { + qs.setCond(5, true); + } + else if ((npcId == LESYINDA) && (cond == 5)) + { + qs.setCond(6, true); + } + else if ((npcId == MAKSHU) && (cond == 6)) + { + int kills = qs.getInt(Integer.toString(MAKSHU)); + if (kills < 1) + { + kills++; + qs.set(Integer.toString(MAKSHU), kills); + } + } + else if ((npcId == HORNAFI) && (cond == 6)) + { + int kills = qs.getInt(Integer.toString(HORNAFI)); + if (kills < 1) + { + kills++; + qs.set(Integer.toString(HORNAFI), kills); + } + } + else if ((npcId == YONTYMAK) && (cond == 7)) + { + qs.setCond(8); + } + else if ((npcId == RON) && (cond == 8)) + { + qs.setCond(8); } } - else if ((npcId == HORNAFI) && (cond == 6)) + final ExQuestNpcLogList log = new ExQuestNpcLogList(getId()); + log.addNpc(MAKSHU, qs.getInt(Integer.toString(MAKSHU))); + log.addNpc(HORNAFI, qs.getInt(Integer.toString(HORNAFI))); + qs.getPlayer().sendPacket(log); + if ((qs.getInt(Integer.toString(MAKSHU)) >= 1) && (qs.getInt(Integer.toString(HORNAFI)) >= 1)) { - int kills = qs.getInt(Integer.toString(HORNAFI)); - if (kills < 1) - { - kills++; - qs.set(Integer.toString(HORNAFI), kills); - } + qs.setCond(7, true); } - else if ((npcId == YONTYMAK) && (cond == 7)) - { - qs.setCond(8); - } - else if ((npcId == RON) && (cond == 8)) - { - qs.setCond(8); - } - } - final ExQuestNpcLogList log = new ExQuestNpcLogList(getId()); - log.addNpc(MAKSHU, qs.getInt(Integer.toString(MAKSHU))); - log.addNpc(HORNAFI, qs.getInt(Integer.toString(HORNAFI))); - qs.getPlayer().sendPacket(log); - if ((qs.getInt(Integer.toString(MAKSHU)) >= 1) && (qs.getInt(Integer.toString(HORNAFI)) >= 1)) - { - qs.setCond(7, true); } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894-2.htm b/L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894-2.htm deleted file mode 100644 index 405e7fcc46..0000000000 --- a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/32894-2.htm +++ /dev/null @@ -1,5 +0,0 @@ -Josephina's Companion Izael:
-You do understand that this is a place cursed by the gods, do you not?
- - - \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/instances/Fortuna.xml b/L2J_Mobius_3.0_Helios/dist/game/data/instances/Fortuna.xml new file mode 100644 index 0000000000..6724afda06 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/instances/Fortuna.xml @@ -0,0 +1,347 @@ + + + + diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894-1.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-1.htm similarity index 75% rename from L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894-1.htm rename to L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-1.htm index 084d79d41a..7483bfc56f 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894-1.htm +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-1.htm @@ -1,6 +1,6 @@ -Josephina's Companion Izael:
-Ah, an ill-omened place, indeed. Many ages ago, a group of heroes quarreled with their god,
-and they were cursed to wander forever in the form of vicious monsters who shun the light.
-Fortuna was the heroes' fortress, but it's become a place of darkness. Nobody who enters it can leave.
- +Josephina's Companion Izael:
+Ah, an ill-omened place, indeed. Many ages ago, a group of heroes quarreled with their god,
+and they were cursed to wander forever in the form of vicious monsters who shun the light.
+Fortuna was the heroes' fortress, but it's become a place of darkness. Nobody who enters it can leave.
+ \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-2.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-2.htm new file mode 100644 index 0000000000..00f3a735d8 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-2.htm @@ -0,0 +1,5 @@ +Josephina's Companion Izael:
+You do understand that this is a place cursed by the gods, do you not?
+ + + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-3.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-3.htm new file mode 100644 index 0000000000..dafbb545e3 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-3.htm @@ -0,0 +1,4 @@ +Josephina's Companion Izael:
+You don't look like you're powerful enough to face a god's curse yet.
+(You must be level 90 or above to start this quest.) + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-4.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-4.htm new file mode 100644 index 0000000000..2d9db2fa83 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-4.htm @@ -0,0 +1,3 @@ +Josephina's Companion Izael:
+The party leader must ask me while you are in a party. + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-5.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-5.htm new file mode 100644 index 0000000000..9660ad69c2 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894-5.htm @@ -0,0 +1,3 @@ +Josephina's Companion Izael:
+You mentioned a map, but there is no map. + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894.htm similarity index 63% rename from L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894.htm rename to L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894.htm index 1741984e54..9989fe8a64 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/32894.htm +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/32894.htm @@ -1,5 +1,5 @@ -Josephina's Companion Izael:
-You have traveled a long way. What brings you here to me?
- - +Josephina's Companion Izael:
+You have traveled a long way. What brings you here to me?
+ + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153-1.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153-1.htm new file mode 100644 index 0000000000..9175059ea1 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153-1.htm @@ -0,0 +1,5 @@ +Josephina's Companion Izael:
+When the power of darkness becomes stronger, the cursed ones will drive out all of the forgotten heroes who rest in this place.
+The forgotten heroes will only find true rest when the root of darkness has been pulled out. I beg of you. Can you help find eternal rest?
+ + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153-2.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153-2.htm new file mode 100644 index 0000000000..598377859a --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153-2.htm @@ -0,0 +1,3 @@ +Josephina's Companion Izael:
+I hope for many things. For your health, for my own eternal peace... + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153.htm new file mode 100644 index 0000000000..86ab23e2dd --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/33153.htm @@ -0,0 +1,5 @@ +Josephina's Companion Izael:
+There's a very dark force emanating from inside, a sensation of Decaying Darkness...?
+The forces that have been waking up must have made this worse.
+ + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/Fortuna.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/Fortuna.java new file mode 100644 index 0000000000..f98673c6c4 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/Fortuna/Fortuna.java @@ -0,0 +1,497 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package instances.Fortuna; + +import com.l2jmobius.gameserver.model.Location; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.instancezone.Instance; +import com.l2jmobius.gameserver.network.NpcStringId; +import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import instances.AbstractInstance; + +/** + * @author Mobius, Stayway + * @URL https://l2wiki.com/Fortuna + * @VIDEO https://www.youtube.com/watch?v=OeDVPu-STY4 + */ +public class Fortuna extends AbstractInstance +{ + // NPCs + private static final int ARCAN_IZAEL = 32894; + private static final int INSTANCE_IZAEL = 33153; + private static final int RON = 25825; + // Location + private static final Location RE_ENTRY_LOCATION = new Location(42104, -172712, -7980); + // Misc + private static final int TEMPLATE_ID = 179; + + public Fortuna() + { + super(TEMPLATE_ID); + addStartNpc(ARCAN_IZAEL, INSTANCE_IZAEL); + addFirstTalkId(ARCAN_IZAEL, INSTANCE_IZAEL); + addTalkId(ARCAN_IZAEL, INSTANCE_IZAEL); + addKillId(RON); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + switch (event) + { + case "32894-1.htm": + case "32894-2.htm": + case "33153-1.htm": + case "33153-2.htm": + { + return event; + } + case "request_enter_fortuna": + { + enterInstance(player, npc, TEMPLATE_ID); + if (player.getInstanceWorld() != null) + { + startQuestTimer("start_fortuna", 60000, player.getInstanceWorld().getNpc(INSTANCE_IZAEL), null); + } + return null; + } + case "request_re_enter_fortuna": + { + if (player.getParty() != null) + { + for (L2PcInstance member : player.getParty().getMembers()) + { + if ((member.getInstanceWorld() != null) && (member.getInstanceWorld().getTemplateId() == TEMPLATE_ID)) + { + player.teleToLocation(RE_ENTRY_LOCATION.getX(), RE_ENTRY_LOCATION.getY(), RE_ENTRY_LOCATION.getZ(), member.getInstanceWorld()); + break; + } + } + } + return null; + } + case "start_fortuna": + { + startQuestTimer("check_fortuna_status", 1000, npc, null); + return null; + } + case "boss_1_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(11); + world.spawnGroup("fortuna_11"); + showOnScreenMsg(world, NpcStringId.BLOODSUCKING_CREATURES_ABSORB_THE_LIGHT_AND_FILL_IT_INTO_DARKNESS, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_2_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(16); + world.spawnGroup("fortuna_16"); + showOnScreenMsg(world, NpcStringId.WE_NEED_A_LITTLE_MORE, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_3_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(19); + world.spawnGroup("fortuna_19"); + showOnScreenMsg(world, NpcStringId.BLOODSUCKING_CREATURES_WAKE_THE_SOLDIERS_NOW, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_4_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(23); + world.spawnGroup("fortuna_23"); + showOnScreenMsg(world, NpcStringId.DARKNESS_SWALLOW_EVERYTHING_AWAY, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_5_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(26); + world.spawnGroup("fortuna_26"); + showOnScreenMsg(world, NpcStringId.I_NOW_HAVE_TO_GO_AND_HANDLE_IT, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + return null; + } + case "boss_6_pause": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + world.setStatus(27); + world.spawnGroup("fortuna_last_boss"); + showOnScreenMsg(world, NpcStringId.RON_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + return null; + } + case "check_fortuna_status": + { + final Instance world = npc.getInstanceWorld(); + if (world == null) + { + return null; + } + switch (world.getStatus()) + { + case 0: + { + world.setStatus(1); + world.spawnGroup("fortuna_1"); + showOnScreenMsg(world, NpcStringId.WHO_DARE_TO_INTERRUPT_OUR_REST, ExShowScreenMessage.TOP_CENTER, 10000, true); + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 1: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(2); + world.spawnGroup("fortuna_2"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 2: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(3); + world.spawnGroup("fortuna_3"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 3: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(4); + world.spawnGroup("fortuna_4"); + showOnScreenMsg(world, NpcStringId.THOSE_WHO_CAME_HERE_LOOKING_FOR_CURSED_ONES_WELCOME, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + startQuestTimer("check_fortuna_status", 15000, npc, null); + break; + } + case 4: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(5); + world.spawnGroup("fortuna_5"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 5: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(6); + world.spawnGroup("fortuna_6"); + showOnScreenMsg(world, NpcStringId.LET_S_SEE_HOW_MUCH_YOU_CAN_ENDURE, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + startQuestTimer("check_fortuna_status", 15000, npc, null); + break; + } + case 6: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(7); + world.spawnGroup("fortuna_7"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 7: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(8); + world.spawnGroup("fortuna_8"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 8: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(9); + world.spawnGroup("fortuna_9"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 9: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(10); + world.spawnGroup("fortuna_10"); + showOnScreenMsg(world, NpcStringId.WEEPING_YUI_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 35000, npc, null); + break; + } + case 10: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_1_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 11: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(12); + world.spawnGroup("fortuna_12"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 12: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(13); + world.spawnGroup("fortuna_13"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 13: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(14); + world.spawnGroup("fortuna_14"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 14: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(15); + world.spawnGroup("fortuna_15"); + showOnScreenMsg(world, NpcStringId.ENRAGED_MASTER_KINEN_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 15: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_2_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 16: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(17); + world.spawnGroup("fortuna_17"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 17: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(18); + world.spawnGroup("fortuna_18"); + showOnScreenMsg(world, NpcStringId.MAGICAL_WARRIOR_KONYAR_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 18: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_3_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 19: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(20); + world.spawnGroup("fortuna_20"); + showOnScreenMsg(world, NpcStringId.THIS_IS_ONLY_THE_START, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 20: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(21); + world.spawnGroup("fortuna_21"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 21: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(22); + world.spawnGroup("fortuna_22"); + showOnScreenMsg(world, NpcStringId.SIR_LESYINDA_OF_THE_BLACK_SHADOW_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 22: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_4_pause", 30000, npc, null); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 23: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(24); + world.spawnGroup("fortuna_24"); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 24: + { + if (world.getAliveNpcs().size() == 1) + { + world.setStatus(25); + world.spawnGroup("fortuna_25"); + showOnScreenMsg(world, NpcStringId.MUKSHU_THE_COWARD_AND_BLIND_HORNAFI_APPEARS, ExShowScreenMessage.BOTTOM_RIGHT, 6000, true); + } + startQuestTimer("check_fortuna_status", 5000, npc, null); + break; + } + case 25: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_5_pause", 30000, npc, null); + showOnScreenMsg(world, NpcStringId.DARKNESS_SWALLOW_EVERYTHING_AWAY, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + case 26: + { + if (world.getAliveNpcs().size() == 1) + { + startQuestTimer("boss_6_pause", 30000, npc, null); + showOnScreenMsg(world, NpcStringId.I_NOW_HAVE_TO_GO_AND_HANDLE_IT, ExShowScreenMessage.TOP_CENTER, 10000, true); + } + else + { + startQuestTimer("check_fortuna_status", 5000, npc, null); + } + break; + } + } + return null; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) + { + if (npc.getInstanceWorld() != null) + { + npc.getInstanceWorld().finishInstance(); + } + return super.onKill(npc, player, isSummon); + } + + @Override + public String onFirstTalk(L2Npc npc, L2PcInstance player) + { + return npc.getId() + ".htm"; + } + + public static void main(String[] args) + { + new Fortuna(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java index 569ebe4ef7..dc0056be55 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q10304_ForForgottenHeroes/Q10304_ForForgottenHeroes.java @@ -180,62 +180,64 @@ public class Q10304_ForForgottenHeroes extends Quest @Override public void actionForEachPlayer(L2PcInstance player, L2Npc npc, boolean isSummon) { - final QuestState qs = getQuestState(player, false); - int cond = qs.getCond(); - int npcId = npc.getId(); - if (player.isInsideRadius(npc, Config.ALT_PARTY_RANGE, true, true)) + if (qs != null) { - if ((npcId == YUI) && (cond == 2)) + int cond = qs.getCond(); + int npcId = npc.getId(); + if (player.isInsideRadius(npc, Config.ALT_PARTY_RANGE, true, true)) { - qs.setCond(3, true); - } - else if ((npcId == KINEN) && (cond == 3)) - { - qs.setCond(4, true); - } - else if ((npcId == KONYAR) && (cond == 4)) - { - qs.setCond(5, true); - } - else if ((npcId == LESYINDA) && (cond == 5)) - { - qs.setCond(6, true); - } - else if ((npcId == MAKSHU) && (cond == 6)) - { - int kills = qs.getInt(Integer.toString(MAKSHU)); - if (kills < 1) + if ((npcId == YUI) && (cond == 2)) { - kills++; - qs.set(Integer.toString(MAKSHU), kills); + qs.setCond(3, true); + } + else if ((npcId == KINEN) && (cond == 3)) + { + qs.setCond(4, true); + } + else if ((npcId == KONYAR) && (cond == 4)) + { + qs.setCond(5, true); + } + else if ((npcId == LESYINDA) && (cond == 5)) + { + qs.setCond(6, true); + } + else if ((npcId == MAKSHU) && (cond == 6)) + { + int kills = qs.getInt(Integer.toString(MAKSHU)); + if (kills < 1) + { + kills++; + qs.set(Integer.toString(MAKSHU), kills); + } + } + else if ((npcId == HORNAFI) && (cond == 6)) + { + int kills = qs.getInt(Integer.toString(HORNAFI)); + if (kills < 1) + { + kills++; + qs.set(Integer.toString(HORNAFI), kills); + } + } + else if ((npcId == YONTYMAK) && (cond == 7)) + { + qs.setCond(8); + } + else if ((npcId == RON) && (cond == 8)) + { + qs.setCond(8); } } - else if ((npcId == HORNAFI) && (cond == 6)) + final ExQuestNpcLogList log = new ExQuestNpcLogList(getId()); + log.addNpc(MAKSHU, qs.getInt(Integer.toString(MAKSHU))); + log.addNpc(HORNAFI, qs.getInt(Integer.toString(HORNAFI))); + qs.getPlayer().sendPacket(log); + if ((qs.getInt(Integer.toString(MAKSHU)) >= 1) && (qs.getInt(Integer.toString(HORNAFI)) >= 1)) { - int kills = qs.getInt(Integer.toString(HORNAFI)); - if (kills < 1) - { - kills++; - qs.set(Integer.toString(HORNAFI), kills); - } + qs.setCond(7, true); } - else if ((npcId == YONTYMAK) && (cond == 7)) - { - qs.setCond(8); - } - else if ((npcId == RON) && (cond == 8)) - { - qs.setCond(8); - } - } - final ExQuestNpcLogList log = new ExQuestNpcLogList(getId()); - log.addNpc(MAKSHU, qs.getInt(Integer.toString(MAKSHU))); - log.addNpc(HORNAFI, qs.getInt(Integer.toString(HORNAFI))); - qs.getPlayer().sendPacket(log); - if ((qs.getInt(Integer.toString(MAKSHU)) >= 1) && (qs.getInt(Integer.toString(HORNAFI)) >= 1)) - { - qs.setCond(7, true); } }