Compute Damage

Just prior to subtracting hitpoints from a combatant as a result of an attack, we search for scripts named “ComputeDamage” in the following places:

  1. The Ammunition (if any) (Perhaps an arrow)

  2. The Primary weapon (if any) (Perhaps a club or bow)

  3. The Target's Monster Type (eg: orc)

  4. The Target Combatant.


Each script can examine hook parameter[0] and return a value that will replace hook parameter[0]. After all scripts have been called, hook parameter[5] will be used as the damage.

Parameters

Context


Attacker Character --- $AttackerContext

Target Character --- $TargetContext()

Weapon --- $ItemContext()