GetEffectSpellId(effect)

From NWN Lexicon
Jump to navigationJump to search

This will return the constant of the spell that applied the effect (SPELL_*).

int GetEffectSpellId(
    effect eSpellEffect
);

Parameters

eSpellEffect
The effect that you wish to examine.


Description

Returns the constant defining the Spell used to apply this effect on the creature.

Will Return -1 if eSpellEffect was not applied by a spell script.


Remarks

You must first create and place the effect you wish to examine into a variable before calling this function. Very useful if you are looking for all the effects of a particular spell or leaving out effects of certain spells. One example could be when you wish to dispel all effects on a creature except those granted by a wish spell.

You can now set the spell Id (or remove it - ie, -1) by using SetEffectSpellId.

Applying duplicate effects from the same spell ID source do not stack (the highest one applies) in certain instances, which can help with overlapping bonuses or penalties from spells, these effects include:

Notably missing from this list are a lot of things; AC increases/decreases (although the highest only applies from *all* sources, except Dodge which stacks), damage immunity increases/decreases, spell resistance increases/decreases, damage resistance increases, damage reduction increases, damage shields, movement speed increases and decreases and turn resistance increases and decreases (plus everything else really but these would be the notable ones you'd expect to maybe not stack). In these cases the stacking occur as usual with all existing effects (excepting the noted AC stacking rules).


See Also

functions: 

RemoveEffect SetEffectSpellId



 author: John Shuell