Adjust Saving Throws


When a character is about to affected by a spell, he is sometimes allowed to cast a saving throw to determine the extent of the spell effect. For example, if his throw succeeds, any damage might be reduced by half. These scripts allow the designer to modify the results of the saving throw by supplying a positive or negative integer to be added to the actual throw after any default adjustments have been made. There are five type of spell effects built into the engine (it is relatively easy to add others using Special Abilities or even building them into the engine) and each causes a script of a different name to be run:


Type of Spell Effect

Script Name

Spell

SaveVsSp_xxx

Paralysis / Poison / Death Magic

SaveVsPPDM_xxx

Petrification / Polymorph

SaveVsPP_xxx

Breath Weapon

SaveVsBW_xxx

Rod / Staff / Wand

SaveVsRSW_xxx


The “xxx” portion of the Script Name is determined by where the engine finds the script. This is done so that the script itself will not have to determine if it is attached to the caster or to the object of the spell. For the case of a script attached to a spell there would be no ambiguity and the “xxx” portion should not be needed. But it is included for the sake of symmetry. The engine searches the following places, in this order:


Search Location

Value of “xxx”

The character who cast the spell

“Cast”

The character performing the saving throw

“Save”

The spell that was cast

“Spell”

The monster type of the caster

“CastMon”

The monster type of the character performing the saving throw

“SaveMon”


Return Value

The script should return a number which will be added to the default saving throw. The default saving throw can be found in Hook Parameter [5].

Parameters

Context