From dd0f015208ebef6a28d658a8e99a42ae8b09c2d1 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 5 Aug 2015 19:07:09 +0000 Subject: [PATCH] Quest Sakum's Influence (10337). Contributed by spider. --- .../Q10337_SakumsInfluence/31795-01.htm | 6 + .../Q10337_SakumsInfluence/31795-02.htm | 6 + .../Q10337_SakumsInfluence/31795-03.htm | 4 + .../Q10337_SakumsInfluence/31795-04.htm | 3 + .../Q10337_SakumsInfluence/33178-01.html | 6 + .../Q10337_SakumsInfluence/33178-02.html | 6 + .../Q10337_SakumsInfluence/33178-03.html | 5 + .../Q10337_SakumsInfluence/33510-01.html | 4 + .../Q10337_SakumsInfluence/33510-02.html | 4 + .../Q10337_SakumsInfluence/33510-03.html | 4 + .../Q10337_SakumsInfluence.java | 251 ++++++++++++++++++ .../Q10337_SakumsInfluence/no_level.htm | 3 + .../scripts/quests/QuestMasterHandler.java | 2 + 13 files changed, 304 insertions(+) create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-01.htm create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-02.htm create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-03.htm create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-04.htm create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-01.html create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-02.html create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-03.html create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-01.html create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-02.html create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-03.html create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/Q10337_SakumsInfluence.java create mode 100644 trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/no_level.htm diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-01.htm b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-01.htm new file mode 100644 index 0000000000..b9bb5f4374 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-01.htm @@ -0,0 +1,6 @@ +Adventurer Guildsman:
+Have you head the news?
+The hunt for Sakum is coming to an end. After the escape from Ye Sagira, Sakum has been chased from Windmill Hill and Ruins of Agony. It is running out of places to run!
+Hahaha!
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-02.htm b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-02.htm new file mode 100644 index 0000000000..c47d304f26 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-02.htm @@ -0,0 +1,6 @@ +Adventurer Guildsman:
+In all things, you must keep a positive outlook... tell yourself that we CAN do this.
+Capturing Sakum isn't an easy task. All we have so far are rumors and conflicting information on what the creature looks like now. Anyone who has actually seen the beast can't give us an accurate sketch of the creature that doesn't look like it was done by a 4-year-old child with a broken hand. So we haven't been able to make accurate wanted posters for the thing.
+it would be helpful if you can find me anything we can use to get an accurate image of the beast. Think you can do this? + + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-03.htm b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-03.htm new file mode 100644 index 0000000000..0ab951ebef --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-03.htm @@ -0,0 +1,4 @@ +Adventure Guildsman:
+I'm glad to hear you will help us. I hear that Guard Silvan has seen Sakum near the Ruins of Despair which seems to have caused the monsters in the area to rage out of control.
+Travel to the Ruins of Despair and speak with Guard Silvan + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-04.htm b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-04.htm new file mode 100644 index 0000000000..b1b767d065 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/31795-04.htm @@ -0,0 +1,3 @@ +Adventure Guildsman:
+Why are you still here? Go to the Ruins of Despair. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-01.html b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-01.html new file mode 100644 index 0000000000..c7f63907aa --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-01.html @@ -0,0 +1,6 @@ +Guard Silvan:
+I remember when the sky used to be clear but now it is cloudy and never rains...
+I wonder what it means...?
+Sorry, I tend to ramble when I haven't slept for days. What brings you to this dismal place?
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-02.html b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-02.html new file mode 100644 index 0000000000..7afdb32555 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-02.html @@ -0,0 +1,6 @@ +Guard Silvan:
+Sakum? Yes, that creature has been sighted in the Ruins of Despair.
+Why do you think I haven't been able to sleep in days? I'm afraid I can't help you with your task... I can barely swing my sword properly.
+Additionally, my guards need to defend this location so I can't send anyone to assist you.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-03.html b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-03.html new file mode 100644 index 0000000000..efd5082ddf --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33178-03.html @@ -0,0 +1,5 @@ +Guard Silvan:
+Tell you what, if all you need is a sketch of Sakum, Guard Lef is a little bit of an artist and has already drawn a pretty good sketch of the creature.
+But you need to do a favor for us first. I need you to eliminate some of the creatures around the Ruins of Despair for us. About 15 Skeleton Warriors, 20 Ruin Imps, and 25 Bets should do it.
+Once you are done, go see Guard Lef about getting that sketch. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-01.html b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-01.html new file mode 100644 index 0000000000..e28da56783 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-01.html @@ -0,0 +1,4 @@ +Guard Lef:
+Ha! Silvan tricked you into doing his work...classic. What did he say he would give you in return? Hmm... by the looks of it he said that I was supposed to give you something. What was it?
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-02.html b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-02.html new file mode 100644 index 0000000000..b0631af386 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-02.html @@ -0,0 +1,4 @@ +Guard Lef:
+I'm getting tired of Silvan getting others to do his work. I understand that he hasn't slept in days, but still... bad form.
+I do have a sketch of Sakum but I'm afraid that I can't just hand it over to you just for doing Silvan's task. You will need to do something for me first. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-03.html b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-03.html new file mode 100644 index 0000000000..94da50f3e8 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/33510-03.html @@ -0,0 +1,4 @@ +Guard Lef:
+Although Silvan some times acts oddly. his heart is in the right place.
+(You have already completed this quest.) + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/Q10337_SakumsInfluence.java b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/Q10337_SakumsInfluence.java new file mode 100644 index 0000000000..33c125cc44 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/Q10337_SakumsInfluence.java @@ -0,0 +1,251 @@ +/* + * Copyright (C) 2004-2015 L2J Server + * + * This file is part of L2J Server. + * + * L2J Server 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. + * + * L2J Server 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.Q10337_SakumsInfluence; + +import java.util.HashMap; +import java.util.Map; + +import com.l2jserver.gameserver.model.actor.L2Npc; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.model.quest.Quest; +import com.l2jserver.gameserver.model.quest.QuestState; +import com.l2jserver.gameserver.model.quest.State; +import com.l2jserver.gameserver.network.serverpackets.ExQuestNpcLogList; +import com.l2jserver.gameserver.util.Util; + +/** + * Sakum's Influence (10337) + * @author spider + */ +public class Q10337_SakumsInfluence extends Quest +{ + // NPCs + private static final int ADV_GUILDSMAN = 31795; + private static final int SILVAN = 33178; + private static final int LEF = 33510; + // Monsters + private static final int SKELETON_WARRIOR = 23022; + private static final int RUIN_IMP = 20506; + private static final int RUIN_IMP_ELDER = 20507; + private static final int RUIN_BAT = 23023; + private static final int SCAVENGER_BAT = 20411; + private static final int BAT = 27458; // for ruin bat & scavenger bat counter(client counter requires BAT id) + private static final Map MOBS_REQUIRED = new HashMap<>(); + { + MOBS_REQUIRED.put(SKELETON_WARRIOR, 10); + MOBS_REQUIRED.put(RUIN_IMP, 20); // imp elder same counter + MOBS_REQUIRED.put(BAT, 25); // & scavenger bat same counter + } + // Rewards + private static final int ADENA_REWARD = 1030; + private static final int EXP_REWARD = 650000; + private static final int SP_REWARD = 156; + // Others + private static final int MIN_LEVEL = 28; + private static final int MAX_LEVEL = 40; + + public Q10337_SakumsInfluence() + { + super(10337, Q10337_SakumsInfluence.class.getSimpleName(), "Sakum's Influence"); + addStartNpc(ADV_GUILDSMAN); + addTalkId(ADV_GUILDSMAN, SILVAN, LEF); + addKillId(SKELETON_WARRIOR, RUIN_IMP, RUIN_IMP_ELDER, RUIN_BAT, SCAVENGER_BAT); + addCondLevel(MIN_LEVEL, MAX_LEVEL, "no_level.htm"); + + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs == null) + { + return null; + } + + String htmltext = null; + switch (event) + { + case "31795-02.htm": + { + htmltext = event; + break; + } + case "31795-03.htm": // start the quest + { + qs.startQuest(); + qs.setCond(2); + qs.setCond(1); // arrow hack + htmltext = event; + break; + } + case "33178-02.html": + { + htmltext = event; + break; + } + case "33178-03.html": // step 2 - go kill mobs + { + qs.setCond(2); + qs.set(Integer.toString(SKELETON_WARRIOR), 0); // db vars for mob counter + qs.set(Integer.toString(RUIN_IMP), 0); + qs.set(Integer.toString(BAT), 0); + htmltext = event; + break; + } + case "33510-02.html": // exit quest, give rewards, remove vars from db + { + if (qs.isCond(3)) + { + giveAdena(player, ADENA_REWARD, true); + addExpAndSp(player, EXP_REWARD, SP_REWARD); + qs.unset(Integer.toString(SKELETON_WARRIOR)); + qs.unset(Integer.toString(RUIN_IMP)); + qs.unset(Integer.toString(BAT)); + qs.exitQuest(false, true); + htmltext = event; + } + break; + } + } + return htmltext; + } + + @Override + public String onTalk(L2Npc npc, L2PcInstance player) + { + final QuestState qs = getQuestState(player, true); + String htmltext = null; + switch (qs.getState()) + { + case State.CREATED: + { + switch (npc.getId()) + { + case ADV_GUILDSMAN: + { + htmltext = "31795-01.htm"; + break; + } + case SILVAN: + { + htmltext = getNoQuestMsg(player); + break; + } + case LEF: + { + htmltext = getNoQuestMsg(player); + break; + } + } + break; + } + case State.STARTED: + { + switch (npc.getId()) + { + case ADV_GUILDSMAN: + { + htmltext = "31795-04.htm"; + break; + } + case SILVAN: + { + if (qs.isCond(1)) + { + htmltext = "33178-01.html"; + } + else + { + htmltext = "33178-03.html"; + } + break; + } + case LEF: + { + if (qs.isCond(3)) // mobs killed condition + { + htmltext = "33510-01.html"; + } + else + { + htmltext = getNoQuestMsg(player); + } + break; + } + } + break; + } + case State.COMPLETED: + { + htmltext = npc.getId() == LEF ? "33510-03.html" : getAlreadyCompletedMsg(player); + break; + } + } + return htmltext; + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc); + if ((qs != null) && qs.isStarted() && qs.isCond(2) && (Util.checkIfInRange(1500, npc, qs.getPlayer(), false))) + { + int kills = 0; + switch (npc.getId()) + { + case SKELETON_WARRIOR: + { + kills = qs.getInt(Integer.toString(SKELETON_WARRIOR)); + kills++; + qs.set(Integer.toString(SKELETON_WARRIOR), kills); + break; + } + case RUIN_BAT: // ruin bat & scavenger bat - same counter BAT + case SCAVENGER_BAT: + { + kills = qs.getInt(Integer.toString(BAT)); + kills++; + qs.set(Integer.toString(BAT), kills); + break; + } + case RUIN_IMP: // ruin imp & ruin imp elder - same counter RUIN_IMP + case RUIN_IMP_ELDER: + { + kills = qs.getInt(Integer.toString(RUIN_IMP)); + kills++; + qs.set(Integer.toString(RUIN_IMP), kills); + break; + } + } + + ExQuestNpcLogList log = new ExQuestNpcLogList(getId()); + log.addNpc(SKELETON_WARRIOR, qs.getInt(Integer.toString(SKELETON_WARRIOR))); + log.addNpc(RUIN_IMP, qs.getInt(Integer.toString(RUIN_IMP))); + log.addNpc(BAT, qs.getInt(Integer.toString(BAT))); + killer.sendPacket(log); + + if ((qs.getInt(Integer.toString(SKELETON_WARRIOR)) >= MOBS_REQUIRED.get(SKELETON_WARRIOR)) && (qs.getInt(Integer.toString(BAT)) >= MOBS_REQUIRED.get(BAT)) && (qs.getInt(Integer.toString(RUIN_IMP)) >= MOBS_REQUIRED.get(RUIN_IMP))) + { + qs.setCond(3); + } + } + return super.onKill(npc, killer, isSummon); + } +} diff --git a/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/no_level.htm b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/no_level.htm new file mode 100644 index 0000000000..04256230d6 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10337_SakumsInfluence/no_level.htm @@ -0,0 +1,3 @@ +You don't meet level requirements
+(Quest available from level 28 to level 40) + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/QuestMasterHandler.java b/trunk/dist/game/data/scripts/quests/QuestMasterHandler.java index 9a21f673bb..ffef7da1e0 100644 --- a/trunk/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/trunk/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -200,6 +200,7 @@ import quests.Q10333_DisappearedSakum.Q10333_DisappearedSakum; import quests.Q10334_ReportingTheStatusOfWindmillHill.Q10334_ReportingTheStatusOfWindmillHill; import quests.Q10335_RequestToFindSakum.Q10335_RequestToFindSakum; import quests.Q10336_DividedSakumKanilov.Q10336_DividedSakumKanilov; +import quests.Q10337_SakumsInfluence.Q10337_SakumsInfluence; import quests.Q10338_SeizeYourDestiny.Q10338_SeizeYourDestiny; import quests.Q10365_SeekerEscort.Q10365_SeekerEscort; import quests.Q10390_KekropusLetter.Q10390_KekropusLetter; @@ -420,6 +421,7 @@ public class QuestMasterHandler Q10334_ReportingTheStatusOfWindmillHill.class, Q10335_RequestToFindSakum.class, Q10336_DividedSakumKanilov.class, + Q10337_SakumsInfluence.class, Q10338_SeizeYourDestiny.class, Q10365_SeekerEscort.class, Q10390_KekropusLetter.class,