Jump to content
  • 0

[NEED HELP] .py spawn a boss.


Question

Posted

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?

6 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.


  • Posts

    • NFT gifts on Telegram are already here! Buy Stars at SOCNET — the black background can be yours today! Purchase existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium, and react to messages in channels! Low prices, many payment methods, and other cool and unique features! Try it today — SOCNET STARS BOT Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and beneficial purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing our products and services: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in September! You can also use the first-purchase promo code: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply write your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — you need to post it in our forum thread! 3. Get $1 for your first SMM Panel trial: just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts & Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • NFT gifts on Telegram are already here! Buy Stars at SOCNET — the black background can be yours today! Purchase existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium, and react to messages in channels! Low prices, many payment methods, and other cool and unique features! Try it today — SOCNET STARS BOT Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and beneficial purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing our products and services: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in September! You can also use the first-purchase promo code: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply write your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — you need to post it in our forum thread! 3. Get $1 for your first SMM Panel trial: just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts & Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • NFT gifts on Telegram are already here! Buy Stars at SOCNET — the black background can be yours today! Purchase existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium, and react to messages in channels! Low prices, many payment methods, and other cool and unique features! Try it today — SOCNET STARS BOT Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and beneficial purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing our products and services: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in September! You can also use the first-purchase promo code: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply write your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." — you need to post it in our forum thread! 3. Get $1 for your first SMM Panel trial: just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts & Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Wts adena 1kk = 10$  discord - GODDARDSHOP 
    • Thanks for the feedback! We’ve actually rented their infrastructure to ensure a high-quality gaming experience (We couldn't find any better files out there). Developer @FixerRay will also be there to assist us 🙂
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock