All pastes #483615 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-11 20:24 UTC
rendered paste body
This is the error:

Traceback (innermost last):
  File "D:\Documents and Settings\Ethernaly\Desktop\L2j Interlude test server\gameserver\data\jscript\custom\1112_InterludeEvent1\__init__.py", line 26, in onTalk
NameError: COMPLETED

	at org.python.core.Py.NameError(Py.java:168)
	at org.python.core.PyFrame.getglobal(PyFrame.java:202)
	at data.jscript.custom.1112_InterludeEvent1$py.onTalk$3(D:\Documents and Settings\Ethernaly\Desktop\L2j Interlude test server\gameserver\data\jscript\custom\1112_InterludeEvent1\__init__.py:26)
	at data.jscript.custom.1112_InterludeEvent1$py.call_function(D:\Documents and Settings\Ethernaly\Desktop\L2j Interlude test server\gameserver\data\jscript\custom\1112_InterludeEvent1\__init__.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:217)
	at org.python.core.PyTableCode.call(PyTableCode.java:437)
	at org.python.core.PyTableCode.call(PyTableCode.java:333)
	at org.python.core.PyFunction.__call__(PyFunction.java:195)
	at org.python.core.PyMethod.__call__(PyMethod.java:99)
	at org.python.core.PyObject.__call__(PyObject.java:615)
	at org.python.core.PyObject._jcallexc(PyObject.java:2678)
	at org.python.core.PyObject._jcall(PyObject.java:2710)
	at org.python.proxies.data.jscript.custom.1112_InterludeEvent1$Quest$247.onTalk(Unknown Source)
	at net.sf.l2j.gameserver.model.quest.Quest.notifyTalk(Quest.java:208)
	at net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance.showQuestWindow(L2NpcInstance.java:1312)
	at net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance.onBypassFeedback(L2NpcInstance.java:1010)
	at net.sf.l2j.gameserver.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:106)
	at net.sf.l2j.gameserver.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:59)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


This is the script :
#made by ethernaly
import sys
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 = "1112_InterludeEvent1"

CAT_QUEEN = 31760
COUPON = 7832

class Quest (JQuest) :

 def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

 def onTalk (self,npc,player):
   st = player.getQuestState(qn)
   if st :
        npcId = npc.getNpcId()
        htmltext = "<html><head><body>I have nothing to say to you</body></html>"
        id = st.getState()
        if id == CREATED :
          if st.getPlayer().getLevel() >= 6 and st.getPlayer().getLevel() < 20 :
           htmltext = "1.htm"
           st.giveItems(COUPON,1)
           st.setState(COMPLETED)
           st.playSound("ItemSound.quest_accept")
           st.exitQuest(1)
        elif id == COMPLETED :
           st.exitQuest(1)
           htmltext = "3.htm"
        else:
          st.exitQuest(1)
          htmltext = "2.htm"
   return htmltext

QUEST       = Quest(1112, qn, "InterludeEvent1")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)

QUEST.setInitialState(CREATED)
QUEST.addStartNpc(CAT_QUEEN)
QUEST.addTalkId(CAT_QUEEN)

print "importing custom data: 1112: InterludeEvent1"