Jump to content
  • 0

[Help] frintezza quest.py GF


Question

Posted

Hi

I edit script frintezza to Gracia Final

Can some body help me ??

I dont know why function def onAttack dont work , evrythink else is work. Script dont heave error on loading and in game . Help plix

 

quest.py

import math
import sys 
from java.lang 						import System
from net.sf.l2j.gameserver.model.quest.jython   	import QuestJython as JQuest 
from net.sf.l2j.gameserver.ai                  		import CtrlIntention 
from net.sf.l2j.gameserver.model.actor.instance 	import L2PcInstance
from net.sf.l2j.gameserver.network.serverpackets	import SocialAction 
from net.sf.l2j.gameserver.network.serverpackets        import SpecialCamera
from net.sf.l2j.util                           		import Rnd
from net.sf.l2j.gameserver.network.serverpackets   	import PlaySound
from net.sf.l2j.gameserver.network.serverpackets 	import CreatureSay
from net.sf.l2j.gameserver.datatables 			import DoorTable
from net.sf.l2j.gameserver.instancemanager 		import GrandBossManager
from net.sf.l2j.gameserver.model.quest 			import State
from net.sf.l2j.gameserver.model.quest 			import QuestState
from net.sf.l2j.gameserver.model.actor.instance 	import L2NpcInstance

# Halisha and Frintezza
Halisha1 	= 100200 
Halisha1a 	= 29046 
Halisha3 	= 29047 
Frintezza	= 29045
FRINTEZZA	= 29045

FRINTEZZA_TELE 	= 32011


#SPAWN COORDS FOR FRINTEZZA AND HALISHA
FX	= 174239
FY	= -89802
FZ	= -5021
HX	= 174231
HY	= -88006
HZ	= -5115

#TELEPORT ITEM
FRINTEZZA_SCROLL  = 8073

#STATUS
DORMANT = 0
FIGHTING = 2    
DEAD = 3 

qn = "frintezza"


class frintezza(JQuest): 
    # init function.  Add in here variables that you'd like to be inherited by subclasses (if any)
    EntryLocked = True
    def __init__(self,id,name,descr):
        JQuest.__init__(self,id,name,descr)
        # finally, don't forget to call the parent constructor to prepare the event TriggerThreeing 
        # mechanisms etc. 
        self.Despawn ={29045: {'bosses': [ 29045, 29046, 29047 ]},}
        self.MobSpawns ={
            29046: {}, 
            29047: {}, 
            } 
        self.Start = False
        self.Done = True
        self.TriggerOne = True
        self.TriggerTwo = True
        self.TriggerThree = True
        self.TriggerLock = True
        self.TriggerUnlock = False
        self.EntryLocked = False
        self.isMorphed = False
self.halisha1 = []
        self.halisha2 = []
        self.halisha3 = []
