GetIsImmune(object, int, object)

Determines whether a creature has a specific immunity.

int GetIsImmune(
    object oCreature,
    int nImmunityType,
    object oVersus = OBJECT_INVALID
);

Parameters

oCreature

The creature to check immunity for.

nImmunityType

IMMUNITY_TYPE_*

oVersus

If this is specified, then we also check for the race and alignment of oVersus. (Default: OBJECT_INVALID)


Description

Returns TRUE if oCreature has immunity of type nImmunity versus oVersus, otherwise FALSE.

oVersus should only change what is returned if an effect is applied with EffectVersusAlignment(), such as Protection from Evil, or EffectVersusRacialType().



Remarks

From version 1.62+, this correctly checks feats (such as a Paladins fear immunity) as well as item/spell immunities.


Version

1.22

See Also

functions: EffectSpellImmunity
categories: Miscellaneous Functions
constants: IMMUNITY_TYPE_* Constants


 author: Tom Cassiotis, editor: Jasperre