05-04-2009, 11:45 AM
лвл апера сделал, он грузится все норм, но не хочет переводить квест в состояние стартед, прошу помощи
А вот исходник кода (в смысле оригинал)
сборка la2base 1.1.7
Код:
import sys
from java.util import Iterator
from net.sf.l2j.gameserver.datatables import SkillTable
from net.sf.l2j import L2DatabaseFactory
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
from net.sf.l2j.gameserver.model import L2LvlupData
from net.sf.l2j.gameserver.model.base import ClassId
from net.sf.l2j.gameserver.model import L2Character
from net.sf.l2j.gameserver.templates import L2CharTemplate
from net.sf.l2j.gameserver.model.actor.stat import CharStat
from net.sf.l2j.gameserver.model import L2Object
from net.sf.l2j.gameserver.model.actor.poly import ObjectPoly
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
from net.sf.l2j.gameserver.serverpackets import SocialAction
qn = "10002_lvl"
#Айтим для апа (ID Айтима)
ID_ITEM = 5575
#Колличество айтимов для апа
NEED_ITEM = 1000000000
#Выдаваемый ап
LVL_UP = 78
#Коливество Exp
NEED_EXP = 1511257834
#Коливество Sp
NEED_SP = 1644001
NPC=[73640]
QuestId = 10002
QuestName = "10002_lvl"
QuestDesc = "lvl"
print "----------- importing quests: 10002_lvl - quest done by martS -----------"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
htmltext = "<html><head><body>У вас недостаточно АА (нужно 1000000000)<br></body></html>"
if event=="1" :
htmltext = "<html><head><body>Вы уже достигли 78 лвл.<br></body></html>"
if st.getPlayer().getLevel() < LVL_UP :
st.giveItems(ID_ITEM,NEED_ITEM)
htmltext = "<html><head><body>Teper u vas 78 LVL!.<br></body></html>"
st.player.getStat().setLevel(LVL_UP)
st.player.addExpAndSp(NEED_EXP,NEED_SP)
st.player.teleToLocation(st.player.getX(),st.player.getY(),st.player.getZ())
st.player.broadcastPacket(SocialAction(st.player.getObjectId(), 15))
st.playSound("ItemSound.quest_finish")
st.setState(State.COMPLETED)
htmltext = "<html><head><body>Поздравляем, теперь у вас 78 лвл!<br></body></html>"
return htmltext
def onTalk (self,npc,player):
st = player.getQuestState(qn)
htmltext = "<html><body>No tengo nada para decirte.</body></html>"
st.setState(State.STARTED)
htmltext = "about.htm"
return htmltext
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
for npcid in NPC:
QUEST.addStartNpc(npcid)
QUEST.addTalkId(npcid)
print "load ok"
Код:
print "importing quests: 10002_lvl - quest done by martS (nolimit.sytes.net)"
import sys
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from net.sf.l2j.gameserver import SkillTable
from net.sf.l2j import L2DatabaseFactory
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
from net.sf.l2j.gameserver.model import L2LvlupData
from net.sf.l2j.gameserver.model.base import ClassId
from net.sf.l2j.gameserver.model import L2Character
from net.sf.l2j.gameserver.templates import L2CharTemplate
from net.sf.l2j.gameserver.model.actor.stat import CharStat
from net.sf.l2j.gameserver.model import L2Object
from net.sf.l2j.gameserver.model.actor.poly import ObjectPoly
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
from net.sf.l2j.gameserver.serverpackets import SocialAction
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
htmltext = "<html><head><body>У вас недостаточно АА (нужно 1000000000)<br></body></html>"
if event=="1" :
htmltext = "<html><head><body>Вы уже достигли 78 лвл.<br></body></html>"
if st.getPlayer().getLevel() < 78 :
st.giveItems(5575,1000000000)
htmltext = "<html><head><body>Теперь у вас 78 лвл!.<br></body></html>"
st.player.getStat().setLevel(78)
st.player.addExpAndSp(1511257834,1644001)
st.player.teleToLocation(st.player.getX(),st.player.getY(),st.player.getZ())
st.player.broadcastPacket(SocialAction(st.player.getObjectId(), 15))
st.playSound("ItemSound.quest_finish")
st.setState(COMPLETED)
htmltext = "<html><head><body>Поздравляем, теперь у вас 78 лвл!<br></body></html>"
return htmltext
def onTalk (Self,npc,st):
npcId = npc.getNpcId()
htmltext = "читер!"
if npcId==7364 :
st.setState(STARTED)
htmltext = "about.htm"
return htmltext
QUEST = Quest(10002,"10002_lvl","lvl")
CREATED = State('Start', QUEST)
STARTED = State('Started', QUEST)
COMPLETED = State('Completed', QUEST)
QUEST.setInitialState(CREATED)
QUEST.addStartNpc(7364)
STARTED.addTalkId(7364)
print "load ok"