Skip to content
Snippets Groups Projects
Commit d7ec795b authored by Zoey76's avatar Zoey76
Browse files

BETA: Quest Nerupa's Request (160) in Java.

Patch by: ivantotov
Tested by: ivantotov, Zoey76
Reviewed by: Zoey76
parent 634b79fd
No related branches found
No related tags found
No related merge requests found
Showing
with 205 additions and 127 deletions
......@@ -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
......
<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
# 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
<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
<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
<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
<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
<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.
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
<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
<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
<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
<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
/*
* 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
UPDATE character_quests SET name='Q00160_NerupasRequest' WHERE name='160_NerupasFavor';
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment