EffectDispelMagicAll(int)

Create a Dispel Magic All effect.

effect EffectDispelMagicAll(
    int nCasterLevel
);

Parameters

nCasterLevel

The highest level spell to dispel.


Description

Returns a new effect object that when applied to the target, dispels all spells of equal or lesser level than nCasterLevel.

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

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 Extraodinary subtype effects can never be dispelled.

It should know, by the use of Linking effects, what are seperate 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 documentated, in the 1.64 patch. It will report the correct spells being removed, and nCasterLevel is used, not any other number.


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 persistant with wether 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

categories: Effects Functions | Spells Functions


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