self.frintezza = []
        self.FrintezzaZone = GrandBossManager.getInstance().getZone(174231,-88006,-5108)
        TombZone = GrandBossManager.getInstance().getZone(174157,-762***-5108)    
        info = GrandBossManager.getInstance().getStatsSet(FRINTEZZA)
        status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA)
        if status == DEAD :
            # load the unlock date and time for Frintezza from DB
            temp = long(info.getLong("respawn_time")) - System.currentTimeMillis()
            if temp > 0 :
                startQuestTimer("FRINTEZZA_unlock", temp, None, None)
            else :
                # the time has already expired while the server was offline. 
                # Set teleport to locked
                EntryLocked = False
                GrandBossManager.getInstance().setBossStatus(FRINTEZZA,DORMANT)
        else :
            EntryLocked = False

    def onTalk (self,npc,player) :
        npcId = npc.getNpcId()
        if npcId == FRINTEZZA_TELE : #GK
            status = GrandBossManager.getInstance().getBossStatus(FRINTEZZA)
            if status == 0 or status == 1 : #If entrance to see Valakas is unlocked (he is Dormant or Waiting)
                party = player.getParty()
                st = player.getQuestState(qn)
                if st.getQuestItemsCount(FRINTEZZA_SCROLL) > 0 :
                    st.takeItems(FRINTEZZA_SCROLL,1)
                    self.FrintezzaZone.allowPlayerEntry(player,600)
                    x = 174258 
                    y = -86350
                    player.teleToLocation(x,y,-5103)
                    if status == 0 :
                        self.frintezza = self.addSpawn(Frintezza,FX,FY,FZ,0,False,0)          
                        GrandBossManager.getInstance().addBoss(self.frintezza) 
                        GrandBossManager.getInstance().setBossStatus(FRINTEZZA,1)
                        self.startQuestTimer("halisha_timer", 20000, npc, player)
                    return
                else :
                    return "<html><body>Kup se bilet noobie</html></body>"
            elif status == 2 :
                 return "<html><body>Spużniles sie noobie, juz kto go klepie.</html></body>"
            elif status == 3 :
                 return "<html><body>Valakas niezyje.</html></body>"
        return


    def onAttack (self,npc,player,damage,isPet,skill) : 
        npcId = npc.getNpcId() 
        objId = npc.getObjectId() 
        if npcId == FRINTEZZA : 
            self.frintezza.setCurrentHpMp(700000,10000)
        elif npcId == Halisha1 : 
            self.lastAttackVsHalisha = System.currentTimeMillis()
            self.startQuestTimer("FRINTEZZA_despawn",60000, None, None)
            if self.TriggerThree == False :
                self.TriggerThree = self.Done
            if self.TriggerThree == True :
                CurrentHP = npc.getCurrentHp()
                if CurrentHP <= npc.getMaxHp() * 0.5 and self.isMorphed == False: 
                    self.startQuestTimer("poly1", **** npc, player) 
        elif npcId == Halisha1a : 
            self.lastAttackVsHalisha = System.currentTimeMillis()
            self.startQuestTimer("FRINTEZZA_despawn",60000, None, None)
        elif npcId == Halisha3 : 
            self.lastAttackVsHalisha = System.currentTimeMillis()
            self.startQuestTimer("FRINTEZZA_despawn",60000, None, None)
        else: 
            return 

    def onKill (self,npc,player,isPet) : 
        npcId = npc.getNpcId() 
        npcObjId = npc.getObjectId()   
        MobSpawns = self.MobSpawns
        if MobSpawns.has_key(npcId) :         
          if npcId == Halisha1a : 
                self.startQuestTimer("poly2", 7500, npc, player) 
                npc.setRHandId(8204) 
                self.isMorphed = False 
          if npcId == Halisha3 : 
                respawnTime = long(432000000)
                npc.broadcastPacket(PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()))
                self.startQuestTimer("FRINTEZZA_unlock", 432000000, None, None) 
                self.startQuestTimer("spawn_cubes", 10000, npc, None)
                if self.frintezza:
                    self.frintezza.onDecay()
                GrandBossManager.getInstance().setBossStatus(FRINTEZZA,DEAD)
                # also save the respawn time so that the info is maintained past reboots
                info = GrandBossManager.getInstance().getStatsSet(FRINTEZZA)
                info.set("respawn_time",(long(System.currentTimeMillis()) + respawnTime))
                GrandBossManager.getInstance().setStatsSet(FRINTEZZA,info)
                #I set the unlock for 5 days but this value needs to be checked
                return
        return 

    def onAdvEvent (self,event,npc,player) : 
        if event == "poly1" and npc and player: 
            self.isMorphed = True 
            heading = npc.getHeading()
            hp = npc.getCurrentHp()
            mp = npc.getCurrentMp()
            npc.deleteMe()         
            self.halisha2 = self.addSpawn(Halisha1a, npc)          
            self.halisha2.broadcastPacket(CreatureSay(self.halisha2.getObjectId(),0,"Scarlet Von Halisha","You will die!!!"))
            self.startQuestTimer("poly1a", **** npc, player) 
            self.halisha2.setHeading(heading) 
            self.halisha2.setCurrentHpMp(hp,mp)
            self.cancelQuestTimer("poly1", npc, None)
        elif event == "poly1a" and npc and player: 
            self.halisha2.broadcastPacket(SpecialCamera(self.halisha2.getObjectId(),800,0,150,0,7000))
            self.halisha2.broadcastPacket(SocialAction(self.halisha2.getObjectId(),1)) 
            self.startQuestTimer("attack", 7000, npc, player) 
        elif event == "attack" and npc and player: 
            self.halisha2.addDamageHate(player,0,500) 
            self.halisha2.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player) 
        elif event == "poly2" and npc and player: 
            self.halisha3 = self.addSpawn(Halisha3, npc) 
            self.halisha3.addDamageHate(player,0,500) 
            self.halisha3.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player) 
            self.cancelQuestTimer("poly2", npc, None)
        elif event == "halisha_timer":
            self.halisha2 = self.addSpawn(Halisha1a,HX,HY,HZ,0,False,0) 
            self.frintezza.broadcastPacket(CreatureSay(self.halisha2.getObjectId(),0,"Frintezza","Halisha!!! Get rid of these ones!"))
            self.frintezza.broadcastPacket(SpecialCamera(self.frintezza.getObjectId(),200,-50,150,0,6000))
            self.frintezza.broadcastPacket(SocialAction(self.frintezza.getObjectId(),3))  
            self.cancelQuestTimer("halisha_timer", npc, None)
        elif event == "FRINTEZZA_unlock" :
            GrandBossManager.getInstance().addBoss(FRINTEZZA)
            GrandBossManager.getInstance().setBossStatus(FRINTEZZA,AWAKE)
            self.cancelQuestTimer("FRINTEZZA_unlock", npc, None)
            self.EntryLocked = False
        elif event == "spawn_cubes" :
            cube = self.addSpawn(31859,HX,HY,HZ,0,False,0)
            self.cancelQuestTimer("FRINTEZZA_despawn", npc, None)
            self.cancelQuestTimer("spawn_cubes", npc, None)
            self.startQuestTimer("remove_players",900000, None, None)
        elif event == "remove_players" :
            self.FrintezzaZone.oustAllPlayers()
        elif event == "teleport_out" :
