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 strength, talents, certain items, and some abilities. Magic resistance of any unit can also be temporarily increased or reduced with some abilities.

Each point of strength increases a hero's magic resistance by.

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%. Besides them, the magic resistance granted by strength can theoretically reach 100% as well, since the bonus from strength gets summed up into, and treated as one instance. This means that heroes can theoretically reach 100% magic resistance with strength.

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

For magical damage after magic resistance:

Example:
 * with level 4 and a  has a magic resistance of:
 * 1 - (1 - ) × (1 - ) × (1 - ) = %
 * on level 25 under the effect of and a level 4  cast by an enemy has a magic resistance of:
 * 1 - (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 Veil of Discord 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
Besides spell immunity, which always grants 100% magic resistance, 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.

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, unless the resistance is provided by spell immunity. 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.

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