scriptname nolightobject extends objectreference
form property lightsource auto
event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, Bool abPowerAttack, Bool abSneakAttack, Bool abBashAttack, Bool abHitBlocked)
spell spellsource = akSource as spell
if spellsource && hasmagiceffectwithkeyword(spellsource)
float posx = GetPositionX()
float posy = GetPositiony()
float posz = GetPositionz()
float angx = GetAngleX()
float angy = GetAngleY()
float angz = GetAngleZ()
objectreference lightsourceref = placeatme(lightsource)
disable
delete
lightsourceref.setposition(posx, posy, posz)
lightsourceref.setangle(angx, angy, angz)
endif
endevent
bool function hasmagiceffectwithkeyword(spell akSpell)
int i = GetNumEffects()
while i > 0
i -= 1
if GetNthEffectMagicEffect(i).haskeyword(MagicDamageFire)
return true
endif
endwhile
return false
endfunction
not sure how it would work. And no I don't think the game engine turns on the light by replacing the object. With a skse plugin you can change those light properties directly for the base form but not for the object reference. Not sure what light source object is decoded yet.