Damage Modification Mechanics

Diablo II Expansion, v. 1.09d
Compiled by Tommi Gustafsson

Contents: 1. Damage Types | 2. Damage Modification | 3. Application Order | 4. Damage Formulas | Acknowledgements


1. Damage Types

There are six different damage types in Diablo II: Fire, Cold, Lightning, Poison, Magic, and Physical. Each of these has its own resistance, although only four of them are shown on the character screen.

1.1 Examples of Damage Types


2. Damage Modification

There are seven types of damage modification in the game:

2.1 Damage Modification Abilities

Damage Reduction Ability Abbreviation Damage Types Affected Difficulty Penalty
(Nightmare/Hell)
Lower Limit Upper Limit An Example Item With This Ability
Resist +X%, 4 different types Resistance Fire/Cold/Lightning/Poison
-40% / -100%
-100%
75%1) / 95%2) / 100%3)
Most items in the game
All Resistances +X

Resistance

Fire, Cold, Lightning, and Poison As above As above As above

Tearhaunch (unique greaves)

Magic Resistance +X% 5)

Resistance

Magic

-

-100%

75%1) / 100%3)

Safety crafted shield 6)
Damage Reduced By X% (physical resistance)
Resistance and DR%
Physical
-
-100%
75%1) / 100%3)
Shaftstop (unique mesh armor)
Damage Reduced By X
DR
Physical
-
-
-
Duskdeep (unique full helm)
Magic Damage Reduced By X
MDR
Fire, Cold, Lightning, and Magic
-
-
-
Greyform (unique quilted armor)
Absorb X%, 3 different types
Absorb%
Fire/Cold/Lightning
-
-
100%
Raven Frost (unique ring)
+X Absorb, 3 different types
Absorb
Fire/Cold/Lightning
-
-
-
Blackhorn's Face (unique death mask)
Energy Shield (Sorceress)
ES
Physical, Fire, Cold, Lightning, and Magic
-
-
-
-
Bone Armor (Necromancer)
BA
Physical
-
-
-
-
Cyclone Armor (Druid)
CA
Fire, Cold, and Lightning
-
-
-
-
Unit Type Modification
XvX
All damage types
-
-
-
-
+ Poison Length Reduced by X% 4)
PLR
Poison 4)
-40% / -100%
-100%
75%1) / 100%3)
Death's Hand (set gloves)
1) 75% is a normal cap for players.
2) 95% is possible to achieve with + maximum resistance items, such as Guardian Angel (unique templar coat).
3) 100% is an absolute cap, which cannot be exceeded. 100% resistance on a monster indicates immunity.
4) Affects poison length, not poison damage.
5) This ability does not function, and thus the magic resistance of players is always 0 %.
6) This is the only item with magic resistance in the game.

2.2 Difficulty Penalty

Difficulty penalty applies only to players and hirelings. It does not affect monsters, golems, and minions.

2.3 Resistance Calculations

Resistances are reduced by certain skills as well as the difficulty penalty. The final resistance is calculated as follows:

  1. Sum up resistances from all sources
  2. Apply all reduction effects, except Cold Mastery --> subtract their effects from the result
  3. Apply cold mastery --> multiply the result by 1 - Cold Mastery % / 100 and round down (only with cold resistance)
  4. Apply difficulty penalty --> subract the penalty from the result
  5. Apply lower and upper limits

For example, with cold resistance, you have to take all these effects into account. Its formula is as follows:

Total Cold Resistance = [(Sum of Cold Resistances - Sum of Cold Resistance Reduction Effects) * (1 - Cold Mastery % / 100)] - Difficulty Penalty

In this formula, difficulty penalty is 40 for nightmare difficulty and 100 for hell difficulty. The values of reduction effects are entered as positive values into the sum. [] indicates rounding down. Then, to deterimine the final cold resistance, you apply the lower and upper limits to the total cold resistance.

2.4 Magic Damage Reduced by X vs. Continuous (Frame-Based) Attacks

The effect of MDR is reduced against certain continuous attacks. Learn more about it here.

2.5 Unit Type Modification (XvX)

