Compute Spell Damage
Just prior to applying the changes to the 'Affected Character Attributes' (as specified in the spelleditor's 'Spell Properties' dialog', we search for a hook named 'ComputeSpellDamage'. We search three places for this hook (in this order):
The Spell itself
The Monster-Type of the combatant being affected. (if it is a monster)
The Target Combatant.
We set hook parameter[0] to the empty string. Then each script is called in the order listed above. Each script can examine hook parameter[0]. The return value from each script replaces hook parameter[0].
Each script that returns a valid numeric value for the adjustment will override any previous value.
Parameters
Hook parameter 5 contains the damage as computed by the engine.
Hook parameter 6 contains the name of the attribute being adjusted. Example:”$CHAR_HITPOINTS”
Context
Attacker Character – $AttackerContext()
Target Character --- $TargetContext()
Spell --- $SpellContext()