This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
Lianne17
Someone good hearted boy for this code?
I copied the quest 623_TheFinestFood ... NPC also changed and added to the HTML folder / custom and added a line to the script to turn, but the game handles, and nothing happens, or no message in the log Thanks
# Tauti Zbrane - v0.1 by disKret & DrLecter
import sys
from com.l2jfrozen import Config
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest
qn = "1010_TautiZbrane"
#NPC
VILEM = 25888
#ITEMS
LEAF_OF_FLAVA,BUFFALO_MEAT,ANTELOPE_HORN = range(7199,7202)
#MOBS, DROPS, CHANCES & REWARDS
BUFFALO,FLAVA,ANTELOPE = [ 21315,21316,21318 ]
DROPLIST = {BUFFALO:[bUFFALO_MEAT,99],FLAVA:[LEAF_OF_FLAVA,99],ANTELOPE:[ANTELOPE_HORN,99]}
REWARDS = [[7152,25000,0,11],[0,73000,34,100]]
#needed count
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
cond = st.getInt("cond")
htmltext = event
leaf = st.getQuestItemsCount(LEAF_OF_FLAVA)
meat = st.getQuestItemsCount(BUFFALO_MEAT)
horn = st.getQuestItemsCount(ANTELOPE_HORN)
if event == "25888-03.htm" and cond == 0 :
if st.getPlayer().getLevel() >= 71 :
st.set("cond","1")
st.setState(STARTED)
st.playSound("ItemSound.quest_accept")
else :
htmltext = "25888-02.htm"
st.exitQuest(1)
elif event == "25888-07.htm" :
if cond == 2 and leaf == meat == horn == 100 :
htmltext = "25888-06.htm"
st.playSound("ItemSound.quest_finish")
random = st.getRandom(100)
i = 0
while i < len(REWARDS) :
item,adena,chance,chance2=REWARDS
if chance<=random<= chance2 :
break
i = i+1
st.giveItems(57,adena)
if item :
st.giveItems(item,1)
else :
st.addExpAndSp(230000,18250)
st.takeItems(LEAF_OF_FLAVA,-1)
st.takeItems(BUFFALO_MEAT,-1)
st.takeItems(ANTELOPE_HORN,-1)
st.exitQuest(1)
return htmltext
def onTalk (self,npc,player) :
htmltext = "<html><body>Bohuzel nesplnujes criteria k vykonu sluzby questu</body></html>"
st = player.getQuestState(qn)
if st :
cond = st.getInt("cond")
leaf = st.getQuestItemsCount(LEAF_OF_FLAVA)
meat = st.getQuestItemsCount(BUFFALO_MEAT)
horn = st.getQuestItemsCount(ANTELOPE_HORN)
if cond == 0 :
htmltext = "25888-01.htm"
elif st.getState() == STARTED :
if cond == 1 :
htmltext = "25888-05.htm"
elif cond == 2 and leaf == meat == horn == 100 :
htmltext = "25888-04.htm"
return htmltext
def onKill(self,npc,player,isPet):
# todo: with the current code, a player who has completed up to 2 out of 3
# item collections may consume the party drop (i.e. become the selected
# player in the random, but get nothing because it was the wrong mob)
# this ought to be corrected later...
partyMember = self.getRandomPartyMember(player,"1")
if not partyMember: return
st = partyMember.getQuestState(qn)
if st :
if st.getState() == STARTED :
item,chance = DROPLIST[npc.getNpcId()]
count = st.getQuestItemsCount(item)
if st.getInt("cond") == 1 and count < 100 :
numItems, chance = divmod(chance*Config.RATE_DROP_QUEST,100)
if st.getRandom(100) < chance :
numItems += 1
if count + numItems >= 100 :
numItems = 100 - count
if numItems != 0 :
st.giveItems(item,int(numItems))
if st.getQuestItemsCount(LEAF_OF_FLAVA) == st.getQuestItemsCount(BUFFALO_MEAT) == st.getQuestItemsCount(ANTELOPE_HORN) == 100 :
st.set("cond","2")
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
return
QUEST = Quest(1010,qn, "custom")
CREATED = State('Start', QUEST)
STARTED = State('Started', QUEST)
QUEST.setInitialState(CREATED)
QUEST.addStartNpc(VILEM)
QUEST.addTalkId(VILEM)
for mob in DROPLIST.keys() :
QUEST.addKillId(mob)
for item in range(7199,7202):
STARTED.addQuestDrop(VILEM,item,1)
1 answer to this question
Recommended Posts