Example #1
0
 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()));
 }
Example #2
0
        // 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());
        }
Example #3
0
 // 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()));
 }
Example #4
0
        /// @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());
        }
Example #5
0
 public static void NWNX_PushArgumentEffect(Lite.Effect value)
 {
     TagEffect(value, NWNX_PUSH);
 }