From becc1b9cc293ec2018f68a0f3e3f19c6af0348a3 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 4 Apr 2019 00:03:56 +0000 Subject: [PATCH] Addition of second kill condition for quest 10529. --- ...IvoryTowersResearchFloatingSeaJournal.java | 85 ++++++++++++++----- .../accept.htm | 3 - .../accept_1.htm | 3 + .../accept_2.html | 3 + .../{finish.html => finish_1.html} | 2 +- .../finish_2.html | 4 + .../start.htm | 2 +- .../game/data/stats/items/48800-48899.xml | 1 + 8 files changed, 76 insertions(+), 27 deletions(-) delete mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept.htm create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept_1.htm create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept_2.html rename L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/{finish.html => finish_1.html} (62%) create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/finish_2.html diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/Q10529_IvoryTowersResearchFloatingSeaJournal.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/Q10529_IvoryTowersResearchFloatingSeaJournal.java index 4d46d24eb6..470632b218 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/Q10529_IvoryTowersResearchFloatingSeaJournal.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/Q10529_IvoryTowersResearchFloatingSeaJournal.java @@ -19,6 +19,7 @@ package quests.custom.Q10529_IvoryTowersResearchFloatingSeaJournal; import java.util.HashSet; import java.util.Set; +import com.l2jmobius.commons.util.CommonUtil; import com.l2jmobius.gameserver.enums.QuestType; import com.l2jmobius.gameserver.model.actor.Npc; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -37,7 +38,7 @@ public class Q10529_IvoryTowersResearchFloatingSeaJournal extends Quest { // NPCs private static final int START_NPC = 33846; - private static final int[] MONSTERS = + private static final int[] MONSTERS_1 = { 24226, 24227, @@ -54,15 +55,24 @@ public class Q10529_IvoryTowersResearchFloatingSeaJournal extends Quest 24238, 24239, }; + private static final int[] MONSTERS_2 = + { + 24232, + 24239, + }; // Item - private static final int MONSTER_DROP = 48836; + private static final int MONSTER_DROP_1 = 48836; + private static final int MONSTER_DROP_2 = 48837; // Misc - private static final int REQUIRED_DROP_COUNT = 100; + private static final int REQUIRED_DROP_COUNT_1 = 100; + private static final int REQUIRED_DROP_COUNT_2 = 1; private static final int KILLING_NPCSTRING_ID = NpcStringId.LV_106_IVORY_TOWER_S_RESEARCH_SEA_OF_SPORES_JOURNAL_IN_PROGRESS.getId(); private static final QuestType QUEST_TYPE = QuestType.ONE_TIME; // 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 KILLING_COND_1 = 1; + private static final int FINISH_COND_1 = 2; + private static final int KILLING_COND_2 = 3; + private static final int FINISH_COND_2 = 4; private static final int MIN_LEVEL = 106; public Q10529_IvoryTowersResearchFloatingSeaJournal() @@ -70,8 +80,9 @@ public class Q10529_IvoryTowersResearchFloatingSeaJournal extends Quest super(10529); addStartNpc(START_NPC); addTalkId(START_NPC); - addKillId(MONSTERS); - registerQuestItems(MONSTER_DROP); + addKillId(MONSTERS_1); + addKillId(MONSTERS_2); + registerQuestItems(MONSTER_DROP_1, MONSTER_DROP_2); addCondMinLevel(MIN_LEVEL, getNoQuestMsg(null)); } @@ -86,20 +97,29 @@ public class Q10529_IvoryTowersResearchFloatingSeaJournal extends Quest switch (event) { - case "accept.htm": + case "accept_1.htm": { if (qs.isCreated()) { qs.startQuest(); - qs.setCond(KILLING_COND); + qs.setCond(KILLING_COND_1, true); + } + break; + } + case "accept_2.html": + { + if (qs.isCond(FINISH_COND_1) && (getQuestItemsCount(player, MONSTER_DROP_1) >= REQUIRED_DROP_COUNT_1)) + { + takeItems(player, MONSTER_DROP_1, -1); + qs.setCond(KILLING_COND_2, true); } break; } case "reward.html": { - if (qs.isCond(FINISH_COND) && (getQuestItemsCount(player, MONSTER_DROP) >= REQUIRED_DROP_COUNT)) + if (qs.isCond(FINISH_COND_2) && (getQuestItemsCount(player, MONSTER_DROP_2) >= REQUIRED_DROP_COUNT_2)) { - takeItems(player, MONSTER_DROP, -1); + takeItems(player, MONSTER_DROP_2, -1); // Reward. addExpAndSp(player, 99527685300L, 99527580); rewardItems(player, 19448, 1); @@ -132,13 +152,21 @@ public class Q10529_IvoryTowersResearchFloatingSeaJournal extends Quest } case State.STARTED: { - if (qs.isCond(KILLING_COND)) + if (qs.isCond(KILLING_COND_1)) { htmltext = "accept.htm"; } - else if (qs.isCond(FINISH_COND)) + else if (qs.isCond(FINISH_COND_1)) { - htmltext = "finish.html"; + htmltext = "finish_1.html"; + } + else if (qs.isCond(KILLING_COND_2)) + { + htmltext = "accept_2.html"; + } + else if (qs.isCond(FINISH_COND_2)) + { + htmltext = "finish_2.html"; } break; } @@ -164,13 +192,23 @@ public class Q10529_IvoryTowersResearchFloatingSeaJournal extends Quest 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 (qs != null) { - if (giveItemRandomly(killer, npc, MONSTER_DROP, 1, REQUIRED_DROP_COUNT, 1, true)) + if (qs.isCond(KILLING_COND_1) && CommonUtil.contains(MONSTERS_1, npc.getId())) { - qs.setCond(FINISH_COND); + if (giveItemRandomly(killer, npc, MONSTER_DROP_1, 1, REQUIRED_DROP_COUNT_1, 1, true)) + { + qs.setCond(FINISH_COND_1); + } + sendNpcLogList(killer); + } + else if (qs.isCond(KILLING_COND_2) && CommonUtil.contains(MONSTERS_2, npc.getId())) + { + if (giveItemRandomly(killer, npc, MONSTER_DROP_2, 1, REQUIRED_DROP_COUNT_2, 0.3, true)) + { + qs.setCond(FINISH_COND_2); + } } - sendNpcLogList(killer); } return super.onKill(npc, killer, isSummon); } @@ -179,11 +217,14 @@ public class Q10529_IvoryTowersResearchFloatingSeaJournal extends Quest public Set getNpcLogList(PlayerInstance player) { final QuestState qs = getQuestState(player, false); - if ((qs != null) && qs.isCond(KILLING_COND)) + if (qs != null) { - final Set holder = new HashSet<>(); - holder.add(new NpcLogListHolder(KILLING_NPCSTRING_ID, false, (int) getQuestItemsCount(player, MONSTER_DROP))); - return holder; + if (qs.isCond(KILLING_COND_1)) + { + final Set holder = new HashSet<>(); + holder.add(new NpcLogListHolder(KILLING_NPCSTRING_ID, false, (int) getQuestItemsCount(player, MONSTER_DROP_1))); + return holder; + } } return super.getNpcLogList(player); } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept.htm deleted file mode 100644 index 9587ea60bd..0000000000 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept.htm +++ /dev/null @@ -1,3 +0,0 @@ -Bacon:
-You will have to hunt monsters in the Sea of Spores. To hunt: Keros, Falena, Atrofa, Nuba, Torfedo, Aranea, Harane, Lesatanas, Arbor, Tergus, Skeletus, Atrofine, Orfen's Handmaiden Arimus, Orfen's Handmaiden Arima. You need to get 100 Sea of Spores Journal. - \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept_1.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept_1.htm new file mode 100644 index 0000000000..482bea293e --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept_1.htm @@ -0,0 +1,3 @@ +Bacon:
+You will have to hunt monsters in the Sea of Spores. Hunt Keros, Falena, Atrofa, Nuba, Torfedo, Aranea, Harane, Lesatanas, Arbor, Tergus, Skeletus, Atrofine, Orfen's Handmaiden Arimus, Orfen's Handmaiden Arima. You need to get 100 Sea of Spores Journal. + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept_2.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept_2.html new file mode 100644 index 0000000000..554fa23c02 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/accept_2.html @@ -0,0 +1,3 @@ +Bacon:
+I need you to kill a few more monsters. Hunt Arimus and Arima. You need to get Dispersing Energy of the Sea of Spores. + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/finish.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/finish_1.html similarity index 62% rename from L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/finish.html rename to L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/finish_1.html index d563ba3258..1b9e97705f 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/finish.html +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/finish_1.html @@ -1,4 +1,4 @@ Bacon:
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/Q10529_IvoryTowersResearchFloatingSeaJournal/finish_2.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/finish_2.html new file mode 100644 index 0000000000..9590d3e081 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/finish_2.html @@ -0,0 +1,4 @@ +Bacon:
+Have you retrieved the item I asked for?
+ + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/start.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/start.htm index 821c50d005..627be9cd64 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/start.htm +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/quests/custom/Q10529_IvoryTowersResearchFloatingSeaJournal/start.htm @@ -1,5 +1,5 @@ Bacon:
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/stats/items/48800-48899.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48800-48899.xml index 62075f2494..3e1c568a84 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48800-48899.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48800-48899.xml @@ -361,6 +361,7 @@ +