From bbd48e42fa0fa2e43b809d01278f9cd21fea732c Mon Sep 17 00:00:00 2001 From: malyelfik <malyelfik@users.noreply.github.com> Date: Wed, 17 Apr 2013 15:06:44 +0000 Subject: [PATCH] BETA: '''Spirit of Mirrors''' (104) in Java Patch by: xban1x Reviewed by: joxit, malyelfik --- L2J_DataPack_BETA/dist/game/data/scripts.cfg | 2 +- .../quests/104_SpiritOfMirrors/30017-05.htm | 4 - .../quests/104_SpiritOfMirrors/30041-01.htm | 4 - .../quests/104_SpiritOfMirrors/30043-01.htm | 3 - .../quests/104_SpiritOfMirrors/30045-01.htm | 3 - .../quests/104_SpiritOfMirrors/__init__.py | 145 ------------- .../30017-01.htm} | 0 .../30017-02.htm} | 0 .../30017-03.htm} | 6 +- .../30017-04.htm} | 6 +- .../30017-05.html} | 0 .../Q00104_SpiritOfMirrors/30017-06.html | 4 + .../Q00104_SpiritOfMirrors/30041-01.html | 4 + .../Q00104_SpiritOfMirrors/30043-01.html | 3 + .../Q00104_SpiritOfMirrors/30045-01.html | 3 + .../Q00104_SpiritOfMirrors.java | 204 ++++++++++++++++++ .../dist/sql/game/updates/20130417update.sql | 3 +- 17 files changed, 227 insertions(+), 167 deletions(-) delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-05.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30041-01.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30043-01.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30045-01.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/__init__.py rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{104_SpiritOfMirrors/30017-00.htm => Q00104_SpiritOfMirrors/30017-01.htm} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{104_SpiritOfMirrors/30017-06.htm => Q00104_SpiritOfMirrors/30017-02.htm} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{104_SpiritOfMirrors/30017-02.htm => Q00104_SpiritOfMirrors/30017-03.htm} (55%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{104_SpiritOfMirrors/30017-03.htm => Q00104_SpiritOfMirrors/30017-04.htm} (76%) rename L2J_DataPack_BETA/dist/game/data/scripts/quests/{104_SpiritOfMirrors/30017-04.htm => Q00104_SpiritOfMirrors/30017-05.html} (100%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-06.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30041-01.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30043-01.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30045-01.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/Q00104_SpiritOfMirrors.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index 7e1171e9d6..88f29fbce5 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -366,7 +366,7 @@ quests/66_CertifiedArbalester/__init__.py quests/Q00101_SwordOfSolidarity/Q00101_SwordOfSolidarity.java quests/Q00102_SeaOfSporesFever/Q00102_SeaOfSporesFever.java quests/103_SpiritOfCraftsman/__init__.py -quests/104_SpiritOfMirrors/__init__.py +quests/Q00104_SpiritOfMirrors/Q00104_SpiritOfMirrors.java quests/105_SkirmishWithOrcs/__init__.py quests/106_ForgottenTruth/__init__.py quests/107_MercilessPunishment/__init__.py diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-05.htm deleted file mode 100644 index 2d7c2f6814..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-05.htm +++ /dev/null @@ -1,4 +0,0 @@ -<html><body>Grand Magister Gallint:<br> -So you have captured all the escaped spirits! Thank you! In the meantime, I have reconstructed all of the magic barriers around the school, and the spirits will not escape again.<br> -I will give you this as a reward for your work. It may not look like much, but it is a helpful item which brings out the inner magic potential of the user. As Einhovant has always said, true power comes from within. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30041-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30041-01.htm deleted file mode 100644 index 82bd9f3825..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30041-01.htm +++ /dev/null @@ -1,4 +0,0 @@ -<html><body>Guard Arnold:<br> -Yesterday afternoon, as I was guarding the students of the magic school while they gathered materials<font color="LEVEL"> near the falls</font>, a great toad crawled by. I wasn't paying much attention to it, but all of a sudden, that great toad turned into an Orc warrior! I was startled and about to draw my sword, but I guess he felt threatened, escaping beyond the falls.<br> -I rubbed my eyes and asked the magister from the magic school what was going on, and he had also clearly seen the toad turn into an Orc warrior. I have no idea what happened. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30043-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30043-01.htm deleted file mode 100644 index 290ca4180f..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30043-01.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Guard Johnstone:<br> -A few days ago, while patrolling the<font color="LEVEL"> northern parts of the island</font>, I encountered a werewolf<font color="LEVEL"> near a farm</font>. I drew my bow and chased after him, but all of a sudden, his body started to waver, and he turned into a great toad! Do you think there are some werewolves that know how to perform strange magic? -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30045-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30045-01.htm deleted file mode 100644 index c6b2f44ecd..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30045-01.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Guard Kenyos:<br> -Last night, while patrolling the<font color="LEVEL"> outskirts</font>, I saw an Orc transforming into a werewolf! I thought I may have been seeing things, because I was so tired, but I asked the other guards and they all say that they saw the same thing! -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/__init__.py b/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/__init__.py deleted file mode 100644 index dceec0654f..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/__init__.py +++ /dev/null @@ -1,145 +0,0 @@ -# Made by Mr. Have fun! - Version 0.5 updated by Censor for www.l2jdp.com -import sys -from com.l2jserver.gameserver.model.itemcontainer import Inventory -from com.l2jserver.gameserver.model.quest import State -from com.l2jserver.gameserver.model.quest import QuestState -from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest -from com.l2jserver import Config - -qn = "104_SpiritOfMirrors" - -GALLINS_OAK_WAND = 748 -WAND_SPIRITBOUND1 = 1135 -WAND_SPIRITBOUND2 = 1136 -WAND_SPIRITBOUND3 = 1137 -WAND_OF_ADEPT = 747 -#Newbie/one time rewards section -#Any quest should rely on a unique bit, but -#it could be shared among quest that were mutually -#exclusive or race restricted. -#Bit #1 isn't used for backwards compatibility. -NEWBIE_REWARD = 2 -SPIRITSHOT_NO_GRADE_FOR_BEGINNERS = 5790 -SPIRITSHOT_NO_GRADE = 2509 -SOULSHOT_NO_GRADE = 1835 - -DROPLIST = { -27003: (WAND_SPIRITBOUND1), -27004: (WAND_SPIRITBOUND2), -27005: (WAND_SPIRITBOUND3) -} - -# Helper function - If player have all quest items returns 1, otherwise 0 -def HaveAllQuestItems (st) : - for mobId in DROPLIST.keys() : - if st.getQuestItemsCount(DROPLIST[mobId]) == 0 : - return 0 - return 1 - -# Main Quest code -class Quest (JQuest) : - - def __init__(self,id,name,descr): - JQuest.__init__(self,id,name,descr) - self.questItemIds = [GALLINS_OAK_WAND, WAND_SPIRITBOUND1, WAND_SPIRITBOUND2, WAND_SPIRITBOUND3] - - def onAdvEvent (self,event,npc, player) : - htmltext = event - st = player.getQuestState(qn) - if not st : return - if event == "30017-03.htm" : - st.set("cond","1") - st.setState(State.STARTED) - st.playSound("ItemSound.quest_accept") - st.giveItems(GALLINS_OAK_WAND,1) - st.giveItems(GALLINS_OAK_WAND,1) - st.giveItems(GALLINS_OAK_WAND,1) - return htmltext - - def onTalk (self,npc,player): - npcId = npc.getNpcId() - htmltext = Quest.getNoQuestMsg(player) - st = player.getQuestState(qn) - if not st: return htmltext - id = st.getState() - if id == State.COMPLETED : - htmltext = Quest.getAlreadyCompletedMsg(player) - elif npcId == 30017 and id == State.CREATED : - if player.getRace().ordinal() != 0 : - htmltext = "30017-00.htm" - st.exitQuest(1) - elif player.getLevel() >= 10 : - htmltext = "30017-02.htm" - return htmltext - else: - htmltext = "30017-06.htm" - st.exitQuest(1) - elif id == State.STARTED : - if npcId == 30017 and st.getInt("cond") and st.getQuestItemsCount(GALLINS_OAK_WAND)>=1 and not HaveAllQuestItems(st) : - htmltext = "30017-04.htm" - elif npcId == 30017 and st.getInt("cond")==3 and HaveAllQuestItems(st) : - for mobId in DROPLIST.keys() : - st.takeItems(DROPLIST[mobId],-1) - if player.getClassId().isMage() : - st.giveItems(SPIRITSHOT_NO_GRADE,500) - else : - st.giveItems(SOULSHOT_NO_GRADE,1000) - # check the player state against this quest newbie rewarding mark. - newbie = player.getNewbie() - if newbie | NEWBIE_REWARD != newbie : - player.setNewbie(newbie|NEWBIE_REWARD) - if player.getClassId().isMage() : - st.giveItems(SPIRITSHOT_NO_GRADE_FOR_BEGINNERS,3000) - st.playTutorialVoice("tutorial_voice_027") - st.rewardItems(1060,100) # Lesser Healing Potions - st.giveItems(WAND_OF_ADEPT,1) - for item in range(4412,4417) : - st.rewardItems(item,10) # Echo crystals - st.giveItems(57,16866) - st.addExpAndSp(39750,3407) - htmltext = "30017-05.htm" - st.unset("cond") - st.exitQuest(False) - st.playSound("ItemSound.quest_finish") - elif npcId == 30045 and st.getInt("cond") : - htmltext = "30045-01.htm" - st.set("cond","2") - st.playSound("ItemSound.quest_middle") - elif npcId == 30043 and st.getInt("cond") : - htmltext = "30043-01.htm" - st.set("cond","2") - st.playSound("ItemSound.quest_middle") - elif npcId == 30041 and st.getInt("cond") : - htmltext = "30041-01.htm" - st.set("cond","2") - st.playSound("ItemSound.quest_middle") - return htmltext - - def onKill(self,npc,player,isPet): - st = player.getQuestState(qn) - if not st: return - if st.getState() != State.STARTED : return - npcId = npc.getNpcId() - if st.getInt("cond") >= 1 and st.getItemEquipped(Inventory.PAPERDOLL_RHAND) == GALLINS_OAK_WAND and not st.getQuestItemsCount(DROPLIST[npcId]) : # (7) means weapon slot - st.takeItems(GALLINS_OAK_WAND,1) - st.giveItems(DROPLIST[npcId],1) - if HaveAllQuestItems(st) : - st.set("cond","3") - st.playSound("ItemSound.quest_middle") - else: - st.playSound("ItemSound.quest_itemget") - return - -QUEST = Quest(104,qn,"Spirit Of Mirrors") - - -QUEST.addStartNpc(30017) - -QUEST.addTalkId(30017) - -QUEST.addTalkId(30041) -QUEST.addTalkId(30043) -QUEST.addTalkId(30045) - -for mobId in DROPLIST.keys(): - QUEST.addKillId(mobId) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-00.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-01.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-00.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-01.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-06.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-02.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-06.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-02.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-03.htm similarity index 55% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-03.htm index 6df8e67269..e420415255 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-02.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-03.htm @@ -1,6 +1,6 @@ <html><body>Grand Magister Gallint:<br> -Recently I have been studying the<font color="LEVEL"> spirit of mirrors</font>. This spirit does not have a set form and reflects the form of others, like a mirror. The name spirit of mirrors comes from that trait. I think that the magical creature called the doppelganger may also be an evolved form of the spirit of mirrors.<br> +Recently I have been studying the <font color="LEVEL">Spirit Of Mirrors</font>. This spirit does not have a set form and reflects the form of others, like a mirror. The name Spirit Of Mirrors comes from that trait. I think that the magical creature called the doppelganger may also be an evolved form of the Spirit Of Mirrors.<br> But there has been a problem! I don't know why, but the magic defense field that I built around the School of Magic disappeared a few days ago. Three of the spirits of mirrors kept in my research lab escaped during that time.<br> -I need to recapture the escaped spirits before they harm anyone, but my priority is in examining the shields around the magic school. So, please help me. Do you think you can find the spirits of mirrors for me? If you help, I will give you the<font color="LEVEL"> wand of the adept</font> as a reward. It is a very useful weapon for those walking the path of a mage.<br> -<a action="bypass -h Quest 104_SpiritOfMirrors 30017-03.htm">Say you will help</a> +I need to recapture the escaped spirits before they harm anyone, but my priority is in examining the shields around the magic school. So, please help me. Do you think you can find the spirits of mirrors for me? If you help, I will give you the <font color="LEVEL">wand of the adept</font> as a reward. It is a very useful weapon for those walking the path of a mage.<br> +<a action="bypass -h Quest Q00104_SpiritOfMirrors 30017-04.htm">Say you will help</a> </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-04.htm similarity index 76% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-03.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-04.htm index 0698a0dc19..6c7dc3f518 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-03.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-04.htm @@ -1,5 +1,5 @@ <html><body>Grand Magister Gallint:<br> -Thank you. Fortunately, I think the spirits have gone into the woods rather than to the village. Things may become complicated if a spirit of mirrors encounters a dangerous beast and changes into its identical form, so they must be caught as soon as possible.<br> -To capture the spirit of mirrors, you need this<font color="LEVEL"> oak wand</font>. Weaken the spirit by attacking it with sword or magic, then deliver the finishing blow with this oak wand, and you will be able to seal the spirit within the wand. I will give you three enchanted wands, one for each spirit that has escaped.<br> -The village<font color="LEVEL"> guards</font> may have found some helpful evidence during their patrol. It may be a good idea to stop by the village and speak to the guards. +Thank you. Fortunately, I think the spirits have gone into the woods rather than to the village. Things may become complicated if a Spirit Of Mirrors encounters a dangerous beast and changes into its identical form, so they must be caught as soon as possible.<br> +To capture the Spirit Of Mirrors, you need this<font color="LEVEL"> oak wand</font>. Weaken the spirit by attacking it with sword or magic, then deliver the finishing blow with this oak wand, and you will be able to seal the spirit within the wand. I will give you three enchanted wands, one for each spirit that has escaped.<br> +The village <font color="LEVEL">guards</font> may have found some helpful evidence during their patrol. It may be a good idea to stop by the village and speak to the guards. </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-05.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/104_SpiritOfMirrors/30017-04.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-05.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-06.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-06.html new file mode 100644 index 0000000000..cfdfca1c59 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30017-06.html @@ -0,0 +1,4 @@ +<html><body>Grand Magister Gallint:<br> +You have captured all the escaped spirits of mirrors! Thank you! Now that I have restored all the force fields around the School of Wizardry, the spirits will never escape again.<br> +I will give you this as a sign of my appreciation. It may not seem like much, but it will help bring out the hidden magic potential of its user. As Einhovant always says, true strength must be found within. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30041-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30041-01.html new file mode 100644 index 0000000000..7369868c94 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30041-01.html @@ -0,0 +1,4 @@ +<html><body>Guard Arnold:<br> +Yesterday afternoon, as I was guarding the students of the magic school while they gathered materials <font color="LEVEL">near the Obelisk of Victory</font>, a great toad crawled by. I wasn't paying much attention to it, but all of a sudden, that great toad turned into an Orc Warrior! I was startled and about to draw my sword, but I guess he felt threatened, escaping beyond the falls.<br> +I rubbed my eyes and asked the magister from the magic school what was going on and he had also clearly seen the toad turn into an Orc Warrior. I have no idea what happened. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30043-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30043-01.html new file mode 100644 index 0000000000..a0cc9843c4 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30043-01.html @@ -0,0 +1,3 @@ +<html><body>Guard Johnstone:<br> +A few days ago, while patrolling the <font color="LEVEL">western parts of the School of Wizardry</font>, I encountered a werewolf <font color="LEVEL">near a bridge</font>. I drew my bow and chased after him, but all of a sudden, his body started to waver, and he turned into a great toad! Do you think there are some werewolves that know how to perform strange magic? +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30045-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30045-01.html new file mode 100644 index 0000000000..a64ab09d18 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/30045-01.html @@ -0,0 +1,3 @@ +<html><body>Guard Kenyos:<br> +Last night, while patrolling the <font color="LEVEL">west coast of the island</font>, I saw an Orc transforming into a werewolf! I thought I may have been seeing things, because I was so tired, but I asked the other guards and they all say that they saw the same thing! +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/Q00104_SpiritOfMirrors.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/Q00104_SpiritOfMirrors.java new file mode 100644 index 0000000000..d47591cf87 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00104_SpiritOfMirrors/Q00104_SpiritOfMirrors.java @@ -0,0 +1,204 @@ +/* + * Copyright (C) 2004-2013 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.Q00104_SpiritOfMirrors; + +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.base.Race; +import com.l2jserver.gameserver.model.holders.ItemHolder; +import com.l2jserver.gameserver.model.itemcontainer.Inventory; +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.NpcStringId; + +/** + * Spirit of Mirrors (104) + * @author xban1x + */ +public final class Q00104_SpiritOfMirrors extends Quest +{ + // NPCs + private static final int GALLINT = 30017; + private static final int ARNOLD = 30041; + private static final int JOHNSTONE = 30043; + private static final int KENYOS = 30045; + // Items + private static final int GALLINTS_OAK_WAND = 748; + private static final int SPIRITBOUND_WAND1 = 1135; + private static final int SPIRITBOUND_WAND2 = 1136; + private static final int SPIRITBOUND_WAND3 = 1137; + // Monsters + private static final Map<Integer, Integer> MONSTERS = new HashMap<>(); + static + { + MONSTERS.put(27003, SPIRITBOUND_WAND1); // Spirit Of Mirrors + MONSTERS.put(27004, SPIRITBOUND_WAND2); // Spirit Of Mirrors + MONSTERS.put(27005, SPIRITBOUND_WAND3); // Spirit Of Mirrors + } + // Rewards + private static final int SOULSHOT_NO_GRADE = 1835; + private static final int SPIRITSHOT_NO_GRADE = 2509; + private static final int SPIRITSHOT = 5790; + private static final ItemHolder[] REWARDS = + { + new ItemHolder(1060, 100), // Lesser Healing Potion + new ItemHolder(4412, 10), // Echo Crystal - Theme of Battle + new ItemHolder(4413, 10), // Echo Crystal - Theme of Love + new ItemHolder(4414, 10), // Echo Crystal - Theme of Solitude + new ItemHolder(4415, 10), // Echo Crystal - Theme of Feast + new ItemHolder(4416, 10), // Echo Crystal - Theme of Celebration + new ItemHolder(747, 1), // Wand of Adept + }; + // Misc + private static final int MIN_LVL = 10; + + private Q00104_SpiritOfMirrors(int questId, String name, String descr) + { + super(questId, name, descr); + addStartNpc(GALLINT); + addTalkId(ARNOLD, GALLINT, JOHNSTONE, KENYOS); + addKillId(MONSTERS.keySet()); + registerQuestItems(GALLINTS_OAK_WAND, SPIRITBOUND_WAND1, SPIRITBOUND_WAND2, SPIRITBOUND_WAND3); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + final QuestState st = player.getQuestState(getName()); + if ((st != null) && event.equalsIgnoreCase("30017-04.htm")) + { + st.startQuest(); + st.giveItems(GALLINTS_OAK_WAND, 3); + return event; + } + return null; + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + final QuestState st = killer.getQuestState(getName()); + if ((st != null) && (st.isCond(1) || st.isCond(2)) && (st.getItemEquipped(Inventory.PAPERDOLL_RHAND) == GALLINTS_OAK_WAND) && !st.hasQuestItems(MONSTERS.get(npc.getNpcId()))) + { + st.takeItems(GALLINTS_OAK_WAND, 1); + st.giveItems(MONSTERS.get(npc.getNpcId()), 1); + if (st.hasQuestItems(SPIRITBOUND_WAND1, SPIRITBOUND_WAND2, SPIRITBOUND_WAND3)) + { + st.setCond(3, true); + } + else + { + st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET); + } + } + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onTalk(L2Npc npc, L2PcInstance player) + { + final QuestState st = player.getQuestState(getName()); + String htmltext = getNoQuestMsg(player); + if (st != null) + { + switch (npc.getNpcId()) + { + case GALLINT: + { + switch (st.getState()) + { + case State.CREATED: + { + htmltext = (player.getRace() == Race.Human) ? (player.getLevel() >= MIN_LVL) ? "30017-03.htm" : "30017-02.htm" : "30017-01.htm"; + break; + } + case State.STARTED: + { + if (st.isCond(3) && st.hasQuestItems(SPIRITBOUND_WAND1, SPIRITBOUND_WAND2, SPIRITBOUND_WAND3)) + { + if ((player.getLevel() < 25) && player.isMageClass()) + { + st.rewardItems(SPIRITSHOT, 3000); + st.playTutorialVoice("tutorial_voice_027"); + } + for (ItemHolder reward : REWARDS) + { + st.giveItems(reward); + } + if (player.isMageClass()) + { + st.giveItems(SPIRITSHOT_NO_GRADE, 500); + } + else + { + st.giveItems(SOULSHOT_NO_GRADE, 1000); + } + st.addExpAndSp(39750, 3407); + st.giveAdena(16866, true); + st.exitQuest(false, true); + // TODO: Newbie Guide + showOnScreenMsg(player, NpcStringId.ACQUISITION_OF_RACE_SPECIFIC_WEAPON_COMPLETE_N_GO_FIND_THE_NEWBIE_GUIDE, 2, 5000); + htmltext = "30017-06.html"; + } + else + { + htmltext = "30017-05.html"; + } + break; + } + case State.COMPLETED: + { + htmltext = getAlreadyCompletedMsg(player); + break; + } + } + break; + } + case ARNOLD: + case JOHNSTONE: + case KENYOS: + { + if (st.isCond(1)) + { + if (!st.isSet(npc.getName())) + { + st.set(npc.getName(), "1"); + } + if (st.isSet("Arnold") && st.isSet("Johnstone") && st.isSet("Kenyos")) + { + st.setCond(2, true); + } + } + htmltext = npc.getNpcId() + "-01.html"; + break; + } + } + } + return htmltext; + } + + public static void main(String[] args) + { + new Q00104_SpiritOfMirrors(104, Q00104_SpiritOfMirrors.class.getSimpleName(), "Spirit of Mirrors"); + } +} \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/sql/game/updates/20130417update.sql b/L2J_DataPack_BETA/dist/sql/game/updates/20130417update.sql index 5cf5bc4a01..c67b0b1564 100644 --- a/L2J_DataPack_BETA/dist/sql/game/updates/20130417update.sql +++ b/L2J_DataPack_BETA/dist/sql/game/updates/20130417update.sql @@ -1 +1,2 @@ -DELETE FROM castle_functions where type=5; \ No newline at end of file +DELETE FROM castle_functions WHERE type=5; +UPDATE character_quests SET name='Q00104_SpiritOfMirrors' WHERE name='104_SpiritOfMirrors'; \ No newline at end of file -- GitLab