enderalse/source/scripts/_00e_undercityaisolonbossscript.psc

59 lines
1.2 KiB
Plaintext
Raw Normal View History

ScriptName _00E_UndercityAisolonBossScript Extends Actor
Actor Property swarm1 Auto
Actor Property swarm2 Auto
Actor Property swarm3 Auto
VisualEffect Property visuals Auto
Bool swarmAct1 = False
Bool swarmAct2 = False
Bool swarmAct3 = False
Bool bDoingCombatRoutine = False
; Backward compatibility
Actor Property queenAisolon Auto
Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
If aeCombatState > 0
DoCombatRoutine()
EndIf
EndEvent
Function DoCombatRoutine()
If (swarmAct1 && swarmAct2 && swarmAct3) || bDoingCombatRoutine
Return
EndIf
bDoingCombatRoutine = True
If swarmAct1 == False
swarmAct1 = True
EnableSwarm(swarm1)
EndIf
Float myBaseHealth = GetBaseActorValue("Health")
While (Is3DLoaded() && IsDead() == False && swarmAct3 == False)
Float myCurHealth = GetActorValue("Health")
If swarmAct2 == False && (myCurHealth < (myBaseHealth * 0.75))
swarmAct2 = True
EnableSwarm(swarm2)
ElseIf swarmAct3 == False && (myCurHealth < (myBaseHealth * 0.5))
swarmAct3 = True
EnableSwarm(swarm3)
EndIf
2021-10-05 22:59:59 +00:00
Utility.Wait(0.1)
EndWhile
bDoingCombatRoutine = False
EndFunction
Function EnableSwarm(Actor swarmRef)
swarmRef.Enable()
visuals.Play(self, 3.0)
EndFunction