Хиро через кнопку
скрипт
import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jfrozen.gameserver.datatables import SkillTable
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.actor.appearance import PcAppearance
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.actor.appearance import PcAppearance
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest
qn = "8204_NpcNoblesse"
NPC=[55511]
GOLDBAR= 4037
NOBLESS_TIARA = 7694
QuestId = 8204
QuestName = "NpcNoblesse"
QuestDesc = "custom"
InitialHtml = "1.htm"
print "importing custom: 8204: NpcNoblesse"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st):
htmltext = event
count=st.getQuestItemsCount(GOLDBAR)
if count < 10 and st.getPlayer().getLevel() < 80 :
htmltext = "Error2.htm"
elif st.getPlayer().isNoble() == 1 :
htmltext = "Error1.htm"
elif st.getQuestItemsCount(GOLDBAR) < 50 :
htmltext = "Error2.htm"
elif st.getPlayer().getLevel() < 80 :
htmltext = "Error2.htm"
else:
st.getPlayer().setTarget(st.getPlayer())
if event == "1":
st.takeItems(GOLDBAR,50)
st.getPlayer().setNoble(True)
st.giveItems(NOBLESS_TIARA,1)
st.playSound("ItemSound.quest_finish")
st.setState(State.COMPLETED)
return "End.htm"
st.exitQuest(1)
if htmltext != event:
st.setState(State.COMPLETED)
st.exitQuest(1)
return htmltext
def onTalk (self,npc,player):
st = player.getQuestState(qn)
htmltext = "<html><head><body>I have nothing to say to you</body></html>"
st.setState(State.STARTED)
return InitialHtml
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)
кнопка
<button value="Next" action="bypass -h npc_%objectId%_Quest 8204_NpcNoblesse" width=203 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
Грузится нормально но при нажатии на кнопку пишет скрипт еррор