83 lines
2.3 KiB
Plaintext
83 lines
2.3 KiB
Plaintext
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
|
|
actor selfRef
|
|
|
|
EVENT OnEffectStart(Actor Target, Actor Caster)
|
|
selfRef = caster
|
|
|
|
;USKP 2.0.1 - Stop this from attaching to the player.
|
|
If selfRef == Game.GetPlayer()
|
|
selfRef = None
|
|
EndIf
|
|
If selfRef == None
|
|
Dispel()
|
|
Return
|
|
EndIf
|
|
|
|
selfRef.PlaySubGraphAnimation( "AutoOneOff" )
|
|
;USKP 2.0.3 - Sanity checks added in case properties are not assigned. Ash Guardians in Dragonborn for example.
|
|
if( AtronachStormCloak )
|
|
AtronachStormCloak.Play(selfRef, -1)
|
|
EndIf
|
|
AtronachStormShockFXS.Play(selfRef)
|
|
if( FXAtronachStormArmor )
|
|
selfRef.EquipItem(FXAtronachStormArmor)
|
|
EndIf
|
|
ENDEVENT
|
|
|
|
Event OnEffectFinish(Actor akTarget, Actor akCaster)
|
|
If selfRef == None
|
|
Return
|
|
EndIf
|
|
|
|
;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
|
|
endEvent
|
|
|
|
EVENT onDying(actor myKiller)
|
|
If selfRef == None
|
|
Return
|
|
EndIf
|
|
|
|
if (selfRef.GetAV("Health") as int) > 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()
|
|
Else ; atronach health <= 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
|
|
|
|
|