enderalse/source/scripts/draugrfxscriptenderal.psc

73 lines
1.8 KiB
Plaintext
Raw Normal View History

2024-02-14 22:41:44 +00:00
Scriptname DraugrFXScriptEnderal extends ActiveMagicEffect
{Attaches and manages fx}
import utility
import form
;===============================================
Actor selfRef
ActorBase myActorBase
VisualEffect Property DraugrMaleEyeGlowFX Auto
VisualEffect Property DraugrFemaleEyeGlowFX Auto
2021-10-05 22:46:41 +00:00
EVENT OnEffectStart(Actor Target, Actor Caster)
selfRef = caster
2021-10-05 22:46:41 +00:00
;Added by USKP to prevent this effect from appearing on the player.
2024-02-14 22:41:44 +00:00
If selfRef == Game.GetForm(0x14)
2021-10-05 22:46:41 +00:00
selfRef = None
EndIf
If selfRef == None
Dispel()
return
EndIf
;USKP 2.0.3 - Don't bother with any of this if the dumb zombie isn't loaded!
If selfRef.Is3DLoaded()
myActorBase = selfRef.GetLeveledActorBase()
2021-10-05 22:22:24 +00:00
2021-10-05 22:46:41 +00:00
Int mySex = myActorBase.GetSex()
If (selfRef.GetSleepState() == 3)
; Debug.Trace("Draugr is sleeping! 3")
Elseif mySex == 0 ; If sex is male (only one currently working) play glow eye art
DraugrMaleEyeGlowFX.Play(selfRef, -1)
ElseIf mySex == 1 ; If sex is female (currently not returned) play debug text to say this is now working
DraugrFemaleEyeGlowFX.Play(selfRef, -1)
2021-10-05 22:22:24 +00:00
EndIf
2021-10-05 22:46:41 +00:00
EndIf
ENDEVENT
Event OnGetUp(ObjectReference akFurniture)
; Debug.Trace("Draugr just got up from " )
;Added by USKP to prevent this effect from appearing on the player.
if selfRef == None
Return
EndIf
2021-10-05 22:22:24 +00:00
2021-10-05 22:46:41 +00:00
; USKP 2.0.1 - Sanity check because the actorbase property isn't always valid when this runs.
If myActorBase
Int mySex = myActorBase.GetSex()
If mySex == 0
DraugrMaleEyeGlowFX.Play(selfRef, -1)
ElseIf mySex == 1
DraugrFemaleEyeGlowFX.Play(selfRef, -1)
EndIf
EndIf
EndEvent
Event OnDying(Actor myKiller)
utility.Wait(3.0)
StopEyes()
EndEvent
2021-10-05 22:46:41 +00:00
EVENT onDeath(actor myKiller)
StopEyes()
ENDEVENT
Function StopEyes()
if selfRef
DraugrMaleEyeGlowFX.Stop(selfRef)
DraugrFemaleEyeGlowFX.Stop(selfRef)
2021-10-05 22:46:41 +00:00
EndIf
EndFunction