IPRemoveAllItemProperties(object, int)

Removes all itemproperties from an item.

void IPRemoveAllItemProperties(
    object oItem,
    int nItemPropertyDuration = DURATION_TYPE_TEMPORARY
);

Parameters

oItem

Item to remove the properties from.

nItemPropertyDuration

DURATION_TYPE_* (Default: DURATION_TYPE_TEMPORARY)


Description

Removes ALL item properties from oItem matching nItemPropertyDuration



Remarks

The value for nItemPropertyDuration must be either DURATION_TYPE_PERMANENT or DURATION_TYPE_TEMPORARY. The instant duration does not apply to itemproperties.

If the value provided is DURATION_TYPE_PERMANENT, all permanent itemproperties are removed, leaving all temporary ones behind. And vice versa for DURATION_TYPE_TEMPORARY.


Known Bugs

Uses RemoveItemProperty, which has an accumulator
bug that may give an erroneous Stacking error message or affect subsequent functions in the same script.- 1/16/04, NWN Toolset version vts026, game version 1.61.8042 English


Requirements

#include "x2_inc_itemprop"

Version

1.61

Example

#include "x2_inc_itemprop"

//Remove all properties from entering PC's helmet.

void main()
{
//Entering object
object oPC=GetEnteringObject();

//Only PCs
if (!GetIsPC(oPC)) return;

//That PC's helmet
object oItem=GetItemInSlot(INVENTORY_SLOT_HEAD, oPC);

//Stop script if the PC had no helmet on
if (!GetIsObjectValid(oItem)) return;

IPRemoveAllItemProperties(oItem, DURATION_TYPE_PERMANENT);
IPRemoveAllItemProperties(oItem, DURATION_TYPE_TEMPORARY);
}

See Also

functions: IPRemoveMatchingItemProperties | RemoveItemProperty
categories: Item Creation Functions | Item Properties Functions
constants: DURATION_TYPE_* Constants


 author: Lilac Soul, editor: Peter Busby