|
|
|
@ -15,16 +15,23 @@ Event OnInit() |
|
|
|
|
|
|
|
|
|
EndEvent |
|
|
|
|
|
|
|
|
|
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) |
|
|
|
|
auto state Fighting |
|
|
|
|
|
|
|
|
|
float CurrentHealth = Self.GetActorValue("Health") |
|
|
|
|
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) |
|
|
|
|
|
|
|
|
|
If (CurrentHealth < (Self.GetBaseActorValue("Health")*0.03)) |
|
|
|
|
If (GetActorValue("Health") < BaseHealth * 0.03) && ! Dying |
|
|
|
|
Dying = True |
|
|
|
|
GotoState("Dying") |
|
|
|
|
PlayDeathSequence() |
|
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|
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) |
|
|
|
|