public static Lite.ItemProperty EffectToItemProperty(Lite.Effect effect) { Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "EffectTypeCast"); Internal.NativeFunctions.nwnxPushEffect(effect.Handle); Internal.NativeFunctions.nwnxCallFunction(); return(new Lite.ItemProperty(Internal.NativeFunctions.nwnxPopItemProperty())); }
// Convert native effect type to unpacked structure public static EffectUnpacked UnpackEffect(Lite.Effect effect) { Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "UnpackEffect"); Internal.NativeFunctions.nwnxPushEffect(effect.Handle); Internal.NativeFunctions.nwnxCallFunction(); return(ResolveUnpack()); }
// Set a script with optional data that runs when an effect expires // Only works for TEMPORARY and PERMANENT effects applied to an object // Note: OBJECT_SELF in the script is the object the effect is applied to public static Lite.Effect SetEffectExpiredScript(Lite.Effect effect, string script, string data = "") { Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "SetEffectExpiredScript"); Internal.NativeFunctions.nwnxPushString(data); Internal.NativeFunctions.nwnxPushString(script); Internal.NativeFunctions.nwnxPushEffect(effect.Handle); Internal.NativeFunctions.nwnxCallFunction(); return(new Lite.Effect(Internal.NativeFunctions.nwnxPopEffect())); }
/// @brief replace an already applied effect on an object /// Only duration, subtype, tag and spell related fields can be overwritten. /// @note eNew and eOld need to have the same type. /// @return Number of internal effects updated. public static int ReplaceEffect(uint obj, Lite.Effect eOld, Lite.Effect eNew) { Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "ReplaceEffect"); Internal.NativeFunctions.nwnxPushEffect(eNew); Internal.NativeFunctions.nwnxPushEffect(eOld); Internal.NativeFunctions.nwnxPushObject(obj); Internal.NativeFunctions.nwnxCallFunction(); return(Internal.NativeFunctions.nwnxPopInt()); }
public static void NWNX_PushArgumentEffect(Lite.Effect value) { TagEffect(value, NWNX_PUSH); }