Returns the equipped armor or shield of a spell target.

object IPGetTargetedOrEquippedArmor(
    int bAllowShields = FALSE



Whether to count shields as armor. (Default: FALSE)


This function is to be used within a spell script.

If the spell target is an item, the function checks whether the item is an armor (or a shield) and returns the item on a successful check. The item need not be equipped.

If the spell target is a creature, the function checks whether the creature has an armor (or a shield) equipped and returns any equipped armor (or shield).

If the targeted creature has no armor (or shield) equipped or the targeted item is not an armor (or shield), OBJECT_INVALID is returned.

If bAllowShields is TRUE, the function checks for armor or shields, otherwise it only checks for armor.

If a targeted creature has both armor and a shield equipped, the armor is returned.


This function only produces reliable results if called from a spell script. It calls GetSpellTargetObject which only makes sense within a spell script.

This is an internal function. See the note near the top of #include index for more details.


#include "x2_inc_itemprop"



See Also

functions:  IPGetTargetedOrEquippedMeleeWeapon
constants:  BASE_ITEM_*
categories:  Get Data from Creature Functions | Get Data from Object Functions | Item Properties Functions

author: motu99, editor: Mistress