GetIsMagicalItem(object)

Returns TRUE if oItem has any item property that classifies it as magical item.

int GetIsMagicalItem(
    object oItem
);

Parameters

oItem

Item which origination had to be determined.


Description

Returns TRUE if oItem has at least one "magical" item property. Returns FALSE if no magical item property is found.

Those are almost all of them even light so basically only very few items are really non-magical.



Remarks

Returns TRUE if oItem has any of the following item properties:
ITEM_PROPERTY_ABILITY_BONUS ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER ITEM_PROPERTY_LIGHT
ITEM_PROPERTY_AC_BONUS ITEM_PROPERTY_DECREASED_DAMAGE ITEM_PROPERTY_MASSIVE_CRITICALS
ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER ITEM_PROPERTY_MIGHTY
ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE ITEM_PROPERTY_DECREASED_SAVING_THROWS ITEM_PROPERTY_MIND_BLANK
ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC ITEM_PROPERTY_MONSTER_DAMAGE
ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT ITEM_PROPERTY_DECREASED_SKILL_MODIFIER ITEM_PROPERTY_NO_DAMAGE
ITEM_PROPERTY_ATTACK_BONUS ITEM_PROPERTY_ENHANCED_CONTAINER_REDUCED_WEIGHT ITEM_PROPERTY_ON_HIT_PROPERTIES
ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP ITEM_PROPERTY_ENHANCEMENT_BONUS ITEM_PROPERTY_ON_MONSTER_HIT
ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP ITEM_PROPERTY_ONHITCASTSPELL
ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP ITEM_PROPERTY_POISON
ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT ITEM_PROPERTY_REGENERATION
ITEM_PROPERTY_BONUS_FEAT ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE ITEM_PROPERTY_REGENERATION_VAMPIRIC
ITEM_PROPERTY_CAST_SPELL ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE ITEM_PROPERTY_SAVING_THROW_BONUS
ITEM_PROPERTY_DAMAGE_BONUS ITEM_PROPERTY_FREEDOM_OF_MOVEMENT ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC
ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP ITEM_PROPERTY_HASTE ITEM_PROPERTY_SKILL_BONUS
ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP ITEM_PROPERTY_HOLY_AVENGER ITEM_PROPERTY_SPELL_RESISTANCE
ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE ITEM_PROPERTY_THIEVES_TOOLS
ITEM_PROPERTY_DAMAGE_REDUCTION ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS ITEM_PROPERTY_TRAP
ITEM_PROPERTY_DAMAGE_RESISTANCE ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL ITEM_PROPERTY_TRUE_SEEING
ITEM_PROPERTY_DAMAGE_VULNERABILITY ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL ITEM_PROPERTY_TURN_RESISTANCE
ITEM_PROPERTY_DARKVISION ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL ITEM_PROPERTY_UNLIMITED_AMMUNITION
ITEM_PROPERTY_DECREASED_ABILITY_SCORE ITEM_PROPERTY_IMPROVED_EVASION
ITEM_PROPERTY_DECREASED_AC ITEM_PROPERTY_KEEN


That leaves the following item properties as not considered to be magical by this function:


Requirements

#include "x2_i0_spells"


Known Bugs

It seems that this function is very old and was not updated when the new item properties showed up in patches. This function does not take into account arcane spell failure decrease and bonus spell slots for specified spell levels. Also this function considers even thieves tools or trap devices as magical items, but they are not.


Version

???

See Also

functions:  GetFirstItemProperty | GetIsItemPropertyValid | GetItemHasItemProperty | GetNextItemProperty
constants:  ITEM_PROPERTY_*
categories:  Get Data from Object Functions


author: ShaDoOoW, editors: Mistress, Kolyana