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.
 
 
 

82 lines
2.3 KiB

Scriptname _00E_MQ11a_DeadDraugrMotionType extends Actor
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnInit()
If (MQ11a.GetStage() < 215)
EnableAI(False)
BlockActivation(True)
EndIf
EndEvent
Event OnActivate(ObjectReference akActionRef)
ObjectReference myTrigger = GetLinkedRef(LinkTrigger)
If myTrigger && (myTrigger == akActionRef)
Reanimate()
EndIf
EndEvent
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function Reanimate()
{Called on various occasions, mainly through _00E_MQ11a_Functions}
EnableAI(True)
_00E_MQ11a_ReanimateSelf.Cast(Self, Self)
_00E_MagConjureReanimate.Play(Self)
GetBaseObject().SetName(_00E_MQ11a_CorpseName.GetName())
; Wait for the corpse to be reanimated (or until timeout via nCountDown). Takes 5-6 secs.
Utility.Wait(2.0)
Int nCountDown = 75
While IsDead() && (nCountDown > 0)
Utility.Wait(0.1)
nCountDown -= 1
EndWhile
StartCombat(PlayerRef)
Int mq11aStage = MQ11a.GetStage()
If mq11aStage >= 95 && mq11aStage < 130
Alias_Calia.GetActorReference().StartCombat(Self)
EndIf
If IsDead() ; Something went wrong. The corpse has been probably desintegrated (e.g., by Devour Soul).
_00E_MQ11a_RegisterEnemyDeathScript regDeathScript = ((Self as Actor) as _00E_MQ11a_RegisterEnemyDeathScript)
If regDeathScript
regDeathScript.RegisterDeath()
EndIf
EndIf
RemoveFromFaction(NoDevourSoulFaction)
BlockActivation(False)
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
Message Property _00E_MQ11a_CorpseName Auto
Quest Property MQ11a Auto
ReferenceAlias Property Alias_Calia Auto
Keyword Property LinkTrigger Auto
Faction Property NoDevourSoulFaction Auto
Spell Property _00E_MQ11a_ReanimateSelf Auto
Sound Property _00E_MagConjureReanimate Auto
Actor Property PlayerRef Auto