The damage is yet modified by the type of attacker and defender (XvX factor). The different factors are listed in the table below. For example, 1/4 means that damage is reduced to one-fourth normal.
Defender
Player Hireling Golem Minion1) Special Boss2) Monster
Attacker Player
1/4
1
1
1
1
1
Hireling
1/4
1/4
1
1
50%, 35%, 25%3)
1
Golem or Minion1)
1/2
1
1
1
1
1
Act 1-4 Boss
1
2
3
5
1
1
Baal
1
2
4
4
1
1
Monster
1
1
1
1
1
1
1) Minion is any creature a player controls, except a hireling or a golem.
2) Special bosses are all act end bosses and some others with eBoss = 1 in monstats.txt.
3) In Normal, Nightmare and Hell difficulties, respectively.

2.6  Life gained from absorb

2.7  Scroll of resistance

Scroll of resistance, which one receives from Malya in Act V after rescuing Anya, adds 10% to fire, cold, lightning and poison resistances.


3. Application Order

3.1 Damage Modification Effects

There is a well-defined order in which the damage modification effects are applied to the damage:
  1. DR and MDR
  2. Resistances
  3. Absorb%, also add life
  4. Absorb, also add life
  5. BA and CA
  6. XvX (modifies also life gain)
  7. ES (modifies also life gain)
In each of these phases, damage cannot be reduced below zero. The result is what I call Damage Dealt. Life gain, mana loss and damage dealt get applied in the following order:
  1. Reduce mana equal to two times of the damage absorbed by Energy Shield
  2. Add life gained from absorb
  3. Reduce life equal to Damage Dealt

3.2 Other Effects

Damage Goes To Mana is applied after Energy Shield.

The source damage for Thorns, Iron Maiden, and Spirit of the Barbs is calculated from the damage after the armor skills but before the XvX modification.

3.3 Defense and Blocking with Regard to Damage Modification Effects

Defense and blocking are calculated in a to-hit step, which occurs before damage modification mechanics. The exact order of the game mechanics is the following:

  1. Check Defense (see to-hit calculations)
  2. Check Blocking (applied at 1/3 if the defender is running)
  3. Determine damage done by the attacker, if the attack hits
  4. Apply damage modification mechanics

4. Damage Formulas

4.1 Damage Dealt, Life Gained and Mana Lost

Assuming that damage is not reduced to zero in any step, we get the following equations for damage dealt, life gained and mana lost:
Damage Dealt = ((Damage - DR) * (1 - Resistance / 100) * (1 - Absorb% / 100) - Absorb - ArmorSkill) * XvX * (1 - ES / 100)
Life Gained = ((Damage - DR) * (1 - Resistance / 100) * Absorb% + Absorb) * XvX * (1 - ES / 100)
Mana Lost = 2 * ((Damage - DR) * (1 - Resistance / 100) * (1 - Absorb% / 100) - Absorb - ArmorSkill) * XvX * ES / 100
Resistance, Absorb% and ES are given as integer values in these equations, such as 50.

4.2 Final Damage

If we further assume that life can be fully added to the character's life amount (it doesn't exceed the maximum), we can calculate the final damage as follows. (It is the damage actually inflicted to the character counting both damage dealt and life gained from absorb.)
Final Damage = Damage Dealt - Life Gained
By expanding the terms, we get:
Final Damage = ((Damage - DR) * (1 - Resistance / 100) * (1 - 2 * Absorb% / 100) - 2 * Absorb - ArmorSkill) * XvX * (1 - ES / 100)
Negative final damage means that you gain life.

Terms in the equations


Acknowledgements

Assa2 for confirming that magic resistance is not affected by difficulty penalty and that the scroll of resistance does not affect magic resistance.
Jarulf
for the application order of the reduction effects and for information about unit type modifications.
Occhidiangela for confirming that magic resistance is not affected by difficulty penalty and that the scroll of resistance does not affect magic resistance.
Rivo/Karon for testing that the unit type modification (XvX) and Energy Shield are applied also to the life gained from absorb, and for confirming that life gain from absorb does not affect Mana Lost.
Ruvanal for testing that MDR applies to fire, cold, lightning and magic damage but not poison damage.
Steve Estes for suggesting to add the application point of Damage Goes To Mana and how defense and blocking relate to damage modification effects.
Valkemen for initially pointing out that magic resistance is not affected by difficulty penalty.