Magic Resistance



Magic resistance is a stat that reduces (or increases, if negative) magical damage a unit takes from spells and attacks. Every unit is capable of gaining or losing magic resistance, and most units start with a small amount of base resistance. A hero's magic resistance can be passively increased with talents, certain items, and some abilities. Magic resistance of any unit can also be temporarily increased or reduced with some abilities.

Base magic resistance
Base magic resistance is a value that never changes throughout a game. It consists of one fixed value set for each unit individually. The base magic resistance of a unit can be a negative number.

Stacking
All sources of magic resistance stack multiplicatively. This means a unit's magic resistance value changes less the higher its magic resistance is, and more the lower it is. This prevents a unit from reaching 100% magic resistance by stacking different sources up.

There are several abilities that set a unit's magic resistance to 100%.

For total magic resistance of a unit (multiply the result by 100 to get the percentage value):
 * Formula

For magical damage after magic resistance:

interacts with magic resistance differently. Instead of stacking manipulatively with other sources of magic resistance, it acts as a multiplier for the base magic resistance. is currently the only source of base magic resistance negation.
 * Base magic resistance negation

Example:
 * with level 4 and a  has a magic resistance of:
 * 1 - (1 - ) × (1 - ) × (1 - ) = %
 * on max level under the effect of a level 4 and a level 4  cast by an enemy has a magic resistance of:
 * 1 - (1 - ) × (1 + ) × (1 + ) = %

Effective HP
The extra damage a unit can take due to magic resistance is known as its extra effective HP (or EHP) for magical damage. Despite each source of magic resistance increasing the magic resistance value less the higher it is and making them seem less effective, each sources increases the unit's effective HP against magical damage by their base value. A unit with 0% magic resistance has 100% effective HP against magical damage, means magical damage equaling 100% of its health is required to kill it. Most heroes have magic resistance by default, making their effective HP against magical damage %.


 * Calculating effective HP

Instead of diminishing in effectiveness, multiple sources of resistance are actually more effective stacked than they are individually. Two sources of 25% resistance stacked provides 78% extra effective HP whereas one source provides 33%.


 * Example
 * has health at max level. With his basic magic resistance, max level  and a, he has an effective HP of:
 * / (1 - × 0.01) =  effective HP
 * has health at max level. With his basic magic resistance, while under the effect of a level 4 Ancient Seal and an enemy level 4 Decrepify, he has an effective HP of:
 * / (1 - × 0.01) =  effective HP

Modifying magic resistance
Several abilites and items have abilities that grant or reduce magic resistance.

Magic resistance increasing abilities
The following abilities increase magic resistance:

Magic resistance reducing abilities
The following abilities reduce magic resistance:

Magic resistance granting talents
The following heroes have a talent that grants them bonus magic resistance.

Besides these, the following heroes have talents which increase the magic resistance of the units they summon

Magic resistance granting items
These items grant bonus magic resistance to the hero who has them equipped.

Magical damage barrier
Magical damage barriers absorb a set amount of magical damage, no matter whether it comes from spells (magical spell damage) or attacks (magical attack damage). They absorb the damage before it is reduced by magic resistance. This means when a hero with for example 25% magic resistance and a 300 health damage barrier gets hit by 400 magical damage, the shield will absorb 300 of that. The exceeding 100 are not absorbed and are now reduced by the 25% magic resistance down to 75. So in this scenario, the hero takes 75 damage. This means a barrier is more effective the lower a unit's magic resistance is, similar to how damage block is more effective, the lower the armor is.

Multiple sources of magical damage barriers do not stack. When affected by multiple, all of them deplete at the same time. For example, if a unit is affected by a level 4 Flame Guard ( barrier health) and by Pipe of Insight ( barrier health), and then takes 300 magical damage, both shields lose 300 capacity, leaving Flame Guard with and Pipe of Insight  absorb capacity. However, if a unit is affected by multiple barriers, and then receives a damage instance that is greater than all barriers individually, the damage gets blocked as if the barriers were one barrier with combined capacity. For example, if a unit is affected by a level 4 Flame Guard ( barrier health) and by Pipe of Insight ( barrier health), and then takes 1000 magical damage, both barriers get depleted, and the unit takes the remaining damage.

Resistência mágica Сопротивление магии 魔法抗性