SpellResistanceCheck(object, object, int, int, int, int)

From NWN Lexicon
Jump to navigationJump to search

Does a spell resistance check.

int SpellResistanceCheck(
    object oTarget,
    object oCaster,
    int nSpellId = -1,
    int nCasterLevel=-1,
    int nSpellResistance=-1,
    int bFeedback=TRUE
);

Parameters

oTarget
Target of the check
oCaster
Caster performing the check against oTarget
nSpellId
The spell ID to use if other variables are not set. If -1 it will attempt to be auto-detected. (default: -1)
nCasterLevel
The caster level. If -1 it attempts to find it automatically from oCaster. (default: -1)
nSpellResistance
The spell resistance to penetrate. If -1 it will use the spell resistance of oTarget. (default: -1)
bFeedback
If TRUE displays feedback automatically, FALSE it suppresses it. (default: TRUE)


Description

Does a spell resistance check. The roll is 1d20 + nCasterLevel + nCasterBonus vs. nSpellResistance.

Returns: TRUE if the target resists oCasters spell resistance roll, FALSE if failed or an error occurred.

Remarks

This along with the sister functions SpellXXX functions allow you to do part of ResistSpell as required, even outside of a proper spell script.

nSpellId defaults to GetSpellId, nCasterLevel defaults to GetCasterLevel(oCaster) plus related feats, and nSpellResistance defaults to GetSpellResistance(oTarget) in case you want to manipulate the values.

Note: nSpellId isn't actually used in the checks since the UserType of the spell is ignored.


Version

This function was added in 1.89.8193.37 of NWN:EE.

Example

See Also

functions:

GetSpellResistance, GetCasterLevel, GetSpellId, ResistSpell, SpellImmunityCheck, SpellAbsorptionLimitedCheck, SpellAbsorptionUnlimitedCheck