IPGetHasItemPropertyOnCharacter(object, int)

Returns whether a character has an item with a certain itemproperty type equipped.

int IPGetHasItemPropertyOnCharacter(
    object oPC,
    int nItemPropertyConst
);

Parameters

oPC

Character to check for itemproperty.

nItemPropertyConst

ITEM_PROPERTY_*


Description

Returns TRUE if a character has any item equipped that has the itemproperty defined in nItemPropertyConst in it (ITEM_PROPERTY_* constant)



Remarks

This function performs a lot of loops, so you might want to be a little careful using it too often.


Known Bugs

Confirmed as of patch 1.61, this function does not check the left hand (offhand) item equipped by oPC.


Requirements

#include "x2_inc_itemprop"

Version

1.61

Example

#include "x2_inc_itemprop"

//The NPC doesn't like people with vampiric regeneration on their items
//put this on the line the NPC will speak if the PC does NOT have vampiric regen
int StartingConditional()
{
object oPC=GetPCSpeaker();

return !IPGetHasItemPropertyOnCharacter(oPC, ITEM_PROPERTY_REGENERATION_VAMPIRIC);
}

See Also

categories: Get Data from Creature Functions | Get Data from Object Functions | Item Properties Functions
constants: ITEM_PROPERTY_* Constants


 author: Lilac Soul, additional contributor(s): Stefan Vitz