Форум администраторов игровых серверов

Форум администраторов игровых серверов (https://forum.zone-game.info/TT.php)
-   Работа со скриптами (https://forum.zone-game.info/forumdisplay.php?f=37)
-   -   Изменение скрипта квеста (https://forum.zone-game.info/showthread.php?t=6140)

krisadr 22.01.2010 10:41

Изменение скрипта квеста
 
вот квест на диологи у помощника новичков в деревне камаэль
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]

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

incognito 22.01.2010 12:08

Re: Изменение скрипта квеста
 
and (level <=19) скобки не обязательны
level = st.getPlayer().getLevel() возможно не правильный синтаксис
у старых ему было так level = player.getLevel()

krisadr 22.01.2010 14:22

Re: Изменение скрипта квеста
 
нее все равно не канает
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 = player.getLevel()')) 

Добавлено через 1 час 4 минуты
эммм я конешно извеняюсь ))) но модераторы... не могли бы вы перенести эту тему в раздел скрипты?))) или мне можно дубликат зделать?))) сори что тупанул....

incognito 22.01.2010 16:12

Re: Изменение скрипта квеста
 
тогда те в исходы нада лезть и смотреть как пишется сия команда и смотреть параметры ее
да попробуй сохранить в утф-8 квест

krisadr 22.01.2010 17:34

Re: Изменение скрипта квеста
 
Алилуя....! у мя получилось..... я просто не стал добовлять констант. а сзазу написал ее значение))) тоесть вместо level поставил and player.getLevel() <=19 и все запахало))) ну эт так на всек случ, вдруг каму то еще понадобится...

Добавлено через 3 часа 42 минуты
а вот как задать что уровень перса должен быть не меньше 11 но и не больше 20?
11=> player.getLevel() <=20 или player.getLevel() 10<20????

incognito 22.01.2010 23:14

Re: Изменение скрипта квеста
 
Цитата:

Сообщение от krisadr (Сообщение 51831)
а вот как задать что уровень перса должен быть не меньше 11 но и не больше 20?
11=> player.getLevel() <=20 или player.getLevel() 10<20????

елы палы: так пишется
if player.getLevel() >= 11 and player.getLevel() <=20:
дальше что нада пиши


Текущее время: 20:10. Часовой пояс GMT +3.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot