Сообщений: 832
Тем: 125
Зарегистрирован: Jan 2009
Репутация:
404
Код: import sys
from com.l2dc.gameserver.model.actor.instance import L2PcInstance
from com.l2dc.gameserver.model.actor.instance import L2NpcInstance
from com.l2dc.gameserver.model.actor.instance import L2PetInstance
from java.util import Iterator
from com.l2dc.gameserver.datatables import SkillTable
from com.l2dc import L2DatabaseFactory
from com.l2dc.gameserver.model.quest import State
from com.l2dc.gameserver.model.quest import QuestState
from com.l2dc.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2dc.gameserver.model import L2Skill
qn = "2009005_NPCBuffer"
NPC=[102,32135,30598,30599,30600,30601,30602,31076,31077,32327]
ADENA_ID=57
QuestId = 2009005
QuestName = "NPCBuffer"
QuestDesc = "custom"
InitialHtml = "1.htm"
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(ADENA_ID)
if st.getPlayer().getLevel() < 2 :
htmltext = "<html><head><body>No Tienes Adena.<br></body></html>"
else:
st.takeItems(ADENA_ID,0)
st.getPlayer().setTarget(st.getPlayer())
#Бафф на война
if event == "1":
SkillTable.getInstance().getInfo(7055,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7052,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7057,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7053,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7041,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7042,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7043,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7044,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7045,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7047,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7056,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7097,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7088,1).getEffects(st.getPlayer(),st.getPlayer())
return
st.setState(State.COMPLETED)
#Бафф на танка
if event == "2":
SkillTable.getInstance().getInfo(7055,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7052,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7058,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7053,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7041,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7042,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7043,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7044,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7045,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7047,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7097,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7092,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7088,1).getEffects(st.getPlayer(),st.getPlayer())
return
st.setState(State.COMPLETED)
#Бафф на БД
if event == "3":
SkillTable.getInstance().getInfo(7055,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7052,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7058,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7053,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7041,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7042,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7043,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7044,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7045,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7047,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7097,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7088,1).getEffects(st.getPlayer(),st.getPlayer())
return
st.setState(State.COMPLETED)
#Бафф на мага
if event == "4":
SkillTable.getInstance().getInfo(7055,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7051,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7052,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7046,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7056,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7058,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7059,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7060,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7097,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7089,1).getEffects(st.getPlayer(),st.getPlayer())
return
st.setState(State.COMPLETED)
return htmltext
def onTalk (self,npc,player):
st = player.getQuestState(qn)
htmltext = "no.html"
st.playSound("ItemSound.quest_accept")
st.setState(State.STARTED)
return InitialHtml
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)
Проблема в том что старых персов этот скрипт бафает, а новых нивкаукую, правда начальный скрипт был немного другой, и я его под себя подстроил, вообщим кто в этом хорошо шарит помогите... (ссылка на Евенты идут с другого скрипта определяющего класс персонажа)
Сообщений: 5,670
Тем: 145
Зарегистрирован: Nov 2008
Репутация:
33,771
Цитата:if st.getPlayer().getLevel() < 2 :
Должен бафать персов, которые выше 2 уровня.
Web программист\разработчик
— Есть только один способ проделать большую работу — полюбить ее. Если вы к этому не пришли, подождите. Не беритесь за дело.
Сообщений: 832
Тем: 125
Зарегистрирован: Jan 2009
Репутация:
404
09-25-2010, 12:19 PM
(Сообщение последний раз редактировалось: 09-25-2010, 04:24 PM krisadr.)
та не я понял в чем дело, там короче из бафера я зделал сразу ссылки на эвенты, а у новых играком просто этот квест еще не начен, так вот можно ли как нить добавить
st.setState(State.STARTED) это в def onEvent(self,event,st): или его можно впихнуть только в def onTalk (self,npc,player):
в таком случае помогите настроить по человечески , а то постоянно что не нравиться при запуске сервера.
вот мой код
Код: import sys
from com.l2dc.gameserver.model.actor.instance import L2PcInstance
from com.l2dc.gameserver.model.actor.instance import L2NpcInstance
from com.l2dc.gameserver.model.actor.instance import L2PetInstance
from java.util import Iterator
from com.l2dc.gameserver.datatables import SkillTable
from com.l2dc import L2DatabaseFactory
from com.l2dc.gameserver.model.quest import State
from com.l2dc.gameserver.model.quest import QuestState
from com.l2dc.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2dc.gameserver.model import L2Skill
qn = "2009005_NPCBuffer"
NPC=[102,32135,30598,30599,30600,30601,30602,31076,31077,32327]
ADENA_ID=57
QuestId = 2009005
QuestName = "NPCBuffer"
QuestDesc = "custom"
InitialHtml = "1.htm"
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(ADENA_ID)
if count < 15 or st.getPlayer().getLevel() < 2 :
htmltext = "<html><head><body>No Tienes Adena.<br></body></html>"
else:
st.takeItems(ADENA_ID,0)
st.getPlayer().setTarget(st.getPlayer())
#Бафф на война
if event == "1":
st.takeItems(ADENA_ID,0)
SkillTable.getInstance().getInfo(7055,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7052,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7057,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7053,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7041,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7042,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7043,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7044,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7045,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7047,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7056,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7097,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7088,1).getEffects(st.getPlayer(),st.getPlayer())
return
st.setState(State.COMPLETED)
#Бафф на танка
if event == "2":
st.takeItems(ADENA_ID,0)
SkillTable.getInstance().getInfo(7055,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7052,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7058,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7053,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7041,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7042,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7043,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7044,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7045,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7047,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7097,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7092,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7088,1).getEffects(st.getPlayer(),st.getPlayer())
return
st.setState(State.COMPLETED)
#Бафф на БД
if event == "3":
st.takeItems(ADENA_ID,0)
SkillTable.getInstance().getInfo(7055,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7052,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7058,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7053,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7041,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7042,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7043,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7044,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7045,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7047,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7097,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7088,1).getEffects(st.getPlayer(),st.getPlayer())
return
st.setState(State.COMPLETED)
#Бафф на мага
if event == "4":
st.takeItems(ADENA_ID,0)
SkillTable.getInstance().getInfo(7055,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7051,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7052,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7046,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7056,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7058,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7059,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7060,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7097,1).getEffects(st.getPlayer(),st.getPlayer())
SkillTable.getInstance().getInfo(7089,1).getEffects(st.getPlayer(),st.getPlayer())
return
st.setState(State.COMPLETED)
if htmltext != event:
st.setState(State.COMPLETED)
st.exitQuest(1)
return htmltext
def onTalk (self,npc,player):
st = player.getQuestState(qn)
htmltext = "no.html"
st.playSound("ItemSound.quest_accept")
st.setState(State.STARTED)
if st.getPlayer().getClassId().getId() == 0x01:
HtmlText = "warrior.htm"
return
elif st.getPlayer().getClassId().getId() == 0x01:
HtmlText = "warrior.htm"
return
elif st.getPlayer().getClassId().getId() == 0x02 :
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x03:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x04:
HtmlText = "knight.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x05:
HtmlText = "knight.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x06:
HtmlText = "knight.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x07:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x08:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x09:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x0a:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x0b:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x0c:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x0d:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x0e:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x0f:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x10:
HtmlText = "mage-52.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x11:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x12:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x13:
HtmlText = "knight.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x14:
HtmlText = "knight.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x15:
HtmlText = "knight.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x16:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x17:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x18:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x19:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x1a:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x1b:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x1c:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x1d:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x1e:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x1f:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x20:
HtmlText = "knight.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x21:
HtmlText = "knight.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x22:
HtmlText = "bladedancer.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x23:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x24:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x25:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x26:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x27:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x28:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x29:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x2a:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x2b:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x2c:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x2d:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x2e:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x2f:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x30:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x31:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x32:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x33:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x34:
HtmlText = "mage.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x35:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x36:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x37:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x38:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x39:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x7b:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x7C:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x7D:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x7E:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x7F:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x80:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x81:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x82:
HtmlText = "warrior.htm"
return HtmlText
elif st.getPlayer().getClassId().getId() == 0x87:
HtmlText = "warrior.htm"
return HtmlText
else: return InitialHtml
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)
Добавлено через 4 часа 5 минут
тему можно закрыть, разобрался
|