//:: plchb_wraithrift.nss // Thanks to Clippy for this great example! // This script is a perfect example of a fire-and-forget placeable OnHeartbeat script. // It will apply the visual effect ID stored in local variable "vfx" (set in the toolset) // Then it will remove the event script from the heartbeat so it never fires again. // This is efficient - it will fire the first heartbeat "when ready" (lazily, especially if it's in an area the player isn't) and then never fire it ever again. void main() { int vfx = GetLocalInt(OBJECT_SELF, "vfx"); if (vfx) { ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(vfx), OBJECT_SELF); SetEventScript(OBJECT_SELF, EVENT_SCRIPT_PLACEABLE_ON_HEARTBEAT, ""); } }