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 - 3 &times; [Rank - (Level/2+2)]

The square bracket term in this case rounds up, and represents a diminishing return for ranks higher than the threshold of Level/2+2.

Critical hits grant a DLBonus of 20.

Armor Level
The Effective Armor Level depends on the Base Armor Level (BaseAL), ALBonus, and Net Armor Penetration (NAP).


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

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 AL bonus. 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 AL bonus against weapon attacks from the front as well as all spell attcks. Other weapons may also grant AL bonus. 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).