GameBlonD Posted February 8, 2011 Posted February 8, 2011 I have create this Quest based on python: import sys from com.l2jserver.gameserver.model.actor.instance import L2PcInstance from java.util import Iterator from com.l2jserver.gameserver.datatables import SkillTable from com.l2jserver import L2DatabaseFactory from com.l2jserver.gameserver.model.actor.appearance import PcAppearance from com.l2jserver.gameserver.model.quest import State from com.l2jserver.gameserver.model.actor.appearance import PcAppearance from com.l2jserver.gameserver.model.quest import QuestState from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest qn = "55502_NpcHb" NPC=[55503] Adena = 57 QuestId = 55502 QuestName = "NpcHb" QuestDesc = "custom" InitialHtml = "1.htm" print "Loaded Quest: 55503 npcHB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent(self,event,st): htmltext = event count=st.getQuestItemsCount(Adena) if count < 900 and st.getPlayer().getLevel() < 80 : htmltext = "Error2.htm" elif st.getQuestItemsCount(Adena) < 1000 : htmltext = "Error2.htm" elif st.player.getQuestState("55502_NpcHb") == 1 : htmltext = "Error1.htm" elif st.getPlayer().getLevel() < 80 : htmltext = "Error2.htm" else: st.getPlayer().setTarget(st.getPlayer()) if event == "2": st.takeItems(Adena,1000) st.playSound("ItemSound.quest_finish") st.setState(State.COMPLETED) return "End.htm" st.exitQuest(1) if htmltext != event: st.setState(State.COMPLETED) st.exitQuest(1) return htmltext def onTalk (self,npc,player): st = player.getQuestState(qn) htmltext = "<html><head><body>I have nothing to say to you</body></html>" st.setState(State.STARTED) return InitialHtml QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc) for npcId in NPC: QUEST.addStartNpc(npcId) QUEST.addTalkId(npcId) And i have one problem npc can't recognize if player have this quest to send him Error1.htm in results to send always end.htm end give quest again from the begging. Anyone now the correct code to add? Quote
Question
GameBlonD
I have create this Quest based on python:
And i have one problem npc can't recognize if player have this quest to send him Error1.htm
in results to send always end.htm end give quest again from the begging.
Anyone now the correct code to add?
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.