To Hit Calculations

Diablo II Expansion, patch 1.10

By Tommi Gustafsson

Contents: 1. Chance To Hit | 2. Simple AR Calculations | 3. Simple DR Calculations | 4. Exact AR Calculations | 5. Exact DR Calculations | 6. Special Modifiers | Acknowledgements


1. Chance to Hit

Many attacks in Diablo II depend on attack rating (AR) to hit. Attack Rating is checked against Defense Rating (DR) of the defender by using the following formula:

Chance to Hit % = 100 x AR / (AR + DR) x 2 x Alvl / (Alvl + Dlvl)

AR = Attack Rating of the attacker
DR = Defense Rating of the defender
Alvl = Level of the attacker
Dlvl = Level of the defender

The chance to hit has an upper cap of 95 % and a lower cap of 5 %. Thus, even if the formula gives a result higher than 95 %, the chance to hit will be 95 %. Similarly results lower than 5 % will produce a 5 % chance to hit.

1.1 Negative AR and DR

If AR is negative, -AR is added to both AR and DR before applying the chance to hit formula. This modification brings AR to zero, which results in a 0 % chance to hit. This is modified to 5 % by the lower cap.

If DR is negative, -DR is added to both AR and DR before applying the chance to hit formula. This modification brings DR to zero, which results in a hit chance equal to 100 x 2 x Alvl / (Alvl + Dlvl).

If both AR and DR are 0 or get modified to 0, the AR / (AR + DR) part of the calculation is ignored, and the chance to hit is calculated as 100 x 2 x Alvl / (Alvl + Dlvl).

1.2 Running and Walking

If a character is running, all to-hit checks against him or her are ignored and attacks hit automatically (100% chance). Defense Rating has an effect only if the character is walking or standing still.


2. Simple Attack Rating Calculations

The total attack rating is calculated from the base AR by applying AR modifying effects, such as skills. They are calculated together about as follows:

Attack Rating = (Base Attack Rating + Direct Attack Rating Bonuses) x (1 + Attack Rating Bonus % / 100)

If there are more than one modifier of the same type, they are summed up. Direct attack rating bonuses include, for example, "+150 to attack rating." Attack rating bonus % includes, e.g., "200% bonus to Attack Rating."

2.1 Base Attack Rating

The Base Attack Rating for characters is calculated as follows:

Base Attack Rating = (Dexterity x 5) - 35 + To Hit Factor

where To Hit Factor is as follows:

Class To Hit Factor
Amazon +5
Sorceress -15
Necromancer -10
Paladin +20
Barbarian +20
Druid +5
Assassin +15

Mercenaries' Base Attack Rating is calculated as follows:

Base Attack Rating = Dexterity x 5

Monster's Base Attack Rating is listed in Arreat Summit's monster pages and the MPQ files.


3. Simple Defense Rating Calculations

The total defense rating is calculated from the base DR and item DRs. They are added to defense rating about as follows:

Defense Rating = (Base Defense Rating + Item Defenses + Direct Defense Bonuses) x (1 + Defense Bonus % / 100)

If there are more than one modifier of the same type (e.g. item defense), they are summed up. Direct defense bonuses include bonuses, such as +100 defense, which are not added into item defenses. Defense Bonus % includes all percentage defense bonuses that do not increase item defenses, such as Defense +X% from skills.

3.1 Base Defense Rating

The Base Defense Rating of characters and mercenaries is the following:

Base Defense Rating = [Dexterity / 4]

[] indicates rounding down.

Monsters' Base Defense Rating is listed in Arreat Summit's monster pages and the MPQ files.

3.2 Item Defense

A defense of an item with defense value is calculated about as follows:

Item Defense = Normal Item Defense x Ethereality Multiplier x (1 + Enhanced Defense % / 100) + Direct Bonuses to Item Defense

Normal item defense is the normal defense of the item without any modifiers. The ranges of normal item defenses are listed in Arreat Summit's armor pages and the MPQ files. Ethereality Multiplier is 1 if item is not ethereal and 1.5 if the item is ethereal. If there are more than one modifier of the same type, they are summed up. Direct item defense modifiers are those that add directly to defense, such as "+X to defense."


