IPGetItemHasProperty(object, itemproperty, int, int)

Checks if an item has a matching itemproperty.

int IPGetItemHasProperty(
    object oItem,
    itemproperty ipCompareTo,
    int nDurationType,
    int bIgnoreSubType = FALSE
);

Parameters

oItem

Item to check for property.

ipCompareTo

ItemProperty to compare to

nDurationType

See description and remarks.

bIgnoreSubType

TRUE to ignore subtype. Otherwise FALSE. (Default: FALSE)


Description

Wrapper for GetItemHasItemProperty that returns true if oItem has an itemproperty that matches ipCompareTo by Type AND DurationType AND SubType

nDurationType = Valid DURATION_TYPE_* or -1 to ignore
bIgnoreSubType - If set to TRUE an item property will be considered identical even if the SubType is different.



Remarks

Only DURATION_TYPE_TEMPORARY, DURATION_TYPE_PERMANENT, and -1 are valid for nDurationType.

This differs from GetItemHasItemProperty in several ways. First of all because it also takes duration type and subtype into account. And also because it uses an itemproperty value for parameter, instead of the ITEM_PROPERTY_* integer constant.

Returns TRUE if oItem has the same type of itemproperty that ipCompareTo is. If nDurationType is different from -1, it also needs to be that same duration type. If bIgnoreSubType is FALSE, it also needs to be of the same subtype.

Returns FALSE if the above isn't mean. It also prints "Not Found" to the log.


Requirements

#include "x2_inc_itemprop"

Version

1.62

See Also

functions: GetItemHasItemProperty
categories: Get Data from Object Functions | Item Creation Functions | Item Properties Functions
constants: DURATION_TYPE_* Constants


 author: Lilac Soul, editor: Mistress, contributor: Kolyana