diff --git a/scripts/_00e_mq11c_oorbayabossfightscript.pex b/scripts/_00e_mq11c_oorbayabossfightscript.pex index 1cd0c009..12c8e755 100644 Binary files a/scripts/_00e_mq11c_oorbayabossfightscript.pex and b/scripts/_00e_mq11c_oorbayabossfightscript.pex differ diff --git a/source/scripts/_00e_mq11c_oorbayabossfightscript.psc b/source/scripts/_00e_mq11c_oorbayabossfightscript.psc index aefcd7dc..3636e8d7 100644 --- a/source/scripts/_00e_mq11c_oorbayabossfightscript.psc +++ b/source/scripts/_00e_mq11c_oorbayabossfightscript.psc @@ -15,16 +15,23 @@ Event OnInit() EndEvent -Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) - - float CurrentHealth = Self.GetActorValue("Health") +auto state Fighting - If (CurrentHealth < (Self.GetBaseActorValue("Health")*0.03)) - PlayDeathSequence() - EndIf + Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) + + If (GetActorValue("Health") < BaseHealth * 0.03) && ! Dying + Dying = True + GotoState("Dying") + PlayDeathSequence() + EndIf -EndEvent + EndEvent + +endstate +state Dying + ; do nothing +endstate ;===================================================================================== ; FUNCTIONS @@ -32,9 +39,7 @@ EndEvent Function PlayDeathSequence() - Dying = True Self.SetGhost(True) - UnregisterForUpdate() ;; Gavrant: the code below is commented out because combatIdleStart breaks something in AI and the oorbaya stops making attacks in a fight ;Debug.SendAnimationEvent(Self, "combatIdleStart") AtronachUnsummonDeathFXS.Play(Self) @@ -54,7 +59,7 @@ Function PlayDeathSequence() utility.wait(0.5) AtronachUnsummonDeathFXS.Stop(Self) _00E_FXOorbayaTrailEffect2.Stop(Self) - Self.SetAlpha (0.0,True) + Self.SetAlpha(0.0, True) Self.SetCriticalStage(Self.CritStage_DisintegrateEnd) Wait(1.5) Self.KillEssential(PlayerREF)