nwnxee / unified

Binaries available under the Releases tab on Github
https://nwnxee.github.io/unified
GNU General Public License v3.0
131 stars 92 forks source link

NWNX_Structs #31

Closed zunath closed 5 years ago

zunath commented 6 years ago

https://github.com/NWNX/nwnx2-linux/blob/master/plugins/structs/nwnx_structs.nss

In the old NWNX_Structs plugin we had the ability to do a lot of things which manipulated internal structures. One feature in particular that I need is a way to add custom item properties onto items. I was able to do it before using code like this:


itemproperty ItemPropertyDirect (int nType, int nSubType, int nCostTable, int nCostValue, int nParamTable, int nParamValue)
{
    itemproperty ip = ItemPropertyAdditional(0);

    SetItemPropertyInteger(ip, 0, nType);
    SetItemPropertyInteger(ip, 1, nSubType);
    SetItemPropertyInteger(ip, 2, nCostTable);
    SetItemPropertyInteger(ip, 3, nCostValue);
    SetItemPropertyInteger(ip, 4, nParamTable);
    SetItemPropertyInteger(ip, 5, nParamValue);

    return ip;
}

Which created a normal item property and then turned around and overwrote its settings. It was a really good workaround for adding custom item properties to items.

Liareth commented 6 years ago

For this to work, the core needs the ability to push and pop effects and item properties like it does the other primitive data types.