EffectSpellResistanceIncrease(int)

Returns an effect which increases spell resistance.

effect EffectSpellResistanceIncrease(
    int nValue
);

Parameters

nValue

amount of spell resistance increase


Description

Returns an effect which increases spell resistance by nValue. If nValue is less than 1, nothing happens.

The limit of nValue is unknown.

Spell resistance is a special defensive ability. If your spell is being resisted by a creature with spell resistance, you must make a caster level check (1d20 + caster level) at least equal to the creature’s spell resistance for the spell to affect that creature. The defender’s spell resistance is like an Armor Class against magical attacks. This check is hardcoded into the function ResistSpell().

You can get a persons highest (or absence of) spell resistance with GetSpellResistance(). It is unknown if the return value of GetSpellResistance() takes into account any VersusAlignmentEffect(), or VersusAlignmentEffect().

The target this effect is applied to must be a creature for it to work. This effect cannot be applied instantly, only temporarily or permanently.



Remarks

Spell resistance should generally be a minimum of 10 (as generated by items with the property) to be of any use.

It also shouldn't stack (see known bugs) with itself, or any form of Monk spell resistance, but only the highest applies at any one time.

This means, in theory (and requires more information then what this author knows) that EffectSpellResistanceIncrease() do not stack, and only the highest one applies - therefore, it is almost an EffectSpellResistanceSet(). If it does stack, then cirtainly all effects of this type will stack into one value, but not stack with item Spell Resistance or monks Spell resistance. If anyone can provide more information it would be apprechiated.

Effect functions are Constructors, which are special methods that help construct effect "objects". You can declare and link effects, and apply them using an ApplyEffectToObject() Command. Once applied, each effect can be got seperately via. looping valid effects on the target (GetFirst/NextEffect()). See the Effect Tutorial for more details.


Known Bugs

A few patches ago (1.29 and before?) Monk Spell Resistance stacked with Item resistance and this effect. Now it doesn't, and only the highest out of the 3 applies.


Version

1.62

Example

// Sample code for applying an increase of 20 to spell resistance

void main()
{
    // This is the Object to apply the effect to.
    object oTarget = OBJECT_SELF;

    // Create the effect to apply
    effect eSRInc = EffectSpellResistanceIncrease(20);

    // 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_GLOBE_USE);

    // Apply the visual effect to the target
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
    // Apply the effect to the object   
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSRInc, oTarget);
}

See Also

functions: ApplyEffectAtLocation | ApplyEffectToObject
categories: Effects Functions


 author: Brett Lathrope, editor: Jasperre, additional contributor(s): Jasperre