Код
#quest by RuslanBat 1-835-434 For l2cz.ru
import sys
from net.sf.l2j import Config
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
qn = "9929_vesper_RuslanBat"
MOB1=60001
MOB2=60002
MOB3=60003
MOB4=60004
MOB5=60005
MOB6=60006
MOB7=60007
MOB8=60008
MOB9=60009
MOB10=60010
MOB11=60011
MOB12=60012
MOB13=60013
MOB14=60014
ITEM1=5555
ITEM2=5555
ITEM3=5555
ITEM4=5555
ITEM5=5555
ITEM6=5555
ITEM7=5555
ITEM8=5555
ITEM9=5555
ITEM10=5555
ITEM11=5555
ITEM12=5555
ITEM13=5555
ITEM14=5555
NPC1=99993
NPC2=99994
MIN_LEVEL=24
class Quest (JQuest) :
def onEvent(self, event, st):
htmltext=event
#начало
if event=="1":
htmltext="99993-01.htm"
st.set("cond","1")
st.setState(State.STARTED)
st.playSound("ItemSound.quest_accept")
#дроп итема 1
if event=="3" and st.getQuestItemsCount(ITEM1):
htmltext="99993-01a.htm"
st.takeItems(ITEM1,1)
st.set("cond","2")
#дроп итема 2
if event=="4" and st.getQuestItemsCount(ITEM2):
htmltext="99993-01a.htm"
st.takeItems(ITEM2,1)
st.set("cond","3")
#дроп итема 3
if event=="5" and st.getQuestItemsCount(ITEM3):
htmltext="99993-01a.htm"
st.takeItems(ITEM3,1)
st.set("cond","4")
#дроп итема 4
if event=="6" and st.getQuestItemsCount(ITEM4):
htmltext="99993-01a.htm"
st.takeItems(ITEM4,1)
st.set("cond","5")
#дроп итема 5
if event=="7" and st.getQuestItemsCount(ITEM5):
htmltext="99993-01a.htm"
st.takeItems(ITEM5,1)
st.set("cond","6")
#дроп итема 6
if event=="8" and st.getQuestItemsCount(ITEM6):
htmltext="99993-01a.htm"
st.takeItems(ITEM6,1)
st.set("cond","7")
#дроп итема 7
if event=="9" and st.getQuestItemsCount(ITEM7):
htmltext="99993-01a.htm"
st.takeItems(ITEM7,1)
st.set("cond","8")
#дроп итема 8
if event=="10" and st.getQuestItemsCount(ITEM8):
htmltext="99993-01a.htm"
st.takeItems(ITEM8,1)
st.set("cond","9")
#дроп итема 9
if event=="11" and st.getQuestItemsCount(ITEM9):
htmltext="99993-01a.htm"
st.takeItems(ITEM9,1)
st.set("cond","10")
#дроп итема 10
if event=="12" and st.getQuestItemsCount(ITEM10):
htmltext="99993-01a.htm"
st.takeItems(ITEM1,10)
st.set("cond","11")
#дроп итема 11
if event=="13" and st.getQuestItemsCount(ITEM11):
htmltext="99993-01a.htm"
st.takeItems(ITEM11,1)
st.set("cond","12")
#дроп итема 12
if event=="14" and st.getQuestItemsCount(ITEM12):
htmltext="99993-01a.htm"
st.takeItems(ITEM12,1)
st.set("cond","13")
#дроп итема 13
if event=="15" and st.getQuestItemsCount(ITEM13):
htmltext="99993-01a.htm"
st.takeItems(ITEM13,1)
st.set("cond","14")
#дроп итема 14
if event=="16" and st.getQuestItemsCount(ITEM14):
htmltext="99993-01a.htm"
st.set("cond","15")
return htmltext
def onTalk(self, npc, player):
htmltext="<html><body>111111111111111111111111You are either not on a quest that involves this NPC11111111, or you don't meet this NPC's minimum quest requirements.</body></html>"
st = player.getQuestState(qn)
if not st : return htmltext
npcId=npc.getNpcId()
id=st.getState()
if id==State.CREATED:
if player.getLevel()>=MIN_LEVEL:
htmltext="99993-00.htm"
else:
st.exitQuest(1)
htmltext="<html><body>1111111111111This quest can only be taken by characters that have a minimum level of %s. Return when you are more experienced.</body></html>" % MIN_LEVEL
elif id==State.STARTED:
cond=st.getInt("cond")
if npcId==NPC1:
if cond==1:
if not st.getQuestItemsCount(ITEM1):
htmltext="99993-02b.htm"
else:
htmltext="99993-02.htm"
elif cond==2:
if not st.getQuestItemsCount(ITEM2):
htmltext="99993-03b.htm"
else:
htmltext="99993-03.htm"
elif cond==3:
if not st.getQuestItemsCount(ITEM3):
htmltext="99993-04b.htm"
else:
htmltext="99993-04.htm"
elif cond==4:
if not st.getQuestItemsCount(ITEM4):
htmltext="99993-05b.htm"
else:
htmltext="99993-05.htm"
elif cond==5:
if not st.getQuestItemsCount(ITEM5):
htmltext="99993-06b.htm"
else:
htmltext="99993-06.htm"
elif cond==6:
if not st.getQuestItemsCount(ITEM6):
htmltext="99993-07b.htm"
else:
htmltext="99993-07.htm"
elif cond==7:
if not st.getQuestItemsCount(ITEM7):
htmltext="99993-08b.htm"
else:
htmltext="99993-08.htm"
elif cond==8:
if not st.getQuestItemsCount(ITEM8):
htmltext="99993-09b.htm"
else:
htmltext="99993-09.htm"
elif cond==9:
if not st.getQuestItemsCount(ITEM9):
htmltext="99993-10b.htm"
else:
htmltext="99993-10.htm"
elif cond==10:
if not st.getQuestItemsCount(ITEM10):
htmltext="99993-11b.htm"
else:
htmltext="99993-11.htm"
elif cond==12:
if not st.getQuestItemsCount(ITEM12):
htmltext="99993-13b.htm"
else:
htmltext="99993-13.htm"
elif cond==13:
if not st.getQuestItemsCount(ITEM13):
htmltext="99993-014b.htm"
else:
htmltext="99993-14.htm"
elif cond==14:
if not st.getQuestItemsCount(ITEM14):
htmltext="99993-015b.htm"
else:
htmltext="99993-15с.htm"
elif npcId==NPC2:
if cond==14 and st.getQuestItemsCount(ITEM14):
htmltext="99994-01.htm"
else:
htmltext="99993-15d.htm"
elif id==State.COMPLETED:
st.exitQuest(0)
htmltext="<html><body>eror212</body></html>"
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()
cond=st.getInt("cond")
if cond==1 and npcId==MOB1 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM1)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM1,int(numItems))
if cond==2 and npcId==MOB2 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM2)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM2,int(numItems))
if cond==3 and npcId==MOB3 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM3)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM3,int(numItems))
if cond==4 and npcId==MOB4 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM4)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM4,int(numItems))
if cond==5 and npcId==MOB5 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM5)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM5,int(numItems))
if cond==6 and npcId==MOB6 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM6)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM6,int(numItems))
if cond==7 and npcId==MOB7 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM7)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM7,int(numItems))
if cond==8 and npcId==MOB8 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM8)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM8,int(numItems))
if cond==9 and npcId==MOB9 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM9)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM9,int(numItems))
if cond==10 and npcId==MOB10 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM10)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM10,int(numItems))
if cond==11 and npcId==MOB11 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM11)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM11,int(numItems))
if cond==12 and npcId==MOB12 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM12)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM12,int(numItems))
if cond==13 and npcId==MOB13 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM13)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM13,int(numItems))
if cond==14 and npcId==MOB14 :
numItems,chance = divmod(100,100)
if st.getRandom(100) < chance :
pieces=st.getQuestItemsCount(ITEM14)
if pieces + numItems >= 1 :
numItems = MAX_COUNT - pieces
if numItems != 0 :
st.playSound("ItemSound.quest_middle")
else :
st.playSound("ItemSound.quest_itemget")
st.giveItems(ITEM14,int(numItems))
return
QUEST=Quest(9929,qn,"Vesper By RuslanBat for L2CZ.RU")
QUEST.addStartNpc(NPC1)
QUEST.addTalkId(99993)
QUEST.addTalkId(NPC2)
QUEST.addKillId(MOB1)
QUEST.addKillId(MOB2)
QUEST.addKillId(MOB3)
QUEST.addKillId(MOB4)
QUEST.addKillId(MOB5)
QUEST.addKillId(MOB6)
QUEST.addKillId(MOB7)
QUEST.addKillId(MOB8)
QUEST.addKillId(MOB9)
QUEST.addKillId(MOB10)
QUEST.addKillId(MOB11)
QUEST.addKillId(MOB12)
QUEST.addKillId(MOB13)
QUEST.addKillId(MOB14)