2021-10-05 22:15:58 +00:00
|
|
|
Scriptname FXAtronachStormSCRIPT extends activeMagicEffect
|
|
|
|
{This script runs from the Storm Atronach's ability and controlls the fx arts.}
|
|
|
|
;===============================================
|
|
|
|
|
|
|
|
import utility
|
|
|
|
import form
|
|
|
|
|
|
|
|
;===============================================
|
|
|
|
VisualEffect Property AtronachStormCloak Auto
|
|
|
|
EffectShader Property AtronachStormShockFXS Auto
|
|
|
|
EffectShader Property AtronachUnsummonDeathFXS Auto
|
|
|
|
Armor Property FXAtronachStormArmor Auto
|
2021-10-05 22:22:24 +00:00
|
|
|
int atronachHealth
|
2021-10-05 22:15:58 +00:00
|
|
|
actor selfRef
|
|
|
|
|
2021-10-05 22:22:24 +00:00
|
|
|
EVENT OnEffectStart(Actor Target, Actor Caster)
|
|
|
|
selfRef = caster
|
|
|
|
|
|
|
|
;USKP 2.0.1 - Stop this from attaching to the player.
|
|
|
|
if( selfRef == Game.GetPlayer() )
|
|
|
|
Return
|
|
|
|
EndIf
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2021-10-05 22:22:24 +00:00
|
|
|
;USSEP 4.1.5 Bug #13993: added this line:
|
|
|
|
USSEP_RegisterForAnimationEvents (selfRef)
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2021-10-05 22:22:24 +00:00
|
|
|
selfRef.PlaySubGraphAnimation( "AutoOneOff" )
|
2021-10-05 22:15:58 +00:00
|
|
|
;USKP 2.0.3 - Sanity checks added in case properties are not assigned. Ash Guardians in Dragonborn for example.
|
|
|
|
if( AtronachStormCloak )
|
2021-10-05 22:22:24 +00:00
|
|
|
AtronachStormCloak.Play(selfRef, -1)
|
2021-10-05 22:15:58 +00:00
|
|
|
EndIf
|
2021-10-05 22:22:24 +00:00
|
|
|
AtronachStormShockFXS.Play(selfRef)
|
|
|
|
if( FXAtronachStormArmor )
|
|
|
|
selfRef.EquipItem(FXAtronachStormArmor)
|
|
|
|
EndIf
|
|
|
|
ENDEVENT
|
|
|
|
|
|
|
|
Event OnEffectFinish(Actor akTarget, Actor akCaster)
|
2021-10-05 22:15:58 +00:00
|
|
|
;USKP 2.0.3 - Sanity checks added in case properties are not assigned. Ash Guardians in Dragonborn for example.
|
|
|
|
if( AtronachStormCloak )
|
|
|
|
AtronachStormCloak.Stop(selfRef)
|
|
|
|
EndIf
|
|
|
|
AtronachStormShockFXS.Stop(selfRef)
|
|
|
|
if( FXAtronachStormArmor )
|
|
|
|
selfRef.unEquipItem(FXAtronachStormArmor)
|
|
|
|
EndIf
|
2021-10-05 22:22:24 +00:00
|
|
|
endEvent
|
2021-10-05 22:15:58 +00:00
|
|
|
|
2021-10-05 22:22:24 +00:00
|
|
|
EVENT onDying(actor myKiller)
|
2023-12-08 02:45:53 +00:00
|
|
|
atronachHealth = selfRef.GetActorValue("Health") as int
|
2021-10-05 22:22:24 +00:00
|
|
|
if atronachHealth > 0
|
|
|
|
; debug.trace("health > 0")
|
|
|
|
;USKP 2.0.3 - Sanity checks added in case properties are not assigned. Ash Guardians in Dragonborn for example.
|
|
|
|
if( AtronachStormCloak )
|
|
|
|
AtronachStormCloak.Stop(selfRef)
|
|
|
|
EndIf
|
|
|
|
AtronachStormShockFXS.Stop(selfRef)
|
|
|
|
AtronachUnsummonDeathFXS.Play(selfRef)
|
|
|
|
wait(1.5)
|
|
|
|
;selfRef.disable()
|
|
|
|
elseIf atronachHealth <= 0
|
|
|
|
; debug.trace("health == 0")
|
|
|
|
;USKP 2.0.3 - Sanity checks added in case properties are not assigned. Ash Guardians in Dragonborn for example.
|
|
|
|
if( AtronachStormCloak )
|
|
|
|
AtronachStormCloak.Stop(selfRef)
|
|
|
|
EndIf
|
|
|
|
selfRef.PlaySubGraphAnimation( "StopEffect" )
|
|
|
|
wait(3)
|
|
|
|
AtronachStormShockFXS.Stop(selfRef)
|
|
|
|
if( FXAtronachStormArmor )
|
|
|
|
selfRef.unEquipItem(FXAtronachStormArmor)
|
|
|
|
EndIf
|
|
|
|
endIf
|
|
|
|
ENDEVENT
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------
|
|
|
|
; Added by USSEP 4.1.5 for Bug #13993:
|
|
|
|
;-----------------------------------------------------------------
|
|
|
|
|
|
|
|
Event OnAnimationEvent (ObjectReference akSource, string asEventName)
|
|
|
|
;do nothing
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
function USSEP_RegisterForAnimationEvents (actor actorRef)
|
|
|
|
if actorRef
|
|
|
|
RegisterForAnimationEvent (actorRef, "AutoOneOff")
|
|
|
|
RegisterForAnimationEvent (actorRef, "StopEffect")
|
|
|
|
endif
|
|
|
|
endFunction
|