4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
925 B

Scriptname _00E_ActorCarryScript extends Actor
Idle Property StopCarryingIdle Auto
Int nCarryStateCounter = 0
; Called from OnBegin in packages
Function StartCarrying()
; Debug.Trace(self + ", StartCarrying")
If nCarryStateCounter < 0 ; Just in case...
nCarryStateCounter = 1
Else
nCarryStateCounter += 1
EndIf
EndFunction
; Called from OnChange in packages
Function StopCarrying()
; Debug.Trace(self + ", StopCarrying")
nCarryStateCounter -= 1
_ResetCarrying()
EndFunction
Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
If nCarryStateCounter > 0 && aeCombatState > 0
_ResetCarrying()
EndIf
EndEvent
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
If nCarryStateCounter > 0
_ResetCarrying()
EndIf
EndEvent
Function _ResetCarrying()
PlayIdle(StopCarryingIdle)
EndFunction