Simple/Hard itemproperty Question

Simple question really. Under the hood is the data type itemproperty a struct with all data hidden? I ask because it shares many similarities with the effect data type in the way that it is used and the effect data type is supposed to be a struct with all data hidden.

TR

uhh yes

nwn2:

// 'testip'

//
void Tell(string sTell) { SendMessageToPC(GetFirstPC(FALSE), sTell); }


void main(string sTag)
{
    Tell("\nrun ( testip ) " + GetName(OBJECT_SELF));

    object oItem;

    if (sTag == "")
        oItem = GetPlayerCurrentTarget(OBJECT_SELF);
    else
        oItem = GetObjectByTag(sTag);

    if (!GetIsObjectValid(oItem)
        || GetObjectType(oItem) != OBJECT_TYPE_ITEM)
    {
        Tell(". error : An item must be targeted or its Tag must be specified.");
        return;
    }

    Tell("ITEM : " + GetName(oItem) + " possessor " + GetName(GetItemPossessor(oItem)));

    itemproperty ipTest = GetFirstItemProperty(oItem);
    while (GetIsItemPropertyValid(ipTest))
    {
        int iType           = GetItemPropertyType(ipTest);
        int iDurType        = GetItemPropertyDurationType(ipTest);
        int iSubType        = GetItemPropertySubType(ipTest);
        int iCostTable      = GetItemPropertyCostTable(ipTest);
        int iCostTableValue = GetItemPropertyCostTableValue(ipTest);
        int iParam1         = GetItemPropertyParam1(ipTest);
        int iParam1Value    = GetItemPropertyParam1Value(ipTest);

        Tell(". Type= "           + IntToString(iType));
        Tell(". DurType= "        + IntToString(iDurType));
        Tell(". SubType= "        + IntToString(iSubType));
        Tell(". CostTable= "      + IntToString(iCostTable));
        Tell(". CostTableValue= " + IntToString(iCostTableValue));
        Tell(". Param1= "         + IntToString(iParam1));
        Tell(". Param1Value= "    + IntToString(iParam1Value));

        Tell("\n");

        ipTest = GetNextItemProperty(oItem);
    }
}

Thanks for the confirmation.

TR

1 Like