ComputeDamage
Just prior to subtracting hitpoints from a combatant as a result of an attack, we set hookParameter[0] to the empty string. Then we search for scripts named “ComputeDamage” in the following places:
- The Weapon (if any)
- The Target's Monster Type (eg: orc)
- The Target Combatant.
Parameters
Parameter [5] = contains the damage as computed by the engine. If the script returns any value then that value is subtracted from the target's hitpoints.
Parameter [6] = contains a "1" if the damage is considered 'non-lethal'.
Parameter [7] = used to replace the normal "Rolls and hits for points" message. There are actually two messages: "Rolls and hits" and "Rolls and backstabs". Hook parameter 7, if non-empty, will replace whichever of the two would otherwise be displayed.
Context
Character (attacker - $Attacker)
Character (target - $Target)
Item (weapon - $Item) - If the combatant has no weapon then $ItemContext() will refer to an item with an empty name and no Special Abilities.