12-10-2011, 06:04 PM
код скрипта НПС
PHP код:
<?php
import sys
from l2.brick import Config
from l2.brick.gameserver.model.quest import State
from l2.brick.gameserver.model.quest import QuestState
from l2.brick.gameserver.model.quest.jython import QuestJython as JQuest
qn = "99940_Obnul"
print "============================="
print " NPC Obnul - OK "
print "============================="
QuestId = 99940
QuestName = "Obnul"
QuestDesc = "quest"
ID_ITEM = 4037
MIN_LVL = 77
COUNT_ITEM = 1
npcId = 5809
class Quest (JQuest) :
def __init__(self,id,name,descr) : JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
st = player.getQuestState(qn)
if event == "DreadNought" :
if st.getPlayer().getLevel() < MIN_LVL :
return "badlevel.htm"
elif st.getQuestItemsCount(ID_ITEM) < (st.getQuestItemsCount(33599) + COUNT_ITEM) :
return "noitem.htm"
else:
st.takeItems(ID_ITEM,(st.getQuestItemsCount(33599) + COUNT_ITEM))
st.giveItems(33599,1)
st.getPlayer().removeExpAndSp(st.getPlayer().getExp(),SP)
st.getPlayer().setClassId(89)
st.getPlayer().setBaseClass(89)
st.giveItems(33563,1)
return "obnyl.htm"
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)
код кнопкы у нпс
<button value="DreadNought" action="bypass -h Quest 99940_Obnul DreadNought" width=90 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF">
ошыбку выдае в строке №27 (st = player.getQuestState(qn)), когда нажымаю кнопку, а когда грузитса сервер усе отлична. Наверна какаято машынальная ошыбка але где?