11-13-2010, 12:32 PM
Привет всем. Вот мучаюсь с такой проблемкой:
Создал квест по мануалу, вроде все как нада, но почему то в startGameServer.bat квест не загружается. А при разговоре с начальным НПЦ после нажатия "задание" он выдаёт I have no tasks for you right now.
Вот ссылка на мануал:
http://forum.doom55.ru/index.php?showtopic=50282
Мой квест:
[src=#python]
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
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
qn = "1001_Fool"
#NPC
SINGAR = 100002
# Items
BOW = 14
# Mobs
DORFA = 100003
def onEvent (self,event,st) :
htmltext = event
cond = st.getInt("cond")
if event == "100002-02.htm" :
if cond == 0 :
st.set("cond","1")
st.setState(STARTED)
st.playSound("ItemSound.quest_accept")
return htmltext
def onTalk (self,npc,player):
st = player.getQuestState(qn)
htmltext = "<html><head><body>I have nothing to say you</body></html>"
npcId = npc.getNpcId()
if not st : return htmltext
cond = st.getInt("cond")
onlyone = st.getInt("onlyone")
if npcId == SINGAR:
htmltext = "100002-01.htm"
return htmltext
elif cond == 2 and st.getQuestItemsCount(BOW) >= 1 :
st.takeItems(BOW,-1)
st.set("cond","0")
st.getPlayer().setNoble(True)
st.giveItems(NOBLESS_TIARA,1)
st.playSound("ItemSound.quest_finish")
st.setState(COMPLETED)
st.set("onlyone","1")
htmltext = "100002-04.htm"
if npcId == SINGAR:
if cond == 0 and onlyone == 0 :
if st.getPlayer().getLevel() >= 1 :
htmltext = "100002-01.htm"
else :
htmltext = "100002-05.htm"
st.exitQuest(1)
elif cond == 1 and st.getQuestItemsCount(FESTIVAL_ADENA_ID) == 0 :
htmltext = "100002-03.htm"
def onKill (self, npc, player) :
st = player.getQuestState(qn)
if not st : return
if st.getState() != STARTED : return
npcId = npc.getNpcId()
cond = st.getInt("cond")
if npcId == DORFA :
if cond == 1 and st.getRandom(100)>70 :
st.giveItems(BOW,1)
st.playSound("ItemSound.quest_middle")
st.set("cond","2")
return
QUEST = Quest(1001,qn,"custom")
CREATED = State('Start', QUEST)
STARTED = State('Started', QUEST)
COMPLETED = State('Completed', QUEST)
QUEST.setInitialState(CREATED)
QUEST.addStartNpc(SINGAR)
QUEST.addTalkId(SINGAR)
QUEST.addKillId(DORFA)
STARTED.addQuestDrop(DORFA,BOW,1)
[/src]
Ссылка у нпц на квест тоже есть...
Создал квест по мануалу, вроде все как нада, но почему то в startGameServer.bat квест не загружается. А при разговоре с начальным НПЦ после нажатия "задание" он выдаёт I have no tasks for you right now.
Вот ссылка на мануал:
http://forum.doom55.ru/index.php?showtopic=50282
Мой квест:
[src=#python]
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
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
qn = "1001_Fool"
#NPC
SINGAR = 100002
# Items
BOW = 14
# Mobs
DORFA = 100003
def onEvent (self,event,st) :
htmltext = event
cond = st.getInt("cond")
if event == "100002-02.htm" :
if cond == 0 :
st.set("cond","1")
st.setState(STARTED)
st.playSound("ItemSound.quest_accept")
return htmltext
def onTalk (self,npc,player):
st = player.getQuestState(qn)
htmltext = "<html><head><body>I have nothing to say you</body></html>"
npcId = npc.getNpcId()
if not st : return htmltext
cond = st.getInt("cond")
onlyone = st.getInt("onlyone")
if npcId == SINGAR:
htmltext = "100002-01.htm"
return htmltext
elif cond == 2 and st.getQuestItemsCount(BOW) >= 1 :
st.takeItems(BOW,-1)
st.set("cond","0")
st.getPlayer().setNoble(True)
st.giveItems(NOBLESS_TIARA,1)
st.playSound("ItemSound.quest_finish")
st.setState(COMPLETED)
st.set("onlyone","1")
htmltext = "100002-04.htm"
if npcId == SINGAR:
if cond == 0 and onlyone == 0 :
if st.getPlayer().getLevel() >= 1 :
htmltext = "100002-01.htm"
else :
htmltext = "100002-05.htm"
st.exitQuest(1)
elif cond == 1 and st.getQuestItemsCount(FESTIVAL_ADENA_ID) == 0 :
htmltext = "100002-03.htm"
def onKill (self, npc, player) :
st = player.getQuestState(qn)
if not st : return
if st.getState() != STARTED : return
npcId = npc.getNpcId()
cond = st.getInt("cond")
if npcId == DORFA :
if cond == 1 and st.getRandom(100)>70 :
st.giveItems(BOW,1)
st.playSound("ItemSound.quest_middle")
st.set("cond","2")
return
QUEST = Quest(1001,qn,"custom")
CREATED = State('Start', QUEST)
STARTED = State('Started', QUEST)
COMPLETED = State('Completed', QUEST)
QUEST.setInitialState(CREATED)
QUEST.addStartNpc(SINGAR)
QUEST.addTalkId(SINGAR)
QUEST.addKillId(DORFA)
STARTED.addQuestDrop(DORFA,BOW,1)
[/src]
Ссылка у нпц на квест тоже есть...