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!"