MySavingThrow(int, object, int, int, object, float)

Checks for spell countering by a saving throw.

int MySavingThrow(
    int nSavingThrow,
    object oTarget,
    int nDC,
    int nSaveType = SAVING_THROW_TYPE_NONE,
    object oSaveVersus = OBJECT_SELF,
    float fDelay = 0.0f
);

Parameters

nSavingThrow

SAVING_THROW_*

oTarget

Target of a spell.

nDC

Difficulty challenge rating of the spell's save.

nSaveType

SAVING_THROW_TYPE_* (Default: SAVING_THROW_TYPE_NONE)

oSaveVersus

Creature or object to save against. (Default: OBJECT_SELF)

fDelay

Delay until save is made. (Default: 0.0f)


Description

Determines spell countering and failing along with visual effects by a creature's saving throws. An appropriate save attempt is made against the supplied DC according using the save specified by nSavingThrow. If successful, a visual effect of the specified save being executed is shown (for example, SAVING_THROW_REFLEX would show the creature moving). If the save fails, or no save is allowed, then the effects of the spell are applied (this includes any instant death animations as indicated by the type of spell). If the creature is immune to the spell being cast and the save is failed, then no effect is applied an the spell resistance visual cue is played.

Returns TRUE only if the saving throw was made, returns FALSE otherwise (even if spell resistance prevents the spell from affecting the creature).



Remarks

nSaveType left at the default of SAVING_THROW_TYPE_NONE does not mean that no save is made; instead it means that the spell has no basis one of the other SAVING_THROW_TYPE_* constants that apply.


Requirements

#include "nw_i0_spells"

Version

1.29

See Also

categories: Spell Casting Effects Functions | Spells Functions | Visual Effects Functions
constants: SAVING_THROW_* Constants | SAVING_THROW_TYPE_* Constants


 author: Charles Feduke
 Send comments on this topic.