Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Color Manager
#1
Ребят, помогите настроить импорты...
вот ошибка:
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
Ответ
#2
сказать что за сборка нельзя?)
ну вообще скрипт я так понял под что-то типо скории, а прикручиваешь к лыже,
попробуй STARTED заменить на State.Started и все State так
Ответ
#3
bayk Написал:Ребят, помогите настроить импорты...
вот ошибка:
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

Измени фаил Явы на свою сборку..и все будет ок!Wink
Ответ
#4
QUEST = Quest(QuestId,qn,QuestDesc)
CREATED = State('Start',QUEST)
STARTED = State('Started',QUEST)
COMPLETED = State('Completed',QUEST)

QUEST.setInitialState(CREATED)

удали это
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  Color name NewRich25 1 1,463 04-13-2016, 08:28 AM
Последний пост: Gaikotsu
  Servise Manager Lucera 2 Java 8. DiName 8 2,694 12-07-2015, 07:43 AM
Последний пост: Deazer
  Проверка у Valakas Manager Snowball1 9 2,179 09-15-2014, 02:01 AM
Последний пост: Snowball1
  NPC Change Name Color Huk 12 6,628 06-17-2010, 09:23 AM
Последний пост: PaInKiLlEr
  Color Manager - не работает zima 0 2,353 10-13-2009, 11:55 PM
Последний пост: zima
  NPC LvL Manager Huk 4 4,471 09-17-2009, 09:35 PM
Последний пост: Tonchi

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)