Hi all ! i have a problem i was trying to make a custom quest i want a npc teleport to a raidboss ,when char is there i want to spawn 4 bosses 1 by one with cinematic ,so i copied and adapt sailren .py but i have a problem that i cant understand.i am getting error at line 48 "getObjectId" the python code is below.i use l2jfrozen.
import sys
from com.l2jfrozen.gameserver.ai import CtrlIntention
from com.l2jfrozen.gameserver.managers import GrandBossManager
from com.l2jfrozen.gameserver.model.actor.position import L2CharPosition
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2jfrozen.gameserver.network.serverpackets import SocialAction
from com.l2jfrozen.gameserver.network.serverpackets import SpecialCamera
from com.l2jfrozen.util.random import Rnd
from java.lang import System
STATUE = 50000
SAILREN = 35646
VELO = 35647
PTERO = 90000
TREX = 35648
STONE = 6673
class Grandmaster (JQuest) :
def __init__(self,id,name,descr):
self.vlc = []
self.ptr = []
self.trx = []
self.slrn = []
JQuest.__init__(self,id,name,descr)
def onAdvEvent (self,event,npc,player):
if event == "start" :
self.vlc = self.addSpawn(VELO,96452,159940,-3275,45000,False,0)
self.startQuestTimer("camera",2000, self.vlc, player)
self.cancelQuestTimer("start",npc,None)
if event == "round2" :
self.ptr = self.addSpawn(PTERO,96409,160011,-3261,45000,False,0)
self.startQuestTimer("camera",2000, self.ptr, player)
self.cancelQuestTimer("round2",npc,None)
if event == "round3" :
self.trx = self.addSpawn(TREX,96500,159998,-3275,45000,False,0)
self.startQuestTimer("camera",2000, self.trx, player)
self.cancelQuestTimer("round3",npc,None)
if event == "grandmaster" :
self.slrn = self.addSpawn(SAILREN,96403,160011,-3299,45000,False,0)
self.startQuestTimer("camera",2000, self.slrn, player)
self.startQuestTimer("vkrovatku",1200000, self.slrn, None)
self.cancelQuestTimer("round4",npc,None)
elif event == "camera" :
player.broadcastPacket(SpecialCamera(npc.getObjectId(),400,-75,3,-150,5000))
npc.broadcastPacket(SocialAction(npc.getObjectId(),1))
elif event == "open" :
self.deleteGlobalQuestVar("close")
self.cancelQuestTimer("open",npc,None)
elif event == "vkrovatku" :
npc.deleteMe()
self.deleteGlobalQuestVar("close")
self.cancelQuestTimer("open",npc,None)
self.cancelQuestTimer("vkrovatku",npc,None)
return
def onTalk (self,npc,player):
st = player.getQuestState("grandmaster")
npcId = npc.getNpcId()
close = self.loadGlobalQuestVar("close")
time = self.loadGlobalQuestVar("time")
party = player.getParty()
if npcId == STATUE :
if st.getQuestItemsCount(STONE) >= 1 :
if close == "" :
if party:
for player in party.getPartyMembers() :
st.takeItems(STONE,1)
self.saveGlobalQuestVar("close", "1")
zone = GrandBossManager.getInstance().getZone(97235,160539,-3312)
if zone:
zone.allowPlayerEntry(player, 3600)
player.teleToLocation(97235,160539,-3312)
self.startQuestTimer("start",30000,npc,player)
self.startQuestTimer("open",1800000,npc,None)
else :
return "<html><body><font color=LEVEL>Only with party...</font></body></html>"
else :
return "<html><body><font color=LEVEL>Some one else is inside...</font></body></html>"
else :
return "<html><body>You need quest item: <font color=LEVEL>Gazkh...</font></body></html>"
return
def onKill(self,npc,player,isPet):
if npc == self.vlc :
self.startQuestTimer("round2",30000,npc,player)
if npc == self.ptr :
self.startQuestTimer("round3",60000,npc,player)
if npc == self.trx :
self.startQuestTimer("grandmaster",180000,npc,player)
if npc == self.slrn :
self.deleteGlobalQuestVar("close")
self.cancelQuestTimer("open",npc,None)
return
QUEST = Grandmaster(-1,"grandmaster","ai")
CREATED = State('Start',QUEST)
QUEST.setInitialState(CREATED)
QUEST.addStartNpc(STATUE)
QUEST.addTalkId(STATUE)
QUEST.addKillId(VELO)
QUEST.addKillId(PTERO)
QUEST.addKillId(TREX)
QUEST.addKillId(SAILREN)
L2Elixir – Patch 4 Is Live!
We’re working non-stop, day and night, to deliver the best possible quality and bring back what made L2Elixir special. This project is built with passion, not shortcuts — for the old-school players who remember, and the new ones who want to experience it properly. Thank you for being part of the journey. Together, we’re making L2Elixir great again ❤️ The legends never fade.
⚙️ General
Enabled Class Change service (same class type only)
ALT + B → Services → Character Development
Enabled Shift + Click on Treasure Chests Players can now identify real chests (Adena, scroll drops) and use Key / Unlock
Event deaths now cancel only debuffs, All self buffs are preserved, fixes issues with Root and similar effects
Bladedancer class can now log in even when Max Clients (2) is reached. Since an active Bladedancer is not available for every damage dealer and some players tried to abuse this via VPN or a second PC, this feature was added to keep things fair. protections applies, requires testing!
🎒 Items
Crystallizing enchanted items now gives the correct increased crystal amount (retail-like behavior)
Removed Agathion Seal Bracelet: Rudolph from Santa rewards (Gracia Final item)
Added Dualsword Craft Stamp into Milestone Exchange list
🧙 Skills
Fixed Banish Undead lethal chance
Hot Springs Malaria and similar effects now level up faster while being attacked
Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc.
That's his mail address evgesha.nrnr@gmail.com , stay away!
@Atom @Celestine
Warning: This guy is a big scammer, trying to sell everything, advertising for servers etc.
That's his mail address evgesha.nrnr@gmail.com , stay away!
@Celestine
@Atom
Question
sakisd
Hi all !
i have a problem i was trying to make a custom quest i want a npc teleport to a raidboss ,when char is there i want to spawn 4 bosses 1 by one with cinematic ,so i copied and adapt sailren .py but i have a problem that i cant understand.i am getting error at line 48 "getObjectId" the python code is below.i use l2jfrozen.
import sys from com.l2jfrozen.gameserver.ai import CtrlIntention from com.l2jfrozen.gameserver.managers import GrandBossManager from com.l2jfrozen.gameserver.model.actor.position import L2CharPosition from com.l2jfrozen.gameserver.model.quest import State from com.l2jfrozen.gameserver.model.quest import QuestState from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest from com.l2jfrozen.gameserver.network.serverpackets import SocialAction from com.l2jfrozen.gameserver.network.serverpackets import SpecialCamera from com.l2jfrozen.util.random import Rnd from java.lang import System STATUE = 50000 SAILREN = 35646 VELO = 35647 PTERO = 90000 TREX = 35648 STONE = 6673 class Grandmaster (JQuest) : def __init__(self,id,name,descr): self.vlc = [] self.ptr = [] self.trx = [] self.slrn = [] JQuest.__init__(self,id,name,descr) def onAdvEvent (self,event,npc,player): if event == "start" : self.vlc = self.addSpawn(VELO,96452,159940,-3275,45000,False,0) self.startQuestTimer("camera",2000, self.vlc, player) self.cancelQuestTimer("start",npc,None) if event == "round2" : self.ptr = self.addSpawn(PTERO,96409,160011,-3261,45000,False,0) self.startQuestTimer("camera",2000, self.ptr, player) self.cancelQuestTimer("round2",npc,None) if event == "round3" : self.trx = self.addSpawn(TREX,96500,159998,-3275,45000,False,0) self.startQuestTimer("camera",2000, self.trx, player) self.cancelQuestTimer("round3",npc,None) if event == "grandmaster" : self.slrn = self.addSpawn(SAILREN,96403,160011,-3299,45000,False,0) self.startQuestTimer("camera",2000, self.slrn, player) self.startQuestTimer("vkrovatku",1200000, self.slrn, None) self.cancelQuestTimer("round4",npc,None) elif event == "camera" : player.broadcastPacket(SpecialCamera(npc.getObjectId(),400,-75,3,-150,5000)) npc.broadcastPacket(SocialAction(npc.getObjectId(),1)) elif event == "open" : self.deleteGlobalQuestVar("close") self.cancelQuestTimer("open",npc,None) elif event == "vkrovatku" : npc.deleteMe() self.deleteGlobalQuestVar("close") self.cancelQuestTimer("open",npc,None) self.cancelQuestTimer("vkrovatku",npc,None) return def onTalk (self,npc,player): st = player.getQuestState("grandmaster") npcId = npc.getNpcId() close = self.loadGlobalQuestVar("close") time = self.loadGlobalQuestVar("time") party = player.getParty() if npcId == STATUE : if st.getQuestItemsCount(STONE) >= 1 : if close == "" : if party: for player in party.getPartyMembers() : st.takeItems(STONE,1) self.saveGlobalQuestVar("close", "1") zone = GrandBossManager.getInstance().getZone(97235,160539,-3312) if zone: zone.allowPlayerEntry(player, 3600) player.teleToLocation(97235,160539,-3312) self.startQuestTimer("start",30000,npc,player) self.startQuestTimer("open",1800000,npc,None) else : return "<html><body><font color=LEVEL>Only with party...</font></body></html>" else : return "<html><body><font color=LEVEL>Some one else is inside...</font></body></html>" else : return "<html><body>You need quest item: <font color=LEVEL>Gazkh...</font></body></html>" return def onKill(self,npc,player,isPet): if npc == self.vlc : self.startQuestTimer("round2",30000,npc,player) if npc == self.ptr : self.startQuestTimer("round3",60000,npc,player) if npc == self.trx : self.startQuestTimer("grandmaster",180000,npc,player) if npc == self.slrn : self.deleteGlobalQuestVar("close") self.cancelQuestTimer("open",npc,None) return QUEST = Grandmaster(-1,"grandmaster","ai") CREATED = State('Start',QUEST) QUEST.setInitialState(CREATED) QUEST.addStartNpc(STATUE) QUEST.addTalkId(STATUE) QUEST.addKillId(VELO) QUEST.addKillId(PTERO) QUEST.addKillId(TREX) QUEST.addKillId(SAILREN)2 answers to this question
Recommended Posts