03-01-2011, 03:18 PM
Ребят, помогите настроить импорты...
вот ошибка:
Error on: D:\server\data\scripts\quests\q1000_ColorManager\_ _init__.py.error.log
Line: -1 - Column: -1
Traceback (innermost last):
File "__init__.py", line 92, in ?
TypeError: net.sf.l2j.gameserver.model.quest.State(): expected 0 args; got 2
вот сам инит:
import sys
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
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
#
#========================================
# DO NOT TOUCH THIS
#========================================
QuestId = 1000
QuestName = "ColorManager"
QuestDesc = "quests"
qn = "q"+str(QuestId)+"_"+str(QuestName)
#========================================
StartNpc = 50001
ItemId = 4037
ItemQty = 100
MinLevel = 1
MaxLevel = 80
#========================================
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent(Self,event,npc,player):
text = "noaction.htm"
st = player.getQuestState(qn)
if not st : return text
if (player.getLevel() < MinLevel) or (player.getLevel() > MaxLevel) : return "charlevel.htm"
if st.getQuestItemsCount(ItemId) < ItemQty : return "nomoney.htm"
nameColor = hex(player.getAppearance().getNameColor())
titleColor = hex(player.getAppearance().getTitleColor())
st.set("nameColor",str(nameColor))
st.set("titleColor",str(titleColor))
if event == "N_Blue" :
nameColor = "FF0000"
elif event == "N_Red" :
nameColor = "0000FF"
elif event == "N_Cyan" :
nameColor = "FFFF00"
elif event == "N_Green" :
nameColor = "00FF00"
elif event == "N_Magenta" :
nameColor = "FF00FF"
elif event == "N_Yellow" :
nameColor = "00FFFF"
elif event == "N_Gray" :
nameColor = "808080"
elif event == "N_White" :
nameColor = "FFFFFF"
elif event == "T_Blue" :
titleColor = "FF0000"
elif event == "T_Red" :
titleColor = "0000FF"
elif event == "T_Cyan" :
titleColor = "FFFF00"
elif event == "T_Green" :
titleColor = "00FF00"
elif event == "T_Magenta" :
titleColor = "FF00FF"
elif event == "T_Yellow" :
titleColor = "00FFFF"
elif event == "T_Gray" :
titleColor = "808080"
elif event == "T_White" :
titleColor = "FFFFFF"
nameColor = int(nameColor,16)
titleColor = int(titleColor,16)
player.getAppearance().setNameColor(nameColor)
player.getAppearance().setTitleColor(titleColor)
st.takeItems(ItemId,ItemQty)
player.broadcastUserInfo()
player.store()
text = "done.htm"
return text
def onTalk (Self,npc,player):
st = player.getQuestState(qn)
if not st :
return "Quest is not started!"
st.setState(STARTED)
return "1.htm"
def onFirstTalk (Self,npc,player):
st = getQuestState(qn)
if not st : return "Invalid quest state"
QUEST = Quest(QuestId,qn,QuestDesc)
CREATED = State('Start',QUEST)
STARTED = State('Started',QUEST)
COMPLETED = State('Completed',QUEST)
QUEST.setInitialState(CREATED)
QUEST.addStartNpc(StartNpc)
QUEST.addTalkId(StartNpc)
print "Loaded: "+qn
вот ошибка:
Error on: D:\server\data\scripts\quests\q1000_ColorManager\_ _init__.py.error.log
Line: -1 - Column: -1
Traceback (innermost last):
File "__init__.py", line 92, in ?
TypeError: net.sf.l2j.gameserver.model.quest.State(): expected 0 args; got 2
вот сам инит:
import sys
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
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
#
#========================================
# DO NOT TOUCH THIS
#========================================
QuestId = 1000
QuestName = "ColorManager"
QuestDesc = "quests"
qn = "q"+str(QuestId)+"_"+str(QuestName)
#========================================
StartNpc = 50001
ItemId = 4037
ItemQty = 100
MinLevel = 1
MaxLevel = 80
#========================================
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent(Self,event,npc,player):
text = "noaction.htm"
st = player.getQuestState(qn)
if not st : return text
if (player.getLevel() < MinLevel) or (player.getLevel() > MaxLevel) : return "charlevel.htm"
if st.getQuestItemsCount(ItemId) < ItemQty : return "nomoney.htm"
nameColor = hex(player.getAppearance().getNameColor())
titleColor = hex(player.getAppearance().getTitleColor())
st.set("nameColor",str(nameColor))
st.set("titleColor",str(titleColor))
if event == "N_Blue" :
nameColor = "FF0000"
elif event == "N_Red" :
nameColor = "0000FF"
elif event == "N_Cyan" :
nameColor = "FFFF00"
elif event == "N_Green" :
nameColor = "00FF00"
elif event == "N_Magenta" :
nameColor = "FF00FF"
elif event == "N_Yellow" :
nameColor = "00FFFF"
elif event == "N_Gray" :
nameColor = "808080"
elif event == "N_White" :
nameColor = "FFFFFF"
elif event == "T_Blue" :
titleColor = "FF0000"
elif event == "T_Red" :
titleColor = "0000FF"
elif event == "T_Cyan" :
titleColor = "FFFF00"
elif event == "T_Green" :
titleColor = "00FF00"
elif event == "T_Magenta" :
titleColor = "FF00FF"
elif event == "T_Yellow" :
titleColor = "00FFFF"
elif event == "T_Gray" :
titleColor = "808080"
elif event == "T_White" :
titleColor = "FFFFFF"
nameColor = int(nameColor,16)
titleColor = int(titleColor,16)
player.getAppearance().setNameColor(nameColor)
player.getAppearance().setTitleColor(titleColor)
st.takeItems(ItemId,ItemQty)
player.broadcastUserInfo()
player.store()
text = "done.htm"
return text
def onTalk (Self,npc,player):
st = player.getQuestState(qn)
if not st :
return "Quest is not started!"
st.setState(STARTED)
return "1.htm"
def onFirstTalk (Self,npc,player):
st = getQuestState(qn)
if not st : return "Invalid quest state"
QUEST = Quest(QuestId,qn,QuestDesc)
CREATED = State('Start',QUEST)
STARTED = State('Started',QUEST)
COMPLETED = State('Completed',QUEST)
QUEST.setInitialState(CREATED)
QUEST.addStartNpc(StartNpc)
QUEST.addTalkId(StartNpc)
print "Loaded: "+qn