Показать сообщение отдельно
Непрочитано 22.01.2010, 10:41   #1
Аватар для krisadr
Пользователь

Автор темы (Топик Стартер) Изменение скрипта квеста

вот квест на диологи у помощника новичков в деревне камаэль
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 код:
Error onD:\ServerSoft\Gracia Final\L2Server\data\scripts\custom\8002_AskForAdvise\__init__.py.error.log
Line
: -Column: -1

Traceback 
(innermost last):
  (
no code objectat line 0
SyntaxError
: ('invalid syntax', ('__init__.py'1910'\t Level=st.getPlayer().getLevel()')) 
вообщем я зделал так...
[SPOILER]# 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()
level = st.getPlayer().getLevel()
if npcId == 30598 :
if Race in [Race.Human] and (level <=19) :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 30599 :
if Race in [Race.Elf] and (level <=19) :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 30600 :
if Race in [Race.DarkElf] and (level <=19) :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 30601 :
if Race in [Race.Dwarf] and (level <=19) :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 30602 :
if Race in [Race.Orc] and (level <=19) :
htmltext = str(npcId) + ".htm"
else :
htmltext = str(npcId) + "-no.htm"
if npcId == 32135 :
if Race in [Race.Kamael] and (level <=19) :
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)[/SPOILER]

Хммм... так вот, что я зделал не так??)) умные люди подскажите ллиз)
krisadr вне форума Ответить с цитированием