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.
 
 
 

78 lines
1.9 KiB

Scriptname _00E_FS_NQ07_LightScript extends activemagiceffect
;=====================================================================================
; EVENTS
;=====================================================================================
bool bActive
Event OnEffectStart(Actor akTarget, Actor akCaster)
bActive = true
EnableAllRefsInFormlist()
EndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
bActive = false
DisableAllRefsInFormlist()
EndEvent
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function EnableAllRefsInFormlist()
int iIndex = _00E_FS_NQ07_LightList.GetSize()
while iIndex > 0
if ! bActive
return
endif
iIndex -= 1
ObjectReference ref = _00E_FS_NQ07_LightList.GetAt(iIndex) as ObjectReference
ref.EnableNoWait()
ref.GetLinkedRef().EnableNoWait()
if ref.Is3DLoaded()
_00E_TeleportOutVFX.Play(ref)
MAGIllusionNightEyeOn.Play(ref)
endif
endwhile
EndFunction
Function DisableAllRefsInFormlist()
int iIndex = _00E_FS_NQ07_LightList.GetSize()
while iIndex > 0
iIndex -= 1
ObjectReference ref = _00E_FS_NQ07_LightList.GetAt(iIndex) as ObjectReference
if ref.Is3DLoaded()
MAGIllusionNightEyeOff.Play(ref)
endif
ref.DisableNoWait()
ref.GetLinkedRef().DisableNoWait()
endwhile
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
VisualEffect Property _00E_TeleportOutVFX Auto
Sound Property MAGIllusionNightEyeOn Auto
Sound Property MAGIllusionNightEyeOff Auto
FormList Property _00E_FS_NQ07_LightList Auto