public static NWN.ItemProperty EffectToItemProperty(NWN.Effect effect)
 {
     Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "EffectTypeCast");
     Internal.NativeFunctions.nwnxPushEffect(effect.Handle);
     Internal.NativeFunctions.nwnxCallFunction();
     return(new NWN.ItemProperty(Internal.NativeFunctions.nwnxPopItemProperty()));
 }
Exemple #2
0
 /// <summary>
 ///  Apply eEffect at lLocation.
 /// </summary>
 public static void ApplyEffectAtLocation(DurationType nDurationType, NWN.Effect eEffect, NWN.Location lLocation, float fDuration = 0.0f)
 {
     NWN.Internal.NativeFunctions.StackPushFloat(fDuration);
     NWN.Internal.NativeFunctions.StackPushLocation(lLocation.Handle);
     NWN.Internal.NativeFunctions.StackPushEffect(eEffect.Handle);
     NWN.Internal.NativeFunctions.StackPushInteger((int)nDurationType);
     NWN.Internal.NativeFunctions.CallBuiltIn(216);
 }
Exemple #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 NWN.Effect SetEffectExpiredScript(NWN.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 NWN.Effect(Internal.NativeFunctions.nwnxPopEffect()));
 }
Exemple #4
0
        // Convert native effect type to unpacked structure
        public static EffectUnpacked UnpackEffect(NWN.Effect effect)
        {
            Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "GetCurrentNodeType");
            Internal.NativeFunctions.nwnxPushEffect(effect.Handle);
            Internal.NativeFunctions.nwnxCallFunction();

            var newEffect = new EffectUnpacked {
                Tag               = Internal.NativeFunctions.nwnxPopString(),
                oParam3           = Internal.NativeFunctions.nwnxPopObject().AsObject(),
                oParam2           = Internal.NativeFunctions.nwnxPopObject().AsObject(),
                oParam1           = Internal.NativeFunctions.nwnxPopObject().AsObject(),
                oParam0           = Internal.NativeFunctions.nwnxPopObject().AsObject(),
                sParam5           = Internal.NativeFunctions.nwnxPopString(),
                sParam4           = Internal.NativeFunctions.nwnxPopString(),
                sParam3           = Internal.NativeFunctions.nwnxPopString(),
                sParam2           = Internal.NativeFunctions.nwnxPopString(),
                sParam1           = Internal.NativeFunctions.nwnxPopString(),
                sParam0           = Internal.NativeFunctions.nwnxPopString(),
                fParam3           = Internal.NativeFunctions.nwnxPopFloat(),
                fParam2           = Internal.NativeFunctions.nwnxPopFloat(),
                fParam1           = Internal.NativeFunctions.nwnxPopFloat(),
                fParam0           = Internal.NativeFunctions.nwnxPopFloat(),
                nParam7           = Internal.NativeFunctions.nwnxPopInt(),
                nParam6           = Internal.NativeFunctions.nwnxPopInt(),
                nParam5           = Internal.NativeFunctions.nwnxPopInt(),
                nParam4           = Internal.NativeFunctions.nwnxPopInt(),
                nParam3           = Internal.NativeFunctions.nwnxPopInt(),
                nParam2           = Internal.NativeFunctions.nwnxPopInt(),
                nParam1           = Internal.NativeFunctions.nwnxPopInt(),
                nParam0           = Internal.NativeFunctions.nwnxPopInt(),
                NumIntegers       = Internal.NativeFunctions.nwnxPopInt(),
                LinkRightValid    = Internal.NativeFunctions.nwnxPopInt(),
                LinkRight         = new NWN.Effect(Internal.NativeFunctions.nwnxPopEffect()),
                LinkLeftValid     = Internal.NativeFunctions.nwnxPopInt(),
                LinkLeft          = new NWN.Effect(Internal.NativeFunctions.nwnxPopEffect()),
                CasterLevel       = Internal.NativeFunctions.nwnxPopInt(),
                ShowIcon          = Internal.NativeFunctions.nwnxPopInt(),
                Expose            = Internal.NativeFunctions.nwnxPopInt(),
                SpellID           = Internal.NativeFunctions.nwnxPopInt(),
                Creator           = Internal.NativeFunctions.nwnxPopObject().AsObject(),
                ExpiryTimeOfDay   = Internal.NativeFunctions.nwnxPopInt(),
                ExpiryCalendarDay = Internal.NativeFunctions.nwnxPopInt(),
                Duration          = Internal.NativeFunctions.nwnxPopFloat(),
                SubType           = Internal.NativeFunctions.nwnxPopInt(),
                Type              = Internal.NativeFunctions.nwnxPopInt(),
                EffectID          = Internal.NativeFunctions.nwnxPopInt()
            };

            return(newEffect);
        }
Exemple #5
0
 public static void StackPushEffect(NWN.Effect value)
 {
     StackPushEffect_Native(value.m_Handle);
 }