From 5c1ace78100e789314110791b40fb99af14c2d4c Mon Sep 17 00:00:00 2001 From: Zoey76 <zoey_76@msn.com> Date: Fri, 15 Aug 2014 20:23:15 +0000 Subject: [PATCH] BETA: Quest Necromancer's Request (632) in Java. --- L2J_DataPack_BETA/dist/game/data/scripts.cfg | 1 - .../632_NecromancersRequest/31522-0.htm | 5 - .../632_NecromancersRequest/31522-1.htm | 8 - .../632_NecromancersRequest/31522-2.htm | 7 - .../632_NecromancersRequest/31522-3.htm | 3 - .../632_NecromancersRequest/__init__.py | 117 ----------- .../31522-101.htm} | 2 +- .../Q00632_NecromancersRequest/31522-103.htm | 4 + .../Q00632_NecromancersRequest/31522-104.htm | 5 + .../Q00632_NecromancersRequest/31522-105.html | 7 + .../Q00632_NecromancersRequest/31522-106.html | 7 + .../Q00632_NecromancersRequest/31522-201.html | 3 + .../Q00632_NecromancersRequest/31522-202.html | 9 + .../Q00632_NecromancersRequest/31522-203.html | 4 + .../Q00632_NecromancersRequest/31522-204.html | 4 + .../Q00632_NecromancersRequest.java | 194 ++++++++++++++++++ .../scripts/quests/QuestMasterHandler.java | 2 + .../dist/sql/game/updates/20140815update.sql | 1 + 18 files changed, 241 insertions(+), 142 deletions(-) delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-0.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-1.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-2.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-3.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/__init__.py rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{632_NecromancersRequest/31522.htm => Q00632_NecromancersRequest/31522-101.htm} (75%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-103.htm create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-104.htm create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-105.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-106.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-201.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-202.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-203.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-204.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/Q00632_NecromancersRequest.java create mode 100644 L2J_DataPack_BETA/dist/sql/game/updates/20140815update.sql diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index e16f1b5d72..62c9cff2aa 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -297,7 +297,6 @@ quests/501_ProofOfClanAlliance/__init__.py quests/503_PursuitClanAmbition/__init__.py quests/604_DaimontheWhiteEyedPart2/__init__.py quests/620_FourGoblets/__init__.py -quests/632_NecromancersRequest/__init__.py quests/660_AidingtheFloranVillage/__init__.py quests/663_SeductiveWhispers/__init__.py quests/999_T1Tutorial/__init__.py diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-0.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-0.htm deleted file mode 100644 index 73034632b0..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-0.htm +++ /dev/null @@ -1,5 +0,0 @@ -<html><body>Mysterious Wizard:<br> -The most important of the materials I need are undead hearts with their Human memory intact.<br> -Especially the grey <font color="LEVEL">heart of undead vampires</font>. They're just as good as red cloth from Aden. I need 200 of them.<br> -Also, I'll trade you something for <font color="LEVEL">undead brains</font>. You can hunt them at night. What do you think? -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-1.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-1.htm deleted file mode 100644 index 5fe4bcd613..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-1.htm +++ /dev/null @@ -1,8 +0,0 @@ -<html><body>Mysterious Wizard:<br> -Come on, that's not enough! Can you imagine how many hearts I need to die a yard of cloth red whith blood?<br> -Excelent material, equivalent to the red cloth of Aden, but infused whith magical power.<br> -Please bring me more hearts.<br>I'll trade you for the dead's brains anytime.<br> -<a action="bypass -h npc_%objectId%_multisell 31522">Trade the dead's brains.</a><br> -<a action="bypass -h Quest 632_NecromancersRequest 1">Say you'll go and bring more vampire hearts.</a><br> -<a action="bypass -h Quest 632_NecromancersRequest 0">Say you want to quit.</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-2.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-2.htm deleted file mode 100644 index 1b6e469d22..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-2.htm +++ /dev/null @@ -1,7 +0,0 @@ -<html><body>Mysterious Wizard:<br> -Good, you brought 200 vampire hearts.<br> -I'll buy them with adena, but the undead brains aren't worth much. I'll trade you something else for them.<br> -<a action="bypass -h Quest 632_NecromancersRequest 2">"I'll sell you the vampire hearts."</a><br> -<a action="bypass -h npc_%objectId%_multisell 31522">"I'll trade the brains."<br> -<a action="bypass -h Quest 632_NecromancersRequest 0">"I want to quit hunting."</a> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-3.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-3.htm deleted file mode 100644 index 77064a7ea7..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522-3.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Mysterious Wizard:<br> -You don't want continue helping me? It's your choise... -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/__init__.py b/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/__init__.py deleted file mode 100644 index bec7a80f48..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/__init__.py +++ /dev/null @@ -1,117 +0,0 @@ -# Made by Next - cleanup by Kerberos -# this script is part of the Official L2J Datapack Project. -# Visit http://www.l2jdp.com/forum/ for more details. -import sys -from com.l2jserver import Config -from com.l2jserver.gameserver.model.quest import State -from com.l2jserver.gameserver.model.quest import QuestState -from com.l2jserver.gameserver.model.quest import Quest as JQuest - -qn = "632_NecromancersRequest" -#NPC -WIZARD = 31522 -#ITEMS -V_HEART = 7542 -Z_BRAIN = 7543 -#DROP CHANCES -V_HEART_CHANCE = 50 # in percents -Z_BRAIN_CHANCE = 33 # in percents -#REWARDS -ADENA = 57 -ADENA_AMOUNT = 120000 -#MOBS -VAMPIRES = [ 21568, 21573, 21582, 21585, 21586, 21587, 21588, 21589, 21590, 21591, 21592, 21593, 21594, 21595 ] -UNDEADS = [ 21547, 21548, 21549, 21551, 21552, 21555, 21556, 21562, 21571, 21576, 21577, 21579 ] - -class Quest (JQuest): - - def __init__(self,id,name,descr): - JQuest.__init__(self,id,name,descr) - self.questItemIds = [V_HEART, Z_BRAIN] - - def onEvent (self,event,st): - if event == "0": - st.playSound("ItemSound.quest_finish") - htmltext = "31522-3.htm" - st.exitQuest(1) - elif event == "1": - htmltext = "31522-0.htm" - elif event == "2": - if st.getInt("cond") == 2: - if st.getQuestItemsCount(V_HEART) == 200: - st.takeItems(V_HEART, 200) - st.rewardItems(ADENA, ADENA_AMOUNT) - st.playSound("ItemSound.quest_finish") - st.set("cond","1") - htmltext = "31522-1.htm" - elif event == "start": - if st.getPlayer().getLevel() > 62 : - htmltext = "31522-0.htm" - st.set("cond","1") - st.setState(State.STARTED) - st.playSound("ItemSound.quest_accept") - else: - htmltext = "<html><body>Mysterious Wizard:<br>This quest can only be taken by characters that have a minimum level of <font color=\"LEVEL\">63</font>. Return when you are more experienced." - st.exitQuest(1) - return htmltext - - def onKill (self,npc,player,isPet): - npcId = npc.getId() - if npcId in UNDEADS: - partyMember = self.getRandomPartyMemberState(player, State.STARTED) - if not partyMember: return - st = partyMember.getQuestState(qn) - if not st: return - chance = Z_BRAIN_CHANCE * Config.RATE_QUEST_DROP - numItems, chance = divmod(chance,100) - if self.getRandom(100) < chance: - numItems += 1 - if numItems : - st.giveItems(Z_BRAIN,int(numItems)) - st.playSound("ItemSound.quest_itemget") - elif npcId in VAMPIRES: - partyMember = self.getRandomPartyMember(player, 1) - if not partyMember: return - st = partyMember.getQuestState(qn) - if not st: return - chance = V_HEART_CHANCE * Config.RATE_QUEST_DROP - numItems, chance = divmod(chance,100) - count = st.getQuestItemsCount(V_HEART) - if self.getRandom(100) < chance: - numItems += 1 - if numItems : - if count + numItems >= 200 : - numItems = 200 - count - st.playSound("ItemSound.quest_middle") - st.set("cond","2") - else: - st.playSound("ItemSound.quest_itemget") - st.giveItems(V_HEART, int(numItems)) - return - - def onTalk (self,npc,player): - htmltext = Quest.getNoQuestMsg(player) - st = player.getQuestState(qn) - if st: - npcId = npc.getId() - id = st.getState() - cond = st.getInt("cond") - if cond == 0 and id == State.CREATED: - if npcId == WIZARD: - htmltext = "31522.htm" - if cond == 1 and id == State.STARTED: - htmltext = "31522-1.htm" - if cond == 2 and id == State.STARTED: - if st.getQuestItemsCount(V_HEART) == 200: - htmltext = "31522-2.htm" - return htmltext - -QUEST = Quest(632, qn, "Necromancer's Request") - -for i in VAMPIRES: - QUEST.addKillId(i) -for i in UNDEADS: - QUEST.addKillId(i) - -QUEST.addStartNpc(WIZARD) -QUEST.addTalkId(WIZARD) \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-101.htm similarity index 75% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-101.htm index efbb73e8f0..acb5e72eeb 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/632_NecromancersRequest/31522.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-101.htm @@ -1,4 +1,4 @@ <html><body>Mysterious Wizard:<br> This land is fertile ground for the materials I need in my dark arts. The problem is, my servants <font color="LEVEL">all have rotten heads</font>! I need someone to give me a hand cultivating the forest.<br> -<a action="bypass -h Quest 632_NecromancersRequest start">Quest</a> +<a action="bypass -h Quest Q00632_NecromancersRequest 31522-104.htm">Quest</a> </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-103.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-103.htm new file mode 100644 index 0000000000..a21dcb17c2 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-103.htm @@ -0,0 +1,4 @@ +<html><body>Mysterious Wizard:<br> +I'm looking for someone whose power is equal to the Lord of the Forest of the Dead! I have many servants, even if their heads are rotten.<br> +(Quest may only be undertaken by a character level 63 or above.) +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-104.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-104.htm new file mode 100644 index 0000000000..ce5b34ecdd --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-104.htm @@ -0,0 +1,5 @@ +<html><body>Mysterious Wizard:<br> +The most important of the materials I need are undead hearts with their Human memory intact.<br> +Especially the grey heart of undead vampires. They're just as good as red cloth from Aden. I need 200 of them.<br> +Also, I'll trade you something for undead brains. You can hunt them at night. What do you think? +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-105.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-105.html new file mode 100644 index 0000000000..f85f6bcf5a --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-105.html @@ -0,0 +1,7 @@ +<html><body>Mysterious Wizard:<br> +Good, you brought 200 vampire hearts.<br> +I'll buy them with Adena, but the undead brains aren't worth much. I'll trade you something else for them.<br> +<a action="bypass -h Quest Q00632_NecromancersRequest 31522-202.html">"I'll sell you the vampire hearts."</a><br> +<a action="bypass -h npc_%objectId%_multisell 31522">"I'll trade the brains."</a><br> +<a action="bypass -h Quest Q00632_NecromancersRequest 31522-204.html">"I want to quit hunting."</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-106.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-106.html new file mode 100644 index 0000000000..6b632f4bfe --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-106.html @@ -0,0 +1,7 @@ +<html><body>Mysterious Wizard:<br> +You don't have 200 vampire hearts yet.<br> +I'll trade you something for the dead's brains though.<br> +<a action="bypass -h npc_%objectId%_multisell 31522">Trade the dead's brains.</a><br> +<a action="bypass -h Quest Q00632_NecromancersRequest 31522-201.html">Continue hunting.</a><br> +<a action="bypass -h Quest Q00632_NecromancersRequest 31522-204.html">Stop hunting.</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-201.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-201.html new file mode 100644 index 0000000000..b344210b38 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-201.html @@ -0,0 +1,3 @@ +<html><body>Mysterious Wizard:<br> +One more favor. Collect 200 vampire hearts. Also, I'll trade you something for any undead brains you can scoop up. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-202.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-202.html new file mode 100644 index 0000000000..928dc2c66c --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-202.html @@ -0,0 +1,9 @@ +<html><body>Mysterious Wizard:<br> +Come on, that's not enough! Can you imagine how many hearts I need to die a yard of cloth red with blood?<br> +Excellent material, equivalent to the red cloth of Aden, but infused with magical power.<br> +Please bring me more hearts.<br> +I'll trade you for the dead's brains anytime.<br> +<a action="bypass -h npc_%objectId%_multisell 31522">Trade the dead's brains.</a><br> +<a action="bypass -h Quest Q00632_NecromancersRequest 31522-201.html">Say you'll go and bring more vampire hearts.</a><br> +<a action="bypass -h Quest Q00632_NecromancersRequest 31522-204.html">Say you want to quit.</a> +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-203.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-203.html new file mode 100644 index 0000000000..12a972b2f6 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-203.html @@ -0,0 +1,4 @@ +<html><body>Mysterious Wizard:<br> +Are you sure you have 200 vampire hearts?<br> +Maybe you dropped some. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-204.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-204.html new file mode 100644 index 0000000000..2e3bb6176e --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/31522-204.html @@ -0,0 +1,4 @@ +<html><body>Mysterious Wizard:<br> +That'll do.<br> +I have enough hearts now. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/Q00632_NecromancersRequest.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/Q00632_NecromancersRequest.java new file mode 100644 index 0000000000..b1b1a00690 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00632_NecromancersRequest/Q00632_NecromancersRequest.java @@ -0,0 +1,194 @@ +/* + * Copyright (C) 2004-2014 L2J DataPack + * + * This file is part of L2J DataPack. + * + * L2J DataPack 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 DataPack 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 <http://www.gnu.org/licenses/>. + */ +package quests.Q00632_NecromancersRequest; + +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; + +/** + * Necromancer's Request (632) + * @author Zoey76 + */ +public final class Q00632_NecromancersRequest extends Quest +{ + // NPC + private static final int MYSTERIOUS_WIZARD = 31522; + // Items + private static final int VAMPIRES_HEART = 7542; + private static final int ZOMBIES_BRAIN = 7543; + // Misc + private static final int MIN_LEVEL = 63; + private static final int REQUIRED_ITEM_COUNT = 200; + private static final int ADENA_REWARD = 120000; + // Monsters + private static final Map<Integer, Double> BRAIN_MONSTERS = new HashMap<>(); + private static final Map<Integer, Double> HEART_MONSTERS = new HashMap<>(); + static + { + BRAIN_MONSTERS.put(21547, 0.565); // Corrupted Knight + BRAIN_MONSTERS.put(21548, 0.484); // Resurrected Knight + BRAIN_MONSTERS.put(21549, 0.585); // Corrupted Guard + BRAIN_MONSTERS.put(21550, 0.597); // Corrupted Guard + BRAIN_MONSTERS.put(21551, 0.673); // Resurrected Guard + BRAIN_MONSTERS.put(21552, 0.637); // Resurrected Guard + BRAIN_MONSTERS.put(21555, 0.575); // Slaughter Executioner + BRAIN_MONSTERS.put(21556, 0.560); // Slaughter Executioner + BRAIN_MONSTERS.put(21562, 0.631); // Guillotine's Ghost + BRAIN_MONSTERS.put(21571, 0.758); // Ghost of Rebellion Soldier + BRAIN_MONSTERS.put(21576, 0.647); // Ghost of Guillotine + BRAIN_MONSTERS.put(21577, 0.625); // Ghost of Guillotine + BRAIN_MONSTERS.put(21579, 0.766); // Ghost of Rebellion Leader + + HEART_MONSTERS.put(21568, 0.452); // Devil Bat + HEART_MONSTERS.put(21569, 0.484); // Devil Bat + HEART_MONSTERS.put(21573, 0.499); // Atrox + HEART_MONSTERS.put(21582, 0.522); // Vampire Soldier + HEART_MONSTERS.put(21585, 0.413); // Vampire Magician + HEART_MONSTERS.put(21586, 0.496); // Vampire Adept + HEART_MONSTERS.put(21587, 0.519); // Vampire Warrior + HEART_MONSTERS.put(21588, 0.428); // Vampire Wizard + HEART_MONSTERS.put(21589, 0.439); // Vampire Wizard + HEART_MONSTERS.put(21590, 0.428); // Vampire Magister + HEART_MONSTERS.put(21591, 0.502); // Vampire Magister + HEART_MONSTERS.put(21592, 0.370); // Vampire Magister + HEART_MONSTERS.put(21593, 0.592); // Vampire Warlord + HEART_MONSTERS.put(21594, 0.554); // Vampire Warlord + HEART_MONSTERS.put(21595, 0.392); // Vampire Warlord + } + + public Q00632_NecromancersRequest() + { + super(632, Q00632_NecromancersRequest.class.getSimpleName(), "Necromancer's Request"); + addStartNpc(MYSTERIOUS_WIZARD); + addTalkId(MYSTERIOUS_WIZARD); + addKillId(BRAIN_MONSTERS.keySet()); + addKillId(HEART_MONSTERS.keySet()); + registerQuestItems(VAMPIRES_HEART, ZOMBIES_BRAIN); + } + + @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 "31522-104.htm": + { + if (player.getLevel() >= MIN_LEVEL) + { + qs.startQuest(); + qs.setMemoState(11); + htmltext = event; + } + break; + } + case "31522-201.html": + { + htmltext = event; + break; + } + case "31522-202.html": + { + if (getQuestItemsCount(player, VAMPIRES_HEART) >= REQUIRED_ITEM_COUNT) + { + takeItems(player, VAMPIRES_HEART, -1); + giveAdena(player, ADENA_REWARD, true); + qs.setMemoState(11); + htmltext = event; + } + else + { + htmltext = "31522-203.html"; + } + break; + } + case "31522-204.html": + { + takeItems(player, VAMPIRES_HEART, -1); + qs.exitQuest(true, true); + htmltext = event; + break; + } + } + return htmltext; + } + + @Override + public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) + { + final QuestState qs = getRandomPartyMemberState(player, -1, 3, npc); + if (qs != null) + { + if (BRAIN_MONSTERS.containsKey(npc.getId())) + { + qs.giveItemRandomly(npc, ZOMBIES_BRAIN, 1, 0, BRAIN_MONSTERS.get(npc.getId()), true); + } + else + { + qs.giveItemRandomly(npc, VAMPIRES_HEART, 1, 0, HEART_MONSTERS.get(npc.getId()), true); + + if (getQuestItemsCount(player, VAMPIRES_HEART) >= REQUIRED_ITEM_COUNT) + { + qs.setCond(2); + qs.setMemoState(12); + } + } + } + return super.onKill(npc, player, isSummon); + } + + @Override + public String onTalk(L2Npc npc, L2PcInstance player) + { + final QuestState qs = getQuestState(player, true); + String htmltext = getNoQuestMsg(player); + if (qs == null) + { + return htmltext; + } + + if (qs.isCreated()) + { + htmltext = player.getLevel() >= MIN_LEVEL ? "31522-101.htm" : "31522-103.htm"; + } + else if (qs.isStarted()) + { + if (qs.isMemoState(11)) + { + htmltext = "31522-106.html"; + } + else if (qs.isMemoState(12) && (getQuestItemsCount(player, VAMPIRES_HEART) >= REQUIRED_ITEM_COUNT)) + { + htmltext = "31522-105.html"; + } + } + return htmltext; + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java index 9ec9d59955..1e02d99db9 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -312,6 +312,7 @@ import quests.Q00627_HeartInSearchOfPower.Q00627_HeartInSearchOfPower; import quests.Q00628_HuntGoldenRam.Q00628_HuntGoldenRam; import quests.Q00629_CleanUpTheSwampOfScreams.Q00629_CleanUpTheSwampOfScreams; import quests.Q00631_DeliciousTopChoiceMeat.Q00631_DeliciousTopChoiceMeat; +import quests.Q00632_NecromancersRequest.Q00632_NecromancersRequest; import quests.Q00633_InTheForgottenVillage.Q00633_InTheForgottenVillage; import quests.Q00634_InSearchOfFragmentsOfDimension.Q00634_InSearchOfFragmentsOfDimension; import quests.Q00635_IntoTheDimensionalRift.Q00635_IntoTheDimensionalRift; @@ -685,6 +686,7 @@ public class QuestMasterHandler Q00628_HuntGoldenRam.class, Q00629_CleanUpTheSwampOfScreams.class, Q00631_DeliciousTopChoiceMeat.class, + Q00632_NecromancersRequest.class, Q00633_InTheForgottenVillage.class, Q00634_InSearchOfFragmentsOfDimension.class, Q00635_IntoTheDimensionalRift.class, diff --git a/L2J_DataPack_BETA/dist/sql/game/updates/20140815update.sql b/L2J_DataPack_BETA/dist/sql/game/updates/20140815update.sql new file mode 100644 index 0000000000..0adc13bdc2 --- /dev/null +++ b/L2J_DataPack_BETA/dist/sql/game/updates/20140815update.sql @@ -0,0 +1 @@ +UPDATE character_quests SET name='632_NecromancersRequest' WHERE name='Q00632_NecromancersRequest'; \ No newline at end of file -- GitLab