// Convert native itemproperty type to unpacked structure public static ItemPropertyUnpacked UnpackIP(Lite.ItemProperty ip) { const string func = "UnpackIP"; NWNXCore.NWNX_PushArgumentItemProperty(ip); NWNXCore.NWNX_CallFunction(PLUGIN_NAME, func); return(new ItemPropertyUnpacked { Id = NWNXCore.NWNX_GetReturnValueString(), Property = NWNXCore.NWNX_GetReturnValueInt(), SubType = NWNXCore.NWNX_GetReturnValueInt(), CostTable = NWNXCore.NWNX_GetReturnValueInt(), CostTableValue = NWNXCore.NWNX_GetReturnValueInt(), Param1 = NWNXCore.NWNX_GetReturnValueInt(), Param1Value = NWNXCore.NWNX_GetReturnValueInt(), UsesPerDay = NWNXCore.NWNX_GetReturnValueInt(), ChanceToAppear = NWNXCore.NWNX_GetReturnValueInt(), IsUseable = Convert.ToBoolean(NWNXCore.NWNX_GetReturnValueInt()), SpellId = NWNXCore.NWNX_GetReturnValueInt(), Creator = NWNXCore.NWNX_GetReturnValueObject(), Tag = NWNXCore.NWNX_GetReturnValueString() }); }