#           Now we need to send back to town the players who did not make
#           it to Frintezza's chamber within 35minutes(like retail)
            self.cancelQuestTimer("teleport_out", npc, None)
            self.TombZone.oustAllPlayers()
        elif event == "FRINTEZZA_despawn" and npc:
            if (self.lastAttackVsHalisha + 1800000 < System.currentTimeMillis()) :
                if self.SpawnGhost1:
                    self.SpawnGhost1.deleteMe()
                if self.SpawnGhost2:
                    self.SpawnGhost2.deleteMe()
                if self.SpawnGhost3:
                    self.SpawnGhost3.deleteMe()
                if self.SpawnGhost4:
                    self.SpawnGhost4.deleteMe()
                if self.halisha1:
                    self.halisha1.deleteMe()   
                if self.halisha2:
                    self.halisha2.deleteMe()   
                if self.halisha3:
                    self.halisha3.deleteMe()   
                if self.frintezza:
                    self.frintezza.deleteMe()   
                self.EntryLocked = False
                self.TombZone.oustAllPlayers()
                self.FrintezzaZone.oustAllPlayers()
                self.cancelQuestTimer("FRINTEZZA_despawn", npc, None)
        return 

        
# now call the constructor (starts up the ai) 
QUEST      = frintezza(-1,"frintezza","ai") 
for i in QUEST.MobSpawns.keys() :
    QUEST.addAttackId(i)
    QUEST.addKillId(i)
    QUEST.addSpawnId(i)
    QUEST.addTalkId(i)


QUEST.addStartNpc(FRINTEZZA_TELE)

print "AI: group template: Last Imperial Tomb...loaded!"

3 answers to this question

Recommended Posts

  • 0
Posted

All script i have edit to java ???

or i have only change name quest.py to quest.java ???

 

You cant do it, because this AI is made in PYTHON so it should be in *.py file - simple.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Virtual numbers for full control and flexibility. We offer long-term number rental (days, months) and one-time SMS receiving — all in one service. Long-term rental is suitable for stable access to accounts, repeated verifications, and number retention. One-time numbers are for quick registrations and single-use operations. Reliable SMS delivery, predictable results, and convenience that even many large SMS services do not offer. Go to the SMS service
    • Telegram gifts are once again showing growth. This is associated with a possible pause in the gift release pipeline by Pavel Durov, as well as the approaching New Year, when demand traditionally increases. Against this backdrop, Telegram Stars, the platform’s internal currency, are once again coming to the forefront. With their help, users send gifts, subscribe to Telegram Premium, and use paid features within the Telegram ecosystem. Buy Telegram Stars with maximum benefit in our bot
    • Telegram gifts are once again showing growth. This is associated with a possible pause in the gift release pipeline by Pavel Durov, as well as the approaching New Year, when demand traditionally increases. Against this backdrop, Telegram Stars, the platform’s internal currency, are once again coming to the forefront. With their help, users send gifts, subscribe to Telegram Premium, and use paid features within the Telegram ecosystem. Buy Telegram Stars with maximum benefit in our bot
    • 流量套利 + SMM 面板 — 强大的增长组合. 通过社交信号加强推广活动,提高信任度和转化率,加速扩张。 为套利专员和 SMM 提供的所有工具 — 在一个地方. 有效链接: SMM 面板: 前往 – 推广您的社交媒体账户。 其他服务和产品: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 信使方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快速且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前促销和特别优惠列表,用于购买我们服务的产品和服务: 1. 您可以在首次购买时使用促销代码:SOCNET(15% 折扣) 2. 获取 $1 商店余额或 10–20% 折扣——只需在我们网站注册后按以下模板填写您的用户名:"SEND ME BONUS, MY USERNAME IS..." ——您需要在我们的论坛主题中发布! 3. SMM 面板首次试用可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道和 Stars 购买机器人中每周都会赠送 Telegram Stars! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式和支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Traffic arbitrage + SMM panel — a powerful combination for growth. Strengthen campaigns with social signals, increase trust and conversion, scale faster. All tools for arbitrage specialists and SMM — in one place. Active links: SMM Panel: Go to – promotion of your social media accounts. Other services and products: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! 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 and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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