NWNX:EE  8193.37.14
nwnx_itemprop.nss
Go to the documentation of this file.
1 
6 const string NWNX_ItemProperty = "NWNX_ItemProperty";
7 
10 {
11  string sID;
12  int nProperty;
13  int nSubType;
14  int nCostTable;
16  int nParam1;
20  int bUsable;
21  int nSpellId;
22  object oCreator;
23  string sTag;
24 };
25 
29 struct NWNX_IPUnpacked NWNX_ItemProperty_UnpackIP(itemproperty ip);
30 
34 itemproperty NWNX_ItemProperty_PackIP(struct NWNX_IPUnpacked ip);
35 
40 struct NWNX_IPUnpacked NWNX_ItemProperty_GetActiveProperty(object oItem, int nIndex);
41 
43 
44 struct NWNX_IPUnpacked NWNX_ItemProperty_UnpackIP(itemproperty ip)
45 {
46  NWNXPushItemProperty(ip);
47  NWNXCall(NWNX_ItemProperty, "UnpackIP");
48  struct NWNX_IPUnpacked n;
49  n.sID = NWNXPopString();
50  n.nProperty = NWNXPopInt();
51  n.nSubType = NWNXPopInt();
52  n.nCostTable = NWNXPopInt();
53  n.nCostTableValue = NWNXPopInt();
54  n.nParam1 = NWNXPopInt();
55  n.nParam1Value = NWNXPopInt();
56  n.nUsesPerDay = NWNXPopInt();
57  n.nChanceToAppear = NWNXPopInt();
58  n.bUsable = NWNXPopInt();
59  n.nSpellId = NWNXPopInt();
60  n.oCreator = NWNXPopObject();
61  n.sTag = NWNXPopString();
62  return n;
63 }
64 
66 {
67  NWNXPushString(n.sTag);
68  NWNXPushObject(n.oCreator);
69  NWNXPushInt(n.nSpellId);
70  NWNXPushInt(n.bUsable);
71  NWNXPushInt(n.nChanceToAppear);
72  NWNXPushInt(n.nUsesPerDay);
73  NWNXPushInt(n.nParam1Value);
74  NWNXPushInt(n.nParam1);
75  NWNXPushInt(n.nCostTableValue);
76  NWNXPushInt(n.nCostTable);
77  NWNXPushInt(n.nSubType);
78  NWNXPushInt(n.nProperty);
79  NWNXCall(NWNX_ItemProperty, "PackIP");
80  return NWNXPopItemProperty();
81 }
82 
83 struct NWNX_IPUnpacked NWNX_ItemProperty_GetActiveProperty(object oItem, int nIndex)
84 {
85  NWNXPushInt(nIndex);
86  NWNXPushObject(oItem);
87  NWNXCall(NWNX_ItemProperty, "GetActiveProperty");
88  struct NWNX_IPUnpacked n;
89  n.nProperty = NWNXPopInt();
90  n.nSubType = NWNXPopInt();
91  n.nCostTable = NWNXPopInt();
92  n.nCostTableValue = NWNXPopInt();
93  n.nParam1 = NWNXPopInt();
94  n.nParam1Value = NWNXPopInt();
95  n.nUsesPerDay = NWNXPopInt();
96  n.nChanceToAppear = NWNXPopInt();
97  n.bUsable = NWNXPopInt();
98  n.sTag = NWNXPopString();
99  return n;
100 }
itemproperty NWNX_ItemProperty_PackIP(struct NWNX_IPUnpacked ip)
Convert unpacked itemproperty structure to native type.
struct NWNX_IPUnpacked NWNX_ItemProperty_UnpackIP(itemproperty ip)
Convert native itemproperty type to unpacked structure.
struct NWNX_IPUnpacked NWNX_ItemProperty_GetActiveProperty(object oItem, int nIndex)
Gets the active item property at the index.
An unpacked itemproperty.