1. Animals
  2. Abilities
  3. Conditions
  4. Tool/Weapon
  5. Weapon Mods
  6. Orb
  7. Equipped
  8. Food/Medicine
  9. Furniture/Construction
  10. Color/Pattern
  11. Items
  12. Attributes
  13. Creatures
  14. Blocks
  15. Props
  16. API Types
  17. API Functions

LTH_damage

void LTH_damage(string fn)

This hook expects functions of the form:

damage fn(entity attacker,entity defender,damage damage)

SERVER This has no effect if performed on the client (but will work in single player)

Sets the function that will modify results from all damage calculations. The hooked function will be called after basic damage is calculated between two entities, an attacker and defender. The attacker is specified as the first enemy, and the defender is the second. The function will return a possibly modified damage report which will be used as the result of calculation. All of this occurs before damage magnification is calculated, so it will be adjusted later for basic strengths, weaknesses, and damage variance.