From d4a72218528d29b9253084acacb249d950977fb8 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 30 Oct 2019 13:03:52 +0000 Subject: [PATCH] Addition of Story of Tauti. Contributed by gigilo1968. --- .../instances/MysticTavern/StoryOfTauti.xml | 129 +++ .../instances/MysticTavern/MysticTavern.java | 36 +- .../MysticTavern/StoryOfTauti/34170-01.html | 3 + .../MysticTavern/StoryOfTauti/34170.html | 5 + .../StoryOfTauti/StoryOfTauti.java | 943 ++++++++++++++++++ .../data/scripts/quests/MissingQuests.txt | 1 - .../Q00833_DevilsTreasureTauti/34180-01.html | 6 + .../Q00833_DevilsTreasureTauti/34180-02.html | 4 + .../Q00833_DevilsTreasureTauti/34180-03.html | 4 + .../Q00833_DevilsTreasureTauti.java | 224 +++++ .../scripts/quests/QuestMasterHandler.java | 2 + .../dist/game/data/stats/npcs/19600-19699.xml | 18 +- .../game/data/stats/skills/16500-16599.xml | 27 +- .../game/data/stats/skills/18500-18599.xml | 40 +- .../dist/game/data/zones/custom_script.xml | 27 + .../instances/MysticTavern/StoryOfTauti.xml | 129 +++ .../instances/MysticTavern/MysticTavern.java | 36 +- .../MysticTavern/StoryOfTauti/34170-01.html | 3 + .../MysticTavern/StoryOfTauti/34170.html | 5 + .../StoryOfTauti/StoryOfTauti.java | 943 ++++++++++++++++++ .../data/scripts/quests/MissingQuests.txt | 1 - .../Q00833_DevilsTreasureTauti/34180-01.html | 6 + .../Q00833_DevilsTreasureTauti/34180-02.html | 4 + .../Q00833_DevilsTreasureTauti/34180-03.html | 4 + .../Q00833_DevilsTreasureTauti.java | 224 +++++ .../scripts/quests/QuestMasterHandler.java | 2 + .../dist/game/data/stats/npcs/19600-19699.xml | 18 +- .../game/data/stats/skills/16500-16599.xml | 21 +- .../game/data/stats/skills/18500-18599.xml | 40 +- .../dist/game/data/zones/custom_script.xml | 27 + .../instances/MysticTavern/StoryOfTauti.xml | 129 +++ .../instances/MysticTavern/MysticTavern.java | 36 +- .../MysticTavern/StoryOfTauti/34170-01.html | 3 + .../MysticTavern/StoryOfTauti/34170.html | 5 + .../StoryOfTauti/StoryOfTauti.java | 943 ++++++++++++++++++ .../data/scripts/quests/MissingQuests.txt | 1 - .../Q00833_DevilsTreasureTauti/34180-01.html | 6 + .../Q00833_DevilsTreasureTauti/34180-02.html | 4 + .../Q00833_DevilsTreasureTauti/34180-03.html | 4 + .../Q00833_DevilsTreasureTauti.java | 224 +++++ .../scripts/quests/QuestMasterHandler.java | 2 + .../dist/game/data/stats/npcs/19600-19699.xml | 18 +- .../game/data/stats/skills/16500-16599.xml | 21 +- .../game/data/stats/skills/18500-18599.xml | 40 +- .../dist/game/data/zones/custom_script.xml | 27 + .../instances/MysticTavern/StoryOfTauti.xml | 129 +++ .../instances/MysticTavern/MysticTavern.java | 36 +- .../MysticTavern/StoryOfTauti/34170-01.html | 3 + .../MysticTavern/StoryOfTauti/34170.html | 5 + .../StoryOfTauti/StoryOfTauti.java | 943 ++++++++++++++++++ .../data/scripts/quests/MissingQuests.txt | 1 - .../Q00833_DevilsTreasureTauti/34180-01.html | 6 + .../Q00833_DevilsTreasureTauti/34180-02.html | 4 + .../Q00833_DevilsTreasureTauti/34180-03.html | 4 + .../Q00833_DevilsTreasureTauti.java | 224 +++++ .../scripts/quests/QuestMasterHandler.java | 2 + .../dist/game/data/stats/npcs/19600-19699.xml | 18 +- .../game/data/stats/skills/16500-16599.xml | 21 +- .../game/data/stats/skills/18500-18599.xml | 46 +- .../dist/game/data/zones/custom_script.xml | 27 + .../instances/MysticTavern/StoryOfTauti.xml | 129 +++ .../instances/MysticTavern/MysticTavern.java | 36 +- .../MysticTavern/StoryOfTauti/34170-01.html | 3 + .../MysticTavern/StoryOfTauti/34170.html | 5 + .../StoryOfTauti/StoryOfTauti.java | 943 ++++++++++++++++++ .../data/scripts/quests/MissingQuests.txt | 1 - .../Q00833_DevilsTreasureTauti/34180-01.html | 6 + .../Q00833_DevilsTreasureTauti/34180-02.html | 4 + .../Q00833_DevilsTreasureTauti/34180-03.html | 4 + .../Q00833_DevilsTreasureTauti.java | 224 +++++ .../scripts/quests/QuestMasterHandler.java | 2 + .../dist/game/data/stats/npcs/19600-19699.xml | 18 +- .../game/data/stats/skills/16500-16599.xml | 21 +- .../game/data/stats/skills/18500-18599.xml | 46 +- .../dist/game/data/zones/custom_script.xml | 27 + .../instances/MysticTavern/StoryOfTauti.xml | 129 +++ .../instances/MysticTavern/MysticTavern.java | 36 +- .../MysticTavern/StoryOfTauti/34170-01.html | 3 + .../MysticTavern/StoryOfTauti/34170.html | 5 + .../StoryOfTauti/StoryOfTauti.java | 943 ++++++++++++++++++ .../data/scripts/quests/MissingQuests.txt | 1 - .../Q00833_DevilsTreasureTauti/34180-01.html | 6 + .../Q00833_DevilsTreasureTauti/34180-02.html | 4 + .../Q00833_DevilsTreasureTauti/34180-03.html | 4 + .../Q00833_DevilsTreasureTauti.java | 224 +++++ .../scripts/quests/QuestMasterHandler.java | 2 + .../dist/game/data/stats/npcs/19600-19699.xml | 18 +- .../game/data/stats/skills/16500-16599.xml | 21 +- .../game/data/stats/skills/18500-18599.xml | 46 +- .../dist/game/data/zones/custom_script.xml | 27 + .../instances/MysticTavern/StoryOfTauti.xml | 129 +++ .../instances/MysticTavern/MysticTavern.java | 36 +- .../MysticTavern/StoryOfTauti/34170-01.html | 3 + .../MysticTavern/StoryOfTauti/34170.html | 5 + .../StoryOfTauti/StoryOfTauti.java | 943 ++++++++++++++++++ .../data/scripts/quests/MissingQuests.txt | 1 - .../Q00833_DevilsTreasureTauti/34180-01.html | 6 + .../Q00833_DevilsTreasureTauti/34180-02.html | 4 + .../Q00833_DevilsTreasureTauti/34180-03.html | 4 + .../Q00833_DevilsTreasureTauti.java | 224 +++++ .../scripts/quests/QuestMasterHandler.java | 2 + .../dist/game/data/stats/npcs/19600-19699.xml | 18 +- .../game/data/stats/skills/16500-16599.xml | 21 +- .../game/data/stats/skills/18500-18599.xml | 46 +- .../dist/game/data/zones/custom_script.xml | 27 + .../game/data/stats/skills/16500-16599.xml | 21 +- .../game/data/stats/skills/18500-18599.xml | 40 +- 107 files changed, 10092 insertions(+), 240 deletions(-) create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/instances/MysticTavern/StoryOfTauti.xml create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/instances/MysticTavern/StoryOfTauti.xml create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/instances/MysticTavern/StoryOfTauti.xml create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/instances/MysticTavern/StoryOfTauti.xml create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/instances/MysticTavern/StoryOfTauti.xml create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/instances/MysticTavern/StoryOfTauti.xml create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/instances/MysticTavern/StoryOfTauti.xml create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/instances/MysticTavern/StoryOfTauti.xml b/L2J_Mobius_2.5_Underground/dist/game/data/instances/MysticTavern/StoryOfTauti.xml new file mode 100644 index 0000000000..e8d0ac86b2 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/instances/MysticTavern/StoryOfTauti.xml @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java index f0f803c31c..d68fbb30b6 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.PlaySound; import ai.AbstractNpcAI; import instances.MysticTavern.StoryOfFreya.StoryOfFreya; +import instances.MysticTavern.StoryOfTauti.StoryOfTauti; import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub; /** @@ -57,7 +58,7 @@ public class MysticTavern extends AbstractNpcAI private static final int LUPIA = 34185; private static final int MEY = 34186; // Instances - // private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_KELBIM = 262; private static final int INSTANCE_FREYA = 263; // Zones @@ -105,7 +106,7 @@ public class MysticTavern extends AbstractNpcAI } final List availableInstances = new ArrayList<>(); availableInstances.add(INSTANCE_FREYA); - // availableInstances.add(INSTANCE_TAUTI); + availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_KELBIM); for (PlayerInstance member : party.getMembers()) { @@ -132,16 +133,16 @@ public class MysticTavern extends AbstractNpcAI } } } - // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) - // { - // for (int i = 0; i < availableInstances.size(); i++) - // { - // if (availableInstances.get(i) == INSTANCE_TAUTI) - // { - // availableInstances.remove(i); - // } - // } - // } + if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) + { + for (int i = 0; i < availableInstances.size(); i++) + { + if (availableInstances.get(i) == INSTANCE_TAUTI) + { + availableInstances.remove(i); + } + } + } // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_KELBIM) > 0) // { // for (int i = 0; i < availableInstances.size(); i++) @@ -160,7 +161,6 @@ public class MysticTavern extends AbstractNpcAI npc.setScriptValue(getRandom(availableInstances.size())); startQuestTimer("npcRoute", 3000, npc, player); } - startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test break; } case "npcRoute": @@ -333,11 +333,11 @@ public class MysticTavern extends AbstractNpcAI player.processQuestEvent(StoryOfFreya.class.getSimpleName(), "start_story"); break; } - // case INSTANCE_TAUTI: - // { - // player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); - // break; - // } + case INSTANCE_TAUTI: + { + player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); + break; + } // case INSTANCE_KELBIM: // { // player.processQuestEvent(StoryOfKelbim.class.getSimpleName(), "start_story"); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html new file mode 100644 index 0000000000..39c376f9e3 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html @@ -0,0 +1,3 @@ +Archaeologist Deton:
+What do you want? I'm busy right now. Come back later. + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html new file mode 100644 index 0000000000..0bcdd62f25 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html @@ -0,0 +1,5 @@ +Archaeologist Deton:
+Hmm, where are we?
+I should take a look at the map again...
+ + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java new file mode 100644 index 0000000000..15f0c319b2 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java @@ -0,0 +1,943 @@ +/* + * 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.MysticTavern.StoryOfTauti; + +import java.util.List; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.enums.ChatType; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.instancemanager.QuestManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.World; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; +import org.l2jmobius.gameserver.model.skills.BuffInfo; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.ScriptZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; +import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger; + +import instances.AbstractInstance; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; + +/** + * Mystic Tavern Tauti Instance + * @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk + * @author Gigi + */ +public class StoryOfTauti extends AbstractInstance +{ + // NPC + private static final int DETON = 34170; + private static final int FLAME_FLOWER = 19606; + private static final int SEAL_DEVICE = 19608; + // Monsters + private static final int FLAME_STACATO = 23681; + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + private static final int SEAL_ARCHANGEL = 23683; + private static final int SEALED_ANGEL = 23685; + private static final int NPC_1 = 19626; + // Item + private static final int FLAME_FLOWER_BUD = 46554; + // Misc + private static final int TEMPLATE_ID = 261; + private static final ScriptZone FLAME_FLOWER_ZONE = ZoneManager.getInstance().getZoneById(80027, ScriptZone.class); + private static final ScriptZone START_ZONE = ZoneManager.getInstance().getZoneById(80028, ScriptZone.class); + private static final ScriptZone SCORPION_ZONE = ZoneManager.getInstance().getZoneById(80029, ScriptZone.class); + private static final ScriptZone GOLEM_ZONE = ZoneManager.getInstance().getZoneById(80030, ScriptZone.class); + private static final ScriptZone TOMBSTONE_ZONE = ZoneManager.getInstance().getZoneById(80031, ScriptZone.class); + private static final ScriptZone ANGEL_ZONE = ZoneManager.getInstance().getZoneById(80032, ScriptZone.class); + private static final ScriptZone SCARAB_ZONE = ZoneManager.getInstance().getZoneById(80033, ScriptZone.class); + private static final SkillHolder DECREASE_PDEF = new SkillHolder(18515, 1); + private static final SkillHolder SUMMON_FLAME_FLOWER = new SkillHolder(18513, 1); + private static final SkillHolder SEAL_ARCHANGEL_WRATH = new SkillHolder(16572, 1); + private static final Location DETON_MOVE = new Location(143641, -149193, -8072); + private static final Location DETON_MOVE_1 = new Location(151084, -152315, -9072); + private static final Location DETON_MOVE_2 = new Location(151618, -152823, -9064); + private static final Location DETON_MOVE_3 = new Location(153296, -145602, -11384); + private static final Location TELEPORT = new Location(153267, -148441, -11560); + private static final int ZONE_1ST_TRIGER = 24137770; + private static final int SKILL_TRIGER = 24138880; + private static Npc _deton; + private static Npc _seal_device; + protected int _count = 0; + + public StoryOfTauti() + { + super(TEMPLATE_ID); + addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL); + addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL); + addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL); + addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE); + addFirstTalkId(DETON); + addEnterZoneId(FLAME_FLOWER_ZONE.getId(), START_ZONE.getId(), SCORPION_ZONE.getId(), GOLEM_ZONE.getId(), TOMBSTONE_ZONE.getId(), ANGEL_ZONE.getId(), SCARAB_ZONE.getId()); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + final Instance world = npc.getInstanceWorld(); + switch (event) + { + case "start_story": + { + player.standUp(); + enterInstance(player, null, TEMPLATE_ID); + final Party party = player.getParty(); + if (party != null) + { + final Instance instance = player.getInstanceWorld(); + for (PlayerInstance member : party.getMembers()) + { + if (member != player) + { + member.standUp(); + member.teleToLocation(player, instance); + instance.addPlayer(member); + instance.addAllowed(member); + } + } + instance.setReenterTime(); + } + break; + } + case "give_map": + { + if ((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) + { + if (world.isStatus(1) || world.isStatus(4)) + { + _deton.setTarget(player); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); + } + else + { + return "34170-01.html"; + } + } + break; + } + case "check_status": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + startQuestTimer("msg_1", 7000, _deton, null); + break; + } + case "msg_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW); + startQuestTimer("msg_2", 10000, _deton, null); + break; + } + case "msg_2": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE); + startQuestTimer("msg_3", 10000, _deton, null); + break; + } + case "msg_3": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME); + break; + } + case "msg_4": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE); + startQuestTimer("msg_5", 7000, _deton, null); + break; + } + case "msg_5": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE); + startQuestTimer("msg_6", 10000, _deton, null); + break; + } + case "msg_6": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE); + break; + } + case "spawn_stacato": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_1", 50000, _deton, null); + break; + } + case "spawn_stacato_1": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_2", 50000, _deton, null); + break; + } + case "spawn_stacato_2": + { + world.spawnGroup("flame_stacato"); + world.setStatus(3); + break; + } + case "check_flower": + { + if (!npc.isDead()) + { + for (final Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000)) + { + if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0)) + { + _deton.setRunning(); + addMoveToDesire(npc, nearby.getLocation(), 23); + if (npc.calculateDistance3D(nearby) < 100) + { + nearby.setCurrentHp(nearby.getCurrentHp() - 10000); + nearby.setScriptValue(1); + npc.setCurrentHp(npc.getCurrentHp() + 15000); + npc.setScriptValue(1); + startQuestTimer("reset_flower", 8000, nearby, null); + if (nearby.getCurrentHp() < 1) + { + nearby.doDie(npc); + } + } + } + } + } + break; + } + case "reset_flower": + { + npc.setScriptValue(0); + break; + } + case "msg_7": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN); + break; + } + case "spawn_scorpion": + { + world.spawnGroup("flame_scorpion"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE); + if (getRandom(10) < 5) + { + world.spawnGroup("ifrit"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IFRIT, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + break; + } + case "attack_player": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, pl -> + { + if ((pl != null) && !pl.isDead()) + { + _deton.setRunning(); + addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23); + addAttackPlayerDesire(npc, pl); + } + if (!npc.isDead() && !npc.isInCombat()) + { + startQuestTimer("attack_player", 5000, npc, pl); + } + }); + break; + } + case "msg_8": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS); + startQuestTimer("msg_9", 8000, _deton, null); + break; + } + case "msg_9": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY); + startQuestTimer("msg_10", 10000, _deton, null); + break; + } + case "msg_10": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING); + break; + } + case "spawn_golem": + { + world.spawnGroup("golem"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away", 10000, _deton, null); + break; + } + case "run_away": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 3500, _deton, null); + break; + } + case "delete_daton": + { + world.despawnGroup("general"); + world.spawnGroup("seal_tmbstone"); + break; + } + case "msg_11": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST); + break; + } + case "msg_12": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA); + startQuestTimer("msg_13", 9000, _deton, null); + break; + } + case "msg_13": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA); + break; + } + case "spawn_scarab": + { + world.spawnGroup("flame_scarab"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away_1", 8000, _deton, null); + break; + } + case "run_away_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 5000, _deton, null); + break; + } + case "switch_quest": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(6)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(7, true); + } + } + } + } + } + }); + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, true)); + break; + } + case "angel_msg": + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_STUPID_IGNORANCE_IS_A_SIN_I_LL_LET_YOU_GO_THIS_ONE_TIME_GO); + world.despawnGroup("seal_tmbstone"); + break; + } + case "angel_teleport": + { + npc.teleToLocation(TELEPORT, world); + startQuestTimer("angel_triger", 2000, npc, player); + break; + } + case "angel_triger": + { + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, false)); + world.spawnGroup("singl_angel"); + startQuestTimer("triger", 3000, npc, player); + break; + } + case "triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, true)); + startQuestTimer("end_triger", 12000, npc, player); + startQuestTimer("clone_1", 1000, npc, player); + world.despawnGroup("seal_arngels"); + break; + } + case "clone_1": + { + world.spawnGroup("clone_1"); + startQuestTimer("clone_2", 500, npc, player); + break; + } + case "clone_2": + { + world.spawnGroup("clone_2"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_3", 500, npc, player); + } + break; + } + case "clone_3": + { + world.spawnGroup("clone_3"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_4", 500, npc, player); + } + break; + } + case "clone_4": + { + world.spawnGroup("clone_4"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_5", 500, npc, player); + } + break; + } + case "clone_5": + { + world.spawnGroup("clone_5"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_6", 500, npc, player); + } + break; + } + case "clone_6": + { + world.spawnGroup("clone_6"); + startQuestTimer("clone_7", 500, npc, player); + break; + } + case "clone_7": + { + world.spawnGroup("clone_7"); + break; + } + case "clone_player": + { + npc.setCloneObjId(player.getObjectId()); + if ((npc.getCloneObjId() == player.getObjectId()) && !player.getEffectList().hasAbnormalVisualEffect(AbnormalVisualEffect.STUN)) + { + player.teleToLocation(npc.getLocation(), world); + player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.STUN); + if ((player.getClan() != null) && (player.getClanCrestId() != 0)) + { + npc.setClanId(player.getClanId()); + } + npc.broadcastStatusUpdate(); + } + npc.setScriptValue(1); + startQuestTimer("clear_player", 12000, npc, player); + break; + } + case "end_triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, false)); + break; + } + case "clear_player": + { + player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STUN); + break; + } + case "end_instance": + { + cancelQuestTimers("check_flower"); + _count = 0; + for (Npc n : world.getAliveNpcs()) + { + n.deleteMe(); + } + world.finishInstance(0); + break; + } + } + return null; + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case SEAL_TOMBSTONE: + { + if (npc.isScriptValue(0)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW); + npc.setScriptValue(1); + break; + } + if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60)) + { + _seal_device.setDisplayEffect(1); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE); + npc.setScriptValue(2); + break; + } + if (npc.isScriptValue(2) && (npc.getCurrentHpPercent() < 40)) + { + if (getRandom(10) < 5) + { + world.spawnGroup("arimanes"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ARIMANES, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + npc.setScriptValue(3); + break; + } + if (npc.isScriptValue(3) && (npc.getCurrentHpPercent() < 20)) + { + _seal_device.setDisplayEffect(2); + npc.setScriptValue(4); + break; + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(9) && npc.isScriptValue(0)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_NOT_LUST_AFTER_WHAT_S_SEALED_HERE_IT_IS_NOT_YOURS); + startQuestTimer("angel_msg", 6000, npc, null); + startQuestTimer("switch_quest", 1000, npc, attacker); + npc.setScriptValue(1); + } + if (world.isStatus(9) && (npc.getCurrentHpPercent() < 50)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_MUST_REMAIN_SEALED_HERE); + startQuestTimer("angel_teleport", 3000, npc, attacker); + world.setStatus(10); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + } + if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30)) + { + world.spawnGroup("last_deton"); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3); + startQuestTimer("msg_12", 6000, _deton, null); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME); + world.setStatus(11); + } + if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5)) + { + npc.setIsInvul(true); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + world.setStatus(12); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(7)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(8, true); + } + } + } + } + } + }); + startQuestTimer("end_instance", 52000, _deton, null); + world.despawnGroup("last_deton"); + world.despawnGroup("last_archagel"); + playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE); + npc.deleteMe(); + } + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_STACATO: + { + if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty()) + { + cancelQuestTimers("end_instance"); + cancelQuestTimers("check_flower"); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME))); + world.setStatus(4); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL); + startQuestTimer("msg_7", 7000, _deton, null); + } + break; + } + case FLAME_SCORPION: + { + if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("msg_8", 3000, _deton, null); + world.setStatus(6); + } + break; + } + case SEAL_TOMBSTONE: + { + _seal_device.setDisplayEffect(3); + _seal_device.doDie(npc); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2); + startQuestTimer("msg_11", 3000, _deton, null); + break; + } + case SEALED_ANGEL: + { + world.spawnGroup("last_archagel"); + world.openCloseDoor(world.getTemplateParameters().getInt("1_door"), true); + break; + } + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + final Instance world = creature.getInstanceWorld(); + final PlayerInstance player = creature.getActingPlayer(); + if (isInInstance(world)) + { + switch (zone.getId()) + { + case 80027: + { + if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1)) + { + world.setStatus(2); + _deton.setTarget(null); + _deton.stopMove(null); + startQuestTimer("msg_4", 7000, _deton, null); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME))); + startQuestTimer("end_instance", 190000, _deton, null); + startQuestTimer("spawn_stacato", 5000, _deton, null); + } + break; + } + case 80028: + { + if (world.isStatus(0)) + { + startQuestTimer("check_status", 21000, _deton, player); + world.setStatus(1); + } + break; + } + case 80029: + { + if (world.isStatus(4)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING); + startQuestTimer("spawn_scorpion", 5000, _deton, player); + world.setStatus(5); + } + break; + } + case 80030: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY); + startQuestTimer("spawn_golem", 7000, _deton, player); + world.setStatus(7); + } + break; + } + case 80031: + { + if (world.isStatus(7)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_SEALED_TABLET_HUH, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.setStatus(8); + } + break; + } + case 80032: + { + if (world.isStatus(8)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THERE_S_NO_FUTURE_FOR_THOSE_WHO_CANNOT_WIN_AGAINST_THEMSELVES, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.spawnGroup("seal_arngels"); + world.setStatus(9); + } + break; + } + case 80033: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT); + startQuestTimer("spawn_scarab", 7000, _deton, player); + world.setStatus(7); + } + break; + } + } + } + return super.onEnterZone(creature, zone); + + } + + @Override + public String onSpawn(Npc npc) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case DETON: + { + _deton = npc; + break; + } + case SEAL_DEVICE: + { + _seal_device = npc; + break; + } + case FLAME_FLOWER: + { + npc.setCurrentHp(npc.getMaxHp() * 0.20); + for (final Npc tombstone : World.getInstance().getVisibleObjectsInRange(npc, MonsterInstance.class, 500)) + { + if (tombstone.getId() == SEAL_TOMBSTONE) + { + npc.setTarget(tombstone); + tryToEffect(npc, tombstone, DECREASE_PDEF.getSkillId()); + } + } + break; + } + case FLAME_STACATO: + { + startQuestTimer("check_flower", 3000, npc, null, true); + break; + } + case FLAME_SCORPION: + { + startQuestTimer("attack_player", 2000, npc, null); + break; + } + case FLAME_GOLEM: + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(3, true); + } + } + } + } + } + }); + break; + } + case FLAME_SCARAB: + { + startQuestTimer("attack_player", 2000, npc, null); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(4, true); + } + } + } + } + } + }); + break; + } + case NPC_1: + { + for (final PlayerInstance nearby : World.getInstance().getVisibleObjectsInRange(npc, PlayerInstance.class, 2000)) + { + if (npc.isScriptValue(0) && (nearby != null)) + { + startQuestTimer("clone_player", 500, npc, nearby); + } + + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(10)) + { + npc.setCurrentHp(npc.getMaxHp() * 0.5); + } + break; + } + } + } + return super.onSpawn(npc); + } + + @Override + public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_FLOWER: + { + if ((world.getStatus() < 5) && (npc.getCurrentHp() == npc.getMaxHp())) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_LOOK_INSIDE_YOUR_BAG_YOU_OBTAINED_A_FLAME_FLOWER, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false, caster.getName())); + giveItems(caster, FLAME_FLOWER_BUD, 1); + npc.doDie(npc); + npc.deleteMe(); + } + break; + } + case SEAL_TOMBSTONE: + { + if (skill.getId() == SUMMON_FLAME_FLOWER.getSkillId()) + { + addSpawn(FLAME_FLOWER, caster, false, 60000, false, world.getId()); + } + break; + } + } + } + return super.onSkillSee(npc, caster, skill, targets, isSummon); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return npc.getId() + ".html"; + } + + private void tryToEffect(Npc npc, Creature character, int diseaseId) + { + final BuffInfo info = character.getEffectList().getBuffInfoBySkillId(diseaseId); + final int skillLevel = (info == null) ? 1 : (info.getSkill().getLevel() < 3) ? info.getSkill().getLevel() + 1 : 3; + final Skill skill = SkillData.getInstance().getSkill(diseaseId, skillLevel); + + if ((skill != null) && SkillCaster.checkUseConditions(npc, skill)) + { + npc.doCast(skill); + } + } + + public static void main(String[] args) + { + new StoryOfTauti(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/MissingQuests.txt b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/MissingQuests.txt index 80f9e4357a..c40b1bcfbe 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/MissingQuests.txt +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/MissingQuests.txt @@ -20,7 +20,6 @@ 789 Waiting for Pa'agrio 816 Plans to Repair the Stronghold 824 Attack the Command Post -833 Devil's Treasure, Tauti 834 Against Dragonclaw 10352 Legacy of Cruma Tower 10357 Altar of Blood that Awakens Destruction diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html new file mode 100644 index 0000000000..d88c3f725f --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html @@ -0,0 +1,6 @@ +Mystic Tavern Owner Settlen:
+Oh, you must have heard Tauti's story!
+I was so shocked when I first heard about Tauti's story. To think that Deton tried to take axe and ended up turning into that...
+Anyway, I told you our stories are very interesting.
+ + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html new file mode 100644 index 0000000000..177a8a9510 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+Anyway, thank you for listening to our stories. Here's a small gift for you.
+Please come by often and let's all have a great time again. + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html new file mode 100644 index 0000000000..1a8f732647 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+The most interesting still ahead, and you want to leave?
+Just think about our employees who are trying for you. Please listen to the story to the end + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java new file mode 100644 index 0000000000..4100e10d37 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java @@ -0,0 +1,224 @@ +/* + * 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 quests.Q00833_DevilsTreasureTauti; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.enums.QuestType; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.quest.State; + +/** + * Devil's Treasure, Tauti (833) + * @URL https://l2wiki.com/Devil%27s_Treasure,_Tauti + * @author Gigi + */ +public class Q00833_DevilsTreasureTauti extends Quest +{ + // NPCs + private static final int DETON = 34170; + private static final int SETTLEN = 34180; + // Monsters + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + // Items + private static final int FRENZED_TAUTIS_FRAGMENT = 47884; + private static final int INSANE_KELBIMS_FRAGMENT = 47885; + private static final int SOE_MISTYC_TAVERN = 46564; + private static final int MYSTIC_ARMOR_PIACE = 46587; + private static final int FLAME_FLOWER = 46554; + + public Q00833_DevilsTreasureTauti() + { + super(833); + addStartNpc(DETON); + addTalkId(SETTLEN); + addKillId(FLAME_SCORPION, FLAME_GOLEM, FLAME_SCARAB, SEAL_TOMBSTONE); + addSeeCreatureId(DETON); + registerQuestItems(FLAME_FLOWER); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + final QuestState qs = getQuestState(player, false); + switch (event) + { + case "34180-02.html": + { + final int chance = getRandom(100); + if (chance <= 10) + { + giveItems(player, FRENZED_TAUTIS_FRAGMENT, 1); + } + else if ((chance > 10) && (chance <= 20)) + { + giveItems(player, INSANE_KELBIMS_FRAGMENT, 1); + } + else if ((chance > 20) && (chance <= 40)) + { + giveItems(player, MYSTIC_ARMOR_PIACE, 1); + } + else + { + giveItems(player, SOE_MISTYC_TAVERN, 1); + } + addExpAndSp(player, 6_362_541_900L, 15_270_101); + qs.exitQuest(QuestType.REPEATABLE, true); + htmltext = event; + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, PlayerInstance player) + { + String htmltext = getNoQuestMsg(player); + final QuestState qs = getQuestState(player, true); + + switch (qs.getState()) + { + case State.STARTED: + { + htmltext = (qs.isCond(8)) ? "34180-01.html" : "34180-03.html"; + } + } + return htmltext; + } + + @Override + public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) + { + final PlayerInstance player = creature.getActingPlayer(); + if (player != null) + { + final QuestState qs = getQuestState(player, true); + if (!qs.isStarted()) + { + playMovie(player, Movie.EPIC_TAUTI_SLIDE); + qs.startQuest(); + } + } + return super.onSeeCreature(npc, creature, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + Party party = killer.getParty(); + if (party != null) + { + party.getMembers().forEach(p -> onKill(npc, p)); + } + else + { + onKill(npc, killer); + } + return super.onKill(npc, killer, isSummon); + } + + private void onKill(Npc npc, PlayerInstance killer) + { + final QuestState qs = getQuestState(killer, false); + switch (npc.getId()) + { + case FLAME_SCORPION: + { + if ((qs != null) && qs.isCond(1) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScorpion = qs.getInt("killed_" + FLAME_SCORPION); + if (killedScorpion < 5) + { + qs.set("killed_" + FLAME_SCORPION, ++killedScorpion); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScorpion >= 5) + { + qs.setCond(2, true); + } + sendNpcLogList(killer); + } + break; + } + case FLAME_GOLEM: + { + if ((qs != null) && qs.isCond(3) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(5, true); + } + break; + } + case FLAME_SCARAB: + { + if ((qs != null) && qs.isCond(4) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScarab = qs.getInt("killed_" + FLAME_SCARAB); + if (killedScarab < 5) + { + qs.set("killed_" + FLAME_SCARAB, ++killedScarab); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScarab >= 5) + { + qs.setCond(5, true); + } + sendNpcLogList(killer); + } + break; + } + case SEAL_TOMBSTONE: + { + if ((qs != null) && qs.isCond(5) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(6, true); + } + break; + } + } + } + + @Override + public Set getNpcLogList(PlayerInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs.isCond(1) || qs.isCond(4)) + { + final Set holder = new HashSet<>(2); + holder.add(new NpcLogListHolder(FLAME_SCORPION, false, qs.getInt("killed_" + FLAME_SCORPION))); + holder.add(new NpcLogListHolder(FLAME_SCARAB, false, qs.getInt("killed_" + FLAME_SCARAB))); + return holder; + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/QuestMasterHandler.java index fbd50eee9e..25f3f44c12 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -222,6 +222,7 @@ import quests.Q00828_EvasBlessing.Q00828_EvasBlessing; import quests.Q00829_MaphrsSalvation.Q00829_MaphrsSalvation; import quests.Q00830_TheWayOfTheGiantsPawn.Q00830_TheWayOfTheGiantsPawn; import quests.Q00831_SayhasScheme.Q00831_SayhasScheme; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; import quests.Q00835_PitiableMelisa.Q00835_PitiableMelisa; import quests.Q00901_HowLavasaurusesAreMade.Q00901_HowLavasaurusesAreMade; import quests.Q00902_ReclaimOurEra.Q00902_ReclaimOurEra; @@ -762,6 +763,7 @@ public class QuestMasterHandler Q00829_MaphrsSalvation.class, Q00830_TheWayOfTheGiantsPawn.class, Q00831_SayhasScheme.class, + Q00833_DevilsTreasureTauti.class, Q00835_PitiableMelisa.class, Q00901_HowLavasaurusesAreMade.class, Q00902_ReclaimOurEra.class, diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/19600-19699.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/19600-19699.xml index 5e46ed4ec3..df1ded1a23 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/19600-19699.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/19600-19699.xml @@ -119,7 +119,7 @@ - + HUMAN FEMALE @@ -130,24 +130,24 @@ - + - - - HUMAN - FEMALE + + ETC - + + + - + @@ -164,7 +164,7 @@ - + diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/16500-16599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/16500-16599.xml index efee65621a..12c96b9eb0 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/16500-16599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/16500-16599.xml @@ -99,7 +99,6 @@ icon.skill0096 A2 10 - 40 3000 30000 -100 @@ -134,7 +133,7 @@ A2 10 500 - 2000 + 3000 30000 1 true @@ -144,8 +143,7 @@ icon.skill11066 A2 10 - 350 - 2500 + 3700 800 true 15000 @@ -694,20 +692,39 @@ icon.skill11276 - A1 + 1 + 1 + A2 900 600000 300000 -707 + 2 true + TARGET + SINGLE icon.skill4111 + 1 + 3 + STUN + STUN A2 400 -100 + 10-10 true + 0;0;80;300 + SELF + FAN_PB + NOT_FRIEND + + + 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 + + diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/18500-18599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/18500-18599.xml index fad561c601..b6d3ebcdf7 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/18500-18599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/18500-18599.xml @@ -123,9 +123,16 @@ 500 + icon.skill0000 + 1 + 46554 A1 1500 3000 + 5 + 0 + SELF + SINGLE @@ -137,12 +144,41 @@ 5000 - + + + icon.skill1042 + 5 + 60 + PD_DOWN A2 - 500 + 600 -692 true + TARGET + SINGLE + + + + -10 + -30 + -50 + + PER + + + + -10 + -30 + -50 + + PER + + + 16571 + 1 + + diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/zones/custom_script.xml b/L2J_Mobius_2.5_Underground/dist/game/data/zones/custom_script.xml index 1b41b7764d..45a359eaaa 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/zones/custom_script.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/zones/custom_script.xml @@ -1131,4 +1131,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/instances/MysticTavern/StoryOfTauti.xml b/L2J_Mobius_3.0_Helios/dist/game/data/instances/MysticTavern/StoryOfTauti.xml new file mode 100644 index 0000000000..e8d0ac86b2 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/instances/MysticTavern/StoryOfTauti.xml @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java index f0f803c31c..d68fbb30b6 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.PlaySound; import ai.AbstractNpcAI; import instances.MysticTavern.StoryOfFreya.StoryOfFreya; +import instances.MysticTavern.StoryOfTauti.StoryOfTauti; import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub; /** @@ -57,7 +58,7 @@ public class MysticTavern extends AbstractNpcAI private static final int LUPIA = 34185; private static final int MEY = 34186; // Instances - // private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_KELBIM = 262; private static final int INSTANCE_FREYA = 263; // Zones @@ -105,7 +106,7 @@ public class MysticTavern extends AbstractNpcAI } final List availableInstances = new ArrayList<>(); availableInstances.add(INSTANCE_FREYA); - // availableInstances.add(INSTANCE_TAUTI); + availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_KELBIM); for (PlayerInstance member : party.getMembers()) { @@ -132,16 +133,16 @@ public class MysticTavern extends AbstractNpcAI } } } - // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) - // { - // for (int i = 0; i < availableInstances.size(); i++) - // { - // if (availableInstances.get(i) == INSTANCE_TAUTI) - // { - // availableInstances.remove(i); - // } - // } - // } + if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) + { + for (int i = 0; i < availableInstances.size(); i++) + { + if (availableInstances.get(i) == INSTANCE_TAUTI) + { + availableInstances.remove(i); + } + } + } // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_KELBIM) > 0) // { // for (int i = 0; i < availableInstances.size(); i++) @@ -160,7 +161,6 @@ public class MysticTavern extends AbstractNpcAI npc.setScriptValue(getRandom(availableInstances.size())); startQuestTimer("npcRoute", 3000, npc, player); } - startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test break; } case "npcRoute": @@ -333,11 +333,11 @@ public class MysticTavern extends AbstractNpcAI player.processQuestEvent(StoryOfFreya.class.getSimpleName(), "start_story"); break; } - // case INSTANCE_TAUTI: - // { - // player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); - // break; - // } + case INSTANCE_TAUTI: + { + player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); + break; + } // case INSTANCE_KELBIM: // { // player.processQuestEvent(StoryOfKelbim.class.getSimpleName(), "start_story"); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html new file mode 100644 index 0000000000..39c376f9e3 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html @@ -0,0 +1,3 @@ +Archaeologist Deton:
+What do you want? I'm busy right now. Come back later. + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html new file mode 100644 index 0000000000..0bcdd62f25 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html @@ -0,0 +1,5 @@ +Archaeologist Deton:
+Hmm, where are we?
+I should take a look at the map again...
+ + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java new file mode 100644 index 0000000000..15f0c319b2 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java @@ -0,0 +1,943 @@ +/* + * 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.MysticTavern.StoryOfTauti; + +import java.util.List; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.enums.ChatType; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.instancemanager.QuestManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.World; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; +import org.l2jmobius.gameserver.model.skills.BuffInfo; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.ScriptZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; +import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger; + +import instances.AbstractInstance; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; + +/** + * Mystic Tavern Tauti Instance + * @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk + * @author Gigi + */ +public class StoryOfTauti extends AbstractInstance +{ + // NPC + private static final int DETON = 34170; + private static final int FLAME_FLOWER = 19606; + private static final int SEAL_DEVICE = 19608; + // Monsters + private static final int FLAME_STACATO = 23681; + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + private static final int SEAL_ARCHANGEL = 23683; + private static final int SEALED_ANGEL = 23685; + private static final int NPC_1 = 19626; + // Item + private static final int FLAME_FLOWER_BUD = 46554; + // Misc + private static final int TEMPLATE_ID = 261; + private static final ScriptZone FLAME_FLOWER_ZONE = ZoneManager.getInstance().getZoneById(80027, ScriptZone.class); + private static final ScriptZone START_ZONE = ZoneManager.getInstance().getZoneById(80028, ScriptZone.class); + private static final ScriptZone SCORPION_ZONE = ZoneManager.getInstance().getZoneById(80029, ScriptZone.class); + private static final ScriptZone GOLEM_ZONE = ZoneManager.getInstance().getZoneById(80030, ScriptZone.class); + private static final ScriptZone TOMBSTONE_ZONE = ZoneManager.getInstance().getZoneById(80031, ScriptZone.class); + private static final ScriptZone ANGEL_ZONE = ZoneManager.getInstance().getZoneById(80032, ScriptZone.class); + private static final ScriptZone SCARAB_ZONE = ZoneManager.getInstance().getZoneById(80033, ScriptZone.class); + private static final SkillHolder DECREASE_PDEF = new SkillHolder(18515, 1); + private static final SkillHolder SUMMON_FLAME_FLOWER = new SkillHolder(18513, 1); + private static final SkillHolder SEAL_ARCHANGEL_WRATH = new SkillHolder(16572, 1); + private static final Location DETON_MOVE = new Location(143641, -149193, -8072); + private static final Location DETON_MOVE_1 = new Location(151084, -152315, -9072); + private static final Location DETON_MOVE_2 = new Location(151618, -152823, -9064); + private static final Location DETON_MOVE_3 = new Location(153296, -145602, -11384); + private static final Location TELEPORT = new Location(153267, -148441, -11560); + private static final int ZONE_1ST_TRIGER = 24137770; + private static final int SKILL_TRIGER = 24138880; + private static Npc _deton; + private static Npc _seal_device; + protected int _count = 0; + + public StoryOfTauti() + { + super(TEMPLATE_ID); + addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL); + addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL); + addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL); + addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE); + addFirstTalkId(DETON); + addEnterZoneId(FLAME_FLOWER_ZONE.getId(), START_ZONE.getId(), SCORPION_ZONE.getId(), GOLEM_ZONE.getId(), TOMBSTONE_ZONE.getId(), ANGEL_ZONE.getId(), SCARAB_ZONE.getId()); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + final Instance world = npc.getInstanceWorld(); + switch (event) + { + case "start_story": + { + player.standUp(); + enterInstance(player, null, TEMPLATE_ID); + final Party party = player.getParty(); + if (party != null) + { + final Instance instance = player.getInstanceWorld(); + for (PlayerInstance member : party.getMembers()) + { + if (member != player) + { + member.standUp(); + member.teleToLocation(player, instance); + instance.addPlayer(member); + instance.addAllowed(member); + } + } + instance.setReenterTime(); + } + break; + } + case "give_map": + { + if ((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) + { + if (world.isStatus(1) || world.isStatus(4)) + { + _deton.setTarget(player); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); + } + else + { + return "34170-01.html"; + } + } + break; + } + case "check_status": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + startQuestTimer("msg_1", 7000, _deton, null); + break; + } + case "msg_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW); + startQuestTimer("msg_2", 10000, _deton, null); + break; + } + case "msg_2": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE); + startQuestTimer("msg_3", 10000, _deton, null); + break; + } + case "msg_3": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME); + break; + } + case "msg_4": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE); + startQuestTimer("msg_5", 7000, _deton, null); + break; + } + case "msg_5": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE); + startQuestTimer("msg_6", 10000, _deton, null); + break; + } + case "msg_6": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE); + break; + } + case "spawn_stacato": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_1", 50000, _deton, null); + break; + } + case "spawn_stacato_1": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_2", 50000, _deton, null); + break; + } + case "spawn_stacato_2": + { + world.spawnGroup("flame_stacato"); + world.setStatus(3); + break; + } + case "check_flower": + { + if (!npc.isDead()) + { + for (final Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000)) + { + if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0)) + { + _deton.setRunning(); + addMoveToDesire(npc, nearby.getLocation(), 23); + if (npc.calculateDistance3D(nearby) < 100) + { + nearby.setCurrentHp(nearby.getCurrentHp() - 10000); + nearby.setScriptValue(1); + npc.setCurrentHp(npc.getCurrentHp() + 15000); + npc.setScriptValue(1); + startQuestTimer("reset_flower", 8000, nearby, null); + if (nearby.getCurrentHp() < 1) + { + nearby.doDie(npc); + } + } + } + } + } + break; + } + case "reset_flower": + { + npc.setScriptValue(0); + break; + } + case "msg_7": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN); + break; + } + case "spawn_scorpion": + { + world.spawnGroup("flame_scorpion"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE); + if (getRandom(10) < 5) + { + world.spawnGroup("ifrit"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IFRIT, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + break; + } + case "attack_player": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, pl -> + { + if ((pl != null) && !pl.isDead()) + { + _deton.setRunning(); + addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23); + addAttackPlayerDesire(npc, pl); + } + if (!npc.isDead() && !npc.isInCombat()) + { + startQuestTimer("attack_player", 5000, npc, pl); + } + }); + break; + } + case "msg_8": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS); + startQuestTimer("msg_9", 8000, _deton, null); + break; + } + case "msg_9": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY); + startQuestTimer("msg_10", 10000, _deton, null); + break; + } + case "msg_10": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING); + break; + } + case "spawn_golem": + { + world.spawnGroup("golem"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away", 10000, _deton, null); + break; + } + case "run_away": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 3500, _deton, null); + break; + } + case "delete_daton": + { + world.despawnGroup("general"); + world.spawnGroup("seal_tmbstone"); + break; + } + case "msg_11": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST); + break; + } + case "msg_12": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA); + startQuestTimer("msg_13", 9000, _deton, null); + break; + } + case "msg_13": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA); + break; + } + case "spawn_scarab": + { + world.spawnGroup("flame_scarab"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away_1", 8000, _deton, null); + break; + } + case "run_away_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 5000, _deton, null); + break; + } + case "switch_quest": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(6)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(7, true); + } + } + } + } + } + }); + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, true)); + break; + } + case "angel_msg": + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_STUPID_IGNORANCE_IS_A_SIN_I_LL_LET_YOU_GO_THIS_ONE_TIME_GO); + world.despawnGroup("seal_tmbstone"); + break; + } + case "angel_teleport": + { + npc.teleToLocation(TELEPORT, world); + startQuestTimer("angel_triger", 2000, npc, player); + break; + } + case "angel_triger": + { + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, false)); + world.spawnGroup("singl_angel"); + startQuestTimer("triger", 3000, npc, player); + break; + } + case "triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, true)); + startQuestTimer("end_triger", 12000, npc, player); + startQuestTimer("clone_1", 1000, npc, player); + world.despawnGroup("seal_arngels"); + break; + } + case "clone_1": + { + world.spawnGroup("clone_1"); + startQuestTimer("clone_2", 500, npc, player); + break; + } + case "clone_2": + { + world.spawnGroup("clone_2"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_3", 500, npc, player); + } + break; + } + case "clone_3": + { + world.spawnGroup("clone_3"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_4", 500, npc, player); + } + break; + } + case "clone_4": + { + world.spawnGroup("clone_4"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_5", 500, npc, player); + } + break; + } + case "clone_5": + { + world.spawnGroup("clone_5"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_6", 500, npc, player); + } + break; + } + case "clone_6": + { + world.spawnGroup("clone_6"); + startQuestTimer("clone_7", 500, npc, player); + break; + } + case "clone_7": + { + world.spawnGroup("clone_7"); + break; + } + case "clone_player": + { + npc.setCloneObjId(player.getObjectId()); + if ((npc.getCloneObjId() == player.getObjectId()) && !player.getEffectList().hasAbnormalVisualEffect(AbnormalVisualEffect.STUN)) + { + player.teleToLocation(npc.getLocation(), world); + player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.STUN); + if ((player.getClan() != null) && (player.getClanCrestId() != 0)) + { + npc.setClanId(player.getClanId()); + } + npc.broadcastStatusUpdate(); + } + npc.setScriptValue(1); + startQuestTimer("clear_player", 12000, npc, player); + break; + } + case "end_triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, false)); + break; + } + case "clear_player": + { + player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STUN); + break; + } + case "end_instance": + { + cancelQuestTimers("check_flower"); + _count = 0; + for (Npc n : world.getAliveNpcs()) + { + n.deleteMe(); + } + world.finishInstance(0); + break; + } + } + return null; + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case SEAL_TOMBSTONE: + { + if (npc.isScriptValue(0)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW); + npc.setScriptValue(1); + break; + } + if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60)) + { + _seal_device.setDisplayEffect(1); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE); + npc.setScriptValue(2); + break; + } + if (npc.isScriptValue(2) && (npc.getCurrentHpPercent() < 40)) + { + if (getRandom(10) < 5) + { + world.spawnGroup("arimanes"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ARIMANES, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + npc.setScriptValue(3); + break; + } + if (npc.isScriptValue(3) && (npc.getCurrentHpPercent() < 20)) + { + _seal_device.setDisplayEffect(2); + npc.setScriptValue(4); + break; + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(9) && npc.isScriptValue(0)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_NOT_LUST_AFTER_WHAT_S_SEALED_HERE_IT_IS_NOT_YOURS); + startQuestTimer("angel_msg", 6000, npc, null); + startQuestTimer("switch_quest", 1000, npc, attacker); + npc.setScriptValue(1); + } + if (world.isStatus(9) && (npc.getCurrentHpPercent() < 50)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_MUST_REMAIN_SEALED_HERE); + startQuestTimer("angel_teleport", 3000, npc, attacker); + world.setStatus(10); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + } + if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30)) + { + world.spawnGroup("last_deton"); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3); + startQuestTimer("msg_12", 6000, _deton, null); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME); + world.setStatus(11); + } + if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5)) + { + npc.setIsInvul(true); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + world.setStatus(12); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(7)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(8, true); + } + } + } + } + } + }); + startQuestTimer("end_instance", 52000, _deton, null); + world.despawnGroup("last_deton"); + world.despawnGroup("last_archagel"); + playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE); + npc.deleteMe(); + } + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_STACATO: + { + if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty()) + { + cancelQuestTimers("end_instance"); + cancelQuestTimers("check_flower"); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME))); + world.setStatus(4); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL); + startQuestTimer("msg_7", 7000, _deton, null); + } + break; + } + case FLAME_SCORPION: + { + if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("msg_8", 3000, _deton, null); + world.setStatus(6); + } + break; + } + case SEAL_TOMBSTONE: + { + _seal_device.setDisplayEffect(3); + _seal_device.doDie(npc); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2); + startQuestTimer("msg_11", 3000, _deton, null); + break; + } + case SEALED_ANGEL: + { + world.spawnGroup("last_archagel"); + world.openCloseDoor(world.getTemplateParameters().getInt("1_door"), true); + break; + } + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + final Instance world = creature.getInstanceWorld(); + final PlayerInstance player = creature.getActingPlayer(); + if (isInInstance(world)) + { + switch (zone.getId()) + { + case 80027: + { + if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1)) + { + world.setStatus(2); + _deton.setTarget(null); + _deton.stopMove(null); + startQuestTimer("msg_4", 7000, _deton, null); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME))); + startQuestTimer("end_instance", 190000, _deton, null); + startQuestTimer("spawn_stacato", 5000, _deton, null); + } + break; + } + case 80028: + { + if (world.isStatus(0)) + { + startQuestTimer("check_status", 21000, _deton, player); + world.setStatus(1); + } + break; + } + case 80029: + { + if (world.isStatus(4)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING); + startQuestTimer("spawn_scorpion", 5000, _deton, player); + world.setStatus(5); + } + break; + } + case 80030: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY); + startQuestTimer("spawn_golem", 7000, _deton, player); + world.setStatus(7); + } + break; + } + case 80031: + { + if (world.isStatus(7)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_SEALED_TABLET_HUH, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.setStatus(8); + } + break; + } + case 80032: + { + if (world.isStatus(8)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THERE_S_NO_FUTURE_FOR_THOSE_WHO_CANNOT_WIN_AGAINST_THEMSELVES, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.spawnGroup("seal_arngels"); + world.setStatus(9); + } + break; + } + case 80033: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT); + startQuestTimer("spawn_scarab", 7000, _deton, player); + world.setStatus(7); + } + break; + } + } + } + return super.onEnterZone(creature, zone); + + } + + @Override + public String onSpawn(Npc npc) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case DETON: + { + _deton = npc; + break; + } + case SEAL_DEVICE: + { + _seal_device = npc; + break; + } + case FLAME_FLOWER: + { + npc.setCurrentHp(npc.getMaxHp() * 0.20); + for (final Npc tombstone : World.getInstance().getVisibleObjectsInRange(npc, MonsterInstance.class, 500)) + { + if (tombstone.getId() == SEAL_TOMBSTONE) + { + npc.setTarget(tombstone); + tryToEffect(npc, tombstone, DECREASE_PDEF.getSkillId()); + } + } + break; + } + case FLAME_STACATO: + { + startQuestTimer("check_flower", 3000, npc, null, true); + break; + } + case FLAME_SCORPION: + { + startQuestTimer("attack_player", 2000, npc, null); + break; + } + case FLAME_GOLEM: + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(3, true); + } + } + } + } + } + }); + break; + } + case FLAME_SCARAB: + { + startQuestTimer("attack_player", 2000, npc, null); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(4, true); + } + } + } + } + } + }); + break; + } + case NPC_1: + { + for (final PlayerInstance nearby : World.getInstance().getVisibleObjectsInRange(npc, PlayerInstance.class, 2000)) + { + if (npc.isScriptValue(0) && (nearby != null)) + { + startQuestTimer("clone_player", 500, npc, nearby); + } + + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(10)) + { + npc.setCurrentHp(npc.getMaxHp() * 0.5); + } + break; + } + } + } + return super.onSpawn(npc); + } + + @Override + public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_FLOWER: + { + if ((world.getStatus() < 5) && (npc.getCurrentHp() == npc.getMaxHp())) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_LOOK_INSIDE_YOUR_BAG_YOU_OBTAINED_A_FLAME_FLOWER, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false, caster.getName())); + giveItems(caster, FLAME_FLOWER_BUD, 1); + npc.doDie(npc); + npc.deleteMe(); + } + break; + } + case SEAL_TOMBSTONE: + { + if (skill.getId() == SUMMON_FLAME_FLOWER.getSkillId()) + { + addSpawn(FLAME_FLOWER, caster, false, 60000, false, world.getId()); + } + break; + } + } + } + return super.onSkillSee(npc, caster, skill, targets, isSummon); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return npc.getId() + ".html"; + } + + private void tryToEffect(Npc npc, Creature character, int diseaseId) + { + final BuffInfo info = character.getEffectList().getBuffInfoBySkillId(diseaseId); + final int skillLevel = (info == null) ? 1 : (info.getSkill().getLevel() < 3) ? info.getSkill().getLevel() + 1 : 3; + final Skill skill = SkillData.getInstance().getSkill(diseaseId, skillLevel); + + if ((skill != null) && SkillCaster.checkUseConditions(npc, skill)) + { + npc.doCast(skill); + } + } + + public static void main(String[] args) + { + new StoryOfTauti(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/MissingQuests.txt b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/MissingQuests.txt index 1a7ecb3dc0..e48395140b 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/MissingQuests.txt +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/MissingQuests.txt @@ -31,7 +31,6 @@ 824 Attack the Command Post 825 Hunter Guild Request - Valley of Saints 832 Hunter Guild Request - Southern Region, Isle of Prayer -833 Devil's Treasure, Tauti 834 Against Dragonclaw 836 Request from the Blackbird Clan 837 Request from the Giant Trackers diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html new file mode 100644 index 0000000000..d88c3f725f --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html @@ -0,0 +1,6 @@ +Mystic Tavern Owner Settlen:
+Oh, you must have heard Tauti's story!
+I was so shocked when I first heard about Tauti's story. To think that Deton tried to take axe and ended up turning into that...
+Anyway, I told you our stories are very interesting.
+ + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html new file mode 100644 index 0000000000..177a8a9510 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+Anyway, thank you for listening to our stories. Here's a small gift for you.
+Please come by often and let's all have a great time again. + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html new file mode 100644 index 0000000000..1a8f732647 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+The most interesting still ahead, and you want to leave?
+Just think about our employees who are trying for you. Please listen to the story to the end + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java new file mode 100644 index 0000000000..4100e10d37 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java @@ -0,0 +1,224 @@ +/* + * 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 quests.Q00833_DevilsTreasureTauti; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.enums.QuestType; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.quest.State; + +/** + * Devil's Treasure, Tauti (833) + * @URL https://l2wiki.com/Devil%27s_Treasure,_Tauti + * @author Gigi + */ +public class Q00833_DevilsTreasureTauti extends Quest +{ + // NPCs + private static final int DETON = 34170; + private static final int SETTLEN = 34180; + // Monsters + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + // Items + private static final int FRENZED_TAUTIS_FRAGMENT = 47884; + private static final int INSANE_KELBIMS_FRAGMENT = 47885; + private static final int SOE_MISTYC_TAVERN = 46564; + private static final int MYSTIC_ARMOR_PIACE = 46587; + private static final int FLAME_FLOWER = 46554; + + public Q00833_DevilsTreasureTauti() + { + super(833); + addStartNpc(DETON); + addTalkId(SETTLEN); + addKillId(FLAME_SCORPION, FLAME_GOLEM, FLAME_SCARAB, SEAL_TOMBSTONE); + addSeeCreatureId(DETON); + registerQuestItems(FLAME_FLOWER); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + final QuestState qs = getQuestState(player, false); + switch (event) + { + case "34180-02.html": + { + final int chance = getRandom(100); + if (chance <= 10) + { + giveItems(player, FRENZED_TAUTIS_FRAGMENT, 1); + } + else if ((chance > 10) && (chance <= 20)) + { + giveItems(player, INSANE_KELBIMS_FRAGMENT, 1); + } + else if ((chance > 20) && (chance <= 40)) + { + giveItems(player, MYSTIC_ARMOR_PIACE, 1); + } + else + { + giveItems(player, SOE_MISTYC_TAVERN, 1); + } + addExpAndSp(player, 6_362_541_900L, 15_270_101); + qs.exitQuest(QuestType.REPEATABLE, true); + htmltext = event; + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, PlayerInstance player) + { + String htmltext = getNoQuestMsg(player); + final QuestState qs = getQuestState(player, true); + + switch (qs.getState()) + { + case State.STARTED: + { + htmltext = (qs.isCond(8)) ? "34180-01.html" : "34180-03.html"; + } + } + return htmltext; + } + + @Override + public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) + { + final PlayerInstance player = creature.getActingPlayer(); + if (player != null) + { + final QuestState qs = getQuestState(player, true); + if (!qs.isStarted()) + { + playMovie(player, Movie.EPIC_TAUTI_SLIDE); + qs.startQuest(); + } + } + return super.onSeeCreature(npc, creature, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + Party party = killer.getParty(); + if (party != null) + { + party.getMembers().forEach(p -> onKill(npc, p)); + } + else + { + onKill(npc, killer); + } + return super.onKill(npc, killer, isSummon); + } + + private void onKill(Npc npc, PlayerInstance killer) + { + final QuestState qs = getQuestState(killer, false); + switch (npc.getId()) + { + case FLAME_SCORPION: + { + if ((qs != null) && qs.isCond(1) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScorpion = qs.getInt("killed_" + FLAME_SCORPION); + if (killedScorpion < 5) + { + qs.set("killed_" + FLAME_SCORPION, ++killedScorpion); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScorpion >= 5) + { + qs.setCond(2, true); + } + sendNpcLogList(killer); + } + break; + } + case FLAME_GOLEM: + { + if ((qs != null) && qs.isCond(3) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(5, true); + } + break; + } + case FLAME_SCARAB: + { + if ((qs != null) && qs.isCond(4) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScarab = qs.getInt("killed_" + FLAME_SCARAB); + if (killedScarab < 5) + { + qs.set("killed_" + FLAME_SCARAB, ++killedScarab); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScarab >= 5) + { + qs.setCond(5, true); + } + sendNpcLogList(killer); + } + break; + } + case SEAL_TOMBSTONE: + { + if ((qs != null) && qs.isCond(5) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(6, true); + } + break; + } + } + } + + @Override + public Set getNpcLogList(PlayerInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs.isCond(1) || qs.isCond(4)) + { + final Set holder = new HashSet<>(2); + holder.add(new NpcLogListHolder(FLAME_SCORPION, false, qs.getInt("killed_" + FLAME_SCORPION))); + holder.add(new NpcLogListHolder(FLAME_SCARAB, false, qs.getInt("killed_" + FLAME_SCARAB))); + return holder; + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/QuestMasterHandler.java index 23fa9629e2..f358d845ee 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -193,6 +193,7 @@ import quests.Q00828_EvasBlessing.Q00828_EvasBlessing; import quests.Q00829_MaphrsSalvation.Q00829_MaphrsSalvation; import quests.Q00830_TheWayOfTheGiantsPawn.Q00830_TheWayOfTheGiantsPawn; import quests.Q00831_SayhasScheme.Q00831_SayhasScheme; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; import quests.Q00835_PitiableMelisa.Q00835_PitiableMelisa; import quests.Q00901_HowLavasaurusesAreMade.Q00901_HowLavasaurusesAreMade; import quests.Q00902_ReclaimOurEra.Q00902_ReclaimOurEra; @@ -731,6 +732,7 @@ public class QuestMasterHandler Q00829_MaphrsSalvation.class, Q00830_TheWayOfTheGiantsPawn.class, Q00831_SayhasScheme.class, + Q00833_DevilsTreasureTauti.class, Q00835_PitiableMelisa.class, Q00836_RequestFromTheBlackbirdClan.class, // TODO: Not done. Q00837_RequestFromTheGiantTrackers.class, // TODO: Not done. diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/19600-19699.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/19600-19699.xml index 2acaf78225..f5fbe8a8b9 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/19600-19699.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/19600-19699.xml @@ -119,7 +119,7 @@
- + HUMAN FEMALE @@ -130,24 +130,24 @@ - + - - - HUMAN - FEMALE + + ETC - + + + - + @@ -164,7 +164,7 @@ - + diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/16500-16599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/16500-16599.xml index ecfc5e2d68..1cc356da09 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/16500-16599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/16500-16599.xml @@ -692,20 +692,39 @@ icon.skill11276 - A1 + 1 + 1 + A2 900 600000 300000 -707 + 2 true + TARGET + SINGLE icon.skill4111 + 1 + 3 + STUN + STUN A2 400 -100 + 10-10 true + 0;0;80;300 + SELF + FAN_PB + NOT_FRIEND + + + 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 + + diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/18500-18599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/18500-18599.xml index fb83e7bac8..2522282709 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/18500-18599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/18500-18599.xml @@ -123,9 +123,16 @@ 500 + icon.skill0000 + 1 + 46554 A1 1500 3000 + 5 + 0 + SELF + SINGLE @@ -137,12 +144,41 @@ 5000 - + + + icon.skill1042 + 5 + 60 + PD_DOWN A2 - 500 + 600 -692 true + TARGET + SINGLE + + + + -10 + -30 + -50 + + PER + + + + -10 + -30 + -50 + + PER + + + 16571 + 1 + + diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/zones/custom_script.xml b/L2J_Mobius_3.0_Helios/dist/game/data/zones/custom_script.xml index 1b41b7764d..45a359eaaa 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/zones/custom_script.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/zones/custom_script.xml @@ -1131,4 +1131,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/instances/MysticTavern/StoryOfTauti.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/instances/MysticTavern/StoryOfTauti.xml new file mode 100644 index 0000000000..e8d0ac86b2 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/instances/MysticTavern/StoryOfTauti.xml @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java index f0f803c31c..d68fbb30b6 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.PlaySound; import ai.AbstractNpcAI; import instances.MysticTavern.StoryOfFreya.StoryOfFreya; +import instances.MysticTavern.StoryOfTauti.StoryOfTauti; import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub; /** @@ -57,7 +58,7 @@ public class MysticTavern extends AbstractNpcAI private static final int LUPIA = 34185; private static final int MEY = 34186; // Instances - // private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_KELBIM = 262; private static final int INSTANCE_FREYA = 263; // Zones @@ -105,7 +106,7 @@ public class MysticTavern extends AbstractNpcAI } final List availableInstances = new ArrayList<>(); availableInstances.add(INSTANCE_FREYA); - // availableInstances.add(INSTANCE_TAUTI); + availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_KELBIM); for (PlayerInstance member : party.getMembers()) { @@ -132,16 +133,16 @@ public class MysticTavern extends AbstractNpcAI } } } - // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) - // { - // for (int i = 0; i < availableInstances.size(); i++) - // { - // if (availableInstances.get(i) == INSTANCE_TAUTI) - // { - // availableInstances.remove(i); - // } - // } - // } + if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) + { + for (int i = 0; i < availableInstances.size(); i++) + { + if (availableInstances.get(i) == INSTANCE_TAUTI) + { + availableInstances.remove(i); + } + } + } // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_KELBIM) > 0) // { // for (int i = 0; i < availableInstances.size(); i++) @@ -160,7 +161,6 @@ public class MysticTavern extends AbstractNpcAI npc.setScriptValue(getRandom(availableInstances.size())); startQuestTimer("npcRoute", 3000, npc, player); } - startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test break; } case "npcRoute": @@ -333,11 +333,11 @@ public class MysticTavern extends AbstractNpcAI player.processQuestEvent(StoryOfFreya.class.getSimpleName(), "start_story"); break; } - // case INSTANCE_TAUTI: - // { - // player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); - // break; - // } + case INSTANCE_TAUTI: + { + player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); + break; + } // case INSTANCE_KELBIM: // { // player.processQuestEvent(StoryOfKelbim.class.getSimpleName(), "start_story"); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html new file mode 100644 index 0000000000..39c376f9e3 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html @@ -0,0 +1,3 @@ +Archaeologist Deton:
+What do you want? I'm busy right now. Come back later. + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html new file mode 100644 index 0000000000..0bcdd62f25 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html @@ -0,0 +1,5 @@ +Archaeologist Deton:
+Hmm, where are we?
+I should take a look at the map again...
+ + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java new file mode 100644 index 0000000000..15f0c319b2 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java @@ -0,0 +1,943 @@ +/* + * 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.MysticTavern.StoryOfTauti; + +import java.util.List; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.enums.ChatType; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.instancemanager.QuestManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.World; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; +import org.l2jmobius.gameserver.model.skills.BuffInfo; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.ScriptZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; +import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger; + +import instances.AbstractInstance; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; + +/** + * Mystic Tavern Tauti Instance + * @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk + * @author Gigi + */ +public class StoryOfTauti extends AbstractInstance +{ + // NPC + private static final int DETON = 34170; + private static final int FLAME_FLOWER = 19606; + private static final int SEAL_DEVICE = 19608; + // Monsters + private static final int FLAME_STACATO = 23681; + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + private static final int SEAL_ARCHANGEL = 23683; + private static final int SEALED_ANGEL = 23685; + private static final int NPC_1 = 19626; + // Item + private static final int FLAME_FLOWER_BUD = 46554; + // Misc + private static final int TEMPLATE_ID = 261; + private static final ScriptZone FLAME_FLOWER_ZONE = ZoneManager.getInstance().getZoneById(80027, ScriptZone.class); + private static final ScriptZone START_ZONE = ZoneManager.getInstance().getZoneById(80028, ScriptZone.class); + private static final ScriptZone SCORPION_ZONE = ZoneManager.getInstance().getZoneById(80029, ScriptZone.class); + private static final ScriptZone GOLEM_ZONE = ZoneManager.getInstance().getZoneById(80030, ScriptZone.class); + private static final ScriptZone TOMBSTONE_ZONE = ZoneManager.getInstance().getZoneById(80031, ScriptZone.class); + private static final ScriptZone ANGEL_ZONE = ZoneManager.getInstance().getZoneById(80032, ScriptZone.class); + private static final ScriptZone SCARAB_ZONE = ZoneManager.getInstance().getZoneById(80033, ScriptZone.class); + private static final SkillHolder DECREASE_PDEF = new SkillHolder(18515, 1); + private static final SkillHolder SUMMON_FLAME_FLOWER = new SkillHolder(18513, 1); + private static final SkillHolder SEAL_ARCHANGEL_WRATH = new SkillHolder(16572, 1); + private static final Location DETON_MOVE = new Location(143641, -149193, -8072); + private static final Location DETON_MOVE_1 = new Location(151084, -152315, -9072); + private static final Location DETON_MOVE_2 = new Location(151618, -152823, -9064); + private static final Location DETON_MOVE_3 = new Location(153296, -145602, -11384); + private static final Location TELEPORT = new Location(153267, -148441, -11560); + private static final int ZONE_1ST_TRIGER = 24137770; + private static final int SKILL_TRIGER = 24138880; + private static Npc _deton; + private static Npc _seal_device; + protected int _count = 0; + + public StoryOfTauti() + { + super(TEMPLATE_ID); + addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL); + addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL); + addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL); + addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE); + addFirstTalkId(DETON); + addEnterZoneId(FLAME_FLOWER_ZONE.getId(), START_ZONE.getId(), SCORPION_ZONE.getId(), GOLEM_ZONE.getId(), TOMBSTONE_ZONE.getId(), ANGEL_ZONE.getId(), SCARAB_ZONE.getId()); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + final Instance world = npc.getInstanceWorld(); + switch (event) + { + case "start_story": + { + player.standUp(); + enterInstance(player, null, TEMPLATE_ID); + final Party party = player.getParty(); + if (party != null) + { + final Instance instance = player.getInstanceWorld(); + for (PlayerInstance member : party.getMembers()) + { + if (member != player) + { + member.standUp(); + member.teleToLocation(player, instance); + instance.addPlayer(member); + instance.addAllowed(member); + } + } + instance.setReenterTime(); + } + break; + } + case "give_map": + { + if ((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) + { + if (world.isStatus(1) || world.isStatus(4)) + { + _deton.setTarget(player); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); + } + else + { + return "34170-01.html"; + } + } + break; + } + case "check_status": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + startQuestTimer("msg_1", 7000, _deton, null); + break; + } + case "msg_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW); + startQuestTimer("msg_2", 10000, _deton, null); + break; + } + case "msg_2": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE); + startQuestTimer("msg_3", 10000, _deton, null); + break; + } + case "msg_3": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME); + break; + } + case "msg_4": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE); + startQuestTimer("msg_5", 7000, _deton, null); + break; + } + case "msg_5": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE); + startQuestTimer("msg_6", 10000, _deton, null); + break; + } + case "msg_6": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE); + break; + } + case "spawn_stacato": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_1", 50000, _deton, null); + break; + } + case "spawn_stacato_1": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_2", 50000, _deton, null); + break; + } + case "spawn_stacato_2": + { + world.spawnGroup("flame_stacato"); + world.setStatus(3); + break; + } + case "check_flower": + { + if (!npc.isDead()) + { + for (final Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000)) + { + if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0)) + { + _deton.setRunning(); + addMoveToDesire(npc, nearby.getLocation(), 23); + if (npc.calculateDistance3D(nearby) < 100) + { + nearby.setCurrentHp(nearby.getCurrentHp() - 10000); + nearby.setScriptValue(1); + npc.setCurrentHp(npc.getCurrentHp() + 15000); + npc.setScriptValue(1); + startQuestTimer("reset_flower", 8000, nearby, null); + if (nearby.getCurrentHp() < 1) + { + nearby.doDie(npc); + } + } + } + } + } + break; + } + case "reset_flower": + { + npc.setScriptValue(0); + break; + } + case "msg_7": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN); + break; + } + case "spawn_scorpion": + { + world.spawnGroup("flame_scorpion"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE); + if (getRandom(10) < 5) + { + world.spawnGroup("ifrit"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IFRIT, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + break; + } + case "attack_player": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, pl -> + { + if ((pl != null) && !pl.isDead()) + { + _deton.setRunning(); + addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23); + addAttackPlayerDesire(npc, pl); + } + if (!npc.isDead() && !npc.isInCombat()) + { + startQuestTimer("attack_player", 5000, npc, pl); + } + }); + break; + } + case "msg_8": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS); + startQuestTimer("msg_9", 8000, _deton, null); + break; + } + case "msg_9": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY); + startQuestTimer("msg_10", 10000, _deton, null); + break; + } + case "msg_10": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING); + break; + } + case "spawn_golem": + { + world.spawnGroup("golem"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away", 10000, _deton, null); + break; + } + case "run_away": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 3500, _deton, null); + break; + } + case "delete_daton": + { + world.despawnGroup("general"); + world.spawnGroup("seal_tmbstone"); + break; + } + case "msg_11": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST); + break; + } + case "msg_12": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA); + startQuestTimer("msg_13", 9000, _deton, null); + break; + } + case "msg_13": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA); + break; + } + case "spawn_scarab": + { + world.spawnGroup("flame_scarab"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away_1", 8000, _deton, null); + break; + } + case "run_away_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 5000, _deton, null); + break; + } + case "switch_quest": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(6)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(7, true); + } + } + } + } + } + }); + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, true)); + break; + } + case "angel_msg": + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_STUPID_IGNORANCE_IS_A_SIN_I_LL_LET_YOU_GO_THIS_ONE_TIME_GO); + world.despawnGroup("seal_tmbstone"); + break; + } + case "angel_teleport": + { + npc.teleToLocation(TELEPORT, world); + startQuestTimer("angel_triger", 2000, npc, player); + break; + } + case "angel_triger": + { + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, false)); + world.spawnGroup("singl_angel"); + startQuestTimer("triger", 3000, npc, player); + break; + } + case "triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, true)); + startQuestTimer("end_triger", 12000, npc, player); + startQuestTimer("clone_1", 1000, npc, player); + world.despawnGroup("seal_arngels"); + break; + } + case "clone_1": + { + world.spawnGroup("clone_1"); + startQuestTimer("clone_2", 500, npc, player); + break; + } + case "clone_2": + { + world.spawnGroup("clone_2"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_3", 500, npc, player); + } + break; + } + case "clone_3": + { + world.spawnGroup("clone_3"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_4", 500, npc, player); + } + break; + } + case "clone_4": + { + world.spawnGroup("clone_4"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_5", 500, npc, player); + } + break; + } + case "clone_5": + { + world.spawnGroup("clone_5"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_6", 500, npc, player); + } + break; + } + case "clone_6": + { + world.spawnGroup("clone_6"); + startQuestTimer("clone_7", 500, npc, player); + break; + } + case "clone_7": + { + world.spawnGroup("clone_7"); + break; + } + case "clone_player": + { + npc.setCloneObjId(player.getObjectId()); + if ((npc.getCloneObjId() == player.getObjectId()) && !player.getEffectList().hasAbnormalVisualEffect(AbnormalVisualEffect.STUN)) + { + player.teleToLocation(npc.getLocation(), world); + player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.STUN); + if ((player.getClan() != null) && (player.getClanCrestId() != 0)) + { + npc.setClanId(player.getClanId()); + } + npc.broadcastStatusUpdate(); + } + npc.setScriptValue(1); + startQuestTimer("clear_player", 12000, npc, player); + break; + } + case "end_triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, false)); + break; + } + case "clear_player": + { + player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STUN); + break; + } + case "end_instance": + { + cancelQuestTimers("check_flower"); + _count = 0; + for (Npc n : world.getAliveNpcs()) + { + n.deleteMe(); + } + world.finishInstance(0); + break; + } + } + return null; + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case SEAL_TOMBSTONE: + { + if (npc.isScriptValue(0)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW); + npc.setScriptValue(1); + break; + } + if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60)) + { + _seal_device.setDisplayEffect(1); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE); + npc.setScriptValue(2); + break; + } + if (npc.isScriptValue(2) && (npc.getCurrentHpPercent() < 40)) + { + if (getRandom(10) < 5) + { + world.spawnGroup("arimanes"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ARIMANES, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + npc.setScriptValue(3); + break; + } + if (npc.isScriptValue(3) && (npc.getCurrentHpPercent() < 20)) + { + _seal_device.setDisplayEffect(2); + npc.setScriptValue(4); + break; + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(9) && npc.isScriptValue(0)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_NOT_LUST_AFTER_WHAT_S_SEALED_HERE_IT_IS_NOT_YOURS); + startQuestTimer("angel_msg", 6000, npc, null); + startQuestTimer("switch_quest", 1000, npc, attacker); + npc.setScriptValue(1); + } + if (world.isStatus(9) && (npc.getCurrentHpPercent() < 50)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_MUST_REMAIN_SEALED_HERE); + startQuestTimer("angel_teleport", 3000, npc, attacker); + world.setStatus(10); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + } + if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30)) + { + world.spawnGroup("last_deton"); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3); + startQuestTimer("msg_12", 6000, _deton, null); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME); + world.setStatus(11); + } + if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5)) + { + npc.setIsInvul(true); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + world.setStatus(12); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(7)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(8, true); + } + } + } + } + } + }); + startQuestTimer("end_instance", 52000, _deton, null); + world.despawnGroup("last_deton"); + world.despawnGroup("last_archagel"); + playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE); + npc.deleteMe(); + } + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_STACATO: + { + if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty()) + { + cancelQuestTimers("end_instance"); + cancelQuestTimers("check_flower"); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME))); + world.setStatus(4); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL); + startQuestTimer("msg_7", 7000, _deton, null); + } + break; + } + case FLAME_SCORPION: + { + if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("msg_8", 3000, _deton, null); + world.setStatus(6); + } + break; + } + case SEAL_TOMBSTONE: + { + _seal_device.setDisplayEffect(3); + _seal_device.doDie(npc); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2); + startQuestTimer("msg_11", 3000, _deton, null); + break; + } + case SEALED_ANGEL: + { + world.spawnGroup("last_archagel"); + world.openCloseDoor(world.getTemplateParameters().getInt("1_door"), true); + break; + } + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + final Instance world = creature.getInstanceWorld(); + final PlayerInstance player = creature.getActingPlayer(); + if (isInInstance(world)) + { + switch (zone.getId()) + { + case 80027: + { + if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1)) + { + world.setStatus(2); + _deton.setTarget(null); + _deton.stopMove(null); + startQuestTimer("msg_4", 7000, _deton, null); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME))); + startQuestTimer("end_instance", 190000, _deton, null); + startQuestTimer("spawn_stacato", 5000, _deton, null); + } + break; + } + case 80028: + { + if (world.isStatus(0)) + { + startQuestTimer("check_status", 21000, _deton, player); + world.setStatus(1); + } + break; + } + case 80029: + { + if (world.isStatus(4)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING); + startQuestTimer("spawn_scorpion", 5000, _deton, player); + world.setStatus(5); + } + break; + } + case 80030: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY); + startQuestTimer("spawn_golem", 7000, _deton, player); + world.setStatus(7); + } + break; + } + case 80031: + { + if (world.isStatus(7)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_SEALED_TABLET_HUH, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.setStatus(8); + } + break; + } + case 80032: + { + if (world.isStatus(8)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THERE_S_NO_FUTURE_FOR_THOSE_WHO_CANNOT_WIN_AGAINST_THEMSELVES, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.spawnGroup("seal_arngels"); + world.setStatus(9); + } + break; + } + case 80033: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT); + startQuestTimer("spawn_scarab", 7000, _deton, player); + world.setStatus(7); + } + break; + } + } + } + return super.onEnterZone(creature, zone); + + } + + @Override + public String onSpawn(Npc npc) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case DETON: + { + _deton = npc; + break; + } + case SEAL_DEVICE: + { + _seal_device = npc; + break; + } + case FLAME_FLOWER: + { + npc.setCurrentHp(npc.getMaxHp() * 0.20); + for (final Npc tombstone : World.getInstance().getVisibleObjectsInRange(npc, MonsterInstance.class, 500)) + { + if (tombstone.getId() == SEAL_TOMBSTONE) + { + npc.setTarget(tombstone); + tryToEffect(npc, tombstone, DECREASE_PDEF.getSkillId()); + } + } + break; + } + case FLAME_STACATO: + { + startQuestTimer("check_flower", 3000, npc, null, true); + break; + } + case FLAME_SCORPION: + { + startQuestTimer("attack_player", 2000, npc, null); + break; + } + case FLAME_GOLEM: + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(3, true); + } + } + } + } + } + }); + break; + } + case FLAME_SCARAB: + { + startQuestTimer("attack_player", 2000, npc, null); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(4, true); + } + } + } + } + } + }); + break; + } + case NPC_1: + { + for (final PlayerInstance nearby : World.getInstance().getVisibleObjectsInRange(npc, PlayerInstance.class, 2000)) + { + if (npc.isScriptValue(0) && (nearby != null)) + { + startQuestTimer("clone_player", 500, npc, nearby); + } + + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(10)) + { + npc.setCurrentHp(npc.getMaxHp() * 0.5); + } + break; + } + } + } + return super.onSpawn(npc); + } + + @Override + public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_FLOWER: + { + if ((world.getStatus() < 5) && (npc.getCurrentHp() == npc.getMaxHp())) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_LOOK_INSIDE_YOUR_BAG_YOU_OBTAINED_A_FLAME_FLOWER, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false, caster.getName())); + giveItems(caster, FLAME_FLOWER_BUD, 1); + npc.doDie(npc); + npc.deleteMe(); + } + break; + } + case SEAL_TOMBSTONE: + { + if (skill.getId() == SUMMON_FLAME_FLOWER.getSkillId()) + { + addSpawn(FLAME_FLOWER, caster, false, 60000, false, world.getId()); + } + break; + } + } + } + return super.onSkillSee(npc, caster, skill, targets, isSummon); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return npc.getId() + ".html"; + } + + private void tryToEffect(Npc npc, Creature character, int diseaseId) + { + final BuffInfo info = character.getEffectList().getBuffInfoBySkillId(diseaseId); + final int skillLevel = (info == null) ? 1 : (info.getSkill().getLevel() < 3) ? info.getSkill().getLevel() + 1 : 3; + final Skill skill = SkillData.getInstance().getSkill(diseaseId, skillLevel); + + if ((skill != null) && SkillCaster.checkUseConditions(npc, skill)) + { + npc.doCast(skill); + } + } + + public static void main(String[] args) + { + new StoryOfTauti(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/MissingQuests.txt b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/MissingQuests.txt index ac833c56d8..ba86dd0773 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/MissingQuests.txt +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/MissingQuests.txt @@ -85,7 +85,6 @@ 824 Attack the Command Post 825 Hunter Guild Request - Valley of Saints 832 Hunter Guild Request - Southern Region, Isle of Prayer -833 Devil's Treasure, Tauti 834 Against Dragonclaw 836 Request from the Blackbird Clan 837 Request from the Giant Trackers diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html new file mode 100644 index 0000000000..d88c3f725f --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html @@ -0,0 +1,6 @@ +Mystic Tavern Owner Settlen:
+Oh, you must have heard Tauti's story!
+I was so shocked when I first heard about Tauti's story. To think that Deton tried to take axe and ended up turning into that...
+Anyway, I told you our stories are very interesting.
+ + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html new file mode 100644 index 0000000000..177a8a9510 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+Anyway, thank you for listening to our stories. Here's a small gift for you.
+Please come by often and let's all have a great time again. + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html new file mode 100644 index 0000000000..1a8f732647 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+The most interesting still ahead, and you want to leave?
+Just think about our employees who are trying for you. Please listen to the story to the end + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java new file mode 100644 index 0000000000..4100e10d37 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java @@ -0,0 +1,224 @@ +/* + * 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 quests.Q00833_DevilsTreasureTauti; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.enums.QuestType; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.quest.State; + +/** + * Devil's Treasure, Tauti (833) + * @URL https://l2wiki.com/Devil%27s_Treasure,_Tauti + * @author Gigi + */ +public class Q00833_DevilsTreasureTauti extends Quest +{ + // NPCs + private static final int DETON = 34170; + private static final int SETTLEN = 34180; + // Monsters + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + // Items + private static final int FRENZED_TAUTIS_FRAGMENT = 47884; + private static final int INSANE_KELBIMS_FRAGMENT = 47885; + private static final int SOE_MISTYC_TAVERN = 46564; + private static final int MYSTIC_ARMOR_PIACE = 46587; + private static final int FLAME_FLOWER = 46554; + + public Q00833_DevilsTreasureTauti() + { + super(833); + addStartNpc(DETON); + addTalkId(SETTLEN); + addKillId(FLAME_SCORPION, FLAME_GOLEM, FLAME_SCARAB, SEAL_TOMBSTONE); + addSeeCreatureId(DETON); + registerQuestItems(FLAME_FLOWER); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + final QuestState qs = getQuestState(player, false); + switch (event) + { + case "34180-02.html": + { + final int chance = getRandom(100); + if (chance <= 10) + { + giveItems(player, FRENZED_TAUTIS_FRAGMENT, 1); + } + else if ((chance > 10) && (chance <= 20)) + { + giveItems(player, INSANE_KELBIMS_FRAGMENT, 1); + } + else if ((chance > 20) && (chance <= 40)) + { + giveItems(player, MYSTIC_ARMOR_PIACE, 1); + } + else + { + giveItems(player, SOE_MISTYC_TAVERN, 1); + } + addExpAndSp(player, 6_362_541_900L, 15_270_101); + qs.exitQuest(QuestType.REPEATABLE, true); + htmltext = event; + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, PlayerInstance player) + { + String htmltext = getNoQuestMsg(player); + final QuestState qs = getQuestState(player, true); + + switch (qs.getState()) + { + case State.STARTED: + { + htmltext = (qs.isCond(8)) ? "34180-01.html" : "34180-03.html"; + } + } + return htmltext; + } + + @Override + public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) + { + final PlayerInstance player = creature.getActingPlayer(); + if (player != null) + { + final QuestState qs = getQuestState(player, true); + if (!qs.isStarted()) + { + playMovie(player, Movie.EPIC_TAUTI_SLIDE); + qs.startQuest(); + } + } + return super.onSeeCreature(npc, creature, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + Party party = killer.getParty(); + if (party != null) + { + party.getMembers().forEach(p -> onKill(npc, p)); + } + else + { + onKill(npc, killer); + } + return super.onKill(npc, killer, isSummon); + } + + private void onKill(Npc npc, PlayerInstance killer) + { + final QuestState qs = getQuestState(killer, false); + switch (npc.getId()) + { + case FLAME_SCORPION: + { + if ((qs != null) && qs.isCond(1) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScorpion = qs.getInt("killed_" + FLAME_SCORPION); + if (killedScorpion < 5) + { + qs.set("killed_" + FLAME_SCORPION, ++killedScorpion); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScorpion >= 5) + { + qs.setCond(2, true); + } + sendNpcLogList(killer); + } + break; + } + case FLAME_GOLEM: + { + if ((qs != null) && qs.isCond(3) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(5, true); + } + break; + } + case FLAME_SCARAB: + { + if ((qs != null) && qs.isCond(4) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScarab = qs.getInt("killed_" + FLAME_SCARAB); + if (killedScarab < 5) + { + qs.set("killed_" + FLAME_SCARAB, ++killedScarab); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScarab >= 5) + { + qs.setCond(5, true); + } + sendNpcLogList(killer); + } + break; + } + case SEAL_TOMBSTONE: + { + if ((qs != null) && qs.isCond(5) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(6, true); + } + break; + } + } + } + + @Override + public Set getNpcLogList(PlayerInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs.isCond(1) || qs.isCond(4)) + { + final Set holder = new HashSet<>(2); + holder.add(new NpcLogListHolder(FLAME_SCORPION, false, qs.getInt("killed_" + FLAME_SCORPION))); + holder.add(new NpcLogListHolder(FLAME_SCARAB, false, qs.getInt("killed_" + FLAME_SCARAB))); + return holder; + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/QuestMasterHandler.java index e6beea91a7..4ed82daef0 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -194,6 +194,7 @@ import quests.Q00828_EvasBlessing.Q00828_EvasBlessing; import quests.Q00829_MaphrsSalvation.Q00829_MaphrsSalvation; import quests.Q00830_TheWayOfTheGiantsPawn.Q00830_TheWayOfTheGiantsPawn; import quests.Q00831_SayhasScheme.Q00831_SayhasScheme; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; import quests.Q00835_PitiableMelisa.Q00835_PitiableMelisa; import quests.Q00901_HowLavasaurusesAreMade.Q00901_HowLavasaurusesAreMade; import quests.Q00902_ReclaimOurEra.Q00902_ReclaimOurEra; @@ -759,6 +760,7 @@ public class QuestMasterHandler Q00829_MaphrsSalvation.class, Q00830_TheWayOfTheGiantsPawn.class, Q00831_SayhasScheme.class, + Q00833_DevilsTreasureTauti.class, Q00835_PitiableMelisa.class, Q00836_RequestFromTheBlackbirdClan.class, // TODO: Not done. Q00837_RequestFromTheGiantTrackers.class, // TODO: Not done. diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/19600-19699.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/19600-19699.xml index 4f2995ea7f..669d9e6213 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/19600-19699.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/19600-19699.xml @@ -102,7 +102,7 @@
- + HUMAN FEMALE @@ -113,24 +113,24 @@ - + - - - HUMAN - FEMALE + + ETC - + + + - + @@ -147,7 +147,7 @@ - + diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/16500-16599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/16500-16599.xml index a2087e16d3..3026b59c1e 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/16500-16599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/16500-16599.xml @@ -691,20 +691,39 @@ icon.skill11276 - A1 + 1 + 1 + A2 900 600000 300000 -707 + 2 true + TARGET + SINGLE icon.skill4111 + 1 + 3 + STUN + STUN A2 400 -100 + 10-10 true + 0;0;80;300 + SELF + FAN_PB + NOT_FRIEND + + + 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 + + diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/18500-18599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/18500-18599.xml index 105b759872..e0d5acf7f7 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/18500-18599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/18500-18599.xml @@ -123,9 +123,16 @@ 500 + icon.skill0000 + 1 + 46554 A1 1500 3000 + 5 + 0 + SELF + SINGLE @@ -137,12 +144,41 @@ 5000 - + + + icon.skill1042 + 5 + 60 + PD_DOWN A2 - 500 + 600 -692 true + TARGET + SINGLE + + + + -10 + -30 + -50 + + PER + + + + -10 + -30 + -50 + + PER + + + 16571 + 1 + + diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/zones/custom_script.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/zones/custom_script.xml index 1b41b7764d..45a359eaaa 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/zones/custom_script.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/zones/custom_script.xml @@ -1131,4 +1131,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/instances/MysticTavern/StoryOfTauti.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/instances/MysticTavern/StoryOfTauti.xml new file mode 100644 index 0000000000..e8d0ac86b2 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/instances/MysticTavern/StoryOfTauti.xml @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java index f0f803c31c..d68fbb30b6 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.PlaySound; import ai.AbstractNpcAI; import instances.MysticTavern.StoryOfFreya.StoryOfFreya; +import instances.MysticTavern.StoryOfTauti.StoryOfTauti; import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub; /** @@ -57,7 +58,7 @@ public class MysticTavern extends AbstractNpcAI private static final int LUPIA = 34185; private static final int MEY = 34186; // Instances - // private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_KELBIM = 262; private static final int INSTANCE_FREYA = 263; // Zones @@ -105,7 +106,7 @@ public class MysticTavern extends AbstractNpcAI } final List availableInstances = new ArrayList<>(); availableInstances.add(INSTANCE_FREYA); - // availableInstances.add(INSTANCE_TAUTI); + availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_KELBIM); for (PlayerInstance member : party.getMembers()) { @@ -132,16 +133,16 @@ public class MysticTavern extends AbstractNpcAI } } } - // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) - // { - // for (int i = 0; i < availableInstances.size(); i++) - // { - // if (availableInstances.get(i) == INSTANCE_TAUTI) - // { - // availableInstances.remove(i); - // } - // } - // } + if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) + { + for (int i = 0; i < availableInstances.size(); i++) + { + if (availableInstances.get(i) == INSTANCE_TAUTI) + { + availableInstances.remove(i); + } + } + } // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_KELBIM) > 0) // { // for (int i = 0; i < availableInstances.size(); i++) @@ -160,7 +161,6 @@ public class MysticTavern extends AbstractNpcAI npc.setScriptValue(getRandom(availableInstances.size())); startQuestTimer("npcRoute", 3000, npc, player); } - startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test break; } case "npcRoute": @@ -333,11 +333,11 @@ public class MysticTavern extends AbstractNpcAI player.processQuestEvent(StoryOfFreya.class.getSimpleName(), "start_story"); break; } - // case INSTANCE_TAUTI: - // { - // player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); - // break; - // } + case INSTANCE_TAUTI: + { + player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); + break; + } // case INSTANCE_KELBIM: // { // player.processQuestEvent(StoryOfKelbim.class.getSimpleName(), "start_story"); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html new file mode 100644 index 0000000000..39c376f9e3 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html @@ -0,0 +1,3 @@ +Archaeologist Deton:
+What do you want? I'm busy right now. Come back later. + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html new file mode 100644 index 0000000000..0bcdd62f25 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html @@ -0,0 +1,5 @@ +Archaeologist Deton:
+Hmm, where are we?
+I should take a look at the map again...
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java new file mode 100644 index 0000000000..15f0c319b2 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java @@ -0,0 +1,943 @@ +/* + * 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.MysticTavern.StoryOfTauti; + +import java.util.List; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.enums.ChatType; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.instancemanager.QuestManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.World; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; +import org.l2jmobius.gameserver.model.skills.BuffInfo; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.ScriptZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; +import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger; + +import instances.AbstractInstance; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; + +/** + * Mystic Tavern Tauti Instance + * @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk + * @author Gigi + */ +public class StoryOfTauti extends AbstractInstance +{ + // NPC + private static final int DETON = 34170; + private static final int FLAME_FLOWER = 19606; + private static final int SEAL_DEVICE = 19608; + // Monsters + private static final int FLAME_STACATO = 23681; + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + private static final int SEAL_ARCHANGEL = 23683; + private static final int SEALED_ANGEL = 23685; + private static final int NPC_1 = 19626; + // Item + private static final int FLAME_FLOWER_BUD = 46554; + // Misc + private static final int TEMPLATE_ID = 261; + private static final ScriptZone FLAME_FLOWER_ZONE = ZoneManager.getInstance().getZoneById(80027, ScriptZone.class); + private static final ScriptZone START_ZONE = ZoneManager.getInstance().getZoneById(80028, ScriptZone.class); + private static final ScriptZone SCORPION_ZONE = ZoneManager.getInstance().getZoneById(80029, ScriptZone.class); + private static final ScriptZone GOLEM_ZONE = ZoneManager.getInstance().getZoneById(80030, ScriptZone.class); + private static final ScriptZone TOMBSTONE_ZONE = ZoneManager.getInstance().getZoneById(80031, ScriptZone.class); + private static final ScriptZone ANGEL_ZONE = ZoneManager.getInstance().getZoneById(80032, ScriptZone.class); + private static final ScriptZone SCARAB_ZONE = ZoneManager.getInstance().getZoneById(80033, ScriptZone.class); + private static final SkillHolder DECREASE_PDEF = new SkillHolder(18515, 1); + private static final SkillHolder SUMMON_FLAME_FLOWER = new SkillHolder(18513, 1); + private static final SkillHolder SEAL_ARCHANGEL_WRATH = new SkillHolder(16572, 1); + private static final Location DETON_MOVE = new Location(143641, -149193, -8072); + private static final Location DETON_MOVE_1 = new Location(151084, -152315, -9072); + private static final Location DETON_MOVE_2 = new Location(151618, -152823, -9064); + private static final Location DETON_MOVE_3 = new Location(153296, -145602, -11384); + private static final Location TELEPORT = new Location(153267, -148441, -11560); + private static final int ZONE_1ST_TRIGER = 24137770; + private static final int SKILL_TRIGER = 24138880; + private static Npc _deton; + private static Npc _seal_device; + protected int _count = 0; + + public StoryOfTauti() + { + super(TEMPLATE_ID); + addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL); + addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL); + addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL); + addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE); + addFirstTalkId(DETON); + addEnterZoneId(FLAME_FLOWER_ZONE.getId(), START_ZONE.getId(), SCORPION_ZONE.getId(), GOLEM_ZONE.getId(), TOMBSTONE_ZONE.getId(), ANGEL_ZONE.getId(), SCARAB_ZONE.getId()); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + final Instance world = npc.getInstanceWorld(); + switch (event) + { + case "start_story": + { + player.standUp(); + enterInstance(player, null, TEMPLATE_ID); + final Party party = player.getParty(); + if (party != null) + { + final Instance instance = player.getInstanceWorld(); + for (PlayerInstance member : party.getMembers()) + { + if (member != player) + { + member.standUp(); + member.teleToLocation(player, instance); + instance.addPlayer(member); + instance.addAllowed(member); + } + } + instance.setReenterTime(); + } + break; + } + case "give_map": + { + if ((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) + { + if (world.isStatus(1) || world.isStatus(4)) + { + _deton.setTarget(player); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); + } + else + { + return "34170-01.html"; + } + } + break; + } + case "check_status": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + startQuestTimer("msg_1", 7000, _deton, null); + break; + } + case "msg_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW); + startQuestTimer("msg_2", 10000, _deton, null); + break; + } + case "msg_2": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE); + startQuestTimer("msg_3", 10000, _deton, null); + break; + } + case "msg_3": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME); + break; + } + case "msg_4": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE); + startQuestTimer("msg_5", 7000, _deton, null); + break; + } + case "msg_5": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE); + startQuestTimer("msg_6", 10000, _deton, null); + break; + } + case "msg_6": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE); + break; + } + case "spawn_stacato": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_1", 50000, _deton, null); + break; + } + case "spawn_stacato_1": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_2", 50000, _deton, null); + break; + } + case "spawn_stacato_2": + { + world.spawnGroup("flame_stacato"); + world.setStatus(3); + break; + } + case "check_flower": + { + if (!npc.isDead()) + { + for (final Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000)) + { + if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0)) + { + _deton.setRunning(); + addMoveToDesire(npc, nearby.getLocation(), 23); + if (npc.calculateDistance3D(nearby) < 100) + { + nearby.setCurrentHp(nearby.getCurrentHp() - 10000); + nearby.setScriptValue(1); + npc.setCurrentHp(npc.getCurrentHp() + 15000); + npc.setScriptValue(1); + startQuestTimer("reset_flower", 8000, nearby, null); + if (nearby.getCurrentHp() < 1) + { + nearby.doDie(npc); + } + } + } + } + } + break; + } + case "reset_flower": + { + npc.setScriptValue(0); + break; + } + case "msg_7": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN); + break; + } + case "spawn_scorpion": + { + world.spawnGroup("flame_scorpion"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE); + if (getRandom(10) < 5) + { + world.spawnGroup("ifrit"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IFRIT, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + break; + } + case "attack_player": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, pl -> + { + if ((pl != null) && !pl.isDead()) + { + _deton.setRunning(); + addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23); + addAttackPlayerDesire(npc, pl); + } + if (!npc.isDead() && !npc.isInCombat()) + { + startQuestTimer("attack_player", 5000, npc, pl); + } + }); + break; + } + case "msg_8": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS); + startQuestTimer("msg_9", 8000, _deton, null); + break; + } + case "msg_9": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY); + startQuestTimer("msg_10", 10000, _deton, null); + break; + } + case "msg_10": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING); + break; + } + case "spawn_golem": + { + world.spawnGroup("golem"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away", 10000, _deton, null); + break; + } + case "run_away": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 3500, _deton, null); + break; + } + case "delete_daton": + { + world.despawnGroup("general"); + world.spawnGroup("seal_tmbstone"); + break; + } + case "msg_11": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST); + break; + } + case "msg_12": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA); + startQuestTimer("msg_13", 9000, _deton, null); + break; + } + case "msg_13": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA); + break; + } + case "spawn_scarab": + { + world.spawnGroup("flame_scarab"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away_1", 8000, _deton, null); + break; + } + case "run_away_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 5000, _deton, null); + break; + } + case "switch_quest": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(6)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(7, true); + } + } + } + } + } + }); + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, true)); + break; + } + case "angel_msg": + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_STUPID_IGNORANCE_IS_A_SIN_I_LL_LET_YOU_GO_THIS_ONE_TIME_GO); + world.despawnGroup("seal_tmbstone"); + break; + } + case "angel_teleport": + { + npc.teleToLocation(TELEPORT, world); + startQuestTimer("angel_triger", 2000, npc, player); + break; + } + case "angel_triger": + { + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, false)); + world.spawnGroup("singl_angel"); + startQuestTimer("triger", 3000, npc, player); + break; + } + case "triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, true)); + startQuestTimer("end_triger", 12000, npc, player); + startQuestTimer("clone_1", 1000, npc, player); + world.despawnGroup("seal_arngels"); + break; + } + case "clone_1": + { + world.spawnGroup("clone_1"); + startQuestTimer("clone_2", 500, npc, player); + break; + } + case "clone_2": + { + world.spawnGroup("clone_2"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_3", 500, npc, player); + } + break; + } + case "clone_3": + { + world.spawnGroup("clone_3"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_4", 500, npc, player); + } + break; + } + case "clone_4": + { + world.spawnGroup("clone_4"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_5", 500, npc, player); + } + break; + } + case "clone_5": + { + world.spawnGroup("clone_5"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_6", 500, npc, player); + } + break; + } + case "clone_6": + { + world.spawnGroup("clone_6"); + startQuestTimer("clone_7", 500, npc, player); + break; + } + case "clone_7": + { + world.spawnGroup("clone_7"); + break; + } + case "clone_player": + { + npc.setCloneObjId(player.getObjectId()); + if ((npc.getCloneObjId() == player.getObjectId()) && !player.getEffectList().hasAbnormalVisualEffect(AbnormalVisualEffect.STUN)) + { + player.teleToLocation(npc.getLocation(), world); + player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.STUN); + if ((player.getClan() != null) && (player.getClanCrestId() != 0)) + { + npc.setClanId(player.getClanId()); + } + npc.broadcastStatusUpdate(); + } + npc.setScriptValue(1); + startQuestTimer("clear_player", 12000, npc, player); + break; + } + case "end_triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, false)); + break; + } + case "clear_player": + { + player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STUN); + break; + } + case "end_instance": + { + cancelQuestTimers("check_flower"); + _count = 0; + for (Npc n : world.getAliveNpcs()) + { + n.deleteMe(); + } + world.finishInstance(0); + break; + } + } + return null; + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case SEAL_TOMBSTONE: + { + if (npc.isScriptValue(0)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW); + npc.setScriptValue(1); + break; + } + if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60)) + { + _seal_device.setDisplayEffect(1); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE); + npc.setScriptValue(2); + break; + } + if (npc.isScriptValue(2) && (npc.getCurrentHpPercent() < 40)) + { + if (getRandom(10) < 5) + { + world.spawnGroup("arimanes"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ARIMANES, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + npc.setScriptValue(3); + break; + } + if (npc.isScriptValue(3) && (npc.getCurrentHpPercent() < 20)) + { + _seal_device.setDisplayEffect(2); + npc.setScriptValue(4); + break; + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(9) && npc.isScriptValue(0)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_NOT_LUST_AFTER_WHAT_S_SEALED_HERE_IT_IS_NOT_YOURS); + startQuestTimer("angel_msg", 6000, npc, null); + startQuestTimer("switch_quest", 1000, npc, attacker); + npc.setScriptValue(1); + } + if (world.isStatus(9) && (npc.getCurrentHpPercent() < 50)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_MUST_REMAIN_SEALED_HERE); + startQuestTimer("angel_teleport", 3000, npc, attacker); + world.setStatus(10); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + } + if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30)) + { + world.spawnGroup("last_deton"); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3); + startQuestTimer("msg_12", 6000, _deton, null); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME); + world.setStatus(11); + } + if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5)) + { + npc.setIsInvul(true); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + world.setStatus(12); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(7)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(8, true); + } + } + } + } + } + }); + startQuestTimer("end_instance", 52000, _deton, null); + world.despawnGroup("last_deton"); + world.despawnGroup("last_archagel"); + playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE); + npc.deleteMe(); + } + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_STACATO: + { + if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty()) + { + cancelQuestTimers("end_instance"); + cancelQuestTimers("check_flower"); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME))); + world.setStatus(4); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL); + startQuestTimer("msg_7", 7000, _deton, null); + } + break; + } + case FLAME_SCORPION: + { + if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("msg_8", 3000, _deton, null); + world.setStatus(6); + } + break; + } + case SEAL_TOMBSTONE: + { + _seal_device.setDisplayEffect(3); + _seal_device.doDie(npc); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2); + startQuestTimer("msg_11", 3000, _deton, null); + break; + } + case SEALED_ANGEL: + { + world.spawnGroup("last_archagel"); + world.openCloseDoor(world.getTemplateParameters().getInt("1_door"), true); + break; + } + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + final Instance world = creature.getInstanceWorld(); + final PlayerInstance player = creature.getActingPlayer(); + if (isInInstance(world)) + { + switch (zone.getId()) + { + case 80027: + { + if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1)) + { + world.setStatus(2); + _deton.setTarget(null); + _deton.stopMove(null); + startQuestTimer("msg_4", 7000, _deton, null); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME))); + startQuestTimer("end_instance", 190000, _deton, null); + startQuestTimer("spawn_stacato", 5000, _deton, null); + } + break; + } + case 80028: + { + if (world.isStatus(0)) + { + startQuestTimer("check_status", 21000, _deton, player); + world.setStatus(1); + } + break; + } + case 80029: + { + if (world.isStatus(4)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING); + startQuestTimer("spawn_scorpion", 5000, _deton, player); + world.setStatus(5); + } + break; + } + case 80030: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY); + startQuestTimer("spawn_golem", 7000, _deton, player); + world.setStatus(7); + } + break; + } + case 80031: + { + if (world.isStatus(7)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_SEALED_TABLET_HUH, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.setStatus(8); + } + break; + } + case 80032: + { + if (world.isStatus(8)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THERE_S_NO_FUTURE_FOR_THOSE_WHO_CANNOT_WIN_AGAINST_THEMSELVES, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.spawnGroup("seal_arngels"); + world.setStatus(9); + } + break; + } + case 80033: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT); + startQuestTimer("spawn_scarab", 7000, _deton, player); + world.setStatus(7); + } + break; + } + } + } + return super.onEnterZone(creature, zone); + + } + + @Override + public String onSpawn(Npc npc) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case DETON: + { + _deton = npc; + break; + } + case SEAL_DEVICE: + { + _seal_device = npc; + break; + } + case FLAME_FLOWER: + { + npc.setCurrentHp(npc.getMaxHp() * 0.20); + for (final Npc tombstone : World.getInstance().getVisibleObjectsInRange(npc, MonsterInstance.class, 500)) + { + if (tombstone.getId() == SEAL_TOMBSTONE) + { + npc.setTarget(tombstone); + tryToEffect(npc, tombstone, DECREASE_PDEF.getSkillId()); + } + } + break; + } + case FLAME_STACATO: + { + startQuestTimer("check_flower", 3000, npc, null, true); + break; + } + case FLAME_SCORPION: + { + startQuestTimer("attack_player", 2000, npc, null); + break; + } + case FLAME_GOLEM: + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(3, true); + } + } + } + } + } + }); + break; + } + case FLAME_SCARAB: + { + startQuestTimer("attack_player", 2000, npc, null); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(4, true); + } + } + } + } + } + }); + break; + } + case NPC_1: + { + for (final PlayerInstance nearby : World.getInstance().getVisibleObjectsInRange(npc, PlayerInstance.class, 2000)) + { + if (npc.isScriptValue(0) && (nearby != null)) + { + startQuestTimer("clone_player", 500, npc, nearby); + } + + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(10)) + { + npc.setCurrentHp(npc.getMaxHp() * 0.5); + } + break; + } + } + } + return super.onSpawn(npc); + } + + @Override + public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_FLOWER: + { + if ((world.getStatus() < 5) && (npc.getCurrentHp() == npc.getMaxHp())) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_LOOK_INSIDE_YOUR_BAG_YOU_OBTAINED_A_FLAME_FLOWER, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false, caster.getName())); + giveItems(caster, FLAME_FLOWER_BUD, 1); + npc.doDie(npc); + npc.deleteMe(); + } + break; + } + case SEAL_TOMBSTONE: + { + if (skill.getId() == SUMMON_FLAME_FLOWER.getSkillId()) + { + addSpawn(FLAME_FLOWER, caster, false, 60000, false, world.getId()); + } + break; + } + } + } + return super.onSkillSee(npc, caster, skill, targets, isSummon); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return npc.getId() + ".html"; + } + + private void tryToEffect(Npc npc, Creature character, int diseaseId) + { + final BuffInfo info = character.getEffectList().getBuffInfoBySkillId(diseaseId); + final int skillLevel = (info == null) ? 1 : (info.getSkill().getLevel() < 3) ? info.getSkill().getLevel() + 1 : 3; + final Skill skill = SkillData.getInstance().getSkill(diseaseId, skillLevel); + + if ((skill != null) && SkillCaster.checkUseConditions(npc, skill)) + { + npc.doCast(skill); + } + } + + public static void main(String[] args) + { + new StoryOfTauti(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/MissingQuests.txt b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/MissingQuests.txt index eb97e7a16b..88ab4fb9a1 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/MissingQuests.txt +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/MissingQuests.txt @@ -109,7 +109,6 @@ 824 Attack the Command Post 825 Hunter Guild Request - Valley of Saints 832 Hunter Guild Request - Southern Region, Isle of Prayer -833 Devil's Treasure, Tauti 834 Against Dragonclaw 836 Request from the Blackbird Clan 837 Request from the Giant Trackers diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html new file mode 100644 index 0000000000..d88c3f725f --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html @@ -0,0 +1,6 @@ +Mystic Tavern Owner Settlen:
+Oh, you must have heard Tauti's story!
+I was so shocked when I first heard about Tauti's story. To think that Deton tried to take axe and ended up turning into that...
+Anyway, I told you our stories are very interesting.
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html new file mode 100644 index 0000000000..177a8a9510 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+Anyway, thank you for listening to our stories. Here's a small gift for you.
+Please come by often and let's all have a great time again. + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html new file mode 100644 index 0000000000..1a8f732647 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+The most interesting still ahead, and you want to leave?
+Just think about our employees who are trying for you. Please listen to the story to the end + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java new file mode 100644 index 0000000000..4100e10d37 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java @@ -0,0 +1,224 @@ +/* + * 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 quests.Q00833_DevilsTreasureTauti; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.enums.QuestType; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.quest.State; + +/** + * Devil's Treasure, Tauti (833) + * @URL https://l2wiki.com/Devil%27s_Treasure,_Tauti + * @author Gigi + */ +public class Q00833_DevilsTreasureTauti extends Quest +{ + // NPCs + private static final int DETON = 34170; + private static final int SETTLEN = 34180; + // Monsters + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + // Items + private static final int FRENZED_TAUTIS_FRAGMENT = 47884; + private static final int INSANE_KELBIMS_FRAGMENT = 47885; + private static final int SOE_MISTYC_TAVERN = 46564; + private static final int MYSTIC_ARMOR_PIACE = 46587; + private static final int FLAME_FLOWER = 46554; + + public Q00833_DevilsTreasureTauti() + { + super(833); + addStartNpc(DETON); + addTalkId(SETTLEN); + addKillId(FLAME_SCORPION, FLAME_GOLEM, FLAME_SCARAB, SEAL_TOMBSTONE); + addSeeCreatureId(DETON); + registerQuestItems(FLAME_FLOWER); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + final QuestState qs = getQuestState(player, false); + switch (event) + { + case "34180-02.html": + { + final int chance = getRandom(100); + if (chance <= 10) + { + giveItems(player, FRENZED_TAUTIS_FRAGMENT, 1); + } + else if ((chance > 10) && (chance <= 20)) + { + giveItems(player, INSANE_KELBIMS_FRAGMENT, 1); + } + else if ((chance > 20) && (chance <= 40)) + { + giveItems(player, MYSTIC_ARMOR_PIACE, 1); + } + else + { + giveItems(player, SOE_MISTYC_TAVERN, 1); + } + addExpAndSp(player, 6_362_541_900L, 15_270_101); + qs.exitQuest(QuestType.REPEATABLE, true); + htmltext = event; + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, PlayerInstance player) + { + String htmltext = getNoQuestMsg(player); + final QuestState qs = getQuestState(player, true); + + switch (qs.getState()) + { + case State.STARTED: + { + htmltext = (qs.isCond(8)) ? "34180-01.html" : "34180-03.html"; + } + } + return htmltext; + } + + @Override + public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) + { + final PlayerInstance player = creature.getActingPlayer(); + if (player != null) + { + final QuestState qs = getQuestState(player, true); + if (!qs.isStarted()) + { + playMovie(player, Movie.EPIC_TAUTI_SLIDE); + qs.startQuest(); + } + } + return super.onSeeCreature(npc, creature, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + Party party = killer.getParty(); + if (party != null) + { + party.getMembers().forEach(p -> onKill(npc, p)); + } + else + { + onKill(npc, killer); + } + return super.onKill(npc, killer, isSummon); + } + + private void onKill(Npc npc, PlayerInstance killer) + { + final QuestState qs = getQuestState(killer, false); + switch (npc.getId()) + { + case FLAME_SCORPION: + { + if ((qs != null) && qs.isCond(1) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScorpion = qs.getInt("killed_" + FLAME_SCORPION); + if (killedScorpion < 5) + { + qs.set("killed_" + FLAME_SCORPION, ++killedScorpion); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScorpion >= 5) + { + qs.setCond(2, true); + } + sendNpcLogList(killer); + } + break; + } + case FLAME_GOLEM: + { + if ((qs != null) && qs.isCond(3) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(5, true); + } + break; + } + case FLAME_SCARAB: + { + if ((qs != null) && qs.isCond(4) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScarab = qs.getInt("killed_" + FLAME_SCARAB); + if (killedScarab < 5) + { + qs.set("killed_" + FLAME_SCARAB, ++killedScarab); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScarab >= 5) + { + qs.setCond(5, true); + } + sendNpcLogList(killer); + } + break; + } + case SEAL_TOMBSTONE: + { + if ((qs != null) && qs.isCond(5) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(6, true); + } + break; + } + } + } + + @Override + public Set getNpcLogList(PlayerInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs.isCond(1) || qs.isCond(4)) + { + final Set holder = new HashSet<>(2); + holder.add(new NpcLogListHolder(FLAME_SCORPION, false, qs.getInt("killed_" + FLAME_SCORPION))); + holder.add(new NpcLogListHolder(FLAME_SCARAB, false, qs.getInt("killed_" + FLAME_SCARAB))); + return holder; + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/QuestMasterHandler.java index d8d3b1245e..6e6380e92d 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -197,6 +197,7 @@ import quests.Q00828_EvasBlessing.Q00828_EvasBlessing; import quests.Q00829_MaphrsSalvation.Q00829_MaphrsSalvation; import quests.Q00830_TheWayOfTheGiantsPawn.Q00830_TheWayOfTheGiantsPawn; import quests.Q00831_SayhasScheme.Q00831_SayhasScheme; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; import quests.Q00835_PitiableMelisa.Q00835_PitiableMelisa; import quests.Q00901_HowLavasaurusesAreMade.Q00901_HowLavasaurusesAreMade; import quests.Q00902_ReclaimOurEra.Q00902_ReclaimOurEra; @@ -701,6 +702,7 @@ public class QuestMasterHandler Q00829_MaphrsSalvation.class, Q00830_TheWayOfTheGiantsPawn.class, Q00831_SayhasScheme.class, + Q00833_DevilsTreasureTauti.class, Q00835_PitiableMelisa.class, Q00836_RequestFromTheBlackbirdClan.class, // TODO: Not done. Q00837_RequestFromTheGiantTrackers.class, // TODO: Not done. diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/npcs/19600-19699.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/npcs/19600-19699.xml index 8249ec6506..38b8faa7b9 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/npcs/19600-19699.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/npcs/19600-19699.xml @@ -102,7 +102,7 @@
- + HUMAN FEMALE @@ -113,24 +113,24 @@ - + - - - HUMAN - FEMALE + + ETC - + + + - + @@ -147,7 +147,7 @@ - + diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/16500-16599.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/16500-16599.xml index 1fd87cac48..e62454a4b7 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/16500-16599.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/16500-16599.xml @@ -691,20 +691,39 @@ icon.skill11276 - A1 + 1 + 1 + A2 900 600000 300000 -707 + 2 true + TARGET + SINGLE icon.skill4111 + 1 + 3 + STUN + STUN A2 400 -100 + 10-10 true + 0;0;80;300 + SELF + FAN_PB + NOT_FRIEND + + + 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 + + diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/18500-18599.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/18500-18599.xml index 98076e0715..1dbf010159 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/18500-18599.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/18500-18599.xml @@ -123,36 +123,70 @@ 500 + icon.skill0000 + 1 + 46554 A1 1500 3000 + 5 + 0 + SELF + SINGLE icon.skill0246 A1 - 500 10 100 - 60000 + 120000 5000 - + + + icon.skill1042 + 5 + 60 + PD_DOWN A2 - 500 + 600 -692 true + TARGET + SINGLE + + + + -10 + -30 + -50 + + PER + + + + -10 + -30 + -50 + + PER + + + 16571 + 1 + + icon.skill0246 A1 - 500 10 100 - 60000 + 120000 5000 diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/zones/custom_script.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/zones/custom_script.xml index 1b41b7764d..45a359eaaa 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/zones/custom_script.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/zones/custom_script.xml @@ -1131,4 +1131,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/instances/MysticTavern/StoryOfTauti.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/instances/MysticTavern/StoryOfTauti.xml new file mode 100644 index 0000000000..e8d0ac86b2 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/instances/MysticTavern/StoryOfTauti.xml @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java index f0f803c31c..d68fbb30b6 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.PlaySound; import ai.AbstractNpcAI; import instances.MysticTavern.StoryOfFreya.StoryOfFreya; +import instances.MysticTavern.StoryOfTauti.StoryOfTauti; import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub; /** @@ -57,7 +58,7 @@ public class MysticTavern extends AbstractNpcAI private static final int LUPIA = 34185; private static final int MEY = 34186; // Instances - // private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_KELBIM = 262; private static final int INSTANCE_FREYA = 263; // Zones @@ -105,7 +106,7 @@ public class MysticTavern extends AbstractNpcAI } final List availableInstances = new ArrayList<>(); availableInstances.add(INSTANCE_FREYA); - // availableInstances.add(INSTANCE_TAUTI); + availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_KELBIM); for (PlayerInstance member : party.getMembers()) { @@ -132,16 +133,16 @@ public class MysticTavern extends AbstractNpcAI } } } - // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) - // { - // for (int i = 0; i < availableInstances.size(); i++) - // { - // if (availableInstances.get(i) == INSTANCE_TAUTI) - // { - // availableInstances.remove(i); - // } - // } - // } + if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) + { + for (int i = 0; i < availableInstances.size(); i++) + { + if (availableInstances.get(i) == INSTANCE_TAUTI) + { + availableInstances.remove(i); + } + } + } // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_KELBIM) > 0) // { // for (int i = 0; i < availableInstances.size(); i++) @@ -160,7 +161,6 @@ public class MysticTavern extends AbstractNpcAI npc.setScriptValue(getRandom(availableInstances.size())); startQuestTimer("npcRoute", 3000, npc, player); } - startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test break; } case "npcRoute": @@ -333,11 +333,11 @@ public class MysticTavern extends AbstractNpcAI player.processQuestEvent(StoryOfFreya.class.getSimpleName(), "start_story"); break; } - // case INSTANCE_TAUTI: - // { - // player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); - // break; - // } + case INSTANCE_TAUTI: + { + player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); + break; + } // case INSTANCE_KELBIM: // { // player.processQuestEvent(StoryOfKelbim.class.getSimpleName(), "start_story"); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html new file mode 100644 index 0000000000..39c376f9e3 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html @@ -0,0 +1,3 @@ +Archaeologist Deton:
+What do you want? I'm busy right now. Come back later. + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html new file mode 100644 index 0000000000..0bcdd62f25 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html @@ -0,0 +1,5 @@ +Archaeologist Deton:
+Hmm, where are we?
+I should take a look at the map again...
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java new file mode 100644 index 0000000000..15f0c319b2 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java @@ -0,0 +1,943 @@ +/* + * 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.MysticTavern.StoryOfTauti; + +import java.util.List; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.enums.ChatType; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.instancemanager.QuestManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.World; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; +import org.l2jmobius.gameserver.model.skills.BuffInfo; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.ScriptZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; +import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger; + +import instances.AbstractInstance; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; + +/** + * Mystic Tavern Tauti Instance + * @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk + * @author Gigi + */ +public class StoryOfTauti extends AbstractInstance +{ + // NPC + private static final int DETON = 34170; + private static final int FLAME_FLOWER = 19606; + private static final int SEAL_DEVICE = 19608; + // Monsters + private static final int FLAME_STACATO = 23681; + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + private static final int SEAL_ARCHANGEL = 23683; + private static final int SEALED_ANGEL = 23685; + private static final int NPC_1 = 19626; + // Item + private static final int FLAME_FLOWER_BUD = 46554; + // Misc + private static final int TEMPLATE_ID = 261; + private static final ScriptZone FLAME_FLOWER_ZONE = ZoneManager.getInstance().getZoneById(80027, ScriptZone.class); + private static final ScriptZone START_ZONE = ZoneManager.getInstance().getZoneById(80028, ScriptZone.class); + private static final ScriptZone SCORPION_ZONE = ZoneManager.getInstance().getZoneById(80029, ScriptZone.class); + private static final ScriptZone GOLEM_ZONE = ZoneManager.getInstance().getZoneById(80030, ScriptZone.class); + private static final ScriptZone TOMBSTONE_ZONE = ZoneManager.getInstance().getZoneById(80031, ScriptZone.class); + private static final ScriptZone ANGEL_ZONE = ZoneManager.getInstance().getZoneById(80032, ScriptZone.class); + private static final ScriptZone SCARAB_ZONE = ZoneManager.getInstance().getZoneById(80033, ScriptZone.class); + private static final SkillHolder DECREASE_PDEF = new SkillHolder(18515, 1); + private static final SkillHolder SUMMON_FLAME_FLOWER = new SkillHolder(18513, 1); + private static final SkillHolder SEAL_ARCHANGEL_WRATH = new SkillHolder(16572, 1); + private static final Location DETON_MOVE = new Location(143641, -149193, -8072); + private static final Location DETON_MOVE_1 = new Location(151084, -152315, -9072); + private static final Location DETON_MOVE_2 = new Location(151618, -152823, -9064); + private static final Location DETON_MOVE_3 = new Location(153296, -145602, -11384); + private static final Location TELEPORT = new Location(153267, -148441, -11560); + private static final int ZONE_1ST_TRIGER = 24137770; + private static final int SKILL_TRIGER = 24138880; + private static Npc _deton; + private static Npc _seal_device; + protected int _count = 0; + + public StoryOfTauti() + { + super(TEMPLATE_ID); + addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL); + addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL); + addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL); + addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE); + addFirstTalkId(DETON); + addEnterZoneId(FLAME_FLOWER_ZONE.getId(), START_ZONE.getId(), SCORPION_ZONE.getId(), GOLEM_ZONE.getId(), TOMBSTONE_ZONE.getId(), ANGEL_ZONE.getId(), SCARAB_ZONE.getId()); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + final Instance world = npc.getInstanceWorld(); + switch (event) + { + case "start_story": + { + player.standUp(); + enterInstance(player, null, TEMPLATE_ID); + final Party party = player.getParty(); + if (party != null) + { + final Instance instance = player.getInstanceWorld(); + for (PlayerInstance member : party.getMembers()) + { + if (member != player) + { + member.standUp(); + member.teleToLocation(player, instance); + instance.addPlayer(member); + instance.addAllowed(member); + } + } + instance.setReenterTime(); + } + break; + } + case "give_map": + { + if ((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) + { + if (world.isStatus(1) || world.isStatus(4)) + { + _deton.setTarget(player); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); + } + else + { + return "34170-01.html"; + } + } + break; + } + case "check_status": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + startQuestTimer("msg_1", 7000, _deton, null); + break; + } + case "msg_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW); + startQuestTimer("msg_2", 10000, _deton, null); + break; + } + case "msg_2": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE); + startQuestTimer("msg_3", 10000, _deton, null); + break; + } + case "msg_3": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME); + break; + } + case "msg_4": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE); + startQuestTimer("msg_5", 7000, _deton, null); + break; + } + case "msg_5": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE); + startQuestTimer("msg_6", 10000, _deton, null); + break; + } + case "msg_6": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE); + break; + } + case "spawn_stacato": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_1", 50000, _deton, null); + break; + } + case "spawn_stacato_1": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_2", 50000, _deton, null); + break; + } + case "spawn_stacato_2": + { + world.spawnGroup("flame_stacato"); + world.setStatus(3); + break; + } + case "check_flower": + { + if (!npc.isDead()) + { + for (final Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000)) + { + if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0)) + { + _deton.setRunning(); + addMoveToDesire(npc, nearby.getLocation(), 23); + if (npc.calculateDistance3D(nearby) < 100) + { + nearby.setCurrentHp(nearby.getCurrentHp() - 10000); + nearby.setScriptValue(1); + npc.setCurrentHp(npc.getCurrentHp() + 15000); + npc.setScriptValue(1); + startQuestTimer("reset_flower", 8000, nearby, null); + if (nearby.getCurrentHp() < 1) + { + nearby.doDie(npc); + } + } + } + } + } + break; + } + case "reset_flower": + { + npc.setScriptValue(0); + break; + } + case "msg_7": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN); + break; + } + case "spawn_scorpion": + { + world.spawnGroup("flame_scorpion"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE); + if (getRandom(10) < 5) + { + world.spawnGroup("ifrit"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IFRIT, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + break; + } + case "attack_player": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, pl -> + { + if ((pl != null) && !pl.isDead()) + { + _deton.setRunning(); + addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23); + addAttackPlayerDesire(npc, pl); + } + if (!npc.isDead() && !npc.isInCombat()) + { + startQuestTimer("attack_player", 5000, npc, pl); + } + }); + break; + } + case "msg_8": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS); + startQuestTimer("msg_9", 8000, _deton, null); + break; + } + case "msg_9": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY); + startQuestTimer("msg_10", 10000, _deton, null); + break; + } + case "msg_10": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING); + break; + } + case "spawn_golem": + { + world.spawnGroup("golem"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away", 10000, _deton, null); + break; + } + case "run_away": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 3500, _deton, null); + break; + } + case "delete_daton": + { + world.despawnGroup("general"); + world.spawnGroup("seal_tmbstone"); + break; + } + case "msg_11": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST); + break; + } + case "msg_12": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA); + startQuestTimer("msg_13", 9000, _deton, null); + break; + } + case "msg_13": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA); + break; + } + case "spawn_scarab": + { + world.spawnGroup("flame_scarab"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away_1", 8000, _deton, null); + break; + } + case "run_away_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 5000, _deton, null); + break; + } + case "switch_quest": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(6)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(7, true); + } + } + } + } + } + }); + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, true)); + break; + } + case "angel_msg": + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_STUPID_IGNORANCE_IS_A_SIN_I_LL_LET_YOU_GO_THIS_ONE_TIME_GO); + world.despawnGroup("seal_tmbstone"); + break; + } + case "angel_teleport": + { + npc.teleToLocation(TELEPORT, world); + startQuestTimer("angel_triger", 2000, npc, player); + break; + } + case "angel_triger": + { + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, false)); + world.spawnGroup("singl_angel"); + startQuestTimer("triger", 3000, npc, player); + break; + } + case "triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, true)); + startQuestTimer("end_triger", 12000, npc, player); + startQuestTimer("clone_1", 1000, npc, player); + world.despawnGroup("seal_arngels"); + break; + } + case "clone_1": + { + world.spawnGroup("clone_1"); + startQuestTimer("clone_2", 500, npc, player); + break; + } + case "clone_2": + { + world.spawnGroup("clone_2"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_3", 500, npc, player); + } + break; + } + case "clone_3": + { + world.spawnGroup("clone_3"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_4", 500, npc, player); + } + break; + } + case "clone_4": + { + world.spawnGroup("clone_4"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_5", 500, npc, player); + } + break; + } + case "clone_5": + { + world.spawnGroup("clone_5"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_6", 500, npc, player); + } + break; + } + case "clone_6": + { + world.spawnGroup("clone_6"); + startQuestTimer("clone_7", 500, npc, player); + break; + } + case "clone_7": + { + world.spawnGroup("clone_7"); + break; + } + case "clone_player": + { + npc.setCloneObjId(player.getObjectId()); + if ((npc.getCloneObjId() == player.getObjectId()) && !player.getEffectList().hasAbnormalVisualEffect(AbnormalVisualEffect.STUN)) + { + player.teleToLocation(npc.getLocation(), world); + player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.STUN); + if ((player.getClan() != null) && (player.getClanCrestId() != 0)) + { + npc.setClanId(player.getClanId()); + } + npc.broadcastStatusUpdate(); + } + npc.setScriptValue(1); + startQuestTimer("clear_player", 12000, npc, player); + break; + } + case "end_triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, false)); + break; + } + case "clear_player": + { + player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STUN); + break; + } + case "end_instance": + { + cancelQuestTimers("check_flower"); + _count = 0; + for (Npc n : world.getAliveNpcs()) + { + n.deleteMe(); + } + world.finishInstance(0); + break; + } + } + return null; + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case SEAL_TOMBSTONE: + { + if (npc.isScriptValue(0)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW); + npc.setScriptValue(1); + break; + } + if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60)) + { + _seal_device.setDisplayEffect(1); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE); + npc.setScriptValue(2); + break; + } + if (npc.isScriptValue(2) && (npc.getCurrentHpPercent() < 40)) + { + if (getRandom(10) < 5) + { + world.spawnGroup("arimanes"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ARIMANES, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + npc.setScriptValue(3); + break; + } + if (npc.isScriptValue(3) && (npc.getCurrentHpPercent() < 20)) + { + _seal_device.setDisplayEffect(2); + npc.setScriptValue(4); + break; + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(9) && npc.isScriptValue(0)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_NOT_LUST_AFTER_WHAT_S_SEALED_HERE_IT_IS_NOT_YOURS); + startQuestTimer("angel_msg", 6000, npc, null); + startQuestTimer("switch_quest", 1000, npc, attacker); + npc.setScriptValue(1); + } + if (world.isStatus(9) && (npc.getCurrentHpPercent() < 50)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_MUST_REMAIN_SEALED_HERE); + startQuestTimer("angel_teleport", 3000, npc, attacker); + world.setStatus(10); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + } + if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30)) + { + world.spawnGroup("last_deton"); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3); + startQuestTimer("msg_12", 6000, _deton, null); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME); + world.setStatus(11); + } + if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5)) + { + npc.setIsInvul(true); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + world.setStatus(12); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(7)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(8, true); + } + } + } + } + } + }); + startQuestTimer("end_instance", 52000, _deton, null); + world.despawnGroup("last_deton"); + world.despawnGroup("last_archagel"); + playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE); + npc.deleteMe(); + } + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_STACATO: + { + if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty()) + { + cancelQuestTimers("end_instance"); + cancelQuestTimers("check_flower"); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME))); + world.setStatus(4); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL); + startQuestTimer("msg_7", 7000, _deton, null); + } + break; + } + case FLAME_SCORPION: + { + if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("msg_8", 3000, _deton, null); + world.setStatus(6); + } + break; + } + case SEAL_TOMBSTONE: + { + _seal_device.setDisplayEffect(3); + _seal_device.doDie(npc); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2); + startQuestTimer("msg_11", 3000, _deton, null); + break; + } + case SEALED_ANGEL: + { + world.spawnGroup("last_archagel"); + world.openCloseDoor(world.getTemplateParameters().getInt("1_door"), true); + break; + } + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + final Instance world = creature.getInstanceWorld(); + final PlayerInstance player = creature.getActingPlayer(); + if (isInInstance(world)) + { + switch (zone.getId()) + { + case 80027: + { + if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1)) + { + world.setStatus(2); + _deton.setTarget(null); + _deton.stopMove(null); + startQuestTimer("msg_4", 7000, _deton, null); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME))); + startQuestTimer("end_instance", 190000, _deton, null); + startQuestTimer("spawn_stacato", 5000, _deton, null); + } + break; + } + case 80028: + { + if (world.isStatus(0)) + { + startQuestTimer("check_status", 21000, _deton, player); + world.setStatus(1); + } + break; + } + case 80029: + { + if (world.isStatus(4)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING); + startQuestTimer("spawn_scorpion", 5000, _deton, player); + world.setStatus(5); + } + break; + } + case 80030: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY); + startQuestTimer("spawn_golem", 7000, _deton, player); + world.setStatus(7); + } + break; + } + case 80031: + { + if (world.isStatus(7)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_SEALED_TABLET_HUH, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.setStatus(8); + } + break; + } + case 80032: + { + if (world.isStatus(8)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THERE_S_NO_FUTURE_FOR_THOSE_WHO_CANNOT_WIN_AGAINST_THEMSELVES, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.spawnGroup("seal_arngels"); + world.setStatus(9); + } + break; + } + case 80033: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT); + startQuestTimer("spawn_scarab", 7000, _deton, player); + world.setStatus(7); + } + break; + } + } + } + return super.onEnterZone(creature, zone); + + } + + @Override + public String onSpawn(Npc npc) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case DETON: + { + _deton = npc; + break; + } + case SEAL_DEVICE: + { + _seal_device = npc; + break; + } + case FLAME_FLOWER: + { + npc.setCurrentHp(npc.getMaxHp() * 0.20); + for (final Npc tombstone : World.getInstance().getVisibleObjectsInRange(npc, MonsterInstance.class, 500)) + { + if (tombstone.getId() == SEAL_TOMBSTONE) + { + npc.setTarget(tombstone); + tryToEffect(npc, tombstone, DECREASE_PDEF.getSkillId()); + } + } + break; + } + case FLAME_STACATO: + { + startQuestTimer("check_flower", 3000, npc, null, true); + break; + } + case FLAME_SCORPION: + { + startQuestTimer("attack_player", 2000, npc, null); + break; + } + case FLAME_GOLEM: + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(3, true); + } + } + } + } + } + }); + break; + } + case FLAME_SCARAB: + { + startQuestTimer("attack_player", 2000, npc, null); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(4, true); + } + } + } + } + } + }); + break; + } + case NPC_1: + { + for (final PlayerInstance nearby : World.getInstance().getVisibleObjectsInRange(npc, PlayerInstance.class, 2000)) + { + if (npc.isScriptValue(0) && (nearby != null)) + { + startQuestTimer("clone_player", 500, npc, nearby); + } + + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(10)) + { + npc.setCurrentHp(npc.getMaxHp() * 0.5); + } + break; + } + } + } + return super.onSpawn(npc); + } + + @Override + public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_FLOWER: + { + if ((world.getStatus() < 5) && (npc.getCurrentHp() == npc.getMaxHp())) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_LOOK_INSIDE_YOUR_BAG_YOU_OBTAINED_A_FLAME_FLOWER, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false, caster.getName())); + giveItems(caster, FLAME_FLOWER_BUD, 1); + npc.doDie(npc); + npc.deleteMe(); + } + break; + } + case SEAL_TOMBSTONE: + { + if (skill.getId() == SUMMON_FLAME_FLOWER.getSkillId()) + { + addSpawn(FLAME_FLOWER, caster, false, 60000, false, world.getId()); + } + break; + } + } + } + return super.onSkillSee(npc, caster, skill, targets, isSummon); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return npc.getId() + ".html"; + } + + private void tryToEffect(Npc npc, Creature character, int diseaseId) + { + final BuffInfo info = character.getEffectList().getBuffInfoBySkillId(diseaseId); + final int skillLevel = (info == null) ? 1 : (info.getSkill().getLevel() < 3) ? info.getSkill().getLevel() + 1 : 3; + final Skill skill = SkillData.getInstance().getSkill(diseaseId, skillLevel); + + if ((skill != null) && SkillCaster.checkUseConditions(npc, skill)) + { + npc.doCast(skill); + } + } + + public static void main(String[] args) + { + new StoryOfTauti(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/MissingQuests.txt b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/MissingQuests.txt index d45ba0f2e2..138b681380 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/MissingQuests.txt +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/MissingQuests.txt @@ -119,7 +119,6 @@ 824 Attack the Command Post 825 Hunter Guild Request - Valley of Saints 832 Hunter Guild Request - Southern Region, Isle of Prayer -833 Devil's Treasure, Tauti 834 Against Dragonclaw 836 Request from the Blackbird Clan 837 Request from the Giant Trackers diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html new file mode 100644 index 0000000000..d88c3f725f --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html @@ -0,0 +1,6 @@ +Mystic Tavern Owner Settlen:
+Oh, you must have heard Tauti's story!
+I was so shocked when I first heard about Tauti's story. To think that Deton tried to take axe and ended up turning into that...
+Anyway, I told you our stories are very interesting.
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html new file mode 100644 index 0000000000..177a8a9510 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+Anyway, thank you for listening to our stories. Here's a small gift for you.
+Please come by often and let's all have a great time again. + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html new file mode 100644 index 0000000000..1a8f732647 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+The most interesting still ahead, and you want to leave?
+Just think about our employees who are trying for you. Please listen to the story to the end + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java new file mode 100644 index 0000000000..4100e10d37 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java @@ -0,0 +1,224 @@ +/* + * 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 quests.Q00833_DevilsTreasureTauti; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.enums.QuestType; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.quest.State; + +/** + * Devil's Treasure, Tauti (833) + * @URL https://l2wiki.com/Devil%27s_Treasure,_Tauti + * @author Gigi + */ +public class Q00833_DevilsTreasureTauti extends Quest +{ + // NPCs + private static final int DETON = 34170; + private static final int SETTLEN = 34180; + // Monsters + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + // Items + private static final int FRENZED_TAUTIS_FRAGMENT = 47884; + private static final int INSANE_KELBIMS_FRAGMENT = 47885; + private static final int SOE_MISTYC_TAVERN = 46564; + private static final int MYSTIC_ARMOR_PIACE = 46587; + private static final int FLAME_FLOWER = 46554; + + public Q00833_DevilsTreasureTauti() + { + super(833); + addStartNpc(DETON); + addTalkId(SETTLEN); + addKillId(FLAME_SCORPION, FLAME_GOLEM, FLAME_SCARAB, SEAL_TOMBSTONE); + addSeeCreatureId(DETON); + registerQuestItems(FLAME_FLOWER); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + final QuestState qs = getQuestState(player, false); + switch (event) + { + case "34180-02.html": + { + final int chance = getRandom(100); + if (chance <= 10) + { + giveItems(player, FRENZED_TAUTIS_FRAGMENT, 1); + } + else if ((chance > 10) && (chance <= 20)) + { + giveItems(player, INSANE_KELBIMS_FRAGMENT, 1); + } + else if ((chance > 20) && (chance <= 40)) + { + giveItems(player, MYSTIC_ARMOR_PIACE, 1); + } + else + { + giveItems(player, SOE_MISTYC_TAVERN, 1); + } + addExpAndSp(player, 6_362_541_900L, 15_270_101); + qs.exitQuest(QuestType.REPEATABLE, true); + htmltext = event; + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, PlayerInstance player) + { + String htmltext = getNoQuestMsg(player); + final QuestState qs = getQuestState(player, true); + + switch (qs.getState()) + { + case State.STARTED: + { + htmltext = (qs.isCond(8)) ? "34180-01.html" : "34180-03.html"; + } + } + return htmltext; + } + + @Override + public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) + { + final PlayerInstance player = creature.getActingPlayer(); + if (player != null) + { + final QuestState qs = getQuestState(player, true); + if (!qs.isStarted()) + { + playMovie(player, Movie.EPIC_TAUTI_SLIDE); + qs.startQuest(); + } + } + return super.onSeeCreature(npc, creature, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + Party party = killer.getParty(); + if (party != null) + { + party.getMembers().forEach(p -> onKill(npc, p)); + } + else + { + onKill(npc, killer); + } + return super.onKill(npc, killer, isSummon); + } + + private void onKill(Npc npc, PlayerInstance killer) + { + final QuestState qs = getQuestState(killer, false); + switch (npc.getId()) + { + case FLAME_SCORPION: + { + if ((qs != null) && qs.isCond(1) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScorpion = qs.getInt("killed_" + FLAME_SCORPION); + if (killedScorpion < 5) + { + qs.set("killed_" + FLAME_SCORPION, ++killedScorpion); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScorpion >= 5) + { + qs.setCond(2, true); + } + sendNpcLogList(killer); + } + break; + } + case FLAME_GOLEM: + { + if ((qs != null) && qs.isCond(3) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(5, true); + } + break; + } + case FLAME_SCARAB: + { + if ((qs != null) && qs.isCond(4) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScarab = qs.getInt("killed_" + FLAME_SCARAB); + if (killedScarab < 5) + { + qs.set("killed_" + FLAME_SCARAB, ++killedScarab); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScarab >= 5) + { + qs.setCond(5, true); + } + sendNpcLogList(killer); + } + break; + } + case SEAL_TOMBSTONE: + { + if ((qs != null) && qs.isCond(5) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(6, true); + } + break; + } + } + } + + @Override + public Set getNpcLogList(PlayerInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs.isCond(1) || qs.isCond(4)) + { + final Set holder = new HashSet<>(2); + holder.add(new NpcLogListHolder(FLAME_SCORPION, false, qs.getInt("killed_" + FLAME_SCORPION))); + holder.add(new NpcLogListHolder(FLAME_SCARAB, false, qs.getInt("killed_" + FLAME_SCARAB))); + return holder; + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/QuestMasterHandler.java index b816accfd4..6042fe1dcf 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -168,6 +168,7 @@ import quests.Q00828_EvasBlessing.Q00828_EvasBlessing; import quests.Q00829_MaphrsSalvation.Q00829_MaphrsSalvation; import quests.Q00830_TheWayOfTheGiantsPawn.Q00830_TheWayOfTheGiantsPawn; import quests.Q00831_SayhasScheme.Q00831_SayhasScheme; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; import quests.Q00835_PitiableMelisa.Q00835_PitiableMelisa; import quests.Q00901_HowLavasaurusesAreMade.Q00901_HowLavasaurusesAreMade; import quests.Q00902_ReclaimOurEra.Q00902_ReclaimOurEra; @@ -630,6 +631,7 @@ public class QuestMasterHandler Q00829_MaphrsSalvation.class, Q00830_TheWayOfTheGiantsPawn.class, Q00831_SayhasScheme.class, + Q00833_DevilsTreasureTauti.class, Q00835_PitiableMelisa.class, Q00836_RequestFromTheBlackbirdClan.class, // TODO: Not done. Q00837_RequestFromTheGiantTrackers.class, // TODO: Not done. diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/npcs/19600-19699.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/npcs/19600-19699.xml index 9b945b7313..0265443ee5 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/npcs/19600-19699.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/npcs/19600-19699.xml @@ -102,7 +102,7 @@
- + HUMAN FEMALE @@ -113,24 +113,24 @@ - + - - - HUMAN - FEMALE + + ETC - + + + - + @@ -147,7 +147,7 @@ - + diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/16500-16599.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/16500-16599.xml index 17eab1b6b2..9f96990368 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/16500-16599.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/16500-16599.xml @@ -691,20 +691,39 @@ icon.skill11276 - A1 + 1 + 1 + A2 900 600000 300000 -707 + 2 true + TARGET + SINGLE icon.skill4111 + 1 + 3 + STUN + STUN A2 400 -100 + 10-10 true + 0;0;80;300 + SELF + FAN_PB + NOT_FRIEND + + + 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 + + diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/18500-18599.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/18500-18599.xml index d3be65a1c2..81c030d456 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/18500-18599.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/18500-18599.xml @@ -123,36 +123,70 @@ 500 + icon.skill0000 + 1 + 46554 A1 1500 3000 + 5 + 0 + SELF + SINGLE icon.skill0246 A1 - 500 10 100 - 60000 + 120000 5000 - + + + icon.skill1042 + 5 + 60 + PD_DOWN A2 - 500 + 600 -692 true + TARGET + SINGLE + + + + -10 + -30 + -50 + + PER + + + + -10 + -30 + -50 + + PER + + + 16571 + 1 + + icon.skill0246 A1 - 500 10 100 - 60000 + 120000 5000 diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/zones/custom_script.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/zones/custom_script.xml index 1b41b7764d..45a359eaaa 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/zones/custom_script.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/zones/custom_script.xml @@ -1131,4 +1131,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/instances/MysticTavern/StoryOfTauti.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/instances/MysticTavern/StoryOfTauti.xml new file mode 100644 index 0000000000..e8d0ac86b2 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/instances/MysticTavern/StoryOfTauti.xml @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java index f0f803c31c..d68fbb30b6 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.PlaySound; import ai.AbstractNpcAI; import instances.MysticTavern.StoryOfFreya.StoryOfFreya; +import instances.MysticTavern.StoryOfTauti.StoryOfTauti; import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub; /** @@ -57,7 +58,7 @@ public class MysticTavern extends AbstractNpcAI private static final int LUPIA = 34185; private static final int MEY = 34186; // Instances - // private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_KELBIM = 262; private static final int INSTANCE_FREYA = 263; // Zones @@ -105,7 +106,7 @@ public class MysticTavern extends AbstractNpcAI } final List availableInstances = new ArrayList<>(); availableInstances.add(INSTANCE_FREYA); - // availableInstances.add(INSTANCE_TAUTI); + availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_KELBIM); for (PlayerInstance member : party.getMembers()) { @@ -132,16 +133,16 @@ public class MysticTavern extends AbstractNpcAI } } } - // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) - // { - // for (int i = 0; i < availableInstances.size(); i++) - // { - // if (availableInstances.get(i) == INSTANCE_TAUTI) - // { - // availableInstances.remove(i); - // } - // } - // } + if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) + { + for (int i = 0; i < availableInstances.size(); i++) + { + if (availableInstances.get(i) == INSTANCE_TAUTI) + { + availableInstances.remove(i); + } + } + } // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_KELBIM) > 0) // { // for (int i = 0; i < availableInstances.size(); i++) @@ -160,7 +161,6 @@ public class MysticTavern extends AbstractNpcAI npc.setScriptValue(getRandom(availableInstances.size())); startQuestTimer("npcRoute", 3000, npc, player); } - startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test break; } case "npcRoute": @@ -333,11 +333,11 @@ public class MysticTavern extends AbstractNpcAI player.processQuestEvent(StoryOfFreya.class.getSimpleName(), "start_story"); break; } - // case INSTANCE_TAUTI: - // { - // player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); - // break; - // } + case INSTANCE_TAUTI: + { + player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); + break; + } // case INSTANCE_KELBIM: // { // player.processQuestEvent(StoryOfKelbim.class.getSimpleName(), "start_story"); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html new file mode 100644 index 0000000000..39c376f9e3 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html @@ -0,0 +1,3 @@ +Archaeologist Deton:
+What do you want? I'm busy right now. Come back later. + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html new file mode 100644 index 0000000000..0bcdd62f25 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html @@ -0,0 +1,5 @@ +Archaeologist Deton:
+Hmm, where are we?
+I should take a look at the map again...
+ + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java new file mode 100644 index 0000000000..15f0c319b2 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java @@ -0,0 +1,943 @@ +/* + * 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.MysticTavern.StoryOfTauti; + +import java.util.List; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.enums.ChatType; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.instancemanager.QuestManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.World; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; +import org.l2jmobius.gameserver.model.skills.BuffInfo; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.ScriptZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; +import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger; + +import instances.AbstractInstance; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; + +/** + * Mystic Tavern Tauti Instance + * @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk + * @author Gigi + */ +public class StoryOfTauti extends AbstractInstance +{ + // NPC + private static final int DETON = 34170; + private static final int FLAME_FLOWER = 19606; + private static final int SEAL_DEVICE = 19608; + // Monsters + private static final int FLAME_STACATO = 23681; + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + private static final int SEAL_ARCHANGEL = 23683; + private static final int SEALED_ANGEL = 23685; + private static final int NPC_1 = 19626; + // Item + private static final int FLAME_FLOWER_BUD = 46554; + // Misc + private static final int TEMPLATE_ID = 261; + private static final ScriptZone FLAME_FLOWER_ZONE = ZoneManager.getInstance().getZoneById(80027, ScriptZone.class); + private static final ScriptZone START_ZONE = ZoneManager.getInstance().getZoneById(80028, ScriptZone.class); + private static final ScriptZone SCORPION_ZONE = ZoneManager.getInstance().getZoneById(80029, ScriptZone.class); + private static final ScriptZone GOLEM_ZONE = ZoneManager.getInstance().getZoneById(80030, ScriptZone.class); + private static final ScriptZone TOMBSTONE_ZONE = ZoneManager.getInstance().getZoneById(80031, ScriptZone.class); + private static final ScriptZone ANGEL_ZONE = ZoneManager.getInstance().getZoneById(80032, ScriptZone.class); + private static final ScriptZone SCARAB_ZONE = ZoneManager.getInstance().getZoneById(80033, ScriptZone.class); + private static final SkillHolder DECREASE_PDEF = new SkillHolder(18515, 1); + private static final SkillHolder SUMMON_FLAME_FLOWER = new SkillHolder(18513, 1); + private static final SkillHolder SEAL_ARCHANGEL_WRATH = new SkillHolder(16572, 1); + private static final Location DETON_MOVE = new Location(143641, -149193, -8072); + private static final Location DETON_MOVE_1 = new Location(151084, -152315, -9072); + private static final Location DETON_MOVE_2 = new Location(151618, -152823, -9064); + private static final Location DETON_MOVE_3 = new Location(153296, -145602, -11384); + private static final Location TELEPORT = new Location(153267, -148441, -11560); + private static final int ZONE_1ST_TRIGER = 24137770; + private static final int SKILL_TRIGER = 24138880; + private static Npc _deton; + private static Npc _seal_device; + protected int _count = 0; + + public StoryOfTauti() + { + super(TEMPLATE_ID); + addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL); + addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL); + addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL); + addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE); + addFirstTalkId(DETON); + addEnterZoneId(FLAME_FLOWER_ZONE.getId(), START_ZONE.getId(), SCORPION_ZONE.getId(), GOLEM_ZONE.getId(), TOMBSTONE_ZONE.getId(), ANGEL_ZONE.getId(), SCARAB_ZONE.getId()); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + final Instance world = npc.getInstanceWorld(); + switch (event) + { + case "start_story": + { + player.standUp(); + enterInstance(player, null, TEMPLATE_ID); + final Party party = player.getParty(); + if (party != null) + { + final Instance instance = player.getInstanceWorld(); + for (PlayerInstance member : party.getMembers()) + { + if (member != player) + { + member.standUp(); + member.teleToLocation(player, instance); + instance.addPlayer(member); + instance.addAllowed(member); + } + } + instance.setReenterTime(); + } + break; + } + case "give_map": + { + if ((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) + { + if (world.isStatus(1) || world.isStatus(4)) + { + _deton.setTarget(player); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); + } + else + { + return "34170-01.html"; + } + } + break; + } + case "check_status": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + startQuestTimer("msg_1", 7000, _deton, null); + break; + } + case "msg_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW); + startQuestTimer("msg_2", 10000, _deton, null); + break; + } + case "msg_2": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE); + startQuestTimer("msg_3", 10000, _deton, null); + break; + } + case "msg_3": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME); + break; + } + case "msg_4": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE); + startQuestTimer("msg_5", 7000, _deton, null); + break; + } + case "msg_5": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE); + startQuestTimer("msg_6", 10000, _deton, null); + break; + } + case "msg_6": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE); + break; + } + case "spawn_stacato": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_1", 50000, _deton, null); + break; + } + case "spawn_stacato_1": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_2", 50000, _deton, null); + break; + } + case "spawn_stacato_2": + { + world.spawnGroup("flame_stacato"); + world.setStatus(3); + break; + } + case "check_flower": + { + if (!npc.isDead()) + { + for (final Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000)) + { + if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0)) + { + _deton.setRunning(); + addMoveToDesire(npc, nearby.getLocation(), 23); + if (npc.calculateDistance3D(nearby) < 100) + { + nearby.setCurrentHp(nearby.getCurrentHp() - 10000); + nearby.setScriptValue(1); + npc.setCurrentHp(npc.getCurrentHp() + 15000); + npc.setScriptValue(1); + startQuestTimer("reset_flower", 8000, nearby, null); + if (nearby.getCurrentHp() < 1) + { + nearby.doDie(npc); + } + } + } + } + } + break; + } + case "reset_flower": + { + npc.setScriptValue(0); + break; + } + case "msg_7": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN); + break; + } + case "spawn_scorpion": + { + world.spawnGroup("flame_scorpion"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE); + if (getRandom(10) < 5) + { + world.spawnGroup("ifrit"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IFRIT, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + break; + } + case "attack_player": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, pl -> + { + if ((pl != null) && !pl.isDead()) + { + _deton.setRunning(); + addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23); + addAttackPlayerDesire(npc, pl); + } + if (!npc.isDead() && !npc.isInCombat()) + { + startQuestTimer("attack_player", 5000, npc, pl); + } + }); + break; + } + case "msg_8": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS); + startQuestTimer("msg_9", 8000, _deton, null); + break; + } + case "msg_9": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY); + startQuestTimer("msg_10", 10000, _deton, null); + break; + } + case "msg_10": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING); + break; + } + case "spawn_golem": + { + world.spawnGroup("golem"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away", 10000, _deton, null); + break; + } + case "run_away": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 3500, _deton, null); + break; + } + case "delete_daton": + { + world.despawnGroup("general"); + world.spawnGroup("seal_tmbstone"); + break; + } + case "msg_11": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST); + break; + } + case "msg_12": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA); + startQuestTimer("msg_13", 9000, _deton, null); + break; + } + case "msg_13": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA); + break; + } + case "spawn_scarab": + { + world.spawnGroup("flame_scarab"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away_1", 8000, _deton, null); + break; + } + case "run_away_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 5000, _deton, null); + break; + } + case "switch_quest": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(6)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(7, true); + } + } + } + } + } + }); + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, true)); + break; + } + case "angel_msg": + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_STUPID_IGNORANCE_IS_A_SIN_I_LL_LET_YOU_GO_THIS_ONE_TIME_GO); + world.despawnGroup("seal_tmbstone"); + break; + } + case "angel_teleport": + { + npc.teleToLocation(TELEPORT, world); + startQuestTimer("angel_triger", 2000, npc, player); + break; + } + case "angel_triger": + { + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, false)); + world.spawnGroup("singl_angel"); + startQuestTimer("triger", 3000, npc, player); + break; + } + case "triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, true)); + startQuestTimer("end_triger", 12000, npc, player); + startQuestTimer("clone_1", 1000, npc, player); + world.despawnGroup("seal_arngels"); + break; + } + case "clone_1": + { + world.spawnGroup("clone_1"); + startQuestTimer("clone_2", 500, npc, player); + break; + } + case "clone_2": + { + world.spawnGroup("clone_2"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_3", 500, npc, player); + } + break; + } + case "clone_3": + { + world.spawnGroup("clone_3"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_4", 500, npc, player); + } + break; + } + case "clone_4": + { + world.spawnGroup("clone_4"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_5", 500, npc, player); + } + break; + } + case "clone_5": + { + world.spawnGroup("clone_5"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_6", 500, npc, player); + } + break; + } + case "clone_6": + { + world.spawnGroup("clone_6"); + startQuestTimer("clone_7", 500, npc, player); + break; + } + case "clone_7": + { + world.spawnGroup("clone_7"); + break; + } + case "clone_player": + { + npc.setCloneObjId(player.getObjectId()); + if ((npc.getCloneObjId() == player.getObjectId()) && !player.getEffectList().hasAbnormalVisualEffect(AbnormalVisualEffect.STUN)) + { + player.teleToLocation(npc.getLocation(), world); + player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.STUN); + if ((player.getClan() != null) && (player.getClanCrestId() != 0)) + { + npc.setClanId(player.getClanId()); + } + npc.broadcastStatusUpdate(); + } + npc.setScriptValue(1); + startQuestTimer("clear_player", 12000, npc, player); + break; + } + case "end_triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, false)); + break; + } + case "clear_player": + { + player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STUN); + break; + } + case "end_instance": + { + cancelQuestTimers("check_flower"); + _count = 0; + for (Npc n : world.getAliveNpcs()) + { + n.deleteMe(); + } + world.finishInstance(0); + break; + } + } + return null; + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case SEAL_TOMBSTONE: + { + if (npc.isScriptValue(0)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW); + npc.setScriptValue(1); + break; + } + if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60)) + { + _seal_device.setDisplayEffect(1); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE); + npc.setScriptValue(2); + break; + } + if (npc.isScriptValue(2) && (npc.getCurrentHpPercent() < 40)) + { + if (getRandom(10) < 5) + { + world.spawnGroup("arimanes"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ARIMANES, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + npc.setScriptValue(3); + break; + } + if (npc.isScriptValue(3) && (npc.getCurrentHpPercent() < 20)) + { + _seal_device.setDisplayEffect(2); + npc.setScriptValue(4); + break; + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(9) && npc.isScriptValue(0)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_NOT_LUST_AFTER_WHAT_S_SEALED_HERE_IT_IS_NOT_YOURS); + startQuestTimer("angel_msg", 6000, npc, null); + startQuestTimer("switch_quest", 1000, npc, attacker); + npc.setScriptValue(1); + } + if (world.isStatus(9) && (npc.getCurrentHpPercent() < 50)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_MUST_REMAIN_SEALED_HERE); + startQuestTimer("angel_teleport", 3000, npc, attacker); + world.setStatus(10); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + } + if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30)) + { + world.spawnGroup("last_deton"); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3); + startQuestTimer("msg_12", 6000, _deton, null); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME); + world.setStatus(11); + } + if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5)) + { + npc.setIsInvul(true); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + world.setStatus(12); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(7)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(8, true); + } + } + } + } + } + }); + startQuestTimer("end_instance", 52000, _deton, null); + world.despawnGroup("last_deton"); + world.despawnGroup("last_archagel"); + playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE); + npc.deleteMe(); + } + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_STACATO: + { + if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty()) + { + cancelQuestTimers("end_instance"); + cancelQuestTimers("check_flower"); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME))); + world.setStatus(4); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL); + startQuestTimer("msg_7", 7000, _deton, null); + } + break; + } + case FLAME_SCORPION: + { + if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("msg_8", 3000, _deton, null); + world.setStatus(6); + } + break; + } + case SEAL_TOMBSTONE: + { + _seal_device.setDisplayEffect(3); + _seal_device.doDie(npc); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2); + startQuestTimer("msg_11", 3000, _deton, null); + break; + } + case SEALED_ANGEL: + { + world.spawnGroup("last_archagel"); + world.openCloseDoor(world.getTemplateParameters().getInt("1_door"), true); + break; + } + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + final Instance world = creature.getInstanceWorld(); + final PlayerInstance player = creature.getActingPlayer(); + if (isInInstance(world)) + { + switch (zone.getId()) + { + case 80027: + { + if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1)) + { + world.setStatus(2); + _deton.setTarget(null); + _deton.stopMove(null); + startQuestTimer("msg_4", 7000, _deton, null); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME))); + startQuestTimer("end_instance", 190000, _deton, null); + startQuestTimer("spawn_stacato", 5000, _deton, null); + } + break; + } + case 80028: + { + if (world.isStatus(0)) + { + startQuestTimer("check_status", 21000, _deton, player); + world.setStatus(1); + } + break; + } + case 80029: + { + if (world.isStatus(4)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING); + startQuestTimer("spawn_scorpion", 5000, _deton, player); + world.setStatus(5); + } + break; + } + case 80030: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY); + startQuestTimer("spawn_golem", 7000, _deton, player); + world.setStatus(7); + } + break; + } + case 80031: + { + if (world.isStatus(7)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_SEALED_TABLET_HUH, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.setStatus(8); + } + break; + } + case 80032: + { + if (world.isStatus(8)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THERE_S_NO_FUTURE_FOR_THOSE_WHO_CANNOT_WIN_AGAINST_THEMSELVES, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.spawnGroup("seal_arngels"); + world.setStatus(9); + } + break; + } + case 80033: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT); + startQuestTimer("spawn_scarab", 7000, _deton, player); + world.setStatus(7); + } + break; + } + } + } + return super.onEnterZone(creature, zone); + + } + + @Override + public String onSpawn(Npc npc) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case DETON: + { + _deton = npc; + break; + } + case SEAL_DEVICE: + { + _seal_device = npc; + break; + } + case FLAME_FLOWER: + { + npc.setCurrentHp(npc.getMaxHp() * 0.20); + for (final Npc tombstone : World.getInstance().getVisibleObjectsInRange(npc, MonsterInstance.class, 500)) + { + if (tombstone.getId() == SEAL_TOMBSTONE) + { + npc.setTarget(tombstone); + tryToEffect(npc, tombstone, DECREASE_PDEF.getSkillId()); + } + } + break; + } + case FLAME_STACATO: + { + startQuestTimer("check_flower", 3000, npc, null, true); + break; + } + case FLAME_SCORPION: + { + startQuestTimer("attack_player", 2000, npc, null); + break; + } + case FLAME_GOLEM: + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(3, true); + } + } + } + } + } + }); + break; + } + case FLAME_SCARAB: + { + startQuestTimer("attack_player", 2000, npc, null); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(4, true); + } + } + } + } + } + }); + break; + } + case NPC_1: + { + for (final PlayerInstance nearby : World.getInstance().getVisibleObjectsInRange(npc, PlayerInstance.class, 2000)) + { + if (npc.isScriptValue(0) && (nearby != null)) + { + startQuestTimer("clone_player", 500, npc, nearby); + } + + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(10)) + { + npc.setCurrentHp(npc.getMaxHp() * 0.5); + } + break; + } + } + } + return super.onSpawn(npc); + } + + @Override + public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_FLOWER: + { + if ((world.getStatus() < 5) && (npc.getCurrentHp() == npc.getMaxHp())) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_LOOK_INSIDE_YOUR_BAG_YOU_OBTAINED_A_FLAME_FLOWER, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false, caster.getName())); + giveItems(caster, FLAME_FLOWER_BUD, 1); + npc.doDie(npc); + npc.deleteMe(); + } + break; + } + case SEAL_TOMBSTONE: + { + if (skill.getId() == SUMMON_FLAME_FLOWER.getSkillId()) + { + addSpawn(FLAME_FLOWER, caster, false, 60000, false, world.getId()); + } + break; + } + } + } + return super.onSkillSee(npc, caster, skill, targets, isSummon); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return npc.getId() + ".html"; + } + + private void tryToEffect(Npc npc, Creature character, int diseaseId) + { + final BuffInfo info = character.getEffectList().getBuffInfoBySkillId(diseaseId); + final int skillLevel = (info == null) ? 1 : (info.getSkill().getLevel() < 3) ? info.getSkill().getLevel() + 1 : 3; + final Skill skill = SkillData.getInstance().getSkill(diseaseId, skillLevel); + + if ((skill != null) && SkillCaster.checkUseConditions(npc, skill)) + { + npc.doCast(skill); + } + } + + public static void main(String[] args) + { + new StoryOfTauti(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/MissingQuests.txt b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/MissingQuests.txt index 6467f96f1a..93458a9a6d 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/MissingQuests.txt +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/MissingQuests.txt @@ -128,7 +128,6 @@ 824 Attack the Command Post 825 Hunter Guild Request - Valley of Saints 832 Hunter Guild Request - Southern Region, Isle of Prayer -833 Devil's Treasure, Tauti 834 Against Dragonclaw 836 Request from the Blackbird Clan 837 Request from the Giant Trackers diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html new file mode 100644 index 0000000000..d88c3f725f --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html @@ -0,0 +1,6 @@ +Mystic Tavern Owner Settlen:
+Oh, you must have heard Tauti's story!
+I was so shocked when I first heard about Tauti's story. To think that Deton tried to take axe and ended up turning into that...
+Anyway, I told you our stories are very interesting.
+ + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html new file mode 100644 index 0000000000..177a8a9510 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+Anyway, thank you for listening to our stories. Here's a small gift for you.
+Please come by often and let's all have a great time again. + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html new file mode 100644 index 0000000000..1a8f732647 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+The most interesting still ahead, and you want to leave?
+Just think about our employees who are trying for you. Please listen to the story to the end + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java new file mode 100644 index 0000000000..4100e10d37 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java @@ -0,0 +1,224 @@ +/* + * 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 quests.Q00833_DevilsTreasureTauti; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.enums.QuestType; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.quest.State; + +/** + * Devil's Treasure, Tauti (833) + * @URL https://l2wiki.com/Devil%27s_Treasure,_Tauti + * @author Gigi + */ +public class Q00833_DevilsTreasureTauti extends Quest +{ + // NPCs + private static final int DETON = 34170; + private static final int SETTLEN = 34180; + // Monsters + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + // Items + private static final int FRENZED_TAUTIS_FRAGMENT = 47884; + private static final int INSANE_KELBIMS_FRAGMENT = 47885; + private static final int SOE_MISTYC_TAVERN = 46564; + private static final int MYSTIC_ARMOR_PIACE = 46587; + private static final int FLAME_FLOWER = 46554; + + public Q00833_DevilsTreasureTauti() + { + super(833); + addStartNpc(DETON); + addTalkId(SETTLEN); + addKillId(FLAME_SCORPION, FLAME_GOLEM, FLAME_SCARAB, SEAL_TOMBSTONE); + addSeeCreatureId(DETON); + registerQuestItems(FLAME_FLOWER); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + final QuestState qs = getQuestState(player, false); + switch (event) + { + case "34180-02.html": + { + final int chance = getRandom(100); + if (chance <= 10) + { + giveItems(player, FRENZED_TAUTIS_FRAGMENT, 1); + } + else if ((chance > 10) && (chance <= 20)) + { + giveItems(player, INSANE_KELBIMS_FRAGMENT, 1); + } + else if ((chance > 20) && (chance <= 40)) + { + giveItems(player, MYSTIC_ARMOR_PIACE, 1); + } + else + { + giveItems(player, SOE_MISTYC_TAVERN, 1); + } + addExpAndSp(player, 6_362_541_900L, 15_270_101); + qs.exitQuest(QuestType.REPEATABLE, true); + htmltext = event; + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, PlayerInstance player) + { + String htmltext = getNoQuestMsg(player); + final QuestState qs = getQuestState(player, true); + + switch (qs.getState()) + { + case State.STARTED: + { + htmltext = (qs.isCond(8)) ? "34180-01.html" : "34180-03.html"; + } + } + return htmltext; + } + + @Override + public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) + { + final PlayerInstance player = creature.getActingPlayer(); + if (player != null) + { + final QuestState qs = getQuestState(player, true); + if (!qs.isStarted()) + { + playMovie(player, Movie.EPIC_TAUTI_SLIDE); + qs.startQuest(); + } + } + return super.onSeeCreature(npc, creature, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + Party party = killer.getParty(); + if (party != null) + { + party.getMembers().forEach(p -> onKill(npc, p)); + } + else + { + onKill(npc, killer); + } + return super.onKill(npc, killer, isSummon); + } + + private void onKill(Npc npc, PlayerInstance killer) + { + final QuestState qs = getQuestState(killer, false); + switch (npc.getId()) + { + case FLAME_SCORPION: + { + if ((qs != null) && qs.isCond(1) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScorpion = qs.getInt("killed_" + FLAME_SCORPION); + if (killedScorpion < 5) + { + qs.set("killed_" + FLAME_SCORPION, ++killedScorpion); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScorpion >= 5) + { + qs.setCond(2, true); + } + sendNpcLogList(killer); + } + break; + } + case FLAME_GOLEM: + { + if ((qs != null) && qs.isCond(3) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(5, true); + } + break; + } + case FLAME_SCARAB: + { + if ((qs != null) && qs.isCond(4) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScarab = qs.getInt("killed_" + FLAME_SCARAB); + if (killedScarab < 5) + { + qs.set("killed_" + FLAME_SCARAB, ++killedScarab); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScarab >= 5) + { + qs.setCond(5, true); + } + sendNpcLogList(killer); + } + break; + } + case SEAL_TOMBSTONE: + { + if ((qs != null) && qs.isCond(5) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(6, true); + } + break; + } + } + } + + @Override + public Set getNpcLogList(PlayerInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs.isCond(1) || qs.isCond(4)) + { + final Set holder = new HashSet<>(2); + holder.add(new NpcLogListHolder(FLAME_SCORPION, false, qs.getInt("killed_" + FLAME_SCORPION))); + holder.add(new NpcLogListHolder(FLAME_SCARAB, false, qs.getInt("killed_" + FLAME_SCARAB))); + return holder; + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/QuestMasterHandler.java index f0515d469f..ac9396ac4b 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -168,6 +168,7 @@ import quests.Q00828_EvasBlessing.Q00828_EvasBlessing; import quests.Q00829_MaphrsSalvation.Q00829_MaphrsSalvation; import quests.Q00830_TheWayOfTheGiantsPawn.Q00830_TheWayOfTheGiantsPawn; import quests.Q00831_SayhasScheme.Q00831_SayhasScheme; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; import quests.Q00835_PitiableMelisa.Q00835_PitiableMelisa; import quests.Q00901_HowLavasaurusesAreMade.Q00901_HowLavasaurusesAreMade; import quests.Q00902_ReclaimOurEra.Q00902_ReclaimOurEra; @@ -649,6 +650,7 @@ public class QuestMasterHandler Q00829_MaphrsSalvation.class, Q00830_TheWayOfTheGiantsPawn.class, Q00831_SayhasScheme.class, + Q00833_DevilsTreasureTauti.class, Q00835_PitiableMelisa.class, Q00836_RequestFromTheBlackbirdClan.class, // TODO: Not done. Q00837_RequestFromTheGiantTrackers.class, // TODO: Not done. diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/npcs/19600-19699.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/npcs/19600-19699.xml index d1bf8b5e3a..a44296bd57 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/npcs/19600-19699.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/npcs/19600-19699.xml @@ -102,7 +102,7 @@
- + HUMAN FEMALE @@ -113,24 +113,24 @@ - + - - - HUMAN - FEMALE + + ETC - + + + - + @@ -147,7 +147,7 @@ - + diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/16500-16599.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/16500-16599.xml index a25a1c2d7e..a44287f16a 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/16500-16599.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/16500-16599.xml @@ -691,20 +691,39 @@ icon.skill11276 - A1 + 1 + 1 + A2 900 600000 300000 -707 + 2 true + TARGET + SINGLE icon.skill4111 + 1 + 3 + STUN + STUN A2 400 -100 + 10-10 true + 0;0;80;300 + SELF + FAN_PB + NOT_FRIEND + + + 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 + + diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/18500-18599.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/18500-18599.xml index fd2dc10f28..f0c2e40bae 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/18500-18599.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/18500-18599.xml @@ -123,36 +123,70 @@ 500 + icon.skill0000 + 1 + 46554 A1 1500 3000 + 5 + 0 + SELF + SINGLE icon.skill0246 A1 - 500 10 100 - 60000 + 120000 5000 - + + + icon.skill1042 + 5 + 60 + PD_DOWN A2 - 500 + 600 -692 true + TARGET + SINGLE + + + + -10 + -30 + -50 + + PER + + + + -10 + -30 + -50 + + PER + + + 16571 + 1 + + icon.skill0246 A1 - 500 10 100 - 60000 + 120000 5000 diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/zones/custom_script.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/zones/custom_script.xml index 1b41b7764d..45a359eaaa 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/zones/custom_script.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/zones/custom_script.xml @@ -1131,4 +1131,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/instances/MysticTavern/StoryOfTauti.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/instances/MysticTavern/StoryOfTauti.xml new file mode 100644 index 0000000000..e8d0ac86b2 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/instances/MysticTavern/StoryOfTauti.xml @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java index f0f803c31c..d68fbb30b6 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/MysticTavern.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.PlaySound; import ai.AbstractNpcAI; import instances.MysticTavern.StoryOfFreya.StoryOfFreya; +import instances.MysticTavern.StoryOfTauti.StoryOfTauti; import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub; /** @@ -57,7 +58,7 @@ public class MysticTavern extends AbstractNpcAI private static final int LUPIA = 34185; private static final int MEY = 34186; // Instances - // private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_KELBIM = 262; private static final int INSTANCE_FREYA = 263; // Zones @@ -105,7 +106,7 @@ public class MysticTavern extends AbstractNpcAI } final List availableInstances = new ArrayList<>(); availableInstances.add(INSTANCE_FREYA); - // availableInstances.add(INSTANCE_TAUTI); + availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_KELBIM); for (PlayerInstance member : party.getMembers()) { @@ -132,16 +133,16 @@ public class MysticTavern extends AbstractNpcAI } } } - // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) - // { - // for (int i = 0; i < availableInstances.size(); i++) - // { - // if (availableInstances.get(i) == INSTANCE_TAUTI) - // { - // availableInstances.remove(i); - // } - // } - // } + if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_TAUTI) > 0) + { + for (int i = 0; i < availableInstances.size(); i++) + { + if (availableInstances.get(i) == INSTANCE_TAUTI) + { + availableInstances.remove(i); + } + } + } // if (InstanceManager.getInstance().getInstanceTime(member, INSTANCE_KELBIM) > 0) // { // for (int i = 0; i < availableInstances.size(); i++) @@ -160,7 +161,6 @@ public class MysticTavern extends AbstractNpcAI npc.setScriptValue(getRandom(availableInstances.size())); startQuestTimer("npcRoute", 3000, npc, player); } - startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test break; } case "npcRoute": @@ -333,11 +333,11 @@ public class MysticTavern extends AbstractNpcAI player.processQuestEvent(StoryOfFreya.class.getSimpleName(), "start_story"); break; } - // case INSTANCE_TAUTI: - // { - // player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); - // break; - // } + case INSTANCE_TAUTI: + { + player.processQuestEvent(StoryOfTauti.class.getSimpleName(), "start_story"); + break; + } // case INSTANCE_KELBIM: // { // player.processQuestEvent(StoryOfKelbim.class.getSimpleName(), "start_story"); diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html new file mode 100644 index 0000000000..39c376f9e3 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170-01.html @@ -0,0 +1,3 @@ +Archaeologist Deton:
+What do you want? I'm busy right now. Come back later. + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html new file mode 100644 index 0000000000..0bcdd62f25 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/34170.html @@ -0,0 +1,5 @@ +Archaeologist Deton:
+Hmm, where are we?
+I should take a look at the map again...
+ + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java new file mode 100644 index 0000000000..15f0c319b2 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/instances/MysticTavern/StoryOfTauti/StoryOfTauti.java @@ -0,0 +1,943 @@ +/* + * 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.MysticTavern.StoryOfTauti; + +import java.util.List; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.data.xml.impl.SkillData; +import org.l2jmobius.gameserver.enums.ChatType; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.instancemanager.QuestManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.World; +import org.l2jmobius.gameserver.model.WorldObject; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.SkillHolder; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; +import org.l2jmobius.gameserver.model.skills.BuffInfo; +import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillCaster; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.ScriptZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; +import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger; + +import instances.AbstractInstance; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; + +/** + * Mystic Tavern Tauti Instance + * @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk + * @author Gigi + */ +public class StoryOfTauti extends AbstractInstance +{ + // NPC + private static final int DETON = 34170; + private static final int FLAME_FLOWER = 19606; + private static final int SEAL_DEVICE = 19608; + // Monsters + private static final int FLAME_STACATO = 23681; + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + private static final int SEAL_ARCHANGEL = 23683; + private static final int SEALED_ANGEL = 23685; + private static final int NPC_1 = 19626; + // Item + private static final int FLAME_FLOWER_BUD = 46554; + // Misc + private static final int TEMPLATE_ID = 261; + private static final ScriptZone FLAME_FLOWER_ZONE = ZoneManager.getInstance().getZoneById(80027, ScriptZone.class); + private static final ScriptZone START_ZONE = ZoneManager.getInstance().getZoneById(80028, ScriptZone.class); + private static final ScriptZone SCORPION_ZONE = ZoneManager.getInstance().getZoneById(80029, ScriptZone.class); + private static final ScriptZone GOLEM_ZONE = ZoneManager.getInstance().getZoneById(80030, ScriptZone.class); + private static final ScriptZone TOMBSTONE_ZONE = ZoneManager.getInstance().getZoneById(80031, ScriptZone.class); + private static final ScriptZone ANGEL_ZONE = ZoneManager.getInstance().getZoneById(80032, ScriptZone.class); + private static final ScriptZone SCARAB_ZONE = ZoneManager.getInstance().getZoneById(80033, ScriptZone.class); + private static final SkillHolder DECREASE_PDEF = new SkillHolder(18515, 1); + private static final SkillHolder SUMMON_FLAME_FLOWER = new SkillHolder(18513, 1); + private static final SkillHolder SEAL_ARCHANGEL_WRATH = new SkillHolder(16572, 1); + private static final Location DETON_MOVE = new Location(143641, -149193, -8072); + private static final Location DETON_MOVE_1 = new Location(151084, -152315, -9072); + private static final Location DETON_MOVE_2 = new Location(151618, -152823, -9064); + private static final Location DETON_MOVE_3 = new Location(153296, -145602, -11384); + private static final Location TELEPORT = new Location(153267, -148441, -11560); + private static final int ZONE_1ST_TRIGER = 24137770; + private static final int SKILL_TRIGER = 24138880; + private static Npc _deton; + private static Npc _seal_device; + protected int _count = 0; + + public StoryOfTauti() + { + super(TEMPLATE_ID); + addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL); + addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL); + addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL); + addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE); + addFirstTalkId(DETON); + addEnterZoneId(FLAME_FLOWER_ZONE.getId(), START_ZONE.getId(), SCORPION_ZONE.getId(), GOLEM_ZONE.getId(), TOMBSTONE_ZONE.getId(), ANGEL_ZONE.getId(), SCARAB_ZONE.getId()); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + final Instance world = npc.getInstanceWorld(); + switch (event) + { + case "start_story": + { + player.standUp(); + enterInstance(player, null, TEMPLATE_ID); + final Party party = player.getParty(); + if (party != null) + { + final Instance instance = player.getInstanceWorld(); + for (PlayerInstance member : party.getMembers()) + { + if (member != player) + { + member.standUp(); + member.teleToLocation(player, instance); + instance.addPlayer(member); + instance.addAllowed(member); + } + } + instance.setReenterTime(); + } + break; + } + case "give_map": + { + if ((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) + { + if (world.isStatus(1) || world.isStatus(4)) + { + _deton.setTarget(player); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); + } + else + { + return "34170-01.html"; + } + } + break; + } + case "check_status": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + startQuestTimer("msg_1", 7000, _deton, null); + break; + } + case "msg_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW); + startQuestTimer("msg_2", 10000, _deton, null); + break; + } + case "msg_2": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE); + startQuestTimer("msg_3", 10000, _deton, null); + break; + } + case "msg_3": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME); + break; + } + case "msg_4": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE); + startQuestTimer("msg_5", 7000, _deton, null); + break; + } + case "msg_5": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE); + startQuestTimer("msg_6", 10000, _deton, null); + break; + } + case "msg_6": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE); + break; + } + case "spawn_stacato": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_1", 50000, _deton, null); + break; + } + case "spawn_stacato_1": + { + world.spawnGroup("flame_stacato"); + startQuestTimer("spawn_stacato_2", 50000, _deton, null); + break; + } + case "spawn_stacato_2": + { + world.spawnGroup("flame_stacato"); + world.setStatus(3); + break; + } + case "check_flower": + { + if (!npc.isDead()) + { + for (final Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000)) + { + if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0)) + { + _deton.setRunning(); + addMoveToDesire(npc, nearby.getLocation(), 23); + if (npc.calculateDistance3D(nearby) < 100) + { + nearby.setCurrentHp(nearby.getCurrentHp() - 10000); + nearby.setScriptValue(1); + npc.setCurrentHp(npc.getCurrentHp() + 15000); + npc.setScriptValue(1); + startQuestTimer("reset_flower", 8000, nearby, null); + if (nearby.getCurrentHp() < 1) + { + nearby.doDie(npc); + } + } + } + } + } + break; + } + case "reset_flower": + { + npc.setScriptValue(0); + break; + } + case "msg_7": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN); + break; + } + case "spawn_scorpion": + { + world.spawnGroup("flame_scorpion"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE); + if (getRandom(10) < 5) + { + world.spawnGroup("ifrit"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IFRIT, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + break; + } + case "attack_player": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, pl -> + { + if ((pl != null) && !pl.isDead()) + { + _deton.setRunning(); + addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23); + addAttackPlayerDesire(npc, pl); + } + if (!npc.isDead() && !npc.isInCombat()) + { + startQuestTimer("attack_player", 5000, npc, pl); + } + }); + break; + } + case "msg_8": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS); + startQuestTimer("msg_9", 8000, _deton, null); + break; + } + case "msg_9": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY); + startQuestTimer("msg_10", 10000, _deton, null); + break; + } + case "msg_10": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING); + break; + } + case "spawn_golem": + { + world.spawnGroup("golem"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away", 10000, _deton, null); + break; + } + case "run_away": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 3500, _deton, null); + break; + } + case "delete_daton": + { + world.despawnGroup("general"); + world.spawnGroup("seal_tmbstone"); + break; + } + case "msg_11": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST); + break; + } + case "msg_12": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA); + startQuestTimer("msg_13", 9000, _deton, null); + break; + } + case "msg_13": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA); + break; + } + case "spawn_scarab": + { + world.spawnGroup("flame_scarab"); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("run_away_1", 8000, _deton, null); + break; + } + case "run_away_1": + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE); + _deton.setTarget(null); + _deton.stopMove(null); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1); + startQuestTimer("delete_daton", 5000, _deton, null); + break; + } + case "switch_quest": + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(6)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(7, true); + } + } + } + } + } + }); + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, true)); + break; + } + case "angel_msg": + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_STUPID_IGNORANCE_IS_A_SIN_I_LL_LET_YOU_GO_THIS_ONE_TIME_GO); + world.despawnGroup("seal_tmbstone"); + break; + } + case "angel_teleport": + { + npc.teleToLocation(TELEPORT, world); + startQuestTimer("angel_triger", 2000, npc, player); + break; + } + case "angel_triger": + { + world.broadcastPacket(new OnEventTrigger(ZONE_1ST_TRIGER, false)); + world.spawnGroup("singl_angel"); + startQuestTimer("triger", 3000, npc, player); + break; + } + case "triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, true)); + startQuestTimer("end_triger", 12000, npc, player); + startQuestTimer("clone_1", 1000, npc, player); + world.despawnGroup("seal_arngels"); + break; + } + case "clone_1": + { + world.spawnGroup("clone_1"); + startQuestTimer("clone_2", 500, npc, player); + break; + } + case "clone_2": + { + world.spawnGroup("clone_2"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_3", 500, npc, player); + } + break; + } + case "clone_3": + { + world.spawnGroup("clone_3"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_4", 500, npc, player); + } + break; + } + case "clone_4": + { + world.spawnGroup("clone_4"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_5", 500, npc, player); + } + break; + } + case "clone_5": + { + world.spawnGroup("clone_5"); + if (world.getAliveNpcs(NPC_1).size() < _count) + { + startQuestTimer("clone_6", 500, npc, player); + } + break; + } + case "clone_6": + { + world.spawnGroup("clone_6"); + startQuestTimer("clone_7", 500, npc, player); + break; + } + case "clone_7": + { + world.spawnGroup("clone_7"); + break; + } + case "clone_player": + { + npc.setCloneObjId(player.getObjectId()); + if ((npc.getCloneObjId() == player.getObjectId()) && !player.getEffectList().hasAbnormalVisualEffect(AbnormalVisualEffect.STUN)) + { + player.teleToLocation(npc.getLocation(), world); + player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.STUN); + if ((player.getClan() != null) && (player.getClanCrestId() != 0)) + { + npc.setClanId(player.getClanId()); + } + npc.broadcastStatusUpdate(); + } + npc.setScriptValue(1); + startQuestTimer("clear_player", 12000, npc, player); + break; + } + case "end_triger": + { + world.broadcastPacket(new OnEventTrigger(SKILL_TRIGER, false)); + break; + } + case "clear_player": + { + player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STUN); + break; + } + case "end_instance": + { + cancelQuestTimers("check_flower"); + _count = 0; + for (Npc n : world.getAliveNpcs()) + { + n.deleteMe(); + } + world.finishInstance(0); + break; + } + } + return null; + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case SEAL_TOMBSTONE: + { + if (npc.isScriptValue(0)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW); + npc.setScriptValue(1); + break; + } + if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60)) + { + _seal_device.setDisplayEffect(1); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE); + npc.setScriptValue(2); + break; + } + if (npc.isScriptValue(2) && (npc.getCurrentHpPercent() < 40)) + { + if (getRandom(10) < 5) + { + world.spawnGroup("arimanes"); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ARIMANES, ExShowScreenMessage.TOP_CENTER, 10000, true)); + } + npc.setScriptValue(3); + break; + } + if (npc.isScriptValue(3) && (npc.getCurrentHpPercent() < 20)) + { + _seal_device.setDisplayEffect(2); + npc.setScriptValue(4); + break; + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(9) && npc.isScriptValue(0)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_NOT_LUST_AFTER_WHAT_S_SEALED_HERE_IT_IS_NOT_YOURS); + startQuestTimer("angel_msg", 6000, npc, null); + startQuestTimer("switch_quest", 1000, npc, attacker); + npc.setScriptValue(1); + } + if (world.isStatus(9) && (npc.getCurrentHpPercent() < 50)) + { + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_MUST_REMAIN_SEALED_HERE); + startQuestTimer("angel_teleport", 3000, npc, attacker); + world.setStatus(10); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + } + if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30)) + { + world.spawnGroup("last_deton"); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3); + startQuestTimer("msg_12", 6000, _deton, null); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME); + world.setStatus(11); + } + if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5)) + { + npc.setIsInvul(true); + SEAL_ARCHANGEL_WRATH.getSkill().applyEffects(npc, attacker); + world.setStatus(12); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if (pl.isInParty()) + { + final Party party = pl.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(7)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(8, true); + } + } + } + } + } + }); + startQuestTimer("end_instance", 52000, _deton, null); + world.despawnGroup("last_deton"); + world.despawnGroup("last_archagel"); + playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE); + npc.deleteMe(); + } + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_STACATO: + { + if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty()) + { + cancelQuestTimers("end_instance"); + cancelQuestTimers("check_flower"); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME))); + world.setStatus(4); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl -> + { + if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()) + { + _deton.setTarget(pl); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl); + } + }); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL); + startQuestTimer("msg_7", 7000, _deton, null); + } + break; + } + case FLAME_SCORPION: + { + if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + startQuestTimer("msg_8", 3000, _deton, null); + world.setStatus(6); + } + break; + } + case SEAL_TOMBSTONE: + { + _seal_device.setDisplayEffect(3); + _seal_device.doDie(npc); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.setRunning(); + _deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2); + startQuestTimer("msg_11", 3000, _deton, null); + break; + } + case SEALED_ANGEL: + { + world.spawnGroup("last_archagel"); + world.openCloseDoor(world.getTemplateParameters().getInt("1_door"), true); + break; + } + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + final Instance world = creature.getInstanceWorld(); + final PlayerInstance player = creature.getActingPlayer(); + if (isInInstance(world)) + { + switch (zone.getId()) + { + case 80027: + { + if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1)) + { + world.setStatus(2); + _deton.setTarget(null); + _deton.stopMove(null); + startQuestTimer("msg_4", 7000, _deton, null); + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME))); + startQuestTimer("end_instance", 190000, _deton, null); + startQuestTimer("spawn_stacato", 5000, _deton, null); + } + break; + } + case 80028: + { + if (world.isStatus(0)) + { + startQuestTimer("check_status", 21000, _deton, player); + world.setStatus(1); + } + break; + } + case 80029: + { + if (world.isStatus(4)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING); + startQuestTimer("spawn_scorpion", 5000, _deton, player); + world.setStatus(5); + } + break; + } + case 80030: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY); + startQuestTimer("spawn_golem", 7000, _deton, player); + world.setStatus(7); + } + break; + } + case 80031: + { + if (world.isStatus(7)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_SEALED_TABLET_HUH, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.setStatus(8); + } + break; + } + case 80032: + { + if (world.isStatus(8)) + { + world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THERE_S_NO_FUTURE_FOR_THOSE_WHO_CANNOT_WIN_AGAINST_THEMSELVES, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false)); + world.spawnGroup("seal_arngels"); + world.setStatus(9); + } + break; + } + case 80033: + { + if (world.isStatus(6)) + { + _deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT); + startQuestTimer("spawn_scarab", 7000, _deton, player); + world.setStatus(7); + } + break; + } + } + } + return super.onEnterZone(creature, zone); + + } + + @Override + public String onSpawn(Npc npc) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case DETON: + { + _deton = npc; + break; + } + case SEAL_DEVICE: + { + _seal_device = npc; + break; + } + case FLAME_FLOWER: + { + npc.setCurrentHp(npc.getMaxHp() * 0.20); + for (final Npc tombstone : World.getInstance().getVisibleObjectsInRange(npc, MonsterInstance.class, 500)) + { + if (tombstone.getId() == SEAL_TOMBSTONE) + { + npc.setTarget(tombstone); + tryToEffect(npc, tombstone, DECREASE_PDEF.getSkillId()); + } + } + break; + } + case FLAME_STACATO: + { + startQuestTimer("check_flower", 3000, npc, null, true); + break; + } + case FLAME_SCORPION: + { + startQuestTimer("attack_player", 2000, npc, null); + break; + } + case FLAME_GOLEM: + { + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(3, true); + } + } + } + } + } + }); + break; + } + case FLAME_SCARAB: + { + startQuestTimer("attack_player", 2000, npc, null); + World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, player -> + { + if (player.isInParty()) + { + final Party party = player.getParty(); + final List members = party.getMembers(); + for (PlayerInstance member : members) + { + if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + final QuestState qs = member.getQuestState(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if ((qs != null) && qs.isCond(2)) + { + final Quest qs833 = QuestManager.getInstance().getQuest(Q00833_DevilsTreasureTauti.class.getSimpleName()); + if (qs833 != null) + { + qs.setCond(4, true); + } + } + } + } + } + }); + break; + } + case NPC_1: + { + for (final PlayerInstance nearby : World.getInstance().getVisibleObjectsInRange(npc, PlayerInstance.class, 2000)) + { + if (npc.isScriptValue(0) && (nearby != null)) + { + startQuestTimer("clone_player", 500, npc, nearby); + } + + } + break; + } + case SEAL_ARCHANGEL: + { + if (world.isStatus(10)) + { + npc.setCurrentHp(npc.getMaxHp() * 0.5); + } + break; + } + } + } + return super.onSpawn(npc); + } + + @Override + public String onSkillSee(Npc npc, PlayerInstance caster, Skill skill, WorldObject[] targets, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + switch (npc.getId()) + { + case FLAME_FLOWER: + { + if ((world.getStatus() < 5) && (npc.getCurrentHp() == npc.getMaxHp())) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_LOOK_INSIDE_YOUR_BAG_YOU_OBTAINED_A_FLAME_FLOWER, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false, caster.getName())); + giveItems(caster, FLAME_FLOWER_BUD, 1); + npc.doDie(npc); + npc.deleteMe(); + } + break; + } + case SEAL_TOMBSTONE: + { + if (skill.getId() == SUMMON_FLAME_FLOWER.getSkillId()) + { + addSpawn(FLAME_FLOWER, caster, false, 60000, false, world.getId()); + } + break; + } + } + } + return super.onSkillSee(npc, caster, skill, targets, isSummon); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return npc.getId() + ".html"; + } + + private void tryToEffect(Npc npc, Creature character, int diseaseId) + { + final BuffInfo info = character.getEffectList().getBuffInfoBySkillId(diseaseId); + final int skillLevel = (info == null) ? 1 : (info.getSkill().getLevel() < 3) ? info.getSkill().getLevel() + 1 : 3; + final Skill skill = SkillData.getInstance().getSkill(diseaseId, skillLevel); + + if ((skill != null) && SkillCaster.checkUseConditions(npc, skill)) + { + npc.doCast(skill); + } + } + + public static void main(String[] args) + { + new StoryOfTauti(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/MissingQuests.txt b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/MissingQuests.txt index 9d24d4c65e..91f6dd6a47 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/MissingQuests.txt +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/MissingQuests.txt @@ -129,7 +129,6 @@ 792 The Superion Giants 816 Plans to Repair the Stronghold 824 Command Post Raid -833 Devil's Treasure, Tauti 834 Against Dragonclaw 836 Request from the Blackbird Clan 837 Request from the Giant Trackers diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html new file mode 100644 index 0000000000..d88c3f725f --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-01.html @@ -0,0 +1,6 @@ +Mystic Tavern Owner Settlen:
+Oh, you must have heard Tauti's story!
+I was so shocked when I first heard about Tauti's story. To think that Deton tried to take axe and ended up turning into that...
+Anyway, I told you our stories are very interesting.
+ + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html new file mode 100644 index 0000000000..177a8a9510 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-02.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+Anyway, thank you for listening to our stories. Here's a small gift for you.
+Please come by often and let's all have a great time again. + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html new file mode 100644 index 0000000000..1a8f732647 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/34180-03.html @@ -0,0 +1,4 @@ +Mystic Tavern Owner Settlen:
+The most interesting still ahead, and you want to leave?
+Just think about our employees who are trying for you. Please listen to the story to the end + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java new file mode 100644 index 0000000000..4100e10d37 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/Q00833_DevilsTreasureTauti/Q00833_DevilsTreasureTauti.java @@ -0,0 +1,224 @@ +/* + * 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 quests.Q00833_DevilsTreasureTauti; + +import java.util.HashSet; +import java.util.Set; + +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.Movie; +import org.l2jmobius.gameserver.enums.QuestSound; +import org.l2jmobius.gameserver.enums.QuestType; +import org.l2jmobius.gameserver.model.Party; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.holders.NpcLogListHolder; +import org.l2jmobius.gameserver.model.quest.Quest; +import org.l2jmobius.gameserver.model.quest.QuestState; +import org.l2jmobius.gameserver.model.quest.State; + +/** + * Devil's Treasure, Tauti (833) + * @URL https://l2wiki.com/Devil%27s_Treasure,_Tauti + * @author Gigi + */ +public class Q00833_DevilsTreasureTauti extends Quest +{ + // NPCs + private static final int DETON = 34170; + private static final int SETTLEN = 34180; + // Monsters + private static final int FLAME_SCORPION = 23682; + private static final int FLAME_GOLEM = 23680; + private static final int FLAME_SCARAB = 23709; + private static final int SEAL_TOMBSTONE = 19607; + // Items + private static final int FRENZED_TAUTIS_FRAGMENT = 47884; + private static final int INSANE_KELBIMS_FRAGMENT = 47885; + private static final int SOE_MISTYC_TAVERN = 46564; + private static final int MYSTIC_ARMOR_PIACE = 46587; + private static final int FLAME_FLOWER = 46554; + + public Q00833_DevilsTreasureTauti() + { + super(833); + addStartNpc(DETON); + addTalkId(SETTLEN); + addKillId(FLAME_SCORPION, FLAME_GOLEM, FLAME_SCARAB, SEAL_TOMBSTONE); + addSeeCreatureId(DETON); + registerQuestItems(FLAME_FLOWER); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + final QuestState qs = getQuestState(player, false); + switch (event) + { + case "34180-02.html": + { + final int chance = getRandom(100); + if (chance <= 10) + { + giveItems(player, FRENZED_TAUTIS_FRAGMENT, 1); + } + else if ((chance > 10) && (chance <= 20)) + { + giveItems(player, INSANE_KELBIMS_FRAGMENT, 1); + } + else if ((chance > 20) && (chance <= 40)) + { + giveItems(player, MYSTIC_ARMOR_PIACE, 1); + } + else + { + giveItems(player, SOE_MISTYC_TAVERN, 1); + } + addExpAndSp(player, 6_362_541_900L, 15_270_101); + qs.exitQuest(QuestType.REPEATABLE, true); + htmltext = event; + break; + } + } + return htmltext; + } + + @Override + public String onTalk(Npc npc, PlayerInstance player) + { + String htmltext = getNoQuestMsg(player); + final QuestState qs = getQuestState(player, true); + + switch (qs.getState()) + { + case State.STARTED: + { + htmltext = (qs.isCond(8)) ? "34180-01.html" : "34180-03.html"; + } + } + return htmltext; + } + + @Override + public String onSeeCreature(Npc npc, Creature creature, boolean isSummon) + { + final PlayerInstance player = creature.getActingPlayer(); + if (player != null) + { + final QuestState qs = getQuestState(player, true); + if (!qs.isStarted()) + { + playMovie(player, Movie.EPIC_TAUTI_SLIDE); + qs.startQuest(); + } + } + return super.onSeeCreature(npc, creature, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + Party party = killer.getParty(); + if (party != null) + { + party.getMembers().forEach(p -> onKill(npc, p)); + } + else + { + onKill(npc, killer); + } + return super.onKill(npc, killer, isSummon); + } + + private void onKill(Npc npc, PlayerInstance killer) + { + final QuestState qs = getQuestState(killer, false); + switch (npc.getId()) + { + case FLAME_SCORPION: + { + if ((qs != null) && qs.isCond(1) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScorpion = qs.getInt("killed_" + FLAME_SCORPION); + if (killedScorpion < 5) + { + qs.set("killed_" + FLAME_SCORPION, ++killedScorpion); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScorpion >= 5) + { + qs.setCond(2, true); + } + sendNpcLogList(killer); + } + break; + } + case FLAME_GOLEM: + { + if ((qs != null) && qs.isCond(3) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(5, true); + } + break; + } + case FLAME_SCARAB: + { + if ((qs != null) && qs.isCond(4) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + int killedScarab = qs.getInt("killed_" + FLAME_SCARAB); + if (killedScarab < 5) + { + qs.set("killed_" + FLAME_SCARAB, ++killedScarab); + playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + + if (killedScarab >= 5) + { + qs.setCond(5, true); + } + sendNpcLogList(killer); + } + break; + } + case SEAL_TOMBSTONE: + { + if ((qs != null) && qs.isCond(5) && killer.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE)) + { + qs.setCond(6, true); + } + break; + } + } + } + + @Override + public Set getNpcLogList(PlayerInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs.isCond(1) || qs.isCond(4)) + { + final Set holder = new HashSet<>(2); + holder.add(new NpcLogListHolder(FLAME_SCORPION, false, qs.getInt("killed_" + FLAME_SCORPION))); + holder.add(new NpcLogListHolder(FLAME_SCARAB, false, qs.getInt("killed_" + FLAME_SCARAB))); + return holder; + } + return super.getNpcLogList(player); + } +} diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/QuestMasterHandler.java index 49fe289902..cf1ee9efe2 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -84,6 +84,7 @@ import quests.Q00828_EvasBlessing.Q00828_EvasBlessing; import quests.Q00829_MaphrsSalvation.Q00829_MaphrsSalvation; import quests.Q00830_TheWayOfTheGiantsPawn.Q00830_TheWayOfTheGiantsPawn; import quests.Q00831_SayhasScheme.Q00831_SayhasScheme; +import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti; import quests.Q00835_PitiableMelisa.Q00835_PitiableMelisa; import quests.Q00901_HowLavasaurusesAreMade.Q00901_HowLavasaurusesAreMade; import quests.Q00903_TheCallOfAntharas.Q00903_TheCallOfAntharas; @@ -302,6 +303,7 @@ public class QuestMasterHandler Q00829_MaphrsSalvation.class, Q00830_TheWayOfTheGiantsPawn.class, Q00831_SayhasScheme.class, + Q00833_DevilsTreasureTauti.class, Q00835_PitiableMelisa.class, Q00836_RequestFromTheBlackbirdClan.class, // TODO: Not done. Q00837_RequestFromTheGiantTrackers.class, // TODO: Not done. diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/npcs/19600-19699.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/npcs/19600-19699.xml index d1bf8b5e3a..a44296bd57 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/npcs/19600-19699.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/npcs/19600-19699.xml @@ -102,7 +102,7 @@
- + HUMAN FEMALE @@ -113,24 +113,24 @@ - + - - - HUMAN - FEMALE + + ETC - + + + - + @@ -147,7 +147,7 @@ - + diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/16500-16599.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/16500-16599.xml index 616701a213..39e92152f7 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/16500-16599.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/16500-16599.xml @@ -691,20 +691,39 @@ icon.skill11276 - A1 + 1 + 1 + A2 900 600000 300000 -707 + 2 true + TARGET + SINGLE icon.skill4111 + 1 + 3 + STUN + STUN A2 400 -100 + 10-10 true + 0;0;80;300 + SELF + FAN_PB + NOT_FRIEND + + + 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 + + diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/18500-18599.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/18500-18599.xml index d5b68e7170..0585523414 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/18500-18599.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/18500-18599.xml @@ -123,36 +123,70 @@ 500 + icon.skill0000 + 1 + 46554 A1 1500 3000 + 5 + 0 + SELF + SINGLE icon.skill0246 A1 - 500 10 100 - 60000 + 120000 5000 - + + + icon.skill1042 + 5 + 60 + PD_DOWN A2 - 500 + 600 -692 true + TARGET + SINGLE + + + + -10 + -30 + -50 + + PER + + + + -10 + -30 + -50 + + PER + + + 16571 + 1 + + icon.skill0246 A1 - 500 10 100 - 60000 + 120000 5000 diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/zones/custom_script.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/zones/custom_script.xml index 1b41b7764d..45a359eaaa 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/zones/custom_script.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/zones/custom_script.xml @@ -1131,4 +1131,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/16500-16599.xml b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/16500-16599.xml index a2087e16d3..3026b59c1e 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/16500-16599.xml +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/16500-16599.xml @@ -691,20 +691,39 @@ icon.skill11276 - A1 + 1 + 1 + A2 900 600000 300000 -707 + 2 true + TARGET + SINGLE icon.skill4111 + 1 + 3 + STUN + STUN A2 400 -100 + 10-10 true + 0;0;80;300 + SELF + FAN_PB + NOT_FRIEND + + + 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 + + diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/18500-18599.xml b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/18500-18599.xml index 105b759872..e0d5acf7f7 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/18500-18599.xml +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/18500-18599.xml @@ -123,9 +123,16 @@ 500 + icon.skill0000 + 1 + 46554 A1 1500 3000 + 5 + 0 + SELF + SINGLE @@ -137,12 +144,41 @@ 5000 - + + + icon.skill1042 + 5 + 60 + PD_DOWN A2 - 500 + 600 -692 true + TARGET + SINGLE + + + + -10 + -30 + -50 + + PER + + + + -10 + -30 + -50 + + PER + + + 16571 + 1 + +