4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

59 lines
1.5 KiB

Scriptname SprigganSwarmActorSCRIPT extends ActiveMagicEffect conditional
{Attaches and manages witchlights's fx}
;======================================================================================;
; IMPORTS /
;=============/
import utility
import form
import game
;======================================================================================;
; PROPERTIES /
;=============/
VisualEffect Property SprigganSwarmFXAttachEffect Auto
objectReference property mySprigganSwarm auto conditional hidden
actorBase property SprigganSwarmBase auto
;======================================================================================;
; VARIABLES /
;=============/
ObjectReference selfRef
;======================================================================================;
; EVENTS /
;=============/
EVENT OnEffectStart(Actor Target, Actor Caster)
selfRef = caster
;Added by USKP to prevent this effect from appearing on the player.
If selfRef == Game.GetPlayer()
Dispel()
return
EndIf
selfRef.RegisterForSingleUpdate(0.25)
int i = 10 ; recursion limiter for 3dLoaded check
while selfRef.is3dLoaded() == FALSE
; wait for onLoad() to complete
; too costly ???
if i >= 10
; debug.trace("Recursion of limit ("+i+") hit by: "+self)
return
else
i+=1
; debug.trace("While() recursion ("+i+")")
endif
endWhile
; only attack FX once the3D is loaded
SprigganSwarmFXAttachEffect.Play(selfRef, -1)
ENDEVENT
EVENT onDeath(actor myKiller)
SprigganSwarmFXAttachEffect.Stop(selfRef)
ENDEVENT