4. Exact Attack Rating Calculations

The exact AR calculation is a bit more tricky than the simple case, because the game rounds down intermediate results in calculations. First, we have to calculate Direct Attack Rating, applying only direct bonuses:

Direct Attack Rating = Base Attack Rating

+ Direct Attack Rating Modifier 1
...
+ Direct Attack Rating Modifier N

N is the number of direct attack rating bonuses, such as "+150 to attack rating." To calculate the total attack rating, each percentage modifier is applied separately, rounding each multiplication down as follows:

Attack Rating = Direct Attack Rating

+ [Direct Attack Rating x Percentage Attack Rating Modifier 1 / 100]
...
+ [Direct Attack Rating x Percentage Attack Rating Modifier M / 100]

M is the number of attack rating modifiers, such as "200% bonus to attack rating." [] indicates rounding down.

4.1 Base Attack Rating

Base Attack Rating is calculated identically to the simple case above, and thus its calculation is not repeated here.


5. Exact Defense Rating Calculations

To get exact results with DR, one has to first calculate Direct Defense Rating and then Defense Rating:

Direct Defense Rating = Base Defense Rating

+ Item Defense 1
...
+ Item Defense M

+ Direct Defense Modifier 1
...
+ Direct Defense Modifier N

M is the number of item defenses from the equipment. N is the number of defense modifiers that are not calculated into item defenses.

To calculate the total defense rating, apply each percentage bonus separately (even if summed up on the screen), rounding each multiplication down.

Defense Rating = Direct Defense Rating

+ [Direct Defense Rating x Percentage Defense Rating Modifier 1 / 100]
...
+ [Direct Defense Rating x Percentage Defense Rating Modifier M / 100]

M is the number of defense rating modifiers, such as "Defense: +200%" or "Defense: -88%" from skills. [] indicates rounding down.

5.1 Base Defense Rating

Base Defense Rating is calculated identically to the simple case above, and thus its calculation is not repeated here.

5.2 Item Defense

Normal Defense uses the given bounds only if there is no Enhanced Defense (ED) modifiers on the armor. If there is any ED on the armor, the maximum value is always used, and it is augmented by 1 through a special modifier. Thus, Base Item Defense is calculated using as follows depending on the case:

1. No Enhanced Defense on the armor:

Base Item Defense = [Normal Item Defense x Ethereality Multiplier]

2. Enhanced Defense on the armor:

Base Item Defense = [(Maximum Normal Item Defense + 1) x Ethereality Multiplier]

Ethereality Multiplier is 1 if item is not ethereal and 1.5 if the item is ethereal. [] indicates rounding down. For example, if an item has Normal Defense of 23-25 and it has ED on it, the base item defense is [26 x Ethereality Multiplier].

To calculate the final item defense, the effects of percentage and direct modifiers are added as follows:

Item Defense = Base Item Defense

+ [Base Item Defense x (Percentage Item Defense Modifier 1 / 100 + ... + Percentage Item Defense Modifier M / 100)]

+  Direct Item Defense Modifier 1
...
+ Direct Item Defense Modifier N

M is the number of percentage defense modifiers. The most one typical is Enhanced Defense. [] indicates rounding down. N is the number direct item defense modifiers. Direct item defense modifiers are those that add directly to defense, such as "+X to defense."


6. Special Modifiers

Special modifiers take effect when determining the chance to hit. Therefore, they affect the total attack rating and the total defense rating, not any intermediate results.

Modifier Effect
Ignores Target's Defense Treats the defender's DR as zero in determining chance to hit. ITD works only against normal monsters.
Target Defense X% Treats the defender's DR as DR - [X / 100 x DR].
-X to target defense per hit Each successful hit reduces enemy defense by X.

Acknowledgements

Adeyke for reporting the exact way of calculating item defenses for patch 1.09.
Myrdinn
for reporting basic to-hit calculations in the patch 1.10, the formula for Target Defense X%, and the chance to hit when both AR and DR are 0.
Ruvanal
for To Hit Factors, and for AR and DR modifications when AR or DR is negative.

Сайт управляется системой uCoz