Updated SprigganFXSCRIPT

This commit is contained in:
Eddoursul 2024-01-27 03:24:11 +01:00
parent fd7a9aaa3c
commit d59ee1f499
2 changed files with 77 additions and 72 deletions

Binary file not shown.

View File

@ -7,36 +7,35 @@ VisualEffect Property SprigganFXAttachEffect Auto
Spell Property crSprigganHeal01 Auto
Spell Property crSprigganCallCreatures Auto
Idle Property FFselfIdle Auto
bool bBledout
bool bIsDead
bool bAnimEffects = true
;===============================================
auto state Alive
EVENT OnEffectStart(Actor Target, Actor Caster)
if Target == None
Return
EndIf
If Target.IsDead() || Target == Game.GetForm(0x14)
event OnEffectStart(Actor Target, Actor Caster)
If ! Target || Target == Game.GetForm(0x14)
GotoState("DoNothing")
Dispel()
return
EndIf
;test to see if spriggan is not in ambush mode
if (Target.IsInCombat() || Target.GetSleepState() == 0) && Target.Is3DLoaded()
SprigganFXAttachEffect.Play(Target, -1)
if bAnimEffects
bAnimEffects = false
Target.PlaySubGraphAnimation("KillFX")
endif
ENDEVENT
; May fire when dispelled with a script or console
Event OnEffectFinish(Actor akTarget, Actor akCaster)
If Target.IsDead()
GotoState("DoNothing")
Dispel()
EndIf
endevent
event OnEffectFinish(Actor akTarget, Actor akCaster)
GotoState("DoNothing")
SprigganFXAttachEffect.Stop(akTarget)
endEvent
endevent
EVENT onCombatStateChanged(Actor akTarget, int aeCombatState)
event OnCombatStateChanged(Actor akTarget, int aeCombatState)
Actor actorRef = GetTargetActor()
if ! actorRef || ! actorRef.Is3DLoaded()
@ -53,92 +52,98 @@ auto state Alive
endif
if aeCombatState == 1
if ! bAnimEffects
bAnimEffects = true
actorRef.PlaySubGraphAnimation("Revive")
endif
SprigganFXAttachEffect.Play(actorRef, -1)
actorRef.playIdle(FFselfIdle)
Utility.Wait(Utility.RandomFloat(1.0, 4.0))
crSprigganCallCreatures.cast(actorRef, actorRef)
Utility.Wait(Utility.RandomFloat(1.0, 3.0))
if GetState() == "Alive"
crSprigganCallCreatures.cast(actorRef, actorRef)
endif
endif
endEVENT
endevent
Event OnGetUp(ObjectReference akFurniture)
Actor actorRef = GetTargetActor()
if ! actorRef
return
endif
SprigganFXAttachEffect.Play(actorRef, -1)
actorRef.PlaySubGraphAnimation("Revive")
endEvent
EVENT onDying(actor myKiller)
GotoState("Dying")
ENDEVENT
EVENT onDeath(actor myKiller)
event onDying(actor myKiller)
GotoState("Dying")
endevent
Event OnEnterBleedout()
if bBledout
return
endif
bBledout = true
RegisterForSingleUpdate(2.0)
ENDEVENT
event onDeath(actor myKiller)
GotoState("Dying")
endevent
; Heals itself
event OnUpdate()
event OnEnterBleedout()
Actor actorRef = GetTargetActor()
SprigganFXAttachEffect.Stop(actorRef)
if ! actorRef
if actorRef.GetActorValue("Variable07")
RegisterForAnimationEvent(actorRef, "BleedoutStop")
return
endif
if actorRef.Is3DLoaded()
actorRef.SetActorValue("Variable07", 1)
Utility.Wait(Utility.RandomFloat(2.0, 3.5))
if GetState() == "Alive"
RegisterForAnimationEvent(actorRef, "BleedoutStop")
crSprigganHeal01.Cast(actorRef)
actorRef.setActorValue("variable07",1)
Utility.Wait(Utility.RandomFloat(1.5, 2.5))
actorRef.evaluatePackage()
actorRef.EvaluatePackage()
endif
endevent
event OnAnimationEvent(ObjectReference akSource, string asEventName)
UnregisterForAnimationEvent(akSource, asEventName)
SprigganFXAttachEffect.Play(akSource)
endevent
endstate
state Dying
event OnBeginState()
RegisterForSingleUpdate(Utility.RandomFloat(2.5, 4.5))
endevent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
GotoState("DoNothing")
akTarget.PlaySubGraphAnimation("KillFX")
endEvent
event OnBeginState()
RegisterForSingleUpdate(Utility.RandomFloat(2.0, 3.5))
UnregisterForAnimationEvent(GetTargetActor(), "BleedoutStop")
endevent
event OnCellAttach()
RegisterForSingleUpdate(1.0)
endevent
event OnCellDetach()
UnregisterForUpdate()
GotoState("Dead")
SprigganFXAttachEffect.Stop(GetTargetActor())
Dispel()
endevent
event OnUpdate()
if bIsDead
Dispel()
return
endif
bIsDead = true
Actor actorRef = GetTargetActor()
if actorRef
SprigganFXAttachEffect.Stop(actorRef)
endif
SprigganFXAttachEffect.Stop(GetTargetActor())
GotoState("Dead")
RegisterForSingleUpdate(Utility.RandomFloat(3.0, 7.5))
endevent
endstate
state Dead
event OnUpdate()
Dispel()
endevent
event OnEffectFinish(Actor akTarget, Actor akCaster)
GotoState("DoNothing")
if bAnimEffects
bAnimEffects = false
akTarget.PlaySubGraphAnimation("KillFX")
endif
endevent
endstate
state DoNothing
endstate
; Compiler wants it here
Event OnEnterBleedout()
ENDEVENT
event OnEnterBleedout()
endevent