6.2 Melee attacks
Here we will only discuss melee attacks; this does not apply to attacks with bows, and is always done to an adjacent target.
6.2.1 Player versus Monster
To Hit
- if the target monster is an Illusion Weaver that is currently running away, exit as it is at the moment immune to any attack
- if the target monster is Stone Cursed, the attack is an automatic hit, go directly to damage calculations
- calculate 50 + Dex/2 + ToHititems + clvl + bonusplayer
- in Hellfire, if the player has any item with the "penetrate armor" effect, temporarily reduce Acmonster as appropriate
- subtract Acmonster
- in Hellfire, if the attack is an adjacent quarter damage attack, subtract 70 - 2·clvl (minimum 30)
- if the value calculated is below 5, set it to 5
- if the value calculated is above 95, set it to 95
- the value now achieved is the final chance to hit (FTH)
- a hit is secured if Rnd[100] < FTH
The steps 3-8 above can be summarized to:
FTH = 50 + Dex/2 + ToHititems + clvl + bonusplayer - Acmonster - penaltyquarter damage
- In Diablo, ToHititems includes the effect of items with the "penetrate armor" effect.
- The bonusplayer is 20 for Warriors and 0 for all other classes.
- penaltyquarter damage only apply to certain attacks in Hellfire, see chapter 2.2.2 for more information.
- Note that if FTH is below 5 or above 95 it is adjusted to 5 and 95. This is commonly referred to as the auto hit and auto miss of a character.
Damage
- calculate Rnd[maxbase weapon damage - minbase weapon damage + 1] + minbase weapon damage (this is basically a random value within the weapons base damage range)
- add +% damage
- add +damage
- add character damage
- if the attacker is a Warrior or Barbarian then double damage if Rnd[100] < clvl (critical hit)
- if the monster is undead or an animal, adjust the damage according to the table in chapter 5.1 under monster type, that is, under certain circumstances multiply damage by 1.5 or divide damage by 2
- if the monster is a demon, triple the damage if the player is carrying any item with the "+200% damage versus demons" effect
- in Hellfire, if the attacker has an item with the devastation effect and Rnd[100] < 5, triple the damage
- in Hellfire, if the attacker has an item with the jester's effect 50% of the time multiply damage by Rnd[100]/100, the other 50% multiply damage by 5·(Rnd[100]+20)/100
- in Hellfire, if the attack is an adjacent "quarter" damage attack, divide the damage by 4 (hence the "quarter" damage)
- in Hellfire, if the attacker has an item with the peril effect, double the damage
- the value now achieved is the final damage (FD)
- deal FD to the target
Steps 1-4 above will generate a damage value that is within the range shown for damage on the character screen.
Steps 5-12 above will further modify the damage by factors that will not be shown on the character screen.
Step 9 above is actually done as:
- calculate Rnd[200]
- if the value is below 100 multiply the damage by this value and then divide by 100
- otherwise subtract 80 and multiply by 5, then multiply the damage by this value and divide by 100
Hit consequences
- in Hellfire, if the attacker has an item of doppelganger's effect and the monster is not Diablo or an unique monster, duplicate the monster if Rnd[100] < 5
- in Hellfire, if the attacker has an item with the peril effect, take the damage from step 3 under Damage above, modify it for the -damage effect and deal it to the attacker
- if the attacker has an item equipped that has the "random life stealing" effect, calculate Rnd[FD/8] and add this to current life (while checking so that current life never exceeds max life)
- if the attacker has an item equipped that has 3% mana stealing, calculate 0.03·FD
- if the attacker has an item equipped that has 5% mana stealing, calculate 0.05·FD
- if the attacker do not have any item of corruption add the amount calculated in step 4 or 5 to the current mana (while checking so that current mana never exceeds max mana)
- if the attacker has an item equipped that has 3% life stealing, calculate 0.03·FD
- if the attacker has an item equipped that has 5% life stealing, calculate 0.05·FD
- add the amount calculated in step 7 or 8 to the current life (while checking so that current life never exceeds max life)
- in Hellfire, if the attacker hit and has an item equipped with the decay effect, subtract 5 from its To Hit bonus, if it reaches -100%, destroy the item
- if the attacker hit, check for weapon durability loss
- if the monster was not Stone Cursed and the player had an item with the "knock back" effect, move the monster one step backwards (backwards is defined according to the monster's facing)
- mark the attacker to be entitled to experience points when the monster dies
- if the target was not a golem and it was not resistant to the spell and FD >= mlvl+3, put monster into hit recovery; a Scavenger or Grave Digger will also be set in a mode to find a carcass to feast/dig upon
- if the target was a Hidden type of monster and it was not resistant to the spell, put monster into hit recovery as well as in retreat mode (see chapter 5.5.9 under Hidden).
- if the monster died, check for any item dropping (see chapter 3.8) and add any experience to the players that are eligible for it (see chapter 2.6)
- if the monster died and it was Diablo, terminate game and show ending movie for players on dlvl 16
6.2.2 Player versus Player
To Hit
- calculate 50 + Dexattacker/2 + ToHititems,attacker + clvlattacker + bonusattacker
- calculate Dextarget/5 + Acitems,target + bonustarget
- subtract the value in step 2 from the value in step 1
- if the value calculated is below 5, set it to 5
- if the value calculated is above 95, set it to 95
- the value now achieved is the final chance to hit (FTH)
- a hit is secured if Rnd[100] < FTH
The steps 1-6 above can be summarized to:
FTH = 50 + Dexattacker/2 + ToHititems,attacker + clvlattacker + bonusattacker - Dextarget/5 - Acitems,target - bonustarget
- In Diablo, ToHititems includes the effect of items with the "penetrate armor" effect.
- The bonusattacker is 20 for Warriors and 0 for all other classes.
- The bonustarget is clvl/4 for Barbarians, depends on the armor type for Monks (0 for non unique plate, clvl/2 for non unique mail or unique plates and 2·clvl for light armor and unique mail or if naked), and 0 for all other classes.
- Note that if FTH is below 5 or above 95 it is adjusted to 5 and 95. This is commonly referred to as the auto hit and auto miss of a character.
Block
- if the target is doing anything other than standing still or performing a melee attack, skip blocking
- if the target is not a Monk and is not carrying a shield, skip blocking
- if the target is a Monk and is not carrying a shield, a staff or has at least one hand bear, skip blocking
- calculate Dextarget + 2·clvltarget + bonustarget
- subtract 2·clvlattacker
- if the value calculated is below 0, set it to 0
- if the value calculated is above 100, set it to 100
- the value now achieved is the final chance to block (FB)
- a block of the attack is done if Rnd[100] < FB
The steps 3-8 above can be summarized to:
FB = Dextarget + 2·(clvltarget - clvlattacker) + bonustarget
- The bonustarget is 30 for Warriors and Barbarians, 25 for Monks and Bards, 20 for Rogues, and 10 for Sorcerers. Note that there seems to be a bug that makes all those bonus values be 0.
- It is possible to achieve 100% blocking.
Damage
- calculate Rnd[maxbase weapon damage - minbase weapon damage + 1] + minbase weapon damage (this is basically a random value within the weapons base damage range)
- add +% damage
- add +damage
- add character damage
- if the attacker is a Warrior or Barbarian then double damage if Rnd[100] < clvlattacker (critical hit)
- the value now achieved is the final damage (FD)
- deal FD to the target
Steps 1-4 above will generate a damage value that is within the range shown for damage on the character screen.
Steps 5-6 above will further modify the damage by factors that will not be shown on the character screen.
Hit consequences
- if the attacker has an item equipped that has the "random life stealing" effect, calculate Rnd[FD/8] and add this to current life (while checking so that current life never exceeds max life). It is worth noticing that in normal Diablo, the random stealing effect is only present on a single player quest item, so this step is this never performed.
- in Hellfire, if the attacker hit (regardless of blocking) and has an item equipped with the decay effect, subtract 5 from its To Hit bonus, if it reaches -100%, destroy the item
- if the attacker hit (regardless of blocking), check for weapon durability loss
- if the attacker hit and the target did not block, check if life went down to 0 or below, if so put target player into death mode and skip further steps
- if FD >= clvltarget and the target did not block then put target player into hit recovery and check for durability loss on helm and armor
- if the target blocked, put target player into block mode and check for durability loss on shield
For the probabilities of durability losses, see chapter 3.7.1.
6.2.3 Monster versus Player
To Hit
- calculate 30 + ToHitbase,monster + 2·mlvl
- calculate Dex/5 + Acitems,player + bonusplayer + 2·clvl
- subtract the value in step 2 from the value in step 1
- in Hellfire, if the player has extra AC versus Demons or Undead, subtract 40/20 if the monster is of the correct type
- if the value calculated is below 15, set it to 15
- on dlvl 14 if the value calculated is below 20, set it to 20
- on dlvl 15 if the value calculated is below 25, set it to 25
- on dlvl 16 if the value calculated is below 30, set it to 30
- the value now achieved is the final chance to hit (FTH)
- a hit is secured if Rnd[100] < FTH
The steps 1-9 above can be summarized to:
FTH = 30 + ToHitbase,monster + 2·(mlvl-clvl) - Dex/5 - Acitems,player - bonusplayer
- ToHitbase,monster is the value found in the tables for each monster in chapter 5.2 and 5.4. For the second attack of Magma Demons it is 10 higher, and for the second attack of Lightning Demons it is 20 lower. For charges the base value is always 500%.
- For unique monsters, use mlvlbattle
- The bonusplayer is clvl/4 for Barbarians, depends on the armor type for Monks (0 for non unique plate, clvl/2 for non unique mail or unique plates, and 2·clvl for light armor and unique mail or if naked), and 0 for all other classes.
- Note that the FTH is adjusted for auto hit values.
Block
- if the target is doing anything other than standing still or performing a melee attack, skip blocking
- if the target is not a Monk and is not carrying a shield, skip blocking
- if the target is a Monk and is not carrying a shield, a staff or has at least one hand bear, skip blocking
- calculate Dex + 2·clvl + bonusplayer
- subtract 2·mlvl
- if the value calculated is below 0, set it to 0
- if the value calculated is above 100, set it to 100
- the value now achieved is the final chance to block (FB)
- a block of the attack is done if Rnd[100] < FB
The steps 3-8 above can be summarized to:
FB = Dex + 2·(clvl - mlvl) + bonusplayer
- The bonusplayer is 30 for Warriors and Barbarians, 25 for Monks and Bards, 20 for Rogues, and 10 for Sorcerers. Note that there seems to be a bug that makes all those bonus values be 0.
- For unique monsters, use mlvlbattle
- In the cases according to step 1-2 above when a block is not checked, the game actually DOES a random check, but the value checked against is 100 and thus will never result in a block.
- It is possible to achieve 100% blocking.
Damage
- calculate Rnd[maxbase damage - minbase damage + 1] + minbase damage (this is basically a random value within the monsters base damage range)
- add -damage
- if damage is below 1, set it to 1
- in Hellfire, if the player has a Reflect spell running, calculate the final reflected damage (FRD) by multiplying the damage by (Rnd[10] + 20)/100
- in Hellfire, if the player has a Reflect spell running, subtract FRD from the damage calculated in steps 1-3
- the value now achieved is the final damage (FD)
- deal FD to target
Hit consequences
- in Hellfire, if the monster hits and the player has a Reflect spell running, reflect FRD to it and check for death and hit recovery of the monster normally
- if the monster hits and it is a Black Death, remove 1 permanently from life
- if the player has any item equipped that has the "damage to attacker" effect, deal Rnd[3] + 1 damage to it and check for death and hit recovery of the monster normally
- if the monster had the knock back ability, move the player one step backwards (backwards is defined according to the player's facing)
- if the attacker hits and the target did not block, check if life went down to 0 or below; if so, put target player into death mode and skip further steps
- if FD >= clvl and the target did not block, put target player into hit recovery and check for durability loss on helm and armor
- if the target blocked, put target player into block mode and check for durability loss on shield
For the probabilities of durability losses, see chapter 3.7.1.
6.2.4 Monster versus Monster
To Hit
- if the target monster is an Illusion Weaver that is currently running away, exit as it is at the moment immune to any attack
- if the target is a monster that is Stone Cursed, the attack is an automatic hit, go directly to damage calculations
- the monsters base To Hit will also be the monsters final chance to hit (FTH) so the AC of the target has no effect
- a hit is secured if Rnd[100] < FTH
Damage
- calculate Rnd[maxbase damage - minbase damage + 1] + minbase damage (this is basically a random value within the monsters base damage range)
- the value now achieved is the final damage (FD)
- deal FD to target
Hit consequences
- if the target was not Stone Cursed and the attacker had attack type with the "knock back" effect, move the target one step backwards (backwards is defined according to the target's facing).
- if the attacker was a golem, mark the golem's owner to be entitled to experience points when the monster dies
- if FD >= mlvltarget+3 or if the target is a Hidden type of monster put target into hit recovery; a Scavenger or Grave Digger will also be set in a mode to find a carcass to feast/dig upon
- if the target died, check for any item dropping (see chapter 3.8) and add any experience to the players that are eligible for it (see chapter 2.6)
- if the target died and it was Diablo, terminate game and show ending movie