EffectDispelMagicAll(int)

From NWN Lexicon
Jump to: navigation, search

Create a Dispel Magic All effect.

effect EffectDispelMagicAll(
    int nCasterLevel = USE_CREATURE_LEVEL
);

Parameters

nCasterLevel
The caster level of the dispeller (OBJECT_SELF). If no parameter is specified, USE_CREATURE_LEVEL will be used. This will cause the dispel effect to use the level of the creature that created the effect.

Description

Returns a new effect object that when applied to a target will attempt to dispel each and every magical effect on the target. Spells which apply two separate unlinked effects (such as Aid, which applies temporary HP separately) can have odd cases where half the spells effects are dispelled.

Dispel magic checks are meant to be 20 + nCasterLevel, versus each spell's effects (good or bad) on the target. The DC is 11 + the effects caster level. Therefore, lesser dispel with a maximum caster bonus of +5, could never dispel anything cast by a level 14 mage.

For instance if you've cast Stoneskin as a level 10 Wizard on yourself, and your level 5 Cleric ally has also cast Bless, the checks are done for each of the 2 spells against a DC of 21 and DC of 16 respectively.

The target this effect is applied to must be a creature for it to work. This effect can only be applied instantly.

Remarks

Supernatural and Extraordinary subtype effects can never be dispelled.

It should know, by the use of Linking effects, what are separate effects from different castings of the spells - such as someone having sets of Bless cast on them.

Also, it is likely not important who the creator of the effect is, except for the messages displayed - there is no way to set an effect so it cannot be dispelled by race, alignment or level.

Effect functions are Constructors, which are special methods that help construct effect "objects". You can declare effects, and apply them using an ApplyEffectToObject Command. See the Effect tutorial for more details.

Known Bugs

The previous bug with nCasterLevel is now working according to how it is documented, in the 1.64 patch. It will report the correct spells being removed, and nCasterLevel is used, not any other number.

NWN:EE corrects the check to be d20 + Caster Level against a DC of 11 + Caster Level. Equal or beating it will now properly remove effects.

There are still bugs regarding how the caster level set on an effect is calculated, in regards to items and feats. See this bug post for further details.

Version

1.64

Example

// Sample code for applying Dispel Magic All (level 10) to a target
 
void main()
{
    // This is the Object to apply the effect to.
    object oTarget = OBJECT_SELF;
 
    // Create the effect to apply
    effect eDispelAll = EffectDispelMagicAll(10);
 
    // Create the visual portion of the effect. This is instantly
    // applied and not persistent with whether or not we have the
    // above effect.
    effect eVis = EffectVisualEffect(VFX_IMP_DISPEL);
 
    // Apply the visual effect to the target
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
    // Apply the effect to the object   
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eDispelAll, oTarget);
}

See Also

functions: EffectDispelMagicBest



 author: John Shuell, editor: Jasperre, additional contributor(s): Jasperre