ResistSpell

From NWN Lexicon



Contents

[edit] ResistSpell(object, object)

Performs a spell resistance check between the caster and the target.

int ResistSpell(
    object oCaster,
    object oTarget
);

[edit] Parameters

oCaster

Caster of the spell.

oTarget

Target of the spell.


[edit] Description

* Return value if oCaster or oTarget is an invalid object: FALSE
* Return value if spell cast is not a player spell: - 1
* Return value if spell resisted: 1
* Return value if spell resisted via magic immunity: 2
* Return value if spell resisted via spell absorption: 3

Bioware uses MyResistSpell() for spells that use this, to apply appropriate effects for the return value. It is a good idea to use this wrapper function instead of this directly. The Bioware function only returns 1 or 0.



[edit] Remarks

This function checks spell resistance, globes, and spell immunity (i.e., the effects EffectSpellImmunity, EffectSpellResistanceIncrease, EffectSpellLevelAbsorption or approprate item properties) if the spell cast is a PC spell as defined in spells.2da. See seperate descriptions for exact effects.

Never use this function for non-player spells (as defined in spells.2da), it merely returns -1, as it would for a non-spell-script.

This function should never be used except in a spell script. It may not work correctly elsewhere, as mantles and globes use the spell's level to stop the spell or decrease the amount of a given spell mantle's power (as well as the caster level of oCaster, of course).

[edit] Known Bugs

1.64: Fixed problem with ResistSpell() scripting command not working correctly when used with Cleric Domain spells and sub-radial spells in combination with spell absorption effects.


[edit] Version

1.64

[edit] See Also

functions: 

MyResistSpell



 author: Jody Fletcher, editor: Jasperre, additional contributor(s): Jasperre
 

Personal tools
Categories