From c95aae2716224310c8d97e20f711d48984d2293e Mon Sep 17 00:00:00 2001
From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Tue, 16 Apr 2019 12:24:24 +0000
Subject: [PATCH] Addition of quest Advent of Krofin Subspecies (683).
Contributed by Liamxroy.
---
.../data/scripts/quests/MissingQuests.txt | 1 -
.../scripts/quests/QuestMasterHandler.java | 3 +-
.../Q00683_AdventOfKrofinSubspecies.java | 234 ++++++++++++++++++
.../accept.htm | 3 +
.../accept2.htm | 3 +
.../finish.html | 4 +
.../finish2.html | 4 +
.../reward.html | 3 +
.../reward2.html | 3 +
.../Q00683_AdventOfKrofinSubspecies/start.htm | 5 +
.../start2.htm | 5 +
.../Q00683_AdventOfKrofinSubspecies.java | 36 ---
12 files changed, 266 insertions(+), 38 deletions(-)
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/Q00683_AdventOfKrofinSubspecies.java
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/accept.htm
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/accept2.htm
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/finish.html
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/finish2.html
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/reward.html
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/reward2.html
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/start.htm
create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/start2.htm
delete mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/not_done/Q00683_AdventOfKrofinSubspecies.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 14d87c4f1a..ac1b50fc8b 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
@@ -52,7 +52,6 @@
680 Hunter Guild Request - Sea of Spores
681 Hunter Guild Request - Shadow of the Mother Tree
682 The Strong in the Closed Space
-683 Advent of Krofin Subspecies
684 Disturbed Fields
690 |Attack| Begin Alliance Base Defense - 1
691 |Attack| Begin Alliance Base Defense - 2
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 beee652667..374c355afc 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
@@ -406,6 +406,7 @@ 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.Q00683_AdventOfKrofinSubspecies.Q00683_AdventOfKrofinSubspecies;
import quests.custom.Q10516_UnveiledFafurionTemple.Q10516_UnveiledFafurionTemple;
import quests.custom.Q10517_FafurionsMinions.Q10517_FafurionsMinions;
import quests.custom.Q10529_IvoryTowersResearchFloatingSeaJournal.Q10529_IvoryTowersResearchFloatingSeaJournal;
@@ -577,7 +578,7 @@ public class QuestMasterHandler
Q00674_ChangesInTheShadowOfTheMotherTree.class, // TODO: Not done.
Q00675_WhatTheThreadOfThePastShows.class, // TODO: Not done.
Q00682_TheStrongInTheClosedSpace.class, // TODO: Not done.
- Q00683_AdventOfKrofinSubspecies.class, // TODO: Not done.
+ Q00683_AdventOfKrofinSubspecies.class, // FIXME: Custom.
Q00684_DisturbedFields.class, // TODO: Not done.
Q00726_LightWithinTheDarkness.class,
Q00727_HopeWithinTheDarkness.class,
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/Q00683_AdventOfKrofinSubspecies.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/Q00683_AdventOfKrofinSubspecies.java
new file mode 100644
index 0000000000..20a0b8eb23
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/Q00683_AdventOfKrofinSubspecies.java
@@ -0,0 +1,234 @@
+/*
+ * 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.Q00683_AdventOfKrofinSubspecies;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.l2jmobius.gameserver.enums.QuestSound;
+import org.l2jmobius.gameserver.enums.QuestType;
+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;
+import org.l2jmobius.gameserver.network.NpcStringId;
+
+/**
+ * Advent of Krofin Subspecies (683)
+ * @URL https://l2wiki.com/Advent_of_Krofin_Subspecies
+ * @author Liamxroy
+ */
+public class Q00683_AdventOfKrofinSubspecies extends Quest
+{
+ // NPCs
+ private static final int START_NPC_1 = 33907;
+ private static final int START_NPC_2 = 34480;
+ private static final int[] MONSTERS =
+ {
+ 24309,
+ 24310,
+ 24311,
+ 24312,
+ 24313,
+ 24314,
+ 24315,
+ 24316,
+ };
+ // Misc
+ private static final int REQUIRED_KILL_COUNT = 250;
+ private static final String KILL_COUNT_VAR = "KillCount";
+ private static final int KILLING_NPCSTRING_ID = NpcStringId.DEFEAT_KROFIN_SUBSPECIES.getId();
+ private static final QuestType QUEST_TYPE = QuestType.DAILY; // REPEATABLE, ONE_TIME, DAILY
+ private static final boolean PARTY_QUEST = false;
+ private static final int KILLING_COND = 1;
+ private static final int FINISH_COND = 2;
+ private static final int MIN_LEVEL = 106;
+
+ public Q00683_AdventOfKrofinSubspecies()
+ {
+ super(683);
+ addStartNpc(START_NPC_1, START_NPC_2);
+ addTalkId(START_NPC_1, START_NPC_2);
+ addKillId(MONSTERS);
+ addCondMinLevel(MIN_LEVEL, 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":
+ case "accept2.htm":
+ {
+ if (qs.isCreated())
+ {
+ qs.startQuest();
+ qs.setCond(KILLING_COND);
+ }
+ break;
+ }
+ case "reward.html":
+ case "reward2.html":
+ {
+ if (qs.isCond(FINISH_COND) && (qs.getInt(KILL_COUNT_VAR) >= REQUIRED_KILL_COUNT))
+ {
+ // Reward.
+ addExpAndSp(player, 49763842650L, 49763790);
+ giveAdena(player, 3225882, 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_1)
+ {
+ 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;
+ }
+ }
+ }
+
+ if (npc.getId() == START_NPC_2)
+ {
+ switch (qs.getState())
+ {
+ case State.CREATED:
+ {
+ htmltext = "start2.htm";
+ break;
+ }
+ case State.STARTED:
+ {
+ if (qs.isCond(KILLING_COND))
+ {
+ htmltext = "accept2.htm";
+ }
+ else if (qs.isCond(FINISH_COND))
+ {
+ htmltext = "finish2.html";
+ }
+ break;
+ }
+ case State.COMPLETED:
+ {
+ if (qs.isNowAvailable())
+ {
+ qs.setState(State.CREATED);
+ htmltext = "start2.htm";
+ }
+ else
+ {
+ htmltext = getAlreadyCompletedMsg(player, QUEST_TYPE);
+ }
+ break;
+ }
+ }
+ }
+ return htmltext;
+ }
+
+ @Override
+ public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
+ {
+ QuestState qs = PARTY_QUEST ? getRandomPartyMemberState(killer, -1, 3, npc) : getQuestState(killer, false);
+ if ((qs != null) && qs.isCond(KILLING_COND))
+ {
+ final PlayerInstance player = qs.getPlayer();
+ final int killCount = qs.getInt(KILL_COUNT_VAR) + 1;
+ if (killCount <= REQUIRED_KILL_COUNT)
+ {
+ qs.set(KILL_COUNT_VAR, killCount);
+
+ if (killCount >= REQUIRED_KILL_COUNT)
+ {
+ qs.setCond(FINISH_COND, true);
+ }
+ else if (killCount < REQUIRED_KILL_COUNT)
+ {
+ playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
+ sendNpcLogList(player);
+ }
+ }
+ }
+
+ 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, true, qs.getInt(KILL_COUNT_VAR)));
+ return holder;
+ }
+ return super.getNpcLogList(player);
+ }
+}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/accept.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/accept.htm
new file mode 100644
index 0000000000..b59ae77a68
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/accept.htm
@@ -0,0 +1,3 @@
+Lionel Hunter:
+You will have to hunt monsters in the. Hunt Krophy, Krotany, Kropiora, Krotania, Spiz Krophy, Spiz Krotany, Spiz Kropiora, Spiz Krotania. You have to kill 250 monsters in total.
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/accept2.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/accept2.htm
new file mode 100644
index 0000000000..d30d4d2fdd
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/accept2.htm
@@ -0,0 +1,3 @@
+Heddy:
+You will have to hunt monsters in the. Hunt Krophy, Krotany, Kropiora, Krotania, Spiz Krophy, Spiz Krotany, Spiz Kropiora, Spiz Krotania. You have to kill 250 monsters in total.
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/finish.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/finish.html
new file mode 100644
index 0000000000..ddc2321249
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/finish.html
@@ -0,0 +1,4 @@
+Lionel Hunter:
+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/Q00683_AdventOfKrofinSubspecies/finish2.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/finish2.html
new file mode 100644
index 0000000000..4007bf47b5
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/finish2.html
@@ -0,0 +1,4 @@
+Heddy:
+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/Q00683_AdventOfKrofinSubspecies/reward.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/reward.html
new file mode 100644
index 0000000000..92bccef711
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/reward.html
@@ -0,0 +1,3 @@
+Lionel Hunter:
+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/Q00683_AdventOfKrofinSubspecies/reward2.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/reward2.html
new file mode 100644
index 0000000000..cb6b243ca4
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/reward2.html
@@ -0,0 +1,3 @@
+Heddy:
+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/Q00683_AdventOfKrofinSubspecies/start.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/start.htm
new file mode 100644
index 0000000000..2b924a367a
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/start.htm
@@ -0,0 +1,5 @@
+Lionel Hunter:
+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/Q00683_AdventOfKrofinSubspecies/start2.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/start2.htm
new file mode 100644
index 0000000000..feec518502
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q00683_AdventOfKrofinSubspecies/start2.htm
@@ -0,0 +1,5 @@
+Heddy:
+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/not_done/Q00683_AdventOfKrofinSubspecies.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/not_done/Q00683_AdventOfKrofinSubspecies.java
deleted file mode 100644
index 0930a2ef6d..0000000000
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/not_done/Q00683_AdventOfKrofinSubspecies.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 org.l2jmobius.Config;
-import org.l2jmobius.gameserver.model.quest.Quest;
-
-/**
- * @author Mobius
- */
-public class Q00683_AdventOfKrofinSubspecies extends Quest
-{
- private static final int START_NPC = 33907;
-
- public Q00683_AdventOfKrofinSubspecies()
- {
- super(683);
- addStartNpc(START_NPC);
- addTalkId(START_NPC);
- addCondMinLevel(Config.PLAYER_MAXIMUM_LEVEL, getNoQuestMsg(null));
- }
-}