Jump to content

Question

Posted

Hello I tried to re implement this quest 

 

and got this error .

 

Quote

Error on: C:\Szerver_L2\L2Sieghart\data\scripts\quests\640_TheZeroHour\__init__.py.error.log
Line: -1 - Column: -1

Traceback (innermost last):
  File "quests/640_TheZeroHour/__init__.py", line 90, in ?
TypeError: com.l2jserver.gameserver.model.quest.State(): expected 0 args; got 2

 

Can anybody help me pls?

 

 

import sys

from com.l2jserver import Config
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest 

qn = "640_TheZeroHour"

#NPC
Kahman = 31554

#MONSTERS
MONSTERS = range(22105,22112)+range(22113,22120)+[22121]

#ITEMS
Fang = 8085

REWARDS={
    "1":[12 ,4042, 1],
    "2":[6  ,4043, 1],
    "3":[6  ,4044, 1],
    "4":[81 ,1887,10],
    "5":[33 ,1888, 5],
    "6":[30 ,1889,10],
    "7":[150,5550,10],
    "8":[131,1890,10],
    "9":[123,1893, 5],
    }

class Quest (JQuest) :

    def __init__(self,id,name,descr):
        JQuest.__init__(self,id,name,descr)
        self.questItemIds = [Fang]

    def onAdvEvent (self,event,npc, player) :
        htmltext = event
        st = player.getQuestState(qn)
        if not st : return
        if event == "31554-02.htm" :
            st.set("cond","1")
            st.setState(STARTED)
            st.playSound("ItemSound.quest_accept")
        elif event == "31554-08.htm" :
            st.playSound("ItemSound.quest_finish")
            st.exitQuest(True)
        elif event in REWARDS.keys() :
            cost,item,amount = REWARDS[event]
            if st.getQuestItemsCount(Fang)>=cost :
                st.takeItems(Fang,cost)
                st.giveItems(item, amount)
                htmltext = "31554-09.htm"
            else :
                htmltext = "31554-06.htm"
        return htmltext

    def onTalk (self, npc, player) :
        htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"
        st = player.getQuestState(qn)
        if not st : return htmltext

        id = st.getState()
        if id == CREATED :
            if player.getLevel() >= 66 :
                st2 = player.getQuestState("109_InSearchOfTheNest")
                if st2 and st2.getState().getName() == 'Completed' :
                    htmltext = "31554-01.htm"
                else :
                    htmltext = "31554-00.htm" #todo: missing retail html
            else :
                htmltext = "31554-00.htm" 
        elif st.getQuestItemsCount(Fang) >= 1 :
            htmltext = "31554-04.htm"
        else :
            htmltext = "31554-03.htm"
        return htmltext

    def onKill(self, npc, player, isPet) :
        st = player.getQuestState(qn)
        if not st : return
        st.giveItems(Fang,int(Config.RATE_QUEST_DROP))
        st.playSound("ItemSound.quest_itemget")
        return

QUEST       = Quest(640,qn,"The Zero Hour")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)

QUEST.setInitialState(CREATED)

QUEST.addStartNpc(Kahman)
QUEST.addTalkId(Kahman)

for i in MONSTERS :
    QUEST.addKillId(i)

 

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...