diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index 6aaab465e5af42007ade13c0a60842d29f0aa924..e5d003f16c0451d8ac5b6faa3452e27edc8da7d7 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -338,7 +338,7 @@ quests/Q00156_MillenniumLove/Q00156_MillenniumLove.java quests/Q00157_RecoverSmuggledGoods/Q00157_RecoverSmuggledGoods.java quests/Q00158_SeedOfEvil/Q00158_SeedOfEvil.java quests/Q00159_ProtectTheWaterSource/Q00159_ProtectTheWaterSource.java -quests/160_NerupasFavor/__init__.py +quests/Q00160_NerupasRequest/Q00160_NerupasRequest.java quests/Q00161_FruitOfTheMotherTree/Q00161_FruitOfTheMotherTree.java quests/Q00162_CurseOfTheUndergroundFortress/Q00162_CurseOfTheUndergroundFortress.java quests/Q00163_LegacyOfThePoet/Q00163_LegacyOfThePoet.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30147-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30147-01.htm deleted file mode 100644 index 28508dcb8b28fd6665f7cd8d5acfddcddf224e1b..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30147-01.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Trader Unoren:<br> -Ah, the spider silk that I asked Nerupa to obtain for me. Thank you. This silvery spidersilk that the silver spiders spin. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30149-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30149-03.htm deleted file mode 100644 index 76224795fe3ae3ddf9296ff714ae369ee63ebbad..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30149-03.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>Trader Creamees:<br> -So you've managed to obtain the nightshade leaf? Please give it to Unoren of the weapons and armor shop. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/__init__.py b/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/__init__.py deleted file mode 100644 index f9038945f5ee7ccd7c5389d11c8337c97bcfe15b..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/__init__.py +++ /dev/null @@ -1,113 +0,0 @@ -# Made by Mr. Have fun! -# Version 0.3 by H1GHL4ND3R -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 = "160_NerupasFavor" - -SILVERY_SPIDERSILK = 1026 -UNOS_RECEIPT = 1027 -CELS_TICKET = 1028 -NIGHTSHADE_LEAF = 1029 -LESSER_HEALING_POTION = 1060 - -class Quest (JQuest) : - - def __init__(self,id,name,descr): - JQuest.__init__(self,id,name,descr) - self.questItemIds = [SILVERY_SPIDERSILK, UNOS_RECEIPT, CELS_TICKET, NIGHTSHADE_LEAF] - - def onAdvEvent (self,event,npc, player) : - htmltext = event - st = player.getQuestState(qn) - if not st : return - if event == "30370-04.htm" : - st.set("cond","1") - st.setState(State.STARTED) - st.playSound("ItemSound.quest_accept") - st.giveItems(SILVERY_SPIDERSILK,1) - return htmltext - - def onTalk (self,npc,player): - htmltext = Quest.getNoQuestMsg(player) - st = player.getQuestState(qn) - if not st : return htmltext - - npcId = npc.getId() - id = st.getState() - if id == State.CREATED : - if player.getRace().ordinal() != 1 : - htmltext = "30370-00.htm" - elif player.getLevel() >= 3 : - htmltext = "30370-03.htm" - st.set("cond","0") - else: - htmltext = "30370-02.htm" - st.exitQuest(1) - elif id == State.COMPLETED : - htmltext = Quest.getAlreadyCompletedMsg(player) - - elif id == State.STARTED : - try : - cond = st.getInt("cond") - except : - cond = None - if cond == 1 : - if npcId == 30370 : - htmltext = "30370-05.htm" - elif npcId == 30147 and st.getQuestItemsCount(SILVERY_SPIDERSILK) : - st.takeItems(SILVERY_SPIDERSILK,1) - st.giveItems(UNOS_RECEIPT,1) - st.set("cond","2") - st.playSound("ItemSound.quest_middle") - htmltext = "30147-01.htm" - elif cond == 2 : - if npcId == 30370 : - htmltext = "30370-05.htm" - elif npcId == 30147 and st.getQuestItemsCount(UNOS_RECEIPT) : - htmltext = "30147-02.htm" - elif npcId == 30149 and st.getQuestItemsCount(UNOS_RECEIPT) : - st.takeItems(UNOS_RECEIPT,1) - st.giveItems(CELS_TICKET,1) - st.set("cond","3") - htmltext = "30149-01.htm" - elif cond == 3 : - if npcId == 30370 : - htmltext = "30370-05.htm" - elif npcId == 30149 and st.getQuestItemsCount(CELS_TICKET) : - htmltext = "30149-02.htm" - elif npcId == 30152 and st.getQuestItemsCount(CELS_TICKET) : - st.takeItems(CELS_TICKET,st.getQuestItemsCount(CELS_TICKET)) - st.giveItems(NIGHTSHADE_LEAF,1) - st.set("cond","4") - htmltext = "30152-01.htm" - elif cond == 4 : - if npcId == 30152 and st.getQuestItemsCount(NIGHTSHADE_LEAF) : - htmltext = "30152-02.htm" - elif npcId == 30149 and st.getQuestItemsCount(NIGHTSHADE_LEAF) : - htmltext = "30149-03.htm" - elif npcId == 30147 and st.getQuestItemsCount(NIGHTSHADE_LEAF) : - htmltext = "30147-03.htm" - elif npcId == 30370 and st.getQuestItemsCount(NIGHTSHADE_LEAF) : - st.takeItems(NIGHTSHADE_LEAF,1) - st.rewardItems(LESSER_HEALING_POTION,5) - st.addExpAndSp(1000,0) - st.unset("cond") - st.exitQuest(False) - st.playSound("ItemSound.quest_finish") - htmltext = "30370-06.htm" - return htmltext - -QUEST = Quest(160,qn,"Nerupa's Request") - -QUEST.addStartNpc(30370) - -QUEST.addTalkId(30370) - -QUEST.addTalkId(30147) -QUEST.addTalkId(30149) -QUEST.addTalkId(30152) -QUEST.addTalkId(30370) \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30147-01.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30147-01.html new file mode 100644 index 0000000000000000000000000000000000000000..b7a711b437403634f4ed3e56c55ca146607437d4 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30147-01.html @@ -0,0 +1,5 @@ +<html><body>Trader Unoren:<br> +Ah, the Spider Silk that I asked Nerupa to obtain for me. Thank you. This Silvery Spidersilk that the silver spiders spin...very strong and flexible, yet light, which makes it a good material for strongbows.<br> +Oh, did Nerupa tell you to get something from me? Hah, Nerupa still insists on trading the old-fashioned way -- bartering. She was absolutely livid when I told her that I'd pay money for the spidersilks. So, she asked me to find the <font color="LEVEL">Nightshade Leaf</font> for her instead. It's very hard to get, but thankfully Creamees of the magic shop recently managed to obtain a few nightshade leaves, and I have ordered one from him.<br> +Here, take this receipt and go to <font color="LEVEL">Creamees,</font> he'll give you the Nightshade Leaf, which you'll give to Nerupa. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30147-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30147-02.html similarity index 62% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30147-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30147-02.html index cae2ad71ca78ddd4d67e1aa5671cfc22947c928f..ef644d634fe242457930aa6db8cd33c92414f0ba 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30147-02.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30147-02.html @@ -1,3 +1,3 @@ <html><body>Trader Unoren:<br> -Are you still in the village? Please get the "Nightshade Leaf" from Creamees at the magic grocery shop, and deliver it to Nerupa. +Are you still in the village? Please get the "Nightshade Leaf" from Creamees at the magic grocery shop, and deliver it to Nerufa. </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30147-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30147-03.html similarity index 59% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30147-03.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30147-03.html index da4cfc3846ffeabc574ab8f9774ccccd11197544..5fa9f3d78beee20561c82c6414d27e9c02b024a2 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30147-03.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30147-03.html @@ -1,3 +1,3 @@ <html><body>Trader Unoren:<br> -So, you have come for the nightshade leaf. I know it's a burden to you, but would you please deliver it to<font color="LEVEL"> Nerupa</font>? I don't know the exact reason why, but Nerupa says that she will not come into the village. According to rumors, they say it's because of the magic barriers that the hierarch has set up around the village ... +So, you have come for the Nightshade Leaf. I know it's a burden to you, but would you please deliver it to <font color="LEVEL">Nerupa</font>? I don't know the exact reason why, but Nerupa says that she will not come into the village. According to rumors, they say it's because of the magic barriers that the hierarch has set up around the village... </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30149-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30149-01.html similarity index 84% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30149-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30149-01.html index 44cc88827d33b8159d705bc5367741589c1aaa58..b0bc42422b50a6e8a4c777bfeef8ee9c0bda009d 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30149-01.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30149-01.html @@ -1,4 +1,4 @@ <html><body>Trader Creamees:<br> -The item that Unoren ordered? Oh, you mean the Nightshade Leaf. I went through a bit of trouble to get this... I stored it in the warehouse because it's such a rare item... <br> +The item that Unoren ordered? Oh, you mean the Nightshade Leaf. I went through a bit of trouble to get this... I stored it in the warehouse because it's such a rare item...<br> If you take this ticket and go see <font color="LEVEL">Julia</font> at the warehouse, she'll give you the Nightshade Leaf. </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30149-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30149-02.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30149-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30149-02.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30149-03.html b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30149-03.html new file mode 100644 index 0000000000000000000000000000000000000000..e6d67862fda808abaa92aac9491baf3b2cc03348 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30149-03.html @@ -0,0 +1,3 @@ +<html><body>Trader Creamees:<br> +I see you've gotten the Nightshade Leaf. Please deliver it the Unoren at the weapon shop. +</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30152-01.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30152-01.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30152-01.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30152-01.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30152-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30152-02.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30152-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30152-02.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-00.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-01.htm similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-00.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-01.htm diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-02.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-02.htm similarity index 84% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-02.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-02.htm index bf9c7f3731161d9e0878346963cec8306b1d40e6..9c90ca50734acd8b7a79e0368df206b1fd11bdd8 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-02.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-02.htm @@ -1,4 +1,4 @@ <html><body>Nerupa:<br> -Recently, one of your kind who lives in the village visited me and asked me to get some silvery spider silks for him. My arachne sisters are wandering the forests and gathering the spider webs that the silver spiders have spun. When the collecting is finished, I'd like you to take them to the village. I hate going into the village.<br> +Recently, one of your kind who lives in the village visited me and asked me to get some silvery Spider Silks for him. My arachne sisters are wandering the forests and gathering the spider webs that the silver spiders have spun. When the collecting is finished, I'd like you to take them to the village. I hate going into the village.<br> (Quest for Elven characters level 3 and above.) </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-03.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-03.htm similarity index 67% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-03.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-03.htm index e5d86c2e690db27c42f9f926fdce6cc2c758772f..63a749691ab4d241553324fad04d42a64fb0d51c 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-03.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-03.htm @@ -1,4 +1,4 @@ <html><body>Nerupa:<br> -Recently, one of your kind who lives in the village visited me and asked me to get some<font color="LEVEL"> silvery spider silks</font> for him. My sisters have combed the forest and collected spider webs spun by silver spiders. But I detest going into the village. I would like it if you could deliver them for me instead. Would you do that for me?<br> -<a action="bypass -h Quest 160_NerupasFavor 30370-04.htm">Say you will do the favor</a> +Recently, one of your kind who lives in the village visited me and asked me to get some <font color="LEVEL">silvery Spider Silks</font> for him. My sisters have combed the forest and collected spider webs spun by silver spiders. But I detest going into the village. I would like it if you could deliver them for me instead. Would you do that for me?<br> +<a action="bypass -h Quest Q00160_NerupasRequest 30370-04.htm">Say you will do the favor</a> </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-04.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-04.htm similarity index 50% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-04.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-04.htm index 2cd2b757e4633954b0ac44a1a470b010880ce09a..e864ba8cf12140a0cf8927bc10e442b712e96e31 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-04.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-04.htm @@ -1,5 +1,5 @@ <html><body>Nerupa:<br> -Go to<font color="LEVEL"> Unoren</font>, who works in the weapons and armor store, and give him this silvery spider silk. And in return, I have asked him to get the<font color="LEVEL"> nightshade leaf</font> for me. Unoren said that the nightshade leaf is hard to find and offered "adena" instead. But I refused.<br> -A young Elf such as yourself may not know this, but we children of the forest have always lived a life where we obtain what we need from nature, trading what we have obtained for other objects, and giving back to nature as much as we have received. But some time ago the Elves learned a strange habit from the Dwarves. The strange practice of giving metal or slips of paper instead of bartering. But I can't understand "money" or "adena" at all.<br> -Eventually, Unoren agreed to find the nightshade leaf for me. Get it from him and bring it back to me. +Go to <font color="LEVEL">Unoren</font>, who works in the weapons and armor store, and give him this silvery Spider Silk. And in return, I have asked him to get the <font color="LEVEL">Nightshade Leaf</font> for me. Unoren said that the Nightshade Leaf is hard to find and offered "Adena" instead. But I refused.<br> +A young Elf such as yourself may not know this, but we children of the forest have always lived a life where we obtain what we need from nature, trading what we have obtained for other objects, and giving back to nature as much as we have received. But some time ago the Elves learned a strange habit from the Dwarves. The strange practice of giving metal or slips of paper instead of bartering. But I can't understand "money" or "Adena" at all.<br> +Eventually, Unoren agreed to find the Nightshade Leaf for me. Get it from him and bring it back to me. </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-05.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-05.html similarity index 64% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-05.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-05.html index cfbc118294ee01309a5435aad3ade5ac93e45b1b..0271960cef48c6a50b72bae997169d4bfd1910fa 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-05.htm +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-05.html @@ -1,3 +1,3 @@ <html><body>Nerupa:<br> -You couldn't manage to get the nightshade leaf from Unoren? Did he say he didn't have it? Don't tell me that that little Elf creature lied to me? +You couldn't manage to get the Nightshade Leaf from Unoren? Did he say he didn't have it? Don't tell me that that little Elf creature lied to me? </body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-06.htm b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-06.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/quests/160_NerupasFavor/30370-06.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/30370-06.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/Q00160_NerupasRequest.java b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/Q00160_NerupasRequest.java new file mode 100644 index 0000000000000000000000000000000000000000..ecc84079da93755dca645b87f9240f159acc510d --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00160_NerupasRequest/Q00160_NerupasRequest.java @@ -0,0 +1,185 @@ +/* + * 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.Q00160_NerupasRequest; + +import com.l2jserver.gameserver.enums.PcRace; +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; + +/** + * Nerupa's Request (160) + * @author ivantotov + */ +public final class Q00160_NerupasRequest extends Quest +{ + // NPCs + private static final int NERUPA = 30370; + private static final int UNOREN = 30147; + private static final int CREAMEES = 30149; + private static final int JULIA = 30152; + // Items + private static final int SILVERY_SPIDERSILK = 1026; + private static final int UNOS_RECEIPT = 1027; + private static final int CELS_TICKET = 1028; + private static final int NIGHTSHADE_LEAF = 1029; + private static final int LESSER_HEALING_POTION = 1060; + // Misc + private static final int MIN_LEVEL = 3; + + private Q00160_NerupasRequest() + { + super(160, Q00160_NerupasRequest.class.getSimpleName(), "Nerupa's Request"); + addStartNpc(NERUPA); + addTalkId(NERUPA, UNOREN, CREAMEES, JULIA); + registerQuestItems(SILVERY_SPIDERSILK, UNOS_RECEIPT, CELS_TICKET, NIGHTSHADE_LEAF); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + final QuestState qs = getQuestState(player, false); + if ((qs != null) && event.equals("30370-04.htm")) + { + qs.startQuest(); + giveItems(player, SILVERY_SPIDERSILK, 1); + return event; + } + return null; + } + + @Override + public String onTalk(L2Npc npc, L2PcInstance player) + { + final QuestState qs = getQuestState(player, true); + String htmltext = getNoQuestMsg(player); + switch (qs.getState()) + { + case State.COMPLETED: + { + htmltext = getAlreadyCompletedMsg(player); + break; + } + case State.CREATED: + { + if (npc.getId() == NERUPA) + { + if (player.getRace() != PcRace.Elf) + { + htmltext = "30370-01.htm"; + } + else if (player.getLevel() < MIN_LEVEL) + { + htmltext = "30370-02.htm"; + } + else + { + htmltext = "30370-03.htm"; + } + } + break; + } + case State.STARTED: + { + switch (npc.getId()) + { + case NERUPA: + { + if (hasQuestItems(player, NIGHTSHADE_LEAF)) + { + takeItems(player, NIGHTSHADE_LEAF, -1); + rewardItems(player, LESSER_HEALING_POTION, 5); + addExpAndSp(player, 1000, 0); + qs.exitQuest(false, true); + htmltext = "30370-06.html"; + } + else + { + htmltext = "30370-05.html"; + } + break; + } + case UNOREN: + { + if (hasQuestItems(player, SILVERY_SPIDERSILK)) + { + takeItems(player, SILVERY_SPIDERSILK, -1); + giveItems(player, UNOS_RECEIPT, 1); + qs.setCond(2, true); + htmltext = "30147-01.html"; + } + else if (hasQuestItems(player, UNOS_RECEIPT)) + { + htmltext = "30147-02.html"; + } + else if (hasQuestItems(player, NIGHTSHADE_LEAF)) + { + htmltext = "30147-03.html"; + } + break; + } + case CREAMEES: + { + if (hasQuestItems(player, UNOS_RECEIPT)) + { + takeItems(player, UNOS_RECEIPT, -1); + giveItems(player, CELS_TICKET, 1); + qs.setCond(3, true); + htmltext = "30149-01.html"; + } + else if (hasQuestItems(player, CELS_TICKET)) + { + htmltext = "30149-02.html"; + } + else if (hasQuestItems(player, NIGHTSHADE_LEAF)) + { + htmltext = "30149-03.html"; + } + break; + } + case JULIA: + { + if (hasQuestItems(player, CELS_TICKET)) + { + takeItems(player, CELS_TICKET, -1); + giveItems(player, NIGHTSHADE_LEAF, 1); + qs.setCond(4, true); + htmltext = "30152-01.html"; + + } + else if (hasQuestItems(player, NIGHTSHADE_LEAF)) + { + htmltext = "30152-02.html"; + } + break; + } + } + break; + } + } + return htmltext; + } + + public static void main(String args[]) + { + new Q00160_NerupasRequest(); + } +} \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/sql/game/updates/20140119update.sql b/L2J_DataPack_BETA/dist/sql/game/updates/20140119update.sql new file mode 100644 index 0000000000000000000000000000000000000000..ff552f668c3f8d07b3a8ef614ba881f1a3f9ca8d --- /dev/null +++ b/L2J_DataPack_BETA/dist/sql/game/updates/20140119update.sql @@ -0,0 +1 @@ +UPDATE character_quests SET name='Q00160_NerupasRequest' WHERE name='160_NerupasFavor'; \ No newline at end of file