GetEffectType

From NWN Lexicon
Jump to: navigation, search

GetEffectType(effect)

Get the type constant of the effect.

int GetEffectType(
    effect eEffect
);

Parameters

eEffect

The effect to compare or examine.

Description

Returns the effect type (EFFECT_TYPE_*) of the effect being examined.

Return EFFECT_TYPE_INVALIDEFFECT if effect is invalid.

Remarks

You must first create and place the effect you wish to examine into a variable before calling this function. Useful when you need to check if a player is under the effects of a certain type before doing something else to them with your scripts. A good example would be checking for protection from evil effects before allowing an evil creature to close to them.

Certain type of valid effects also returns EFFECT_TYPE_INVALIDEFFECT, namely:
Knockdown
Taunt
Summon

EDIT FROM PREVIOUS REMARKS: It was previously mentioned that visual effects have no effecttype. This is incorrect, this function will return EFFECT_TYPE_VISUALEFFECT for visual effects.

Version

1.61

See Also

functions: 

RemoveEffect

constants: 

EFFECT_TYPE_* Constants


 author: John Shuell, editor: Lilac Soul