GetItemPropertyType

From NWN Lexicon



Contents

[edit] GetItemPropertyType(itemproperty)

Returns the type of itemproperty a property is.

[edit] Parameters

ip

Itemproperty to get the type of.


[edit] Description

Will return the item property type.



[edit] Remarks

Returns ITEM_PROPERTY_*.

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

Can be used to remove itemproperties of a certain type from an item.


[edit] Version

1.61

[edit] Example

//Remove true seeing from the entering PC's headgear
 
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;
 
//Get the first itemproperty on the helmet
itemproperty ipLoop=GetFirstItemProperty(oItem);
 
//Loop for as long as the ipLoop variable is valid
while (GetIsItemPropertyValid(ipLoop))
   {
   //If ipLoop is a true seeing property, remove it
   if (GetItemPropertyType(ipLoop)==ITEM_PROPERTY_TRUE_SEEING)
      RemoveItemProperty(oItem, ipLoop);
 
   //Next itemproperty on the list...
   ipLoop=GetNextItemProperty(oItem);
   }
 
SendMessageToPC(oPC, IntToString(GetItemPropertyType(ipLoop)));
}

[edit] See Also

functions: 

RemoveItemProperty



 author: Lilac Soul
 

Personal tools
Categories