Updated for NWNEE 37-13

Updated for NWNEE 37-13.  Updated NWNxEE.  Full compile. Updated release archive.
This commit is contained in:
Jaysyn904
2025-01-10 20:29:31 -05:00
parent a8639499df
commit 82994dfc26
447 changed files with 10620 additions and 6020 deletions

View File

@@ -2,13 +2,13 @@
/// @brief Utility functions to manipulate the builtin itemproperty type.
/// @{
/// @file nwnx_itemprop.nss
#include "nwnx"
const string NWNX_ItemProperty = "NWNX_ItemProperty"; ///< @private
/// @brief An unpacked itemproperty.
struct NWNX_IPUnpacked
{
string sID; ///< @todo Describe
int nProperty; ///< @todo Describe
int nSubType; ///< @todo Describe
int nCostTable; ///< @todo Describe
@@ -33,49 +33,68 @@ struct NWNX_IPUnpacked NWNX_ItemProperty_UnpackIP(itemproperty ip);
/// @return The itemproperty.
itemproperty NWNX_ItemProperty_PackIP(struct NWNX_IPUnpacked ip);
/// @brief Gets the active item property at the index
/// @param oItem - the item with the property
/// @param nIndex - the index such as returned by some Item Events
/// @return A constructed NWNX_IPUnpacked, except for creator, and spell id.
struct NWNX_IPUnpacked NWNX_ItemProperty_GetActiveProperty(object oItem, int nIndex);
/// @}
struct NWNX_IPUnpacked NWNX_ItemProperty_UnpackIP(itemproperty ip)
{
string sFunc = "UnpackIP";
NWNX_PushArgumentItemProperty(NWNX_ItemProperty, sFunc, ip);
NWNX_CallFunction(NWNX_ItemProperty, sFunc);
NWNXPushItemProperty(ip);
NWNXCall(NWNX_ItemProperty, "UnpackIP");
struct NWNX_IPUnpacked n;
n.nProperty = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.nSubType = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.nCostTable = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.nCostTableValue = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.nParam1 = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.nParam1Value = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.nUsesPerDay = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.nChanceToAppear = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.bUsable = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.nSpellId = NWNX_GetReturnValueInt(NWNX_ItemProperty, sFunc);
n.oCreator = NWNX_GetReturnValueObject(NWNX_ItemProperty, sFunc);
n.sTag = NWNX_GetReturnValueString(NWNX_ItemProperty, sFunc);
n.sID = NWNXPopString();
n.nProperty = NWNXPopInt();
n.nSubType = NWNXPopInt();
n.nCostTable = NWNXPopInt();
n.nCostTableValue = NWNXPopInt();
n.nParam1 = NWNXPopInt();
n.nParam1Value = NWNXPopInt();
n.nUsesPerDay = NWNXPopInt();
n.nChanceToAppear = NWNXPopInt();
n.bUsable = NWNXPopInt();
n.nSpellId = NWNXPopInt();
n.oCreator = NWNXPopObject();
n.sTag = NWNXPopString();
return n;
}
itemproperty NWNX_ItemProperty_PackIP(struct NWNX_IPUnpacked n)
{
string sFunc = "PackIP";
NWNX_PushArgumentString(NWNX_ItemProperty, sFunc, n.sTag);
NWNX_PushArgumentObject(NWNX_ItemProperty, sFunc, n.oCreator);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nSpellId);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.bUsable);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nChanceToAppear);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nUsesPerDay);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nParam1Value);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nParam1);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nCostTableValue);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nCostTable);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nSubType);
NWNX_PushArgumentInt(NWNX_ItemProperty, sFunc, n.nProperty);
NWNX_CallFunction(NWNX_ItemProperty, sFunc);
return NWNX_GetReturnValueItemProperty(NWNX_ItemProperty, sFunc);
NWNXPushString(n.sTag);
NWNXPushObject(n.oCreator);
NWNXPushInt(n.nSpellId);
NWNXPushInt(n.bUsable);
NWNXPushInt(n.nChanceToAppear);
NWNXPushInt(n.nUsesPerDay);
NWNXPushInt(n.nParam1Value);
NWNXPushInt(n.nParam1);
NWNXPushInt(n.nCostTableValue);
NWNXPushInt(n.nCostTable);
NWNXPushInt(n.nSubType);
NWNXPushInt(n.nProperty);
NWNXCall(NWNX_ItemProperty, "PackIP");
return NWNXPopItemProperty();
}
struct NWNX_IPUnpacked NWNX_ItemProperty_GetActiveProperty(object oItem, int nIndex)
{
NWNXPushInt(nIndex);
NWNXPushObject(oItem);
NWNXCall(NWNX_ItemProperty, "GetActiveProperty");
struct NWNX_IPUnpacked n;
n.nProperty = NWNXPopInt();
n.nSubType = NWNXPopInt();
n.nCostTable = NWNXPopInt();
n.nCostTableValue = NWNXPopInt();
n.nParam1 = NWNXPopInt();
n.nParam1Value = NWNXPopInt();
n.nUsesPerDay = NWNXPopInt();
n.nChanceToAppear = NWNXPopInt();
n.bUsable = NWNXPopInt();
n.sTag = NWNXPopString();
return n;
}