Sorry if i'm in wrong section, i need a help section.
I have .py script and a help to use it.
## RB EVENT'as ## Julius
import maths
import sys
from com.l2jfrozen.gameserver.model.entity import Announcements
from com.l2jfrozen.util.random import Rnd
from java.lang import System
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.model.actor.instance import L2PcInstance
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
eventInterval = 600000 # Po 1h kai bosas mires ar dinges, atsiras naujas
FirstStart = 3 #45 min po serverio rr prasides eventas
class raidbossEvent (JQuest):
def __init__(self,id,name,descr):
JQuest.__init__(self,id,name,descr)
#Bartz
self.startQuestTimer("raidSpawn", FirstStart, None, None)
self.RbSpawn = []
self.RaidBosses ={
0: {'name':"Nemesis" , 'id':25281},
1: {'name':"Sailren" , 'id':29065},
2: {'name':"Golem" , 'id':25523},
3: {'name':"Dina" , 'id':25305},
4: {'name':"Nukra" , 'id':25391},
5: {'name':"Uruka" , 'id':25527},
}
self.RaidBossId = [ 25281,29065,25523,25305,25391,25527 ]
self.RbCoords ={
0: {'name':"in the Coliseum" , 'X':149527 , 'Y':46867 , 'Z':-3408},
1: {'name':"somewhere in Giran" , 'X':79782 , 'Y':149792 , 'Z':-3536},
2: {'name':"somewhere in Giran" , 'X':81562 , 'Y':145514 , 'Z':-3536},
3: {'name':"in the Peace Farm zone" , 'X':85549 , 'Y':255842 , 'Z':-11664},
4: {'name':"somewhere in Aden" , 'X':146863 , 'Y':28034 , 'Z':-2272},
5: {'name':"somewhere in Aden" , 'X':150165 , 'Y':29357 , 'Z':-2456,
}
def onAdvEvent (self,event,npc,player):
if event == "raidSpawn" :
ra = int(Rnd.get(6))
rb = int(Rnd.get(6))
self.RbSpawn = []
raidboss = self.RaidBosses[ra]['name']
location = self.RbCoords[rb]['name']
Announcements.getInstance().announceToAll(raidboss + " has just spawned " + location + " and will disappear in 2 hours, hurry up!")
self.RbSpawn = self.addSpawn(self.RaidBosses[ra]['id'],self.RbCoords[rb]['X'],self.RbCoords[rb]['Y'],self.RbCoords[rb]['Z'],0,False,0)
self.startQuestTimer("RbDespawn", 7200000, None, None)
if event == "RbDespawn":
self.startQuestTimer("raidSpawn", eventInterval, None, None)
self.RbSpawn.deleteMe()
Announcements.getInstance().announceToAll(raidboss + " vanished from the world.")
def onKill(self,npc,player,isPet):
npcId = npc.getNpcId()
npcObjId = npc.getObjectId()
if npc == self.RbSpawn:
if npc.getObjectId() == self.RbSpawn.getObjectId():
self.startQuestTimer("raidSpawn", eventInterval, None, None)
self.cancelQuestTimer("RbDespawn", None, None)
Announcements.getInstance().announceToAll(raidboss + "is now dead!")
QUEST = raidbossEvent(-1, "raidbossEvent", "ai")
for i in QUEST.RaidBossId:
QUEST.addKillId(i)
print "Event loaded!!!"
Error
Error on: /home/server/gameserver/data/scripts/ai/individual/raidbossEvent.py.error.log
Line: -1 - Column: -1
Traceback (innermost last):
(no code object) at line 0
SyntaxError: ('invalid syntax', ('raidbossEvent.py', 42, 5, ' def onAdvEvent (self,event,npc,player):'))
Need help here, or maybe you have script to share?