Jump to content
  • 0

Santa Quest Script


Question

Posted (edited)

Hi, can any body help me? server Interlude .when i trying to load sata claus script i getting error:  Traceback (innermost last):

  File "__init__.py", line 3, in ?
ImportError: no module named net
 
 
script: 
 
import sys
from com.l2scoria.gameserver.model.quest import State
from net.l2scoria.gameserver.model.quest import QuestState
from net.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest
 
class Quest (JQuest) :
 
 def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
 
 def onEvent (self,event,st) :
    htmltext = event
 
# Christmas
    if event == "1":
        if st.getQuestItemsCount(5556) >= 1 and st.getQuestItemsCount(5557) >= 1 and st.getQuestItemsCount(5558) >= 1 and st.getQuestItemsCount(5559) >= 1:
            st.takeItems(5556,1)
            st.takeItems(5557,1)
            st.takeItems(5558,1)
            st.takeItems(5559,1)
            st.giveItems(5283,3)
            htmltext = "Merry Christmas."
else:
             htmltext = "You do not have all four ornaments."
 
    if event == "0":
      htmltext = "Trade has been canceled."
    
    if htmltext != event:
      st.setState(COMPLETED)
      st.exitQuest(1)
 
    return htmltext
 
 def onTalk (Self,npc,st):
 
   npcId = npc.getNpcId()
   htmltext = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>"
   st.setState(STARTED)
   return "1.htm"
 
QUEST       = Quest(5007,"5007_santa","custom")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)
 
QUEST.setInitialState(CREATED)
 
QUEST.addStartNpc(31863)
QUEST.addStartNpc(31864)
 
STARTED.addTalkId(31863)
STARTED.addTalkId(31864)
 
Edited by bildukas86

2 answers to this question

Recommended Posts

  • 0
Posted

Moved.

Use "code" tags please.

 

Try changing the imports to "com."

 

from com.l2scoria.gameserver.model.quest import QuestState
from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest
but probably more errors will show up.

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...