GetEffectCasterLevel(effect)

From NWN Lexicon
Revision as of 14:15, 22 September 2020 by Jasperre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Nwnee logo.jpg Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.
Returns the caster level of the creature who created the effect.
int GetEffectCasterLevel(
    effect eEffect
);

Parameters

eEffect
The effect object to get the caster level from.

Description

Returns the caster level set when the effect was created as part of a spell script.

Only works on valid spells and where GetCasterLevel returns a proper value.

If not created by a creature, returns 0. If created by a spell-like ability, returns 0.

Remarks

There is currently no way to set the caster level on an effect.

This is used internally by EffectDispelMagicBest and EffectDispelMagicAll to remove magical effects using a dispel check on each one (removing a linked set if one is removed).

Known Bugs

If a PC logs out and logs back in all effects are "decoupled" causing many to lose the caster level attached to them. It also increases the amount of effects that would be affected by EffectDispelMagic functions.

Version

1.74.8149

Example

Information icon.png This article is in need of examples. You can help the NWN Lexicon by showing how to use this code effectively.

See Also

functions: GetCasterLevel(), GetEffectCreator()