public static ItemPropertyUnpacked UnpackIP(ItemProperty ip) { const string FunctionName = "UnpackIP"; NWNXCore.NWNX_PushArgumentItemProperty(NWNX_ItemProperty, FunctionName, ip); NWNXCore.NWNX_CallFunction(NWNX_ItemProperty, FunctionName); var n = new ItemPropertyUnpacked { ItemPropertyID = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), Property = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), SubType = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), CostTable = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), CostTableValue = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), Param1 = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), Param1Value = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), UsesPerDay = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), ChanceToAppear = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), IsUseable = Convert.ToBoolean(NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName)), SpellID = NWNXCore.NWNX_GetReturnValueInt(NWNX_ItemProperty, FunctionName), Creator = NWNXCore.NWNX_GetReturnValueObject(NWNX_ItemProperty, FunctionName), Tag = NWNXCore.NWNX_GetReturnValueString(NWNX_ItemProperty, FunctionName) }; return(n); }
// 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) }); }