Damage/Armor effect

Armor Effect
The Armor Effect (AE) depends on the difference of Effective Damage Level (EffDL) and Effective Armor Level (EffAL):


 * '''AE = 2(EffDL-EffAL)/40

Damage Level
The Effective Damage Level (EffDL) is a simple sum of the Base Damage Level (BaseDL) and any Damage Level bonuses (DLBonus).


 * EffDL = BaseDL + DLBonus

For attacks from spells and caster weapons (Staves, Wands, etc), the BaseDL is proportional to the attacker's level.


 * BaseDLcaster = 3 &times; Level 

For other types of attacks (melee weapons, bows, and pets), the BaseDL depends on the attacker's rank in the respective attribute. If the attack is a skill with a linked attribute, the rank from that attribute is used instead.


 * BaseDLnoncaster = 5 &times; Rank

If the Rank of the linked attribute is greater than a threshold of Level/2+2, then there is a DLBonus of  - 3 &times; [Rank - (Level/2+2)], serving as a diminishing return. The square bracket term in this case rounds up (towards zero).

Critical hits grant a DLBonus of 20.

Armor Level
The Effective Armor Level depends on the Base Armor Level (BaseAL), AL Enhancers (ALEnhance), AL Shifter (ALShift), and Net Armor Penetration (NAP).


 * EffAL = (BaseAL + ALEnhance) &times; (1 - NAP/100) + ALShift

Each attack randomly hit one of the following body locations:
 * Chest - 37.5% for weapon attacks
 * Legs - 25% for weapon attacks
 * Head/Hands/Feet - 12.5% each for weapon attacks

Certain attack skills and spells have a bias in which body part they are more likely to hit. Relative positioning of the attacker and target can also affect which part is more likely to be hit. The Armor Level of the piece corresponding to the location attacked is used as the BaseAL, while any bonuses on that armor contributes to ALEnhance. Additionally, certain armors have the Gives 15 armor while casting bonus, which is applied even if the attack hits a different part of the armor. Finally, certain armor are described as having a negative bonus of Reduced armor vs Holy damage, but they actually function as "received damage +5 against Holy damage", regardless of hit location and stacking.

Shields provides additional ALEnhance against all attacks. Other weapons may also grant ALEnhance. Unlike bonuses from armor, the ones from weapons are always applied regardless of which body location was hit.

Armor penetration can come from the Warrior's Strength attribute, weapon upgrades, or skill properties. Add up all the various bits of armor penetration to obtain the net armor penetration (NAP).

Finally, skills that modify armor in their description are calculated in ALShift.