//:: plchb_darkmote.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"); //int vfx = 11; //if (vfx) //ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(vfx), OBJECT_SELF); //ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectAreaOfEffect(AOE_PER_DARKNESS, "NW_S0_DarknessA", "NW_S0_DarknessB", ""), OBJECT_SELF); ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectAreaOfEffect(AOE_PER_DARKNESS, "NW_S0_DarknessA", "", "NW_S0_DarknessB"), GetLocation(OBJECT_SELF)); SetEventScript(OBJECT_SELF, EVENT_SCRIPT_PLACEABLE_ON_HEARTBEAT, ""); }