From 98fd413e24e8c4567542e0fd2102908f7dec321c Mon Sep 17 00:00:00 2001
From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Wed, 3 Apr 2019 19:52:11 +0000
Subject: [PATCH] Addition of quest How to Overcome Fear (560). Contributed by
Liamxroy.
---
.../data/scripts/quests/MissingQuests.txt | 1 -
.../scripts/quests/QuestMasterHandler.java | 3 +-
.../Q00560_HowToOvercomeFear.java | 191 ++++++++++++++++++
.../Q00560_HowToOvercomeFear/accept.htm | 3 +
.../Q00560_HowToOvercomeFear/finish.html | 4 +
.../Q00560_HowToOvercomeFear/reward.html | 3 +
.../custom/Q00560_HowToOvercomeFear/start.htm | 5 +
.../Q10517_FafurionsMinions.java | 2 +-
.../not_done/Q10517_FafurionsMinions.java | 36 ----
.../game/data/stats/items/80300-80399.xml | 1 +
10 files changed, 210 insertions(+), 39 deletions(-)
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/Q00560_HowToOvercomeFear.java
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/accept.htm
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/finish.html
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/reward.html
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/start.htm
delete mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/not_done/Q10517_FafurionsMinions.java
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 bb61511f22..eb595b81b5 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
@@ -7,7 +7,6 @@
557 Red Libra Request - Fall of Etina
558 Request from the Red Libra Guild - Sea of Spores
559 Request from the Red Libra Guild - Krofin’s Nest
-560 How to Overcome Fear
561 Basic Mission: Harnak Underground Ruins
562 Basic Mission: Altar of Evil
563 Basic Mission: Bloody Swampland
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 617ab2d7d9..2dda04540d 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
@@ -391,6 +391,7 @@ import quests.Q10840_TimeToRecover.Q10840_TimeToRecover;
import quests.Q10841_DeepInsideAteliaFortress.Q10841_DeepInsideAteliaFortress;
import quests.Q10843_AnomalyInTheEnchantedValley.Q10843_AnomalyInTheEnchantedValley;
import quests.custom.Q00529_RegularBarrierMaintenance.Q00529_RegularBarrierMaintenance;
+import quests.custom.Q00560_HowToOvercomeFear.Q00560_HowToOvercomeFear;
import quests.custom.Q10516_UnveiledFafurionTemple.Q10516_UnveiledFafurionTemple;
import quests.custom.Q10517_FafurionsMinions.Q10517_FafurionsMinions;
import quests.custom.Q10529_IvoryTowersResearchFloatingSeaJournal.Q10529_IvoryTowersResearchFloatingSeaJournal;
@@ -502,7 +503,7 @@ public class QuestMasterHandler
Q00529_RegularBarrierMaintenance.class, // FIXME: Custom.
Q00551_OlympiadStarter.class,
Q00553_OlympiadUndefeated.class,
- Q00560_HowToOvercomeFear.class, // TODO: Not done.
+ Q00560_HowToOvercomeFear.class, // FIXME: Custom.
Q00561_BasicMissionHarnakUndergroundRuins.class, // TODO: Not done.
Q00562_BasicMissionAltarOfEvil.class, // TODO: Not done.
Q00563_BasicMissionBloodySwampland.class, // TODO: Not done.
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/Q00560_HowToOvercomeFear.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/Q00560_HowToOvercomeFear.java
new file mode 100644
index 0000000000..801eab0ce8
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/Q00560_HowToOvercomeFear.java
@@ -0,0 +1,191 @@
+/*
+ * 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.custom.Q00560_HowToOvercomeFear;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import com.l2jmobius.gameserver.enums.QuestType;
+import com.l2jmobius.gameserver.model.actor.Npc;
+import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import com.l2jmobius.gameserver.model.holders.NpcLogListHolder;
+import com.l2jmobius.gameserver.model.quest.Quest;
+import com.l2jmobius.gameserver.model.quest.QuestState;
+import com.l2jmobius.gameserver.model.quest.State;
+import com.l2jmobius.gameserver.network.NpcStringId;
+
+import quests.custom.Q10517_FafurionsMinions.Q10517_FafurionsMinions;
+
+/**
+ * How to Overcome Fear (560)
+ * @URL https://l2wiki.com/How_to_Overcome_Fear
+ * @author Liamxroy
+ */
+public class Q00560_HowToOvercomeFear extends Quest
+{
+ // NPCs
+ private static final int START_NPC = 34489;
+ private static final int[] MONSTERS =
+ {
+ 24318,
+ 24319,
+ 24320,
+ 24321,
+ 24322,
+ 24323,
+ 24324,
+ 24325,
+ 24326,
+ 24327,
+ 24328,
+ 24329,
+ };
+ // Item
+ private static final int MONSTER_DROP = 80324;
+ // Misc
+ private static final int REQUIRED_DROP_COUNT = 30;
+ private static final int KILLING_NPCSTRING_ID = NpcStringId.LV_110_HOW_TO_OVERCOME_FEAR_IN_PROGRESS.getId();
+ private static final QuestType QUEST_TYPE = QuestType.DAILY; // REPEATABLE, ONE_TIME, DAILY
+ private static final boolean PARTY_QUEST = true;
+ private static final int KILLING_COND = 1;
+ private static final int FINISH_COND = 2;
+ private static final int MIN_LEVEL = 110;
+
+ public Q00560_HowToOvercomeFear()
+ {
+ super(560);
+ addStartNpc(START_NPC);
+ addTalkId(START_NPC);
+ addKillId(MONSTERS);
+ registerQuestItems(MONSTER_DROP);
+ addCondMinLevel(MIN_LEVEL, getNoQuestMsg(null));
+ addCondCompletedQuest(Q10517_FafurionsMinions.class.getSimpleName(), getNoQuestMsg(null));
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ final QuestState qs = getQuestState(player, false);
+ if (qs == null)
+ {
+ return null;
+ }
+
+ switch (event)
+ {
+ case "accept.htm":
+ {
+ if (qs.isCreated())
+ {
+ qs.startQuest();
+ qs.setCond(KILLING_COND);
+ }
+ break;
+ }
+ case "reward.html":
+ {
+ if (qs.isCond(FINISH_COND) && (getQuestItemsCount(player, MONSTER_DROP) >= REQUIRED_DROP_COUNT))
+ {
+ takeItems(player, MONSTER_DROP, -1);
+ // Reward.
+ addExpAndSp(player, 166685607000L, 166685580);
+ giveAdena(player, 4190158, false);
+ qs.exitQuest(QUEST_TYPE, true);
+ }
+ break;
+ }
+ default:
+ {
+ return null;
+ }
+ }
+ return event;
+ }
+
+ @Override
+ public String onTalk(Npc npc, PlayerInstance player)
+ {
+ final QuestState qs = getQuestState(player, true);
+ String htmltext = getNoQuestMsg(player);
+
+ if (npc.getId() == START_NPC)
+ {
+ switch (qs.getState())
+ {
+ case State.CREATED:
+ {
+ htmltext = "start.htm";
+ break;
+ }
+ case State.STARTED:
+ {
+ if (qs.isCond(KILLING_COND))
+ {
+ htmltext = "accept.htm";
+ }
+ else if (qs.isCond(FINISH_COND))
+ {
+ htmltext = "finish.html";
+ }
+ break;
+ }
+ case State.COMPLETED:
+ {
+ if (qs.isNowAvailable())
+ {
+ qs.setState(State.CREATED);
+ htmltext = "start.htm";
+ }
+ else
+ {
+ htmltext = getAlreadyCompletedMsg(player, QUEST_TYPE);
+ }
+ break;
+ }
+ }
+ }
+ return htmltext;
+ }
+
+ @Override
+ public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
+ {
+ final QuestState qs = PARTY_QUEST ? getRandomPartyMemberState(killer, -1, 3, npc) : getQuestState(killer, false);
+ if ((qs != null) && qs.isCond(KILLING_COND))
+ {
+ if (giveItemRandomly(killer, npc, MONSTER_DROP, 1, REQUIRED_DROP_COUNT, 1, true))
+ {
+ qs.setCond(FINISH_COND);
+ }
+ sendNpcLogList(killer);
+ }
+ return super.onKill(npc, killer, isSummon);
+ }
+
+ @Override
+ public Set getNpcLogList(PlayerInstance player)
+ {
+ final QuestState qs = getQuestState(player, false);
+ if ((qs != null) && qs.isCond(KILLING_COND))
+ {
+ final Set holder = new HashSet<>();
+ holder.add(new NpcLogListHolder(KILLING_NPCSTRING_ID, false, (int) getQuestItemsCount(player, MONSTER_DROP)));
+ return holder;
+ }
+ return super.getNpcLogList(player);
+ }
+}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/accept.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/accept.htm
new file mode 100644
index 0000000000..9feafef28f
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/accept.htm
@@ -0,0 +1,3 @@
+Lupicia:
+You have to defeat monsters created by Fafurion, dwelling in Fafurion Temple and to bring her Fragments of Power carried by his closest minions. To hunt: Temple Guard Captain, Temple Guard Captain, Elite Guardian Warrior, Elite Guardian Archer, Temple Patrol Guard, Temple Knight Recruit, Temple Guard, Temple Guardian Warrior, Temple Wizard, Temple Guardian Wizard, Temple Priest, Temple Guardian Priest, Starving Water Dragon. You need to get 30 Fragment of Power.
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/finish.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/finish.html
new file mode 100644
index 0000000000..3badf62ecf
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/finish.html
@@ -0,0 +1,4 @@
+Lupicia:
+Have you retrieved the items I asked for?
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/reward.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/reward.html
new file mode 100644
index 0000000000..3d22d24765
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/reward.html
@@ -0,0 +1,3 @@
+Lupicia:
+Thank you for your assistance.
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/start.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/start.htm
new file mode 100644
index 0000000000..20c2875a4e
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00560_HowToOvercomeFear/start.htm
@@ -0,0 +1,5 @@
+Lupicia:
+If you have time I have a mission for you.
+This area needs to be cleansed.
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10517_FafurionsMinions/Q10517_FafurionsMinions.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10517_FafurionsMinions/Q10517_FafurionsMinions.java
index 345e7e37e7..d6cac255ee 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10517_FafurionsMinions/Q10517_FafurionsMinions.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10517_FafurionsMinions/Q10517_FafurionsMinions.java
@@ -32,7 +32,7 @@ import com.l2jmobius.gameserver.network.NpcStringId;
import quests.custom.Q10516_UnveiledFafurionTemple.Q10516_UnveiledFafurionTemple;
/**
- * https://l2wiki.com/Fafurion%27s_Minions (10517)
+ * Fafurion's Minions (10517)
* @URL https://l2wiki.com/Fafurion%27s_Minions
* @author Liamxroy
*/
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/not_done/Q10517_FafurionsMinions.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/not_done/Q10517_FafurionsMinions.java
deleted file mode 100644
index 6796b5c747..0000000000
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/not_done/Q10517_FafurionsMinions.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.not_done;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.model.quest.Quest;
-
-/**
- * @author Mobius
- */
-public class Q10517_FafurionsMinions extends Quest
-{
- private static final int START_NPC = 34489;
-
- public Q10517_FafurionsMinions()
- {
- super(10517);
- addStartNpc(START_NPC);
- addTalkId(START_NPC);
- addCondMinLevel(Config.PLAYER_MAXIMUM_LEVEL, getNoQuestMsg(null));
- }
-}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/80300-80399.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/80300-80399.xml
index 68ea83969e..4c74f2a519 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/80300-80399.xml
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/80300-80399.xml
@@ -320,6 +320,7 @@
+