01-22-2010, 10:41 AM
вот квест на диологи у помощника новичков в деревне камаэль
PHP код:
<?php
# Created by L2Emu Team
import sys
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
qn = "8002_AskForAdvise"
NPC = [30598,30599,30600,30601,30602,32135]
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onTalk (Self,npc,player):
st = player.getQuestState(qn)
npcId = npc.getNpcId()
Race = st.getPlayer().getRace()
if npcId == 30598 :
if Race in [Race.Human] :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 30599 :
if Race in [Race.Elf] :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 30600 :
if Race in [Race.DarkElf] :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 30601 :
if Race in [Race.Dwarf] :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 30602 :
if Race in [Race.Orc] :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 32135 :
if Race in [Race.Kamael] :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
st.exitQuest(1)
return htmltext
QUEST = Quest(-1,qn,"custom")
for i in NPC:
QUEST.addStartNpc(i)
QUEST.addTalkId(i)
и так... я бы хотел в него добавать по мимо проверки рассы, проверку уровня... попытался сам похимичить.... результат такой...
PHP код:
<?php
Error on: D:\ServerSoft\Gracia Final\L2Server\data\scripts\custom\8002_AskForAdvise\__init__.py.error.log
Line: -1 - Column: -1
Traceback (innermost last):
(no code object) at line 0
SyntaxError: ('invalid syntax', ('__init__.py', 19, 10, '\t Level=st.getPlayer().getLevel()'))