public static Core.Effect ItemPropertyToEffect(Core.ItemProperty ip) { Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "EffectTypeCast"); Internal.NativeFunctions.nwnxPushItemProperty(ip.Handle); Internal.NativeFunctions.nwnxCallFunction(); return(new Core.Effect(Internal.NativeFunctions.nwnxPopEffect())); }
// Convert native itemproperty type to unpacked structure public static ItemPropertyUnpacked UnpackIP(Core.ItemProperty ip) { Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "UnpackIP"); Internal.NativeFunctions.nwnxPushItemProperty(ip.Handle); Internal.NativeFunctions.nwnxCallFunction(); return(new ItemPropertyUnpacked { Property = Internal.NativeFunctions.nwnxPopInt(), SubType = Internal.NativeFunctions.nwnxPopInt(), CostTable = Internal.NativeFunctions.nwnxPopInt(), CostTableValue = Internal.NativeFunctions.nwnxPopInt(), Param1 = Internal.NativeFunctions.nwnxPopInt(), Param1Value = Internal.NativeFunctions.nwnxPopInt(), UsesPerDay = Internal.NativeFunctions.nwnxPopInt(), ChanceToAppear = Internal.NativeFunctions.nwnxPopInt(), IsUseable = Convert.ToBoolean(Internal.NativeFunctions.nwnxPopInt()), SpellID = Internal.NativeFunctions.nwnxPopInt(), Creator = Internal.NativeFunctions.nwnxPopObject(), Tag = Internal.NativeFunctions.nwnxPopString() }); }
// Convert native itemproperty type to unpacked structure public static ItemPropertyUnpacked UnpackIP(Core.ItemProperty ip) { const string func = "UnpackIP"; NWNXCore.NWNX_PushArgumentItemProperty(PLUGIN_NAME, func, ip); NWNXCore.NWNX_CallFunction(PLUGIN_NAME, func); return(new ItemPropertyUnpacked { Property = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func), SubType = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func), CostTable = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func), CostTableValue = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func), Param1 = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func), Param1Value = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func), UsesPerDay = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func), ChanceToAppear = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func), IsUseable = Convert.ToBoolean(NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func)), SpellID = NWNXCore.NWNX_GetReturnValueInt(PLUGIN_NAME, func), Creator = NWNXCore.NWNX_GetReturnValueObject(PLUGIN_NAME, func), Tag = NWNXCore.NWNX_GetReturnValueString(PLUGIN_NAME, func) }); }
public static Core.ItemProperty NWNX_GetReturnValueItemProperty(string pluginName, string functionName) { Core.ItemProperty ip = NWScript.NWScript.ItemPropertyTrueSeeing(); return(NWScript.NWScript.TagItemProperty(ip, NWNX_INTERNAL_BuildString(pluginName, functionName, "POP"))); }
public static void NWNX_PushArgumentItemProperty(string pluginName, string functionName, Core.ItemProperty value) { NWScript.NWScript.TagItemProperty(value, NWNX_INTERNAL_BuildString(pluginName, functionName, "PUSH")); }