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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..