2023-12-04 15:02:58 +00:00
|
|
|
scriptName magicAttachAshPileOnDeath extends ActiveMagicEffect
|
|
|
|
{Scripted effect for on death ash pile}
|
|
|
|
|
|
|
|
import debug
|
|
|
|
import FormList
|
|
|
|
|
|
|
|
;======================================================================================;
|
|
|
|
; PROPERTIES /
|
|
|
|
;=============/
|
|
|
|
|
|
|
|
float property fDelay = 0.75 auto
|
|
|
|
{time to wait before Spawning Ash Pile}
|
|
|
|
; float property fDelayAlpha = 1.65 auto
|
|
|
|
; {time to wait before Setting alpha to zero.}
|
|
|
|
float property fDelayEnd = 1.65 auto
|
|
|
|
{time to wait before Removing Base Actor}
|
|
|
|
float property ShaderDuration = 0.00 auto
|
|
|
|
{Duration of Effect Shader.}
|
|
|
|
Activator property AshPileObject auto
|
|
|
|
{The object we use as a pile.}
|
|
|
|
EffectShader property MagicEffectShader auto
|
|
|
|
{The Effect Shader we want.}
|
|
|
|
Bool property bSetAlphaZero = True auto
|
|
|
|
{The Effect Shader we want.}
|
|
|
|
FormList Property ImmunityList auto
|
|
|
|
{If the target is in this list, they will not be disintegrated.}
|
|
|
|
Bool property bSetAlphaToZeroEarly = False Auto
|
|
|
|
{Use this if we want to set the acro to invisible somewhere before the effect shader is done.}
|
|
|
|
|
|
|
|
;======================================================================================;
|
|
|
|
; VARIABLES /
|
|
|
|
;=============/
|
|
|
|
|
|
|
|
|
|
|
|
actor Victim
|
|
|
|
race VictimRace
|
|
|
|
bool TargetIsImmune = True
|
|
|
|
; bool DeadAlready = FALSE
|
|
|
|
|
|
|
|
;======================================================================================;
|
|
|
|
; EVENTS /
|
|
|
|
;=============/
|
|
|
|
|
|
|
|
Event OnEffectStart(Actor Target, Actor Caster)
|
|
|
|
victim = target
|
|
|
|
; DeadAlready = Victim.IsDead()
|
2023-12-06 15:31:10 +00:00
|
|
|
;trace("victim == " + victim + ", is this right?")
|
2023-12-04 15:02:58 +00:00
|
|
|
EndEvent
|
|
|
|
|
|
|
|
|
|
|
|
Event OnDying(Actor Killer)
|
|
|
|
|
|
|
|
if ImmunityList == none
|
|
|
|
TargetIsImmune = False
|
|
|
|
else
|
|
|
|
ActorBase VictimBase = Victim.GetBaseObject() as ActorBase
|
|
|
|
VictimRace = VictimBase.GetRace()
|
|
|
|
|
|
|
|
if ImmunityList.hasform(VictimRace)
|
|
|
|
TargetIsImmune = True
|
|
|
|
elseif ImmunityList.hasform(VictimBase)
|
|
|
|
TargetIsImmune = True
|
|
|
|
else
|
|
|
|
TargetIsImmune = False
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if TargetIsImmune == False
|
2023-12-06 15:31:10 +00:00
|
|
|
;trace("victim just died")
|
2023-12-04 15:02:58 +00:00
|
|
|
; DeadAlready = true
|
|
|
|
victim.SetCriticalStage(Victim.CritStage_DisintegrateStart)
|
|
|
|
;victim.SetAlpha (0.99,False)
|
|
|
|
if MagicEffectShader != none
|
|
|
|
MagicEffectShader.play(Victim,ShaderDuration)
|
|
|
|
endif
|
|
|
|
if bSetAlphaToZeroEarly
|
|
|
|
victim.SetAlpha (0.0,True)
|
|
|
|
endif
|
|
|
|
utility.wait(fDelay)
|
|
|
|
Victim.AttachAshPile(AshPileObject)
|
|
|
|
; AshPileRef = AshPileObject
|
|
|
|
; AshPileRef.SetAngle(0.0,0.0,(Victim.GetAngleZ()))
|
|
|
|
utility.wait(fDelayEnd)
|
|
|
|
if MagicEffectShader != none
|
|
|
|
MagicEffectShader.stop(Victim)
|
|
|
|
endif
|
|
|
|
if bSetAlphaZero == True
|
|
|
|
victim.SetAlpha (0.0,True)
|
|
|
|
endif
|
|
|
|
victim.SetCriticalStage(Victim.CritStage_DisintegrateEnd)
|
|
|
|
endif
|
|
|
|
|
|
|
|
EndEvent
|