GetHasEffect(int, object)

From NWN Lexicon
Jump to navigationJump to search

Determines whether a creature has an effect.

int GetHasEffect(
    int nEffectType,
    object oTarget = OBJECT_SELF
);

Parameters

nEffectType
The type of effect, from the constant list EFFECT_TYPE_*, we are interested in.
oTarget
The object to investigate. (Default: OBJECT_SELF)

Description

Returns TRUE if oTarget has the effect nEffectType active, otherwise FALSE.

Requirements

#include "x0_i0_match"

Version

1.28

Example

#include "x0_i0_match"

void main()
{
    int isPoisoned = GetHasEffect(EFFECT_TYPE_POISON, GetFirstPC());
    int isParalyzed = GetHasEffect(EFFECT_TYPE_PARALYZE, GetFirstPC());
}

See Also

constants:  EFFECT_TYPE_* Constants

 author: Tom Cassiotis, editors: Charles Feduke, Mistress