GetItemPropertyDurationType

From NWN Lexicon



Contents

[edit] GetItemPropertyDurationType(itemproperty)

Gets the duration type of an itemproperty.

[edit] Parameters

ip

Itemproperty to get the duration type of


[edit] Description

Will return the duration type of the item property.



[edit] Remarks

Returns DURATION_TYPE_PERMANENT for permanent itemproperties, and DURATION_TYPE_TEMPORARY for temporary itemproperties.

Returns -1 on error, i.e. if ip is not a valid itemproperty.


[edit] Version

1.61

[edit] Example

//Source code for the IPRemoveAllItemProperties function in
//the x2_inc_itemprop include file
 
// ----------------------------------------------------------------------------
// Removes ALL item properties from oItem matching nItemPropertyDuration
// ----------------------------------------------------------------------------
void IPRemoveAllItemProperties(object oItem, int nItemPropertyDuration = DURATION_TYPE_TEMPORARY)
{
    itemproperty ip = GetFirstItemProperty(oItem);
    while (GetIsItemPropertyValid(ip))
    {
        if (GetItemPropertyDurationType(ip) == nItemPropertyDuration)
        {
            RemoveItemProperty(oItem, ip);
        }
        ip = GetNextItemProperty(oItem);
    }
}

[edit] See Also



 author: Lilac Soul
 

Personal tools
Categories