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