<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://heroes.thelazy.net//api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Entelechy</id>
	<title>Heroes 3 wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://heroes.thelazy.net//api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Entelechy"/>
	<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php/Special:Contributions/Entelechy"/>
	<updated>2026-05-01T07:32:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19625</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19625"/>
		<updated>2014-08-14T09:03:24Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* The damage calculation formula */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value . Some creatures like [[Naga]]s do not have a damage range, meaning they deal a fixed amount of damage. This is also true for creatures that are [[bless]]ed or [[curse]]d. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together (see External Links below). However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Crystal Dragon]]s and [[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may deliver [[Death Blow]]s, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; Hero level &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
A special case of damage calculation concerns the spell and creature ability [[Fire Shield]]. [[Efreet Sultan]]s and any creatures that have Fire Shield cast on them counter-inflict damage from [[melee]] attacks. This is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;Fire Shield damage =  FS &amp;amp;times; DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FS is a percentage that equals 0.20 for Efreet Sultans and (basic) Fire Shield, 0.25 for advanced Fire Shield, and 0.30 for expert Fire Shield.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
On [[lava]] terrain, one hundred [[Archangel]]s that benefit from basic [[Bless]] cast by a level 14 [[Adela]] with expert [[Offense]] and an Attack Skill of 8 deliver a [[luck]]y strike against a stack of [[Petrify|petrified]] [[Arch Devil]]s that adopted a defensive stance right after a level 20 [[Tazar]] with advanced [[Armorer]] and 14 Defense casted expert [[Shield]] and expert [[Stone Skin]] at the beginning of the present combat round. How much damage do the Archangels inflict?&lt;br /&gt;
&lt;br /&gt;
First, base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;) is calculated. Because Bless has been cast with basic (rather than advanced or expert) proficiency and Archangels always deal a fixed amount of damage, base damage is equal to 100 &amp;amp;times; 50 = 5000.&lt;br /&gt;
 &lt;br /&gt;
This base damage is modified by several I and R variables. Let’s calculate I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; first. The Archangels have a base Attack Skill of 30, to which +8 Attack from Adela is added, for a total of 38. The Arch Devils have a base Defense Skill of 28, to which +14 Defense from Tazar is added, +6 due to Stone Skin and +1 due to [[Native Terrain]], for a total of 49. Because the Arch Devils adopted a defensive stance only after Stone Skin was cast, they receive a 20% Defense bonus over a Defense Skill of 49 (rather than 43), meaning their defense is 1.2 &amp;amp;times; 49 = 58.8, which is rounded down to 58. This is 58 - 38 points higher than the Attack Skill of the Archangels, meaning that I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0 and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 20 &amp;amp;times; 0.025 = 0.5.&lt;br /&gt;
&lt;br /&gt;
Because Adela has learned expert Offense, I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Adela’s Bless specialty at Hero level 14 means that I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;  = 0.03 &amp;amp;times; 14 / 7 = 0.06.&lt;br /&gt;
&lt;br /&gt;
Because the Archangels deliver a lucky strike, I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 1.00&lt;br /&gt;
&lt;br /&gt;
Archangels hate Arch Devils, so I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50.&lt;br /&gt;
      &lt;br /&gt;
Because Tazar has learned advanced Armorer, R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.10.&lt;br /&gt;
 &lt;br /&gt;
Tazar’s Armorer specialty at Hero level 20 means that R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; 20 &amp;amp;times; 0.10 = 0.10.&lt;br /&gt;
&lt;br /&gt;
Tazar has cast expert Shield, meaning that R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Because the Arch Devils are petrified, R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50&lt;br /&gt;
&lt;br /&gt;
Substituting these values in the damage formula above shows that total damage is equal to 100 &amp;amp;times; 50 &amp;amp;times; (1 + 0.30 + 0.06 + 1.00 + 0.50) &amp;amp;times; (1 - 0.50) &amp;amp;times; (1 - 0.10 - 0.10) &amp;amp;times; (1 - 0.30) &amp;amp;times; (1 - 0.50) = 2002.&lt;br /&gt;
&lt;br /&gt;
However, because this damage is exactly 2002 (i.e., an integer value) and Tazar has learned Armorer, damage is reduced by one additional damage point, for a total of 2001.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=20955 Base damage calculation]&amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Angelito: [http://heroescommunity.com/viewthread.php3?TID=11801 How do the offence and armorer skillls work exactly?] &amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=21273 Rules for (Creature) Spells and Orbs]&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19624</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19624"/>
		<updated>2014-08-14T09:02:16Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value . Some creatures like [[Naga]]s do not have a damage range, meaning they deal a fixed amount of damage. This is also true for creatures that are [[bless]]ed or [[curse]]d. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together (see External Links below). However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Crystal Dragon]]s and [[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may deliver [[Death Blow]]s, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; Hero level &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
A special case of damage calculation concerns the spell and creature ability [[Fire Shield]]. [[Efreet Sultan]]s and any creatures that have Fire Shield cast on them counter-inflict damage from [[melee]] attacks. This is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;Fire Shield damage =  FS &amp;amp;times; DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FS is a percentage that equals 0.20 for Efreet Sultans and (basic) Fire Shield, 0.25 for advanced Fire Shield, and 0.30 for expert Fire Shield.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
On [[lava]] terrain, one hundred [[Archangel]]s that benefit from basic [[Bless]] cast by a level 14 [[Adela]] with expert [[Offense]] and an Attack Skill of 8 deliver a [[luck]]y strike against a stack of [[Petrify|petrified]] [[Arch Devil]]s that adopted a defensive stance right after a level 20 [[Tazar]] with advanced [[Armorer]] and 14 Defense casted expert [[Shield]] and expert [[Stone Skin]] at the beginning of the present combat round. How much damage do the Archangels inflict?&lt;br /&gt;
&lt;br /&gt;
First, base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;) is calculated. Because Bless has been cast with basic (rather than advanced or expert) proficiency and Archangels always deal a fixed amount of damage, base damage is equal to 100 &amp;amp;times; 50 = 5000.&lt;br /&gt;
 &lt;br /&gt;
This base damage is modified by several I and R variables. Let’s calculate I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; first. The Archangels have a base Attack Skill of 30, to which +8 Attack from Adela is added, for a total of 38. The Arch Devils have a base Defense Skill of 28, to which +14 Defense from Tazar is added, +6 due to Stone Skin and +1 due to [[Native Terrain]], for a total of 49. Because the Arch Devils adopted a defensive stance only after Stone Skin was cast, they receive a 20% Defense bonus over a Defense Skill of 49 (rather than 43), meaning their defense is 1.2 &amp;amp;times; 49 = 58.8, which is rounded down to 58. This is 58 - 38 points higher than the Attack Skill of the Archangels, meaning that I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0 and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 20 &amp;amp;times; 0.025 = 0.5.&lt;br /&gt;
&lt;br /&gt;
Because Adela has learned expert Offense, I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Adela’s Bless specialty at Hero level 14 means that I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;  = 0.03 &amp;amp;times; 14 / 7 = 0.06.&lt;br /&gt;
&lt;br /&gt;
Because the Archangels deliver a lucky strike, I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 1.00&lt;br /&gt;
&lt;br /&gt;
Archangels hate Arch Devils, so I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50.&lt;br /&gt;
      &lt;br /&gt;
Because Tazar has learned advanced Armorer, R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.10.&lt;br /&gt;
 &lt;br /&gt;
Tazar’s Armorer specialty at Hero level 20 means that R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; 20 &amp;amp;times; 0.10 = 0.10.&lt;br /&gt;
&lt;br /&gt;
Tazar has cast expert Shield, meaning that R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Because the Arch Devils are petrified, R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50&lt;br /&gt;
&lt;br /&gt;
Substituting these values in the damage formula above shows that total damage is equal to 100 &amp;amp;times; 50 &amp;amp;times; (1 + 0.30 + 0.06 + 1.00 + 0.50) &amp;amp;times; (1 - 0.50) &amp;amp;times; (1 - 0.10 - 0.10) &amp;amp;times; (1 - 0.30) &amp;amp;times; (1 - 0.50) = 2002.&lt;br /&gt;
&lt;br /&gt;
However, because this damage is exactly 2002 (i.e., an integer value) and Tazar has learned Armorer, damage is reduced by one additional damage point, for a total of 2001.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=20955 Base damage calculation]&amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Angelito: [http://heroescommunity.com/viewthread.php3?TID=11801 How do the offence and armorer skillls work exactly?] &amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=21273 Rules for (Creature) Spells and Orbs]&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19623</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19623"/>
		<updated>2014-08-14T08:58:23Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value . Some creatures like [[Naga]]s do not have a damage range, meaning they deal a fixed amount of damage. This is also true for creatures that are [[bless]]ed or [[curse]]d. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together (see External Links below). However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Crystal Dragon]]s and [[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may deliver [[Death Blow]]s, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
A special case of damage calculation concerns the spell and creature ability [[Fire Shield]]. [[Efreet Sultan]]s and any creatures that have Fire Shield cast on them counter-inflict damage from [[melee]] attacks. This is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;Fire Shield damage =  FS &amp;amp;times; DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FS is a percentage that equals 0.20 for Efreet Sultans and (basic) Fire Shield, 0.25 for advanced Fire Shield, and 0.30 for expert Fire Shield.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
On [[lava]] terrain, one hundred [[Archangel]]s that benefit from basic [[Bless]] cast by a level 14 [[Adela]] with expert [[Offense]] and an Attack Skill of 8 deliver a [[luck]]y strike against a stack of [[Petrify|petrified]] [[Arch Devil]]s that adopted a defensive stance right after a level 20 [[Tazar]] with advanced [[Armorer]] and 14 Defense casted expert [[Shield]] and expert [[Stone Skin]] at the beginning of the present combat round. How much damage do the Archangels inflict?&lt;br /&gt;
&lt;br /&gt;
First, base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;) is calculated. Because Bless has been cast with basic (rather than advanced or expert) proficiency and Archangels always deal a fixed amount of damage, base damage is equal to 100 &amp;amp;times; 50 = 5000.&lt;br /&gt;
 &lt;br /&gt;
This base damage is modified by several I and R variables. Let’s calculate I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; first. The Archangels have a base Attack Skill of 30, to which +8 Attack from Adela is added, for a total of 38. The Arch Devils have a base Defense Skill of 28, to which +14 Defense from Tazar is added, +6 due to Stone Skin and +1 due to [[Native Terrain]], for a total of 49. Because the Arch Devils adopted a defensive stance only after Stone Skin was cast, they receive a 20% Defense bonus over a Defense Skill of 49 (rather than 43), meaning their defense is 1.2 &amp;amp;times; 49 = 58.8, which is rounded down to 58. This is 58 - 38 points higher than the Attack Skill of the Archangels, meaning that I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0 and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 20 &amp;amp;times; 0.025 = 0.5.&lt;br /&gt;
&lt;br /&gt;
Because Adela has learned expert Offense, I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Adela’s Bless specialty at Hero level 14 means that I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;  = 0.03 &amp;amp;times; 14 / 7 = 0.06.&lt;br /&gt;
&lt;br /&gt;
Because the Archangels deliver a lucky strike, I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 1.00&lt;br /&gt;
&lt;br /&gt;
Archangels hate Arch Devils, so I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50.&lt;br /&gt;
      &lt;br /&gt;
Because Tazar has learned advanced Armorer, R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.10.&lt;br /&gt;
 &lt;br /&gt;
Tazar’s Armorer specialty at Hero level 20 means that R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; 20 &amp;amp;times; 0.10 = 0.10.&lt;br /&gt;
&lt;br /&gt;
Tazar has cast expert Shield, meaning that R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Because the Arch Devils are petrified, R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50&lt;br /&gt;
&lt;br /&gt;
Substituting these values in the damage formula above shows that total damage is equal to 100 &amp;amp;times; 50 &amp;amp;times; (1 + 0.30 + 0.06 + 1.00 + 0.50) &amp;amp;times; (1 - 0.50) &amp;amp;times; (1 - 0.10 - 0.10) &amp;amp;times; (1 - 0.30) &amp;amp;times; (1 - 0.50) = 2002.&lt;br /&gt;
&lt;br /&gt;
However, because this damage is exactly 2002 (i.e., an integer value) and Tazar has learned Armorer, damage is reduced by one additional damage point, for a total of 2001.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=20955 Base damage calculation]&amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Angelito: [http://heroescommunity.com/viewthread.php3?TID=11801 How do the offence and armorer skillls work exactly?] &amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=21273 Rules for (Creature) Spells and Orbs]&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19622</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19622"/>
		<updated>2014-08-14T07:17:50Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value . Some creatures like [[Naga]]s do not have a damage range, meaning they deal a fixed amount of damage. This is also true for creatures that are [[bless]]ed or [[curse]]d. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together (see External Links below). However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Crystal Dragon]]s and [[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may deliver [[Death Blow]]s, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
A special case of damage calculation concerns the spell and creature ability [[Fire Shield]]. [[Efreet Sultan]]s and any creatures that have Fire Shield cast on them counter-inflict damage from [[melee]] attacks. This is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;Fire Shield damage =  FS &amp;amp;times; DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FS is a percentage that equals 0.20 for Efreet Sultans and (basic) Fire Shield, 0.25 for advanced Fire Shield, and 0.30 for expert Fire Shield.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
On [[lava]] terrain, one hundred [[Archangel]]s that benefit from basic [[Bless]] cast by a level 14 [[Adela]] with expert [[Offense]] and an Attack Skill of 8 deliver a [[luck]]y strike against a stack of [[Petrify|petrified]] [[Arch Devil]]s that adopted a defensive stance right after a level 20 [[Tazar]] with advanced [[Armorer]] and 14 Defense casted expert [[Shield]] and expert [[Stone Skin]] at the beginning of the present combat round. How much damage do the Archangels inflict?&lt;br /&gt;
&lt;br /&gt;
First, base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;) is calculated. Because Bless has been cast with basic (rather than advanced or expert) proficiency and Archangels always deal a fixed amount of damage, base damage is equal to 100 &amp;amp;times; 50 = 5000.&lt;br /&gt;
 &lt;br /&gt;
This base damage is modified by several I and R variables. Let’s calculate I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; first. The Archangels have a base Attack Skill of 30, to which +8 Attack from Adela is added, for a total of 38. The Arch Devils have a base Defense Skill of 28, to which +14 Defense from Tazar is added, +6 due to Stone Skin and +1 due to [[Native Terrain]], for a total of 49. Because the Arch Devils adopted a defensive stance only after Stone Skin was cast, they receive a 20% Defense bonus over a Defense Skill of 49 (rather than 43), meaning their defense is 1.2 &amp;amp;times; 49 = 58.8, which is rounded down to 58. This is 58 - 38 points higher than the Attack Skill of the Archangels, meaning that I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0 and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 20 &amp;amp;times; 0.025 = 0.5.&lt;br /&gt;
&lt;br /&gt;
Because Adela has learned expert Offense, I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Adela’s Bless specialty at Hero level 14 means that I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;  = 0.03 &amp;amp;times; 14 / 7 = 0.06.&lt;br /&gt;
&lt;br /&gt;
Because the Archangels deliver a lucky strike, I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 1.00&lt;br /&gt;
&lt;br /&gt;
Archangels hate Arch Devils, so I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50.&lt;br /&gt;
      &lt;br /&gt;
Because Tazar has learned advanced Armorer, R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.10.&lt;br /&gt;
 &lt;br /&gt;
Tazar’s Armorer specialty at Hero level 20 means that R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; 20 &amp;amp;times; 0.10 = 0.10.&lt;br /&gt;
&lt;br /&gt;
Tazar has cast expert Shield, meaning that R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Because the Arch Devils are petrified, R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50&lt;br /&gt;
&lt;br /&gt;
Substituting these values in the damage formula above shows that total damage is equal to 100 &amp;amp;times; 50 &amp;amp;times; (1 + 0.30 + 0.06 + 1.00 + 0.50) &amp;amp;times; (1 - 0.50) &amp;amp;times; (1 - 0.80) &amp;amp;times; (1 - 0.70) &amp;amp;times; (1 - 0.50) = 2002.&lt;br /&gt;
&lt;br /&gt;
However, because this damage is exactly 2002 (i.e., an integer value) and Tazar has learned Armorer, damage is reduced by one additional damage point, for a total of 2001.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=20955 Base damage calculation]&amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Angelito: [http://heroescommunity.com/viewthread.php3?TID=11801 How do the offence and armorer skillls work exactly?] &amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=21273 Rules for (Creature) Spells and Orbs]&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19602</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19602"/>
		<updated>2014-08-13T21:00:14Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value . Some creatures like [[Naga]]s do not have a damage range, meaning they deal a fixed amount of damage. This is also true for creatures that are [[bless]]ed or [[curse]]d. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together (see External Links below). However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Crystal Dragon]]s and [[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may deliver [[Death Blow]]s, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
A special case of damage calculation concerns the spell and creature ability [[Fire Shield]]. [[Efreet Sultan]]s and any creatures that have Fire Shield cast on them counter-inflict damage from [[melee]] attacks. This is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;Fire Shield damage =  FS &amp;amp;times; DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FS is a percentage that equals 0.20 for Efreet Sultans and (basic) Fire Shield, 0.25 for advanced Fire Shield, and 0.30 for expert Fire Shield.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
On [[lava]] terrain, one hundred [[Archangel]]s that benefit from basic [[Bless]] cast by a level 14 [[Adela]] with expert [[Offense]] and an Attack Skill of 8 deliver a [[luck]]y strike against a stack of [petrify|petrified] [[Arch Devil]]s that adopted a defensive stance right after a level 20 [[Tazar]] with advanced [[Armorer]] and 14 Defense casted expert [[Shield]] and expert [[Stone Skin]] at the beginning of the present combat round. How much damage do the Archangels inflict?&lt;br /&gt;
&lt;br /&gt;
First, base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;) is calculated. Because Bless has been cast with basic (rather than advanced or expert) proficiency and Archangels always deal a fixed amount of damage, base damage is equal to 100 &amp;amp;times; 50 = 5000.&lt;br /&gt;
 &lt;br /&gt;
This base damage is modified by several I and R variables. Let’s calculate I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; first. The Archangels have a base Attack Skill of 30, to which +8 Attack from Adela is added, for a total of 38. The Arch Devils have a base Defense Skill of 28, to which +14 Defense from Tazar is added, +6 due to Stone Skin and +1 due to [[Native Terrain]], for a total of 49. Because the Arch Devils adopted a defensive stance only after Stone Skin was cast, they receive a 20% Defense bonus over a Defense Skill of 49 (rather than 43), meaning their defense is 1.2 &amp;amp;times; 49 = 58.8, which is rounded down to 58. This is 58 - 38 points higher than the Attack Skill of the Archangels, meaning that I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0 and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 20 &amp;amp;times; 0.025 = 0.5.&lt;br /&gt;
&lt;br /&gt;
Because Adela has learned expert Offense, I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Adela’s Bless specialty at Hero level 14 means that I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;  = 0.03 &amp;amp;times; 14 / 7 = 0.06.&lt;br /&gt;
&lt;br /&gt;
Because the Archangels deliver a lucky strike, I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 1.00&lt;br /&gt;
&lt;br /&gt;
Archangels hate Arch Devils, so I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50.&lt;br /&gt;
      &lt;br /&gt;
Because Tazar has learned advanced Armorer, R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.10.&lt;br /&gt;
 &lt;br /&gt;
Tazar’s Armorer specialty at Hero level 20 means that R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; 20 &amp;amp;times; 0.10 = 0.10.&lt;br /&gt;
&lt;br /&gt;
Tazar has cast expert Shield, meaning that R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Because the Arch Devils are petrified, R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50&lt;br /&gt;
&lt;br /&gt;
Substituting these values in the damage formula above shows that total damage is equal to 100 &amp;amp;times; 50 &amp;amp;times; (1 + 0.30 + 0.06 + 1.00 + 0.50) &amp;amp;times; (1 - 0.50) &amp;amp;times; (1 - 0.80) &amp;amp;times; (1 - 0.70) &amp;amp;times; (1 - 0.50) = 2002.&lt;br /&gt;
&lt;br /&gt;
However, because this damage is exactly 2002 (i.e., an integer value) and Tazar has learned Armorer, damage is reduced by one additional damage point, for a total of 2001.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=20955 Base damage calculation]&amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Angelito: [http://heroescommunity.com/viewthread.php3?TID=11801 How do the offence and armorer skillls work exactly?] &amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=21273 Rules for (Creature) Spells and Orbs]&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19601</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19601"/>
		<updated>2014-08-13T20:57:30Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Example verified through testing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value . Some creatures like [[Naga]]s do not have a damage range, meaning they deal a fixed amount of damage. This is also true for creatures that are [[bless]]ed or [[curse]]d. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together (see External Links below). However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Crystal Dragon]]s and [[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may strike [[Death Blow]] attacks, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
A special case of damage calculation concerns the spell and creature ability [[Fire Shield]]. [[Efreet Sultan]]s and any creatures that have Fire Shield cast on them counter-inflict damage from [[melee]] attacks. This is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;Fire Shield damage =  FS &amp;amp;times; DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FS is a percentage that equals 0.20 for Efreet Sultans and (basic) Fire Shield, 0.25 for advanced Fire Shield, and 0.30 for expert Fire Shield.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
On [[lava]] terrain, one hundred [[Archangel]]s that benefit from basic [[Bless]] cast by a level 14 [[Adela]] with expert [[Offense]] and an Attack Skill of 8 deliver a [[luck]]y strike against a stack of [petrify|petrified] [[Arch Devil]]s that adopted a defensive stance right after a level 20 [[Tazar]] with advanced [[Armorer]] and 14 Defense casted expert [[Shield]] and expert [[Stone Skin]] at the beginning of the present combat round. How much damage do the Archangels inflict?&lt;br /&gt;
&lt;br /&gt;
First, base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;) is calculated. Because Bless has been cast with basic (rather than advanced or expert) proficiency and Archangels always deal a fixed amount of damage, base damage is equal to 100 &amp;amp;times; 50 = 5000.&lt;br /&gt;
 &lt;br /&gt;
This base damage is modified by several I and R variables. Let’s calculate I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; first. The Archangels have a base Attack Skill of 30, to which +8 Attack from Adela is added, for a total of 38. The Arch Devils have a base Defense Skill of 28, to which +14 Defense from Tazar is added, +6 due to Stone Skin and +1 due to [[Native Terrain]], for a total of 49. Because the Arch Devils adopted a defensive stance only after Stone Skin was cast, they receive a 20% Defense bonus over a Defense Skill of 49 (rather than 43), meaning their defense is 1.2 &amp;amp;times; 49 = 58.8, which is rounded down to 58. This is 58 - 38 points higher than the Attack Skill of the Archangels, meaning that I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0 and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 20 &amp;amp;times; 0.025 = 0.5.&lt;br /&gt;
&lt;br /&gt;
Because Adela has learned expert Offense, I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Adela’s Bless specialty at Hero level 14 means that I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;  = 0.03 &amp;amp;times; 14 / 7 = 0.06.&lt;br /&gt;
&lt;br /&gt;
Because the Archangels deliver a lucky strike, I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 1.00&lt;br /&gt;
&lt;br /&gt;
Archangels hate Arch Devils, so I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50.&lt;br /&gt;
      &lt;br /&gt;
Because Tazar has learned advanced Armorer, R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.10.&lt;br /&gt;
 &lt;br /&gt;
Tazar’s Armorer specialty at Hero level 20 means that R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; 20 &amp;amp;times; 0.10 = 0.10.&lt;br /&gt;
&lt;br /&gt;
Tazar has cast expert Shield, meaning that R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.30.&lt;br /&gt;
&lt;br /&gt;
Because the Arch Devils are petrified, R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50&lt;br /&gt;
&lt;br /&gt;
Substituting these values in the damage formula above shows that total damage is equal to 100 &amp;amp;times; 50 &amp;amp;times; (1 + 0.30 + 0.06 + 1.00 + 0.50) &amp;amp;times; (1 - 0.50) &amp;amp;times; (1 - 0.80) &amp;amp;times; (1 - 0.70) &amp;amp;times; (1 - 0.50) = 2002.&lt;br /&gt;
&lt;br /&gt;
However, because this damage is exactly 2002 (i.e., an integer value) and Tazar has learned Armorer, damage is reduced by one additional damage point, for a total of 2001.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=20955 Base damage calculation]&amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Angelito: [http://heroescommunity.com/viewthread.php3?TID=11801 How do the offence and armorer skillls work exactly?] &amp;lt;br&amp;gt;&lt;br /&gt;
Thread at [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=21273 Rules for (Creature) Spells and Orbs]&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19216</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19216"/>
		<updated>2014-08-01T21:53:03Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: I guess this article is nearing its completion, isn&amp;#039;t it?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value . Some creatures like [[Naga]]s do not have a damage range, meaning they deal a fixed amount of damage. This is also true for creatures that are [[bless]]ed or [[curse]]d. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together (see External Links below). However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may strike [[Death Blow]] attacks, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
A special case of damage calculation concerns the spell and creature ability [[Fire Shield]]. [[Efreet Sultan]]s and any creatures that have Fire Shield cast on them counter-inflict damage from [[melee]] attacks. This is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;Fire Shield damage =  FS &amp;amp;times; DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FS is a percentage that equals 0.20 for Efreet Sultans and (basic) Fire Shield, 0.25 for advanced Fire Shield, and 0.30 for expert Fire Shield.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
Thread on [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=20955 Base damage calculation]&amp;lt;br&amp;gt;&lt;br /&gt;
Thread on [http://heroescommunity.com HeroesCommunity], started by Angelito: [http://heroescommunity.com/viewthread.php3?TID=11801 How do the offence and armorer skillls work exactly?] &amp;lt;br&amp;gt;&lt;br /&gt;
Thread on [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=21273 Rules for (Creature) Spells and Orbs]&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19215</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19215"/>
		<updated>2014-08-01T21:48:38Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Perhaps a more complicated example than this one about Naga vs Pikemen is insightful?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may strike [[Death Blow]] attacks, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
A special case of damage calculation concerns the spell and creature ability [[Fire Shield]]. [[Efreet Sultan]]s and any creatures that have Fire Shield cast on them counter-inflict damage from [[melee]] attacks. This is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;Fire Shield damage =  FS &amp;amp;times; DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FS is a percentage that equals 0.20 for Efreet Sultans and (basic) Fire Shield, 0.25 for advanced Fire Shield, and 0.30 for expert Fire Shield.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
Thread on [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=20955 Base damage calculation]&amp;lt;br&amp;gt;&lt;br /&gt;
Thread on [http://heroescommunity.com HeroesCommunity], started by Angelito: [http://heroescommunity.com/viewthread.php3?TID=11801 How do the offence and armorer skillls work exactly?] &amp;lt;br&amp;gt;&lt;br /&gt;
Thread on [http://heroescommunity.com HeroesCommunity], started by Ecoris: [http://heroescommunity.com/viewthread.php3?TID=21273 Rules for (Creature) Spells and Orbs]&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19214</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19214"/>
		<updated>2014-08-01T21:42:11Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Fire Shield&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may strike [[Death Blow]] attacks, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
A special case of damage calculation concerns the spell and creature ability [[Fire Shield]]. [[Efreet Sultan]]s and any creatures that have Fire Shield cast on them counter-inflict damage from [[melee]] attacks. This is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;Fire Shield damage =  FS &amp;amp;times; DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FS is a percentage that equals 0.20 for Efreet Sultans and (basic) Fire Shield, 0.25 for advanced Fire Shield, and 0.30 for expert Fire Shield.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19213</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19213"/>
		<updated>2014-08-01T21:13:19Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Creature Specialties - variable R8 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may strike [[Death Blow]] attacks, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti-Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying attack]] or a [[Medusa]]&#039;s [[Stone gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19212</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19212"/>
		<updated>2014-08-01T21:10:05Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Nice work with the proofreading so far!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right. To summarize the above formula, the content in the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content in the second parentheses reduces the damage with a modifier varying from ~0.01 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference (ADD), denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of the base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] or [disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or hero&#039;s [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive ADD therefore increases damage, meaning that the variable I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative ADD decreases damage, meaning that R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is positive whereas I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The ADD can modify base damage only within 1.00...3.00 if ADD is postivie, and within 0.70...1.00 if ADD is negative. These limits are reached by a positive ADD of +60 and a negative ADD of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability, and if a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 for I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; depending on what level the skill is (if any). Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks. Because creatures cannot peform ranged and melee attacks at the same time, Archery and Offense modifiers cannot affect damage simultaneously.&lt;br /&gt;
&lt;br /&gt;
Variable R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is related to Archery and Offense modifiers through heroes who specilize in these skills. There are three heroes specializing in Archery or Offense; Orrin specializes in Archery, while Gundula and Crag Hack specialize Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
A special case of the variable I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; is [[Adela]] and her [[Bless]] specialty. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-tier creatures. Her Bless grants +3% damage per her level to 1st level creatures, whereas it grants +0.6% per her level for 5th level creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The [[luck]] variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable luck, which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt;, which denotes creature specialties from [[Cavalier and Champion|Cavaliers and Champions]], [[Dread Knight]]s, [[Ballista]]s, [[elemental]]s, and creatures that [[hate]] each other. Dread Knights may strike [[Death Blow]] attacks, which gives variable I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 1.00, effectively doubling base damage (though not necessarily total damage). The I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; variable is also 1.00 for a Ballista whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Although [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do not hate each other, they also do double base damage against each other (i.e., I&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 1.00). Finally, the jousting specialty of Cavaliers and Champions lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to the variables I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and I&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; variables R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;3&amp;lt;/small&amp;gt; denote how [[Armorer]] and specializing in the skill affects the value of final damage. The reduction due to Armorer is not dependable on the attack type, but is the same for both ranged and melee damage. R&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; can receive values 0, 0.05, 0.10 or 0.15, respectively indicating that a hero does not posses the skill, has it on basic, advanced or expert level. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - increase the effectiveness of Armorer secondary skill by 5% for every level. Thus, as can be seen from the following formula, they double the effectiveness of the Armorer skill when they reach level 20:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take extra damage from [[arrow tower]]s. The damage reduction is reversed, as if the sign within the parenthesis would be plus instead of minus. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the ADD is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Magic shields - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;small&amp;gt;4&amp;lt;/small&amp;gt; = 0.25), or by 50% when cast with advanced or expert proficiency. Similarly to Armorer and arrow towers, also Air Shield actually increases the damage from arrow towers instead if decreasing it.&lt;br /&gt;
&lt;br /&gt;
==== Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is unable to shoot (i.e., blocked). It has to resort to melee attacks. This typically reduces its damage by 50% (R&amp;lt;small&amp;gt;5&amp;lt;/small&amp;gt; = 0.50). However, [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
==== Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind the wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;small&amp;gt;6&amp;lt;/small&amp;gt; = 0.50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Mind spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
Additionally, when [[Forgetfulness]] cast with basic or no proficiency, it causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;small&amp;gt;7&amp;lt;/small&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variable R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Damage may also be reduced by some special abilities from creatures:&lt;br /&gt;
&lt;br /&gt;
* [[Psychic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against creatures that are immune to [[Mind spell]]s, such as [[Giant]]s and [[Undead]]. This is not affected by the [[Orb of Vulnerability]].&lt;br /&gt;
* [[Magic Elemental]]s deal half damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) against [[Magic Elemental]]s and [[Black Dragon]]s. This is not affected by the [[Orb of Vulnerability]], [[Anti Magic]], or [[Magic Resistance]].&lt;br /&gt;
* Creatures that are petrified by a [[Basilisk]]&#039;s [[Petrifying Attack]] or a [[Medusa]]&#039;s [[Stone Gaze]] take 50% damage (R&amp;lt;small&amp;gt;8&amp;lt;/small&amp;gt; = 0.50) from [[ranged attack|ranged]] and [[melee]] attacks. Taking damage also deactivates the effect. &lt;br /&gt;
* Creatures that are paralyzed by a [[Scorpicore]]&#039;s [[Paralyzing Venom]] retaliate at only 25% of their full strength against the attack that deactivates the effect.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19135</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19135"/>
		<updated>2014-08-01T08:03:56Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Blind - variable R7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability. If a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill.&lt;br /&gt;
&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Spells - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.25), or even by 50% when cast with advanced or expert proficiency. [[Forgetfulness]], when cast with basic or no proficiency, causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
====Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is  unable to shoot (i.e., blocked). It has to resort to [[melee]] attacks. This typically reduces its damage by 50% (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50). [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
====Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind a wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = .50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Blind - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25% (R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variables R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
** Petrified&lt;br /&gt;
** Paralyzed&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19134</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19134"/>
		<updated>2014-08-01T07:56:27Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Blind - variable R7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability. If a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill.&lt;br /&gt;
&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Spells - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.25), or even by 50% when cast with advanced or expert proficiency. [[Forgetfulness]], when cast with basic or no proficiency, causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
====Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is  unable to shoot (i.e., blocked). It has to resort to [[melee]] attacks. This typically reduces its damage by 50% (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50). [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
====Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind a wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = .50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Blind - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be at only 50% strength (R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and at 25%(R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variables R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
** Petrified&lt;br /&gt;
** Paralyzed&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19070</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=19070"/>
		<updated>2014-07-31T21:22:42Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Blind added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability. If a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill.&lt;br /&gt;
&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Spells - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.25), or even by 50% when cast with advanced or expert proficiency. [[Forgetfulness]], when cast with basic or no proficiency, causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
====Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is  unable to shoot (i.e., blocked). It has to resort to [[melee]] attacks. This typically reduces its damage by 50% (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50). [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
====Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind a wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = .50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Spells - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The spell [[Blind]] is deactivated when a blinded creature stack is attacked. Any retaliation against this attack will not be at full strength. It will be only 50% (R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50) when Blind is cast with basic or no proficiency, and 25%(R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.25) when cast with advanced proficiency. An attack that deactivates expert Blind cannot be retaliated against, but the targeted creature stack does retain its ability to retaliate against another attack in that same combat round. [[Unicorn]]s and [[War Unicorn]]s cast Blind with basic proficiency, unless the battle takes place on [[Magic Plains]].&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variables R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
** Petrified&lt;br /&gt;
** Paralyzed&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Necromancy&amp;diff=18986</id>
		<title>Necromancy</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Necromancy&amp;diff=18986"/>
		<updated>2014-07-28T20:46:01Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Claim of witches being offered falsified according to Did You Know page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Secondary skills}}&lt;br /&gt;
{{Secondary skill&lt;br /&gt;
 | B_effect = Creature Gathering, Necropolis only, allows 10% of the creatures killed in combat to be brought back from the dead as [[skeleton]]s.&lt;br /&gt;
 | A_effect = Creature Gathering, Necropolis only, allows 20% of the creatures killed in combat to be brought back from the dead as [[skeleton]]s.&lt;br /&gt;
 | E_effect = Creature Gathering, Necropolis only, allows 30% of the creatures killed in combat to be brought back from the dead as [[skeleton]]s.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Background information==&lt;br /&gt;
&lt;br /&gt;
Necromancy is a [[Secondary Skill]] that all [[Necropolis]] heroes - both [[Death Knight]]s and [[Necromancer]]s - start with. No other heroes have Necromancy as a starting skill, nor can they learn basic Necromancy by levelling up. Non-[[Necropolis]] heroes can learn Necromancy only from [[Witch Hut]]s and [[Scholar (Adventure Map)|Scholar]]s, and only if the mapmaker specifically allows it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Recommended for:&#039;&#039;&#039; N/A. Heroes either start with this skill, or are typically unable to learn it.&lt;br /&gt;
&lt;br /&gt;
On many maps, especially XL maps with droves of low-level creatures, Necromancy is considered overpowered by tournament players, and its use is therefore frequently banned from competitive play.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
*Basic Necromancy enables a victorious hero to raise as [[Skeleton]]s up to 10% of enemy creatures killed in combat, with a minimum of one.&lt;br /&gt;
*Advanced Necromancy enables a victorious hero to raise as [[Skeleton]]s up to 20% of enemy creatures killed in combat, with a minimum of one.&lt;br /&gt;
*Expert Necromancy enables a victorious hero to raise as [[Skeleton]]s up to 30% of enemy creatures killed in combat, with a minimum of one.&lt;br /&gt;
&lt;br /&gt;
All enemy creatures that are displayed after battle as casualties can be raised as skeletons, even if this includes [[sacrifice]]d creatures, [[clone]]d creatures, summoned [[elemental]]s or [[war machines]](!).&lt;br /&gt;
&lt;br /&gt;
When a victorious army contains [[Skeleton Warrior]]s but no [[Skeleton]]s, and no empty army slot is available, Skeleton Warriors will be raised instead of Skeletons, but only 2/3 of the usual number.&lt;br /&gt;
&lt;br /&gt;
==Heroes with a specialty in this skill==&lt;br /&gt;
*[[Isra]] the [[Death Knight]]&lt;br /&gt;
*[[Vidomina]] the [[Necromancer]]&lt;br /&gt;
&lt;br /&gt;
==Artifacts affecting this skill==&lt;br /&gt;
*[[Amulet of the Undertaker]] (Neck). Gives +5% Necromancy to a hero&#039;s Necromancy skill.&lt;br /&gt;
*[[Vampire&#039;s Cowl]]  (Shoulders). Gives +10% Necromancy to a hero&#039;s Necromancy skill.&lt;br /&gt;
*[[Dead Man&#039;s Boots]] (Feet). Gives +15% Necromancy to a hero&#039;s Necromancy skill.&lt;br /&gt;
*[[Cloak of the Undead King]] (Shoulders, combination artifact assembled from the other three Necromancy artifacts). Heroes without Necromancy can raise [[Skeleton]]s as if they have learnt Expert Necromancy. Heroes with Necromancy receive +30% to their total Necromancy percentage on top of the +30% Necromancy provided by the individual artifacts, and can raise [[Walking Dead]], [[Wight]]s and [[Lich]]es at, respectively, Basic, Advanced and Expert Necromancy. &#039;&#039;Note: Available only in the&#039;&#039; [[Shadow of Death]] &#039;&#039;expansion&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Buildings affecting this skill==&lt;br /&gt;
*[[Necromancy Amplifier]] &lt;br /&gt;
*[[Soul prison]]&lt;br /&gt;
&lt;br /&gt;
==In-depth==&lt;br /&gt;
&lt;br /&gt;
The exact number of skeletons raised depends on a hero’s total Necromancy percentage. This is calculated by summing all the Necromancy percentages as provided by a hero&#039;s Necromancy skill &#039;&#039;prior to&#039;&#039; combat (including any Necromancy [[specialty]]), Necromancy artifacts, [[Necromancy amplifier]]s and the [[Soul Prison]]. Thus, a level 10 [[Isra]] with Advanced Necromancy, the [[Amulet of the Undertaker]], two [[Necromancy Amplifier]]s and a [[Soul Prison]] has a total Necromancy percentage of (10 × 0.05 × 20% + 20%) + 5% + 2 × 10% + 20% = 75%. The maximum percentage is 100%.&lt;br /&gt;
&lt;br /&gt;
The number of raised skeletons is &#039;&#039;separately&#039;&#039; calculated for each enemy stack and is not affected by whether either a victorious or a defeated hero had any health artifacts such as the [[Vial of Lifeblood]] equipped: &lt;br /&gt;
*If an enemy stack consisted of creatures with 6 [[health]] or more, the number of raised skeletons from that stack is equal to the &#039;&#039;number of creatures&#039;&#039; killed multiplied by a hero’s total Necromancy percentage. &lt;br /&gt;
*If an enemy stack consisted of creatures with less than 6 [[health]], the number of skeletons raised from that stack is equal to the &#039;&#039;total number of health points&#039;&#039; of the killed creatures multiplied by a hero’s total Necromancy percentage. &lt;br /&gt;
The total number of skeletons raised equals the sum of the number of skeletons raised from each separate stack.&lt;br /&gt;
&lt;br /&gt;
To illustrate, a hero with 35% Necromancy will raise 5 Skeletons if she defeats an enemy hero who has fled after losing one stack of 8 [[Stone Gargoyle]]s, one stack of 1 [[Gremlin]], and 15 Gremlins from one stack of 20 Gremlins. That is, 35% of 8 Stone Gargoyles is enough for 2 skeletons, the stack of 1 Gremlin consists of too few hitpoints to raise a skeleton from, and the 15 Gremlins that were killed provide 60 health, of which 35% (i.e., 21 health) can be raised into 3 skeletons. The total number of skeletons raised is therefore 2 + 0 + 3 = 5.&lt;br /&gt;
&lt;br /&gt;
Finally, when having killed at least one enemy creature, even if it is just a [[Peasant]], victorious heroes with Necromancy will always raise at least one skeleton, regardless of their total Necromancy percentage. &lt;br /&gt;
&lt;br /&gt;
[[Category: Secondary skills]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
It is kindalike [[Diplomacy]] in that it helps gather units.&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Melee_penalty&amp;diff=18921</id>
		<title>Melee penalty</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Melee_penalty&amp;diff=18921"/>
		<updated>2014-07-27T14:59:22Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Ice and Air elementals have melee penalty (even though it is sometimes indeed noted that they don&amp;#039;t)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Melee penalty&#039;&#039;&#039; is term for [[shooter]]s handicap, that causes them to inflict only half of the [[damage]] they would do, if they were [[ranged attack|attacking at range]]. Shooters are forced to either move or attack another [[troop]] in melee, if a troop is located adjacent to it.&lt;br /&gt;
&lt;br /&gt;
Several shooters have &#039;&#039;no melee penalty&#039;&#039;&#039; as [[special ability]], which allows them to do the same amount of damage as with ranged attack. However, [[Archer and marksman|marksmen]] and [[Wood and grand elf|grand elves]], who have [[Double attack]] as special ability, will only attack once in melee combat. Additionally, in {{sod}} [[Bow of the Sharpshooter]] eliminates melee penalty completely, and allows shooter troops to use their ranged attack even if another troop is located adjacent to it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creatures w/out melee penalty ==&lt;br /&gt;
{{Creaturetable}}&lt;br /&gt;
{{Creaturetablerow|Beholder           |Dungeon   |3| 9| 7| 3| 5|  22| 5|  250|               |[[Ranged attack|Ranged]], No [[Melee penalty|Melee]]}}&lt;br /&gt;
{{Creaturetablerow|Evil Eye           |Dungeon   |3|10| 8| 3| 5|  22| 7|  280|               |[[Ranged attack|Ranged]], No [[Melee penalty|Melee]]}}&lt;br /&gt;
{{Creaturetablerow|Medusa             |Dungeon   |4| 9| 9| 6| 8|  25| 5|  300|               |[[Ranged attack|Ranged]], No [[Melee penalty|Melee]], [[Petrify]]}}&lt;br /&gt;
{{Creaturetablerow|Medusa Queen       |Dungeon   |4|10|10| 6| 8|  30| 6|  330|               |[[Ranged attack|Ranged]], No [[Melee penalty|Melee]], [[Petrify]]}}&lt;br /&gt;
{{Creaturetablerow|Mage               |Tower     |4|11| 8| 7| 9|  25| 5|  350|               |[[Ranged attack|Ranged]], No [[Melee penalty|Melee]], [[Spells]] cost -2 [[sp]]}}&lt;br /&gt;
{{Creaturetablerow|Arch Mage          |Tower     |4|12| 9| 7| 9|  30| 7|  450|               |[[Ranged attack|Ranged]], No [[Melee penalty|Melee]], No [[Obstacle penalty]], [[Spells]] cost -2 [[sp]]}}&lt;br /&gt;
{{Creaturetablerow|Zealot             |Castle    |5|12|10|10|12|  30| 7|  450|               |[[Ranged attack|Ranged]], No [[Melee penalty|Melee]]}}&lt;br /&gt;
{{Creaturetablerow|Enchanter          |Neutral   | |17|12|14|14|  30| 9|  750|               |[[Ranged attack|Ranged]], No [[Melee penalty|Melee]], [[Spellcaster]]}}&lt;br /&gt;
{{Creaturetablerow|Titan              |Tower     |7|24|24|40|60| 300|11| 5000|     +2 {{gem}}|[[Ranged attack|Ranged]], No [[Melee penalty|Melee]], [[Spell immunity|Resist]] [[Mind spell]], [[Hate]]s [[Black Dragon]]s}}&lt;br /&gt;
|}&lt;br /&gt;
[[List of all creatures]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{An|Bow of the Sharpshooter}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Creature specialties]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18920</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18920"/>
		<updated>2014-07-27T14:57:16Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Range and Melee penalty - variable R5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability. If a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill.&lt;br /&gt;
&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Spells - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.25), or even by 50% when cast with advanced or expert proficiency. [[Forgetfulness]], when cast with basic or no proficiency, causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
====Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is  unable to shoot (i.e., blocked). It has to resort to [[melee]] attacks. This typically reduces its damage by 50% (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50). [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].&lt;br /&gt;
&lt;br /&gt;
====Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind a wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = .50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Blind - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variables R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
** Petrified&lt;br /&gt;
** Paralyzed&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18919</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18919"/>
		<updated>2014-07-27T14:55:12Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Obstacle, Range, and Melee Penalty added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability. If a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill.&lt;br /&gt;
&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Spells - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.25), or even by 50% when cast with advanced or expert proficiency. [[Forgetfulness]], when cast with basic or no proficiency, causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
====Range and Melee penalty - variable R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] do only 50% damage (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50) to targets that are situated at a distance of ten or more [[hex]]es on the combat field. This range penalty is negated by [[Sharpshooter]]s and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]]. When a target occupies two hexes, it is possible for a range penalty to apply to the second hex, but not to the first hex the creature is standing on.&lt;br /&gt;
&lt;br /&gt;
When a hex adjacent to a ranged unit is occupied by an enemy unit, the ranged unit is  unable to shoot (i.e., blocked). It has to resort to making [[melee]] attacks. This typically reduces their damage by 50% (R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = .50). [[Beholder]]s, [[Evil Eye]]s, [[Medusa]]s, [[Medusa Queen]]s, [[Mage|Magi]], [[Arch Mage|Arch Magi]], [[Zealot]]s, [[Enchanter]]s and [[Titan]]s are the only ranged units that do not suffer from this [[melee penalty]].   &lt;br /&gt;
&lt;br /&gt;
====Obstacle Penalty - variable R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;====&lt;br /&gt;
&lt;br /&gt;
[[Ranged attack|Ranged units]] that during a siege attack a target behind a wall receive an [[obstacle penalty]] if the wall protecing the target is not destroyed. As a result, their damage is reduced by 50% (R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = .50). This damage is halved once again if a range penalty applies. The obstacle penalty is negated by [[Arch Mage|Arch Magi]] and [[Sharpshooter]]s, and by heroes carrying the [[Golden Bow]] or [[Bow of the Sharpshooter]].&lt;br /&gt;
&lt;br /&gt;
==== Blind - variable R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
&lt;br /&gt;
==== Creature Specialties - variables R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
** Petrified&lt;br /&gt;
** Paralyzed&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18916</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18916"/>
		<updated>2014-07-27T14:10:27Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*The spells [[Protection from Air]], [[Protection from Earth|Earth]], [[Protection from Fire|Fire]] and [[Protection from Water|Water]] reduce spell damage from the school they protect against by 30%, or even by 50% when cast at advanced or expert level.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability. If a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill.&lt;br /&gt;
&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Spells - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.25), or even by 50% when cast with advanced or expert proficiency. [[Forgetfulness]], when cast with basic or no proficiency, causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Other factors – variables R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
** Petrified&lt;br /&gt;
** Paralyzed&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18713</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18713"/>
		<updated>2014-07-26T14:03:48Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability. If a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill.&lt;br /&gt;
&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Spells - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense Skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]], [[Air Shield]], and [[Forgetfulness]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15), or even by 30% when cast with advanced or expert proficiency. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.25), or even by 50% when cast with advanced or expert proficiency. [[Forgetfulness]], when cast with basic or no proficiency, causes half of an enemy creature stack to forget to use its ranged attack, effectively halving its ranged damage (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.50).&lt;br /&gt;
&lt;br /&gt;
==== Other factors – variables R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
** Petrified&lt;br /&gt;
** Paralyzed&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18711</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18711"/>
		<updated>2014-07-26T13:58:38Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Spells - Variable R4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability. If a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill.&lt;br /&gt;
&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Spells - Variable R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
There are many spells that modify damage, but most do so by increasing or decreasing the attack and defense Skills of allied or enemy troops. [[Stone Skin]], for example, increases an allied unit&#039;s defense skill, and therefore modifies damage by affecting variable R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. The only spells that modify damage directly are [[Shield]] and [[Air Shield]]. Shield reduces all [[melee]] damage done to the hero&#039;s troops by 15% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15), or even by 30% when cast at advanced or expert level. [[Air shield]] reduces all [[ranged attack|ranged]] damage done to the hero&#039;s troops by 25% (R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.25), or even by 50% when cast at advanced or expert level.  &lt;br /&gt;
&lt;br /&gt;
==== Other factors – variables R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
** Petrified&lt;br /&gt;
** Paralyzed&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18708</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18708"/>
		<updated>2014-07-26T13:42:57Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Secondary skill factors – variables R1 and R2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[Bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Variable I&amp;lt;small&amp;gt;2&amp;lt;/small&amp;gt; represents [[secondary skill]] modifier of either [[Archery]] or [[Offense]] depending on the attack type. Creatures able to [[Ranged attack|attack from the distance]] gain bonus from the Archery secondary skill when using their ability. If a creature engages into [[melee]] combat, it gains bonus to its damage from Offense secondary skill.&lt;br /&gt;
&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1 - 0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=User_talk:Entelechy&amp;diff=18706</id>
		<title>User talk:Entelechy</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=User_talk:Entelechy&amp;diff=18706"/>
		<updated>2014-07-26T13:33:34Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Spelling and grammar */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to the forum ==&lt;br /&gt;
Welcome to HoMM3-wiki, or one of them. Now that you have a profile, I would like to ask you to sign your talk posts with &amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt;, whcih is a kind of standard. Also, if you want &amp;quot;more power&amp;quot; you should contact [[User:Terra]]. –[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 14:42, 4 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:Thanks for showing me around! I still need to learn more about the programming and conventions in Wikis, but that was one of the reasons to post here in the first :place, so your help is much appreciated. Given that this is a post in a talk page, as :you referred to above, I can test right away what the above-mentioned code does (just allow me a few attempts and some consulting of Wiki Help to get it right ;-)).&lt;br /&gt;
:-[[User:Entelechy|Entelechy]] 22:55, 4 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Spelling and grammar ==&lt;br /&gt;
As you obviously are either native English speaker or otherwise experienced with it, perhaps you could tell me some answers to some spelling issues. First that comes to mind is capitalization. For example, are creature names spelled with capital letters? –[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 09:17, 24 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:I must say you caught me there, and I&#039;m sure I haven&#039;t been using capitalization consistently either :-). The way I see it, a Black Dragon is still just a dragon that is black (not a Dragon that is Black), so I don&#039;t think there is a specific grammar rule at work here. But I admit it can look nice to write black dragon as Black Dragon, and I notice that the tutorial consistently mentions the names of creatures, spells, towns, hero classes, buildings, adventure map locations etc. with capital letters, so I am fine with doing that too (and more consistently than I am doing now). What do you think?&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18691</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18691"/>
		<updated>2014-07-23T21:04:12Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Secondary skill factors – variables R1 and R2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer value. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1-0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1-0.05) = 94.05, which is not an integer value and therefore rounded off in the usual way, that is, to 94.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18690</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18690"/>
		<updated>2014-07-23T21:00:58Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Minor rephrasing and some Armorer description added. Perhaps the point about heroes without Armorer not profiting from Armorer specialty is general enough for the hero specialty page?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Just like the variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in Archery and Offense increases, respectively, ranged and melee damage, so do the variables R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; denote how learning and specializing in [[Armorer]] reduces both ranged and melee damage. R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; can take the values 0.05, 0.10 and 0.15, indicating that basic, advanced and expert Armorer reduce damage by, respectively, 5%, 10% and 15%. The three heroes with an Armorer specialty - [[Mephala]], [[Neela]] and [[Tazar]] - double the effectiveness of the Armorer skill when they reach level 20, as shown by the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Armorer has two unexpected side effects. First, heroes with Armorer take double damage from [[arrow tower]]s. Second, damage is reduced by 1 if creatures from a hero with Armorer take an amount of damage that is exactly an integer number. Thus, if 100 [[Peasant]]s attack a stack of Peasants commanded by a hero with basic Armorer (and the Attack-Defense difference is 0), damage is not 100 &amp;amp;times; 1 &amp;amp;times;(1-0.05) = 95, but 94. If the attack had instead been performed by 99 Peasants, the damage would be 99 &amp;amp;times; 1 &amp;amp;times;(1-0.05) = 94.05, which is not an integer number and therefore conventionally rounded off to 94.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18689</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18689"/>
		<updated>2014-07-23T20:26:37Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Creature abilities – variable I5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during the combat turn in which they attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18686</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18686"/>
		<updated>2014-07-23T19:28:42Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Secondary skill factors – variables I2 and I3 = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; becomes 0, which leads I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; to become 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with the skill they specialize in, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her [[Bless]] specialty is a special case of variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;. Adela&#039;s Bless maximizes base damage as usual, but also deals extra damage according to the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is greater for low-level than high-level creatures. Her Bless grants +3% damage per hero level  to level 1 creatures, whereas it grants +0.6% per hero level for level 5 creatures.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The final variable capable of increasing total damage is I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, which denotes creature specialties from Cavaliers and Champions, Dread Knights, Ballistas, Elementals, and creatures that hate each other. &lt;br /&gt;
&lt;br /&gt;
The jousting specialty of [[Cavalier and Champion|Cavaliers and Champions]] lets them deal 5% extra damage for every hex they travel during their combat turn to attack their target:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s can make [[Death Blow]] attacks, which gives variable I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 1.00, effectovely doubling base damage (though not necessarily total damage). The I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; variable is also 1.00 for a [[Ballista]] whose shots deal double (base) damage. Additionally, there are a few creatures who [[hate]] each other, which gives I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; a value of 0.50 when they attack each other. This is true for [[Angel]]s and [[Devil]]s, [[Titan]]s and [[Black Dragon]]s, and [[Genie]]s and [[Efreet]]i. Finally, [[Fire Elemental]]s and [[Water Elemental]]s, as well as [[Air Elemental]]s and [[Earth Elemental]]s do double base damage against each other (i.e., I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18685</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18685"/>
		<updated>2014-07-23T18:49:37Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Attack-Defense difference – variables I1 and R1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value (i.e., the difference is positive), then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will receive +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are a few creatures who [[hate]] each other, giving C a value of 0.50 when they attack a hated target.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18684</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18684"/>
		<updated>2014-07-23T18:48:24Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Attack-Defense difference – variables I1 and R1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialties]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value, in other words if the difference is positive, then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive whereas R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will receive +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are a few creatures who [[hate]] each other, giving C a value of 0.50 when they attack a hated target.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18681</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18681"/>
		<updated>2014-07-22T11:50:08Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Secondary skill factors – variables I2 and I3 = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialtiesy]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value, in other words if the difference is positive, then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive while R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes specializing in these skills. Archery and Offense cannot affect damage simultaneously, because they are related to [[ranged attack|ranged]] and [[melee]] attacks, respectively. For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They receive additional bonus from Archery or Offense secondary skill, as calculated with the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not receive his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will receive +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
The luck variable may be either 0 or 1.00, depending on whether or not the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. This is determined by the combat variable [[luck]], which may be 0 (neutral), +1 (positive), +2 (good) or +3 (excellent). These values determine how often lucky strikes occur. These probabilities are, respectively, 0/24 (0%), 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%). Luck may be affected by artifacts, adventure map locations, spells and the secondary skill [[Luck (secondary skill)|Luck]].&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are a few creatures who [[hate]] each other, giving C a value of 0.50 when they attack a hated target.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18680</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18680"/>
		<updated>2014-07-22T11:35:38Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Attack-Defense difference – variables I1 and R1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, denoted by I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any bonuses from [[native terrain]] or [[Hero_specialty#Creature_specialties|creature specialtiesy]].&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value, in other words if the difference is positive, then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive while R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18679</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18679"/>
		<updated>2014-07-22T11:29:38Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Would it be acceptable to compress the text a bit like this? The confusion from the HC thread may not need to be discussed if we can just explain it right on this page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack-Defense difference – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The Attack-Defense difference, or I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; in the formula, is typically the main modifier of base damage. It is calculated as the difference between the attacker&#039;s attack value and the defender&#039;s defense value. These are determined by adding up the attack skill of the attacking hero and of the attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Spells and creature abilities that affect attack or defense values, such as [[bloodlust]] and [[disease]], are also taken into account in this part of the formula, as are any [[native terrain]] bonuses.&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s total attack value is higher than the defending creature&#039;s total defense value, in other words if the difference is positive, then the attacking creature receives a 5% bonus to its base damage for every point the attack value is higher. If the difference is negative, then the attacking creature receives a 2.5% penalty to its total damage for every point the attack value is lower. A positive Attack-Defense difference therefore increases damage, meaning that the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; in the formula is positive while R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. Conversely, a negative Attack-Defense difference decreases damage, meaning that R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is positive whereas I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0. An Attack-Defense difference of 0 does not modify base damage.&lt;br /&gt;
&lt;br /&gt;
The Attack-Defense difference can modify base damage only within a specific limit. This limit is reached by a positive Attack-Defense difference of +60 and a negative Attack-Defense difference of -28. This means that a high attack skill can grant no more than +300% bonus damage, whereas a high defense skill can grant no more than a -70% penalty. Thus, the Attack-Defense difference can modify a base damage of 100 to no more than 400, and to no less than 30.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18658</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18658"/>
		<updated>2014-07-22T10:24:24Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for [[Adela]]&#039;s [[bless]]&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack to defense ratio – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The second most influential variables are I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt;, which represent so called attack to defense difference or more shortly, AD-difference. It is calculated from the difference of the attacker&#039;s attack value and the defender&#039;s defese value. They are determined by adding up attack skills of the attacking hero and attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Also spells affecting attack or defense values are taken into account in this part of the formula.&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s combined attack value is higher than defending creature&#039;s combined defense value, in other words if the difference is positive, then the attacking creature recieves +5% increase to its damage for every point the attack value is higher up to 60 points. If the difference is negative, then the attacking creature recieves -2.5% penalty for its damage for every point the attck value is lower up to 28 points. When the difference is positive, it increases the damage and is taken into account with the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. If it is negative, then it reduces the damage and is taken into account in R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. This means that if the difference is positive, R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0, and the otherway round. If the difference is 0, then both variables are 0.&lt;br /&gt;
&lt;br /&gt;
In practice this means, that if the attacker&#039;s combined attack skill value is greater than the defenders combined defense skill value, the attacker may recieve up to +300% increase to its damage. Then again, if the attack value is smaller, the attacker may recieve -70% reduction to the final damage. It should be noted, that there has been some confusion wheter the bonus cap is 300% or 400%. To clarify this issue, the bonus is +300% but the damage is 400% compared to non-modified damage. To phrase the same question mathematically, bonus of +300% is &amp;quot;1 + 1 &amp;amp;times; 3.00&amp;quot; and the damage of 400% is &amp;quot;1 &amp;amp;times; 4.00&amp;quot; – in the end, they are equivalent.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18657</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18657"/>
		<updated>2014-07-22T10:20:54Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* The damage calculation formula */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for Adela&#039;s bless&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack to defense ratio – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The second most influential variables are I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt;, which represent so called attack to defense difference or more shortly, AD-difference. It is calculated from the difference of the attacker&#039;s attack value and the defender&#039;s defese value. They are determined by adding up attack skills of the attacking hero and attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Also spells affecting attack or defense values are taken into account in this part of the formula.&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s combined attack value is higher than defending creature&#039;s combined defense value, in other words if the difference is positive, then the attacking creature recieves +5% increase to its damage for every point the attack value is higher up to 60 points. If the difference is negative, then the attacking creature recieves -2.5% penalty for its damage for every point the attck value is lower up to 28 points. When the difference is positive, it increases the damage and is taken into account with the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. If it is negative, then it reduces the damage and is taken into account in R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. This means that if the difference is positive, R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0, and the otherway round. If the difference is 0, then both variables are 0.&lt;br /&gt;
&lt;br /&gt;
In practice this means, that if the attacker&#039;s combined attack skill value is greater than the defenders combined defense skill value, the attacker may recieve up to +300% increase to its damage. Then again, if the attack value is smaller, the attacker may recieve -70% reduction to the final damage. It should be noted, that there has been some confusion wheter the bonus cap is 300% or 400%. To clarify this issue, the bonus is +300% but the damage is 400% compared to non-modified damage. To phrase the same question mathematically, bonus of +300% is &amp;quot;1 + 1 &amp;amp;times; 3.00&amp;quot; and the damage of 400% is &amp;quot;1 &amp;amp;times; 4.00&amp;quot; – in the end, they are equivalent.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18656</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18656"/>
		<updated>2014-07-22T10:20:21Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* The damage calculation formula */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.03 &amp;amp;times; (hero &#039;&#039;&#039;&amp;amp;divide;&#039;&#039;&#039; creature level) for Adela&#039;s bless&amp;lt;br&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;9&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl 1-5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 if target is [[Petrify|petrified]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage (DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt;) is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;f&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primary determinant for the final damage is the base damage (DMG&amp;lt;small&amp;gt;b&amp;lt;/small&amp;gt;), which is affected by the number of attacking creatures and their damage range. All other variables are basically modifiers of the base damage. Variables are denoted as I if they (i)ncrease damage and as R if they (r)educe it. I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; are mutually exclusive, but all other variables may simultaneously affect the final damage (DMG&amp;lt;small&amp;gt;f&amp;lt;/small&amp;gt;). A brief summary of the variables have been given in the table on the right.&lt;br /&gt;
&lt;br /&gt;
To summarize the above formula, the content of the first parentheses increase the base damage by multiplying it with a modifier varying from 1.00 to 8.00, and the content of the second parentheses reduces the damage with a modifier varying from 0.00 to 1.00.&lt;br /&gt;
&lt;br /&gt;
=== Attack to defense ratio – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
The second most influential variables are I&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt; and R&amp;lt;small&amp;gt;1&amp;lt;/small&amp;gt;, which represent so called attack to defense difference or more shortly, AD-difference. It is calculated from the difference of the attacker&#039;s attack value and the defender&#039;s defese value. They are determined by adding up attack skills of the attacking hero and attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Also spells affecting attack or defense values are taken into account in this part of the formula.&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s combined attack value is higher than defending creature&#039;s combined defense value, in other words if the difference is positive, then the attacking creature recieves +5% increase to its damage for every point the attack value is higher up to 60 points. If the difference is negative, then the attacking creature recieves -2.5% penalty for its damage for every point the attck value is lower up to 28 points. When the difference is positive, it increases the damage and is taken into account with the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. If it is negative, then it reduces the damage and is taken into account in R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. This means that if the difference is positive, R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0, and the otherway round. If the difference is 0, then both variables are 0.&lt;br /&gt;
&lt;br /&gt;
In practice this means, that if the attacker&#039;s combined attack skill value is greater than the defenders combined defense skill value, the attacker may recieve up to +300% increase to its damage. Then again, if the attack value is smaller, the attacker may recieve -70% reduction to the final damage. It should be noted, that there has been some confusion wheter the bonus cap is 300% or 400%. To clarify this issue, the bonus is +300% but the damage is 400% compared to non-modified damage. To phrase the same question mathematically, bonus of +300% is &amp;quot;1 + 1 &amp;amp;times; 3.00&amp;quot; and the damage of 400% is &amp;quot;1 &amp;amp;times; 4.00&amp;quot; – in the end, they are equivalent.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18647</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18647"/>
		<updated>2014-07-19T20:16:46Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when casting the spell they [[Hero specialty#Spell specialties|specialize]] in.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]] &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]];&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 if defender is [[Petrify|petrified]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;9&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. lvl1 - 5 [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Variables are denoted as I if they (I)ncrease damage and as (R) if they (R)educe it (see also Table 1). I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; are mutually exclusive, but all other variables may simultaneously affect total damage (DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt;). Note that all variables are merely modifiers of base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;), meaning that the number of attacking creatures and their damage range remain the primary determinants of total damage. To summarize the above formula, every damage bonus is calculated as &lt;br /&gt;
a percentage of the base damage to which it is then added, and every damage penalty then multiplies this amount with a number between 0 and 1.&lt;br /&gt;
&lt;br /&gt;
=== Attack to defense ratio – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Besides the actual damage range of the creature type, the most influential variables are I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. They represent so called attack to defense ratio (AD-ratio), which is calculated from the difference of the attacker&#039;s attack value and the defender&#039;s defese value. They are determined by adding up attack skills of the attacking hero and attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Also spells affecting attack or defense values are taken into account in this part of the formula.&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s combined attack value is higher than defending creature&#039;s combined defense value, in other words if the difference is positive, then the attacking creature recieves +5% increase to its damage for every point the attack value is higher up to 60 points. If the difference is negative, then the attacking creature recieves -2.5% penalty for its damage for every point the attck value is lower up to 28 points. When the difference is positive, it increases the damage and is taken into account with the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. If it is negative, then it reduces the damage and is taken into account in R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. This means that if the difference is positive, R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0, and the otherway round. If the difference is 0, then both variables are 0.&lt;br /&gt;
&lt;br /&gt;
In practice this means, that if the attacker&#039;s combined attack skill value is greater than the defenders combined defense skill value, the attacker may recieve up to +300% increase to its damage. Then again, if the attack value is smaller, the attacker may recieve -70% reduction to the final damage. It should be noted, that there has been some confusion wheter the bonus cap is 300% or 400%. To clarify this issue, the bonus is +300% but the damage is 400% compared to non-modified damage. To phrase the same question mathematically, bonus of +300% is &amp;quot;1 + 1 &amp;amp;times; 3.00&amp;quot; and the damage of 400% is &amp;quot;1 &amp;amp;times; 4.00&amp;quot; – in the end, they are equivalent.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18646</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18646"/>
		<updated>2014-07-19T17:02:58Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* The damage calculation formula */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when they [[Hero specialty#Spell specialties|specialize]] in this spell.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; ([[Attack]] - [[Defense]]) (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]] &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]];&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; ([[Defense]] - [[Attack]]) (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 if defender is [[Petrify|petrified]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;9&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. full [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Variables are denoted as I if they (I)ncrease damage and as (R) if they (R)educe it (see also Table 1). I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; are mutually exclusive, but all other variables may simultaneously affect Total damage (DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt;). Note that all variables are merely modifiers of base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;), meaning that the number of attacking creatures and their damage range remain the primary determinants of total damage. To summarize the above formula, every damage bonus is calculated as &lt;br /&gt;
a percentage of the base damage to which it is then added, and every damage penalty then multiplies this amount with a number between 0 and 1.&lt;br /&gt;
&lt;br /&gt;
=== Attack to defense ratio – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Besides the actual damage range of the creature type, the most influential variables are I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. They represent so called attack to defense ratio (AD-ratio), which is calculated from the difference of the attacker&#039;s attack value and the defender&#039;s defese value. They are determined by adding up attack skills of the attacking hero and attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Also spells affecting attack or defense values are taken into account in this part of the formula.&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s combined attack value is higher than defending creature&#039;s combined defense value, in other words if the difference is positive, then the attacking creature recieves +5% increase to its damage for every point the attack value is higher up to 60 points. If the difference is negative, then the attacking creature recieves -2.5% penalty for its damage for every point the attck value is lower up to 28 points. When the difference is positive, it increases the damage and is taken into account with the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. If it is negative, then it reduces the damage and is taken into account in R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. This means that if the difference is positive, R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0, and the otherway round. If the difference is 0, then both variables are 0.&lt;br /&gt;
&lt;br /&gt;
In practice this means, that if the attacker&#039;s combined attack skill value is greater than the defenders combined defense skill value, the attacker may recieve up to +300% increase to its damage. Then again, if the attack value is smaller, the attacker may recieve -70% reduction to the final damage. It should be noted, that there has been some confusion wheter the bonus cap is 300% or 400%. To clarify this issue, the bonus is +300% but the damage is 400% compared to non-modified damage. To phrase the same question mathematically, bonus of +300% is &amp;quot;1 + 1 &amp;amp;times; 3.00&amp;quot; and the damage of 400% is &amp;quot;1 &amp;amp;times; 4.00&amp;quot; – in the end, they are equivalent.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18645</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18645"/>
		<updated>2014-07-19T17:01:33Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when they [[Hero specialty#Spell specialties|specialize]] in this spell.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; [[Attack]] - [[Defense]] (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]] &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]];&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; [[Defense]] - [[Attack]] (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 at advanced, expert level&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 if defender is [[Petrify|petrified]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;9&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. full [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Variables are denoted as I if they (I)ncrease damage and as (R) if they (R)educe it (see also Table 1). I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; are mutually exclusive, but all other variables may simultaneously affect Total damage (DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt;). Note that all variables are merely modifiers of base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;), meaning that the number of attacking creatures and their damage range remain the primary determinants of total damage. To summarize the above formula, every damage bonus is calculated as &lt;br /&gt;
a percentage of the base damage to which it is then added, and every damage penalty then multiplies this amount with a number between 0 and 1. &lt;br /&gt;
&lt;br /&gt;
=== Attack to defense ratio – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Besides the actual damage range of the creature type, the most influential variables are I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. They represent so called attack to defense ratio (AD-ratio), which is calculated from the difference of the attacker&#039;s attack value and the defender&#039;s defese value. They are determined by adding up attack skills of the attacking hero and attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Also spells affecting attack or defense values are taken into account in this part of the formula.&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s combined attack value is higher than defending creature&#039;s combined defense value, in other words if the difference is positive, then the attacking creature recieves +5% increase to its damage for every point the attack value is higher up to 60 points. If the difference is negative, then the attacking creature recieves -2.5% penalty for its damage for every point the attck value is lower up to 28 points. When the difference is positive, it increases the damage and is taken into account with the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. If it is negative, then it reduces the damage and is taken into account in R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. This means that if the difference is positive, R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0, and the otherway round. If the difference is 0, then both variables are 0.&lt;br /&gt;
&lt;br /&gt;
In practice this means, that if the attacker&#039;s combined attack skill value is greater than the defenders combined defense skill value, the attacker may recieve up to +300% increase to its damage. Then again, if the attack value is smaller, the attacker may recieve -70% reduction to the final damage. It should be noted, that there has been some confusion wheter the bonus cap is 300% or 400%. To clarify this issue, the bonus is +300% but the damage is 400% compared to non-modified damage. To phrase the same question mathematically, bonus of +300% is &amp;quot;1 + 1 &amp;amp;times; 3.00&amp;quot; and the damage of 400% is &amp;quot;1 &amp;amp;times; 4.00&amp;quot; – in the end, they are equivalent.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18644</id>
		<title>User:Entelechy/sandbox</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18644"/>
		<updated>2014-07-19T16:56:49Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My Sandbox&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; [[Attack]] - [[Defense]] (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert [[Archery]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert [[Offense]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Archery/Offense [[Hero_specialty#Secondary_skill_specialties|specialty]] &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[luck]]y strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for [[Death Blow]], [[Ballista]] double damage&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for [[hate]];&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; [[hex]]es travelled for [[Cavalier]]s, [[Champion]]s&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.025 &amp;amp;times; [[Defense]] - [[Attack]] (if D ≥ A)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert [[Armorer]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level for Armorer [[Hero_specialty#Secondary_skill_specialties|specialty]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 for advanced, expert&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 for advanced, expert&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if attacker has [[range penalty|range]] or [[melee penalty]]{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall ([[obstacle penalty]]){{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 if defender is [[Petrify|petrified]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;9&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. [[mind spell]] immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. full [[spell immunity]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18643</id>
		<title>User:Entelechy/sandbox</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18643"/>
		<updated>2014-07-19T16:45:18Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My Sandbox&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; Attack - Defense (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.10, 0.25, 0.50 for basic, advanced, expert Archery&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert Offense{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for lucky strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&amp;amp;thinsp;&amp;amp;thinsp; = 1.00 for Death Blow, Ballista double damage;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 1.00 if [[Elemental]] attacks opposite [[Elemental]] type;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for hate;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; hexes travelled for Cavaliers, Champions&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert Armorer&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.15 for [[Shield]], 0.30 for advanced, expert&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.25 for [[Air Shield]], 0.50 for advanced, expert&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for shooter with (basic) [[Forgetfulness]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.50 if attacker has range or melee penalty{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if defender is [[Petrify|petrified]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; = 0.50 for Psychic Elemental vs. mind-spell immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.50 for Magic Elemental vs. full magic immunity&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after being [[paralyze]]d&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18642</id>
		<title>User:Entelechy/sandbox</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18642"/>
		<updated>2014-07-19T16:20:05Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My Sandbox&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; Attack - Defense (if A ≥ D)&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.10, 0.25, 0.50 for basic, advanced, expert Archery&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;ensp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.10, 0.20, 0.30 for basic, advanced, expert Offense{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level &lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 1.00 for lucky strikes&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 1.00 for Death Blow, Ballista double damage;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.50 for hate;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;thinsp;&amp;amp;thinsp;= 0.05 &amp;amp;times; hexes travelled for Cavaliers, Champions&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.05, 0.10, 0.15 for basic, advanced, expert Armorer&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;times; hero level&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.25 for [[Air Shield]], 0.50 for advanced, expert&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.15 for [[Shield]], 0.30 for advanced, expert&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; = 0.50 if attacker has range or melee penalty{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; = 0.50 if target is behind a wall{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; = 0.50 if defender is [[Petrify|petrified]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; = 0.50 for retaliation after being [[Blind]]ed&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;emsp;&amp;amp;ensp;&amp;amp;thinsp;= 0.75 for retaliation after advanced [[Blind]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; Creature specialty reduction&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18641</id>
		<title>User:Entelechy/sandbox</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18641"/>
		<updated>2014-07-19T15:21:59Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My Sandbox&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; Only if AD-ratio is positive&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; Secondary skill bonus from Archery of Offense. {{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; Hero specialty bonus&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; Bonus from lucky strike&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; Creature specialty bonus&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; Opponent&#039;s Armorer reduction&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; Opponent&#039;s Armorer specialty reduction&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; [[Air Shield]] or [[Shield]] affecting the defender&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; Range or melee penalty affecting the attacker.{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; Target is behind a wall.{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt; Defender is [[Petrify|petrified]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; Target retaliates from [[Blind]]ed state&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt; Creature specialty reduction&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18640</id>
		<title>User:Entelechy/sandbox</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=User:Entelechy/sandbox&amp;diff=18640"/>
		<updated>2014-07-19T15:14:17Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: Created page with &amp;quot;My Sandbox&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My Sandbox&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18639</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18639"/>
		<updated>2014-07-18T21:15:55Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*Heroes increase spell damage with 3% per hero level when they [[Hero specialty#Spell specialties|specialize]] in this spell.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally [[immunity|immune]] to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Variable{{-}}&lt;br /&gt;
! {{-}}Range{{-}}&lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...3,00{{-}}&lt;br /&gt;
| {{-}}Only if AD-ratio is positive&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0.50&lt;br /&gt;
| {{-}}Secondary skill bonus from Archery of Offense. {{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00..2,475{{-}}&lt;br /&gt;
| {{-}}Hero specialty bonus&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0.00 or 1.00&lt;br /&gt;
| {{-}}Bonus from lucky strike&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}special&lt;br /&gt;
| {{-}}Creature specialty bonus&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0,15&lt;br /&gt;
| {{-}}Opponent&#039;s Armorer reduction&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0,7425{{-}}&lt;br /&gt;
| {{-}}Opponent&#039;s Armorer specialty reduction&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0,50&lt;br /&gt;
| {{-}}[[Air Shield]] or [[Shield]] affecting the defender&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00 or 0,50&lt;br /&gt;
| {{-}}Range or melee penalty affecting the attacker.{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00 or 0,50&lt;br /&gt;
| {{-}}Target is behind a wall.{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00 or 0,50&lt;br /&gt;
| {{-}}Defender is [[Petrify|petrified]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0.75&lt;br /&gt;
| {{-}}Target retaliates from [[Blind]]ed state&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;&lt;br /&gt;
| special&lt;br /&gt;
| Creature specialty reduction&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Variables are denoted as I if they (I)ncrease damage and as (R) if they (R)educe it (see also Table 1). I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; are mutually exclusive, but all other variables may simultaneously affect Total damage (DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt;). Note that all variables are merely modifiers of base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;), meaning that the number of attacking creatures and their damage range remain the primary determinants of total damage. To summarize the above formula, every damage bonus is calculated as &lt;br /&gt;
a percentage of the base damage to which it is then added, and every damage penalty then multiplies this amount with a number between 0 and 1. &lt;br /&gt;
&lt;br /&gt;
=== Attack to defense ratio – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Besides the actual damage range of the creature type, the most influential variables are I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. They represent so called attack to defense ratio (AD-ratio), which is calculated from the difference of the attacker&#039;s attack value and the defender&#039;s defese value. They are determined by adding up attack skills of the attacking hero and attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Also spells affecting attack or defense values are taken into account in this part of the formula.&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s combined attack value is higher than defending creature&#039;s combined defense value, in other words if the difference is positive, then the attacking creature recieves +5% increase to its damage for every point the attack value is higher up to 60 points. If the difference is negative, then the attacking creature recieves -2.5% penalty for its damage for every point the attck value is lower up to 28 points. When the difference is positive, it increases the damage and is taken into account with the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. If it is negative, then it reduces the damage and is taken into account in R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. This means that if the difference is positive, R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0, and the otherway round. If the difference is 0, then both variables are 0.&lt;br /&gt;
&lt;br /&gt;
In practice this means, that if the attacker&#039;s combined attack skill value is greater than the defenders combined defense skill value, the attacker may recieve up to +300% increase to its damage. Then again, if the attack value is smaller, the attacker may recieve -70% reduction to the final damage. It should be noted, that there has been some confusion wheter the bonus cap is 300% or 400%. To clarify this issue, the bonus is +300% but the damage is 400% compared to non-modified damage. To phrase the same question mathematically, bonus of +300% is &amp;quot;1 + 1 &amp;amp;times; 3.00&amp;quot; and the damage of 400% is &amp;quot;1 &amp;amp;times; 4.00&amp;quot; – in the end, they are equivalent.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Talk:Damage&amp;diff=18638</id>
		<title>Talk:Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Talk:Damage&amp;diff=18638"/>
		<updated>2014-07-18T20:57:37Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Edit June 23rd, 2014: Besides some minor rephrasing, I corrected the lower damage cap, which is not 72.5% damage, but 30% damage. I also added that terrain, spells and creature specialties may affect attack and defense skills.-[[User:Entelechy|Entelechy]] 11:26, 11 July 2014 (CEST) (signed later).&lt;br /&gt;
&lt;br /&gt;
:I bealieve we mean the same thing here. 70% from 100 is 70, while -30% from 100 is also 70. However, we have a disagreement in wheter it is 70%/-30% or 72.5%/-27.5%. Everywhere it is said that the the reduction is the first one, but to my recollection I tested this out and the vague truth is the latter. [http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;PID=1192104#focus Link here]. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:10, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Haha, that thread looks familiar :-). Actually, when making the above-mentioned edit, I did actually stumble upon your post and therefore I tested it again before editing this page. But again I found a maximum damage reduction of 70% (i.e., attacks do only 30% damage). I am not sure what can account for our different findings. But feel free to let me know if you get the same results when testing it again and then I am happy to try and find out what may be going on. -[[User:Entelechy|Entelechy]] 13:02, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
This page does a good job explaining base damage and how this is modified by attack and defense skills. But maybe it is a good idea to include all damage modifiers here? Perhaps just mention them and refer to their corresponding page, or even provide a full explanation here? User Ecoris from HeroesCommunity compiled a useful list of modifiers in this thread (11th post):  &lt;br /&gt;
http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;pagenumber=2. Also, a version of his general description (9th post on that page) could be included here. -[[User:Entelechy|Entelechy]] 11:26, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:Go ahead! :) I have just been too lazy to organize this page. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:10, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Ok, I will put it on my to-do list ;-). -[[User:Entelechy|Entelechy]] 13:03, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Wow, it seems this item on my to-do list has just become a lot smaller :-). Great additions so far (also on the Master Genie page by the way)!-[[User:Entelechy|Entelechy]] 20:17, 14 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Given your great and hard work on editing this page, I felt it would be inappropriate to edit it at the same time. I did find the following [http://heroescommunity.com/viewthread.php3?TID=20955&amp;amp;PID=424843#focus thread] on HeroesCommunity, though, which might be useful. But I am also happy to incorporate it here myself, of course, once you feel you are done with this page for now. -[[User:Entelechy|Entelechy]] 19:57, 15 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::One is always welcome to do changes and add more contents. Although it is sometimes good to check if another is currently working on article. Personally I like to &amp;quot;save&amp;quot; the changes from time to time. Your article seems (based on quick reading) valid, but I am not sure it has any concrete knowledge. It seems to contain more guesses than hard evidence. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 08:19, 16 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::::Thanks for the comments. Perhaps it might be an idea then to just add an External Link section on this page and also refer in it to the other above-mentioned thread. I also added some information on spell damage by the way - I hope it is useful. I am wondering about the formula, though. Shouldn&#039;t AD be added to the list with As when it is positive and to the list of Ds when it is negative? Also, I believe all Ds should be entered in separate brackets as follows: (1-D1)x(1-D2) etc. As the formula is now, it seems damage may be negative. -[[User:Entelechy|Entelechy]] 23:53, 16 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::::I have been wondering AD&#039;s place as well. In fact, I origianlly wrote them sparately, but came to a conclusion, that it such a significant factor, that it should stand alone. However, I am still not sure. Lets leave it there for awhile and finish the article. We can then make a decision wheter to put it in the brackets or not.&lt;br /&gt;
&lt;br /&gt;
:::::I believe the formula is right. Your suggestion is incorrect, because (1-x)&amp;amp;times;(1-y) is same as 1&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;-y-x+xy. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 07:08, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
== The formula ==&lt;br /&gt;
Hmm, is it so that the added up A&#039;s have a maximum of 3.00 and added up D&#039;s have a maximum of 0.70; meaning that if the sum is reduced to those numbers if the sum otherwise would go over it? --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 07:18, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:Let me just try and write down what I believe is the correct formula. We know that all bonus damage is calculated as a percentage of base damage and that all bonuses are added separately to this base damage. So if base damage is 100, then an A/D difference of +20 adds 100 base damage (A1 = 1) and luck adds another 100 (A2 = 1), for a total of 300. We could say, then, that Total Damage = Base Damage + (A1 x Base Damage + A2 x Base Damage). This can be rewritten as Total Damage = Base Damage x (1 + A1 + A2).&lt;br /&gt;
:Now, we know that defense modifiers simply multiply this whole formula of &amp;quot;Base Damage x (1 + A1 + A2 + ...)&amp;quot; with a number below 1. So if there would be a negative A/D difference of, say, -12 (D1 = 0.3), then damage would be reduced to 70% because 1 - 12 x 0.025 = 0.7. Advanced armorer, which reduces damage by 10% (D2 = 0.1), would reduce this further by multiplying this 0.7 with 1 - 0.10, which is 0.7 x 0.9 = 0.63. Defense modifiers therefore reduce damage as follows: Total damage = damage x (1-D1) x (1-D2). You are right that (1-D1) x (1-D2) is equal to 1 - D1 - D2 + D1D2, but if you substitute the values, you&#039;ll see that 1 - 0.3 - 0.1 + 0.03 is indeed the same 0.63 that we arrived at above. The formula in the above-mentioned thread therefore seems correct to me:&lt;br /&gt;
:Total Damage = Base Damage x (1+A1+A2+A3+...) x (1-D1) x (1-D2) x (1-D3) x ... . It is only a bit tricky that positive A/D difference should be included as an A, and negative A/D difference as a D. The caps of A = 3 and D = 0.7 are applied only to  A/D difference though, damage can be increased or reduced further by other factors. Feel free to let me know what you think and then we can decide how to best phrase the formula.&lt;br /&gt;
:-[[User:Entelechy|Entelechy]] 11:11, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::My reasoning is, that because there cannot be postive and negative AD-differnce affecting the result at the same time, should the factor therefore be sparate from the others. This seems more &amp;quot;beautiful to my mathematical eye&amp;quot;. :)&lt;br /&gt;
&lt;br /&gt;
::My knowledge about the calculation seems to be wrong appears to be wrong here! I have always believed, that those reductions are added up together, but it seems not to be the case. As Ecoris said  [http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;PID=366833#focus here] – short and sweet I might add – &amp;quot;&#039;&#039;damage bonuses are cumulative, while damage reductions are multiplicative&#039;&#039;&amp;quot;. I have never studied or even thought this more closely until now. That is, of course, much more logical. If expert Armorer (-15%) and expert Shield (-30%) affecting at the same time, the correct final reduction seems to be (1 - 0.15) &amp;amp;times; (1 - 0.30) = -0.595 or -41.5% not -45% (or factor 0.55) as I have believed. My apology. :) --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:38, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::Uh, but this &amp;quot;new&amp;quot; infromation also changes the calculation routine, bummer. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:40, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::::No problem, I agree that writing these articles has been quite educational. I learned, for example, that an ammo cart can be raised as a skeleton :-s. Talking about mathematical beauty, all As are basically interchangeable in the formula (only their weighting differs) and so are all Ds, so we may not even have to bother with linking the numbers to specific variable names. Identifying a modifier as an attack or defense variable and giving its weighting may also suffice. Finally, perhaps my edit about magic resistances and immunities is a bit lengthy - I wonder if it is easier to just say that modifiers of spell damage are only valid when the target does not resist the spell and is not immune to it. -[[User:Entelechy|Entelechy]] 23:38, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::Ammo Cart becomes skeleton. :) With [[Animate Dead]] or [[Necromancy]]? I think you made good additions to spell damage. Sometimes things just cannot be said shortly. Perhaps a table could help, if you think it is too long. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 06:09, 18 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::::With Necromancy apparently :). I would also advice against cloning a legion of level 1 units against Necro if you don&#039;t plan to win the battle :p. Thanks for the feedback, I will leave it the way it is then. I have just edited the page a bit, but I am a slow writer (the fact that my activities will increase again next week will also not help). A suggestion that I have is to change attack-defense ratio into attack-defense difference. That is, after all, what it basically is. To my knowledge attack-defense ratio stems from HoMMIV, where this was indeed how damage was calculated. -[[User:Entelechy|Entelechy]] 22:57, 18 July 2014 (CEST)&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18637</id>
		<title>Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Damage&amp;diff=18637"/>
		<updated>2014-07-18T20:42:54Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Damage&#039;&#039;&#039; is a general term for the amount of [[health]] loss a [[creature]] or a [[spell]] can cause to a single creature or to a creatures [[stack]]. If a creature suffers more damage than its current health, it is eliminated, while in a stack of creatures, the topmost dies. The remainder of the damage is dealt to the next one and so forth until all damage is dealt or the whole stack is eliminated.&lt;br /&gt;
&lt;br /&gt;
Creature&#039;s ability to deal damage typically has a range, which means that it causes randomly chosen damage between the minimum and maximum value. Some creatures like [[Naga]]s do not have a damage treshold meaning they always do the same amount of damage. Creatures in a stack cause individual damages, and the combined damage of the stack is calculated by adding them together. However, the final damage can deviate from the combined damage greatly because of different additions and reductions, which are covered in the next section.&lt;br /&gt;
&lt;br /&gt;
Spells can deal damage much like creatures do, except that the amount of inflicted damage does not vary within a range but is fixed. The exact amount of unmodified spell damage can always be calculated with a linear formula. For example, basic [[Lightning Bolt]] cast by a hero with 7 [[Primary skill#Power skill|spell power]] does 7 &amp;amp;times; 25 + 10 = 185 damage. For other spells different values than 25 and 10 need to be substituted. The eventual amount of spell damage is modified as follows:&lt;br /&gt;
*The [[Sorcery]] secondary skill increases spell damage.&lt;br /&gt;
*[[Hero specialty#Spell specialties|Spell specialists]] increase spell damage with 3% per hero level.&lt;br /&gt;
*[[Elemental]]s take double damage from certain spells. [[Fire Elemental]]s, for example, are vulnerable to [[Ice Bolt]].   &lt;br /&gt;
*The damage that [[Stone Golem]]s, [[Iron Golem]]s, [[Gold Golem]]s and [[Diamond Golem]]s take from spells is reduced by, respectively, 50%, 75%, 85% and 95%.&lt;br /&gt;
*[[Dwarf|Dwarves]] have a 20% chance and [[Battle Dwarf|Battle Dwarves]] a 40% chance to completely resist any (damage) spells. &lt;br /&gt;
*Creatures adjacent to [[Unicorn]]s and [[War Unicorn]]s have a 20% chance to completely resist any (damage) spells.&lt;br /&gt;
*The [[Resistance]] secondary skill and resistance artifacts such as the [[Boots of Polarity]] provide each creature stack of a hero&#039;s army with a chance to resist any (damage) spell.&lt;br /&gt;
*Some creatures are naturally immune to certain (damage) spells.&lt;br /&gt;
&lt;br /&gt;
== Damage calculation of creature stacks ==&lt;br /&gt;
=== The damage calculation formula ===&lt;br /&gt;
{| border=1 cellspacing=0 style=&amp;quot;margin: 0 0 0 1em; float:right; border: 1px solid; background:#{{Grey 3}};&amp;quot;&lt;br /&gt;
|+ &amp;lt;big&amp;gt;&#039;&#039;&#039;Table 1: Damage calculation variables&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
|- bgcolor={{Grey 1}} &lt;br /&gt;
! {{-}}Variable{{-}}&lt;br /&gt;
! {{-}}Range{{-}}&lt;br /&gt;
! {{-}}Description{{-}}&lt;br /&gt;
|- &lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...3,00{{-}}&lt;br /&gt;
| {{-}}Only if AD-ratio is positive&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0.50&lt;br /&gt;
| {{-}}Secondary skill bonus from Archery of Offense. {{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00..2,475{{-}}&lt;br /&gt;
| {{-}}Hero specialty bonus&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0.00 or 1.00&lt;br /&gt;
| {{-}}Bonus from lucky strike&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}special&lt;br /&gt;
| {{-}}Creature specialty bonus&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0,15&lt;br /&gt;
| {{-}}Opponent&#039;s Armorer reduction&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0,7425{{-}}&lt;br /&gt;
| {{-}}Opponent&#039;s Armorer specialty reduction&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0,50&lt;br /&gt;
| {{-}}[[Air Shield]] or [[Shield]] affecting the defender&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00 or 0,50&lt;br /&gt;
| {{-}}Range or melee penalty affecting the attacker.{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00 or 0,50&lt;br /&gt;
| {{-}}Target is behind a wall.{{-}}&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00 or 0,50&lt;br /&gt;
| {{-}}Defender is [[Petrify|petrified]]&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;&lt;br /&gt;
| {{-}}0,00...0.75&lt;br /&gt;
| {{-}}Target retaliates from [[Blind]]ed state&lt;br /&gt;
|-&lt;br /&gt;
| {{-}}R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;&lt;br /&gt;
| special&lt;br /&gt;
| Creature specialty reduction&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Mathematical formula for calculating the final damage is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt; DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt; = DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; &amp;amp;times; (1 + I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; + I&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;) &amp;amp;times; (1 - R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt;)&amp;amp;times;(1 - R&amp;lt;sub&amp;gt;8&amp;lt;/sub&amp;gt;)&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Variables are denoted as I if they (I)ncrease damage and as (R) if they (R)educe it (see also Table 1). I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; are mutually exclusive, but all other variables may simultaneously affect Total damage (DMG&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt;). Note that all variables are merely modifiers of base damage (DMG&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;), meaning that the number of attacking creatures and their damage range remain the primary determinants of total damage. To summarize the above formula, every damage bonus is calculated as &lt;br /&gt;
a percentage of the base damage to which it is then added, and every damage penalty then multiplies this amount with a number between 0 and 1. &lt;br /&gt;
&lt;br /&gt;
=== Attack to defense ratio – variables I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ===&lt;br /&gt;
Besides the actual damage range of the creature type, the most influential variables are I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. They represent so called attack to defense ratio (AD-ratio), which is calculated from the difference of the attacker&#039;s attack value and the defender&#039;s defese value. They are determined by adding up attack skills of the attacking hero and attacking creature type, and by adding up defense skill of the defending hero and defending creature type. Also spells affecting attack or defense values are taken into account in this part of the formula.&lt;br /&gt;
&lt;br /&gt;
If the attacking creature&#039;s combined attack value is higher than defending creature&#039;s combined defense value, in other words if the difference is positive, then the attacking creature recieves +5% increase to its damage for every point the attack value is higher up to 60 points. If the difference is negative, then the attacking creature recieves -2.5% penalty for its damage for every point the attck value is lower up to 28 points. When the difference is positive, it increases the damage and is taken into account with the variable I&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. If it is negative, then it reduces the damage and is taken into account in R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;. This means that if the difference is positive, R&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; is 0, and the otherway round. If the difference is 0, then both variables are 0.&lt;br /&gt;
&lt;br /&gt;
In practice this means, that if the attacker&#039;s combined attack skill value is greater than the defenders combined defense skill value, the attacker may recieve up to +300% increase to its damage. Then again, if the attack value is smaller, the attacker may recieve -70% reduction to the final damage. It should be noted, that there has been some confusion wheter the bonus cap is 300% or 400%. To clarify this issue, the bonus is +300% but the damage is 400% compared to non-modified damage. To phrase the same question mathematically, bonus of +300% is &amp;quot;1 + 1 &amp;amp;times; 3.00&amp;quot; and the damage of 400% is &amp;quot;1 &amp;amp;times; 4.00&amp;quot; – in the end, they are equivalent.&lt;br /&gt;
&lt;br /&gt;
=== Secondary skill factors – variables I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; and I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Variable I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; is related to secondary skills [[Archery]] and [[Offense]], and A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; to heroes who specialize in them: [[Orrin]], [[Gundula]] and [[Crag Hack]]. Archery and Offense cannot affect at the same time, because they are related to [[ranged attack|range]] and [[melee]] attacks (respectively). For ranged attacks, Archery secondary skill may give 0, 0.10, 0.25 or 0.50 depending on whether the hero has the skill and on what level the skill is. Similarly, Offense may give 0, 0.10, 0.20 or 0.30 to melee attacks.&lt;br /&gt;
&lt;br /&gt;
Three heroes specialize in Archery or Offense. Orrin has Archery as a specialty while Gundula and Crag Hack has Offense. They recieve additional bonus from Archery or Offense secondary skill, that is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;I&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; I&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be seen from the formula, the specialty bonus requires that the hero has the appropriate secondary skill, otherwise A&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will become 0, which leads to that A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; will be 0 as well. In other words, Orrin does not recieve his specialty bonus if he does not have Archery secondary skill; same applies to Gundula and Crag Hack with Offense. By default these heroes start with an appropriate secondary skill, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
Additionally, [[Adela]] and her specialty to [[Bless]] spell is a special case of variable A&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;. When creature stack blessed by Adela attacks, it recieves an additional damage from her specialty, that can be calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;SP = 0.03 &amp;amp;times; hero level &amp;amp;divide; creature level&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the division, Adela&#039;s Bless bonus is higher to low-tier creatures. First level creatures will recieve +3% bonus to damage per Adela&#039;s level, while fifth level creatures only recieve +0.6% bonus per Adela&#039;a level.&lt;br /&gt;
&lt;br /&gt;
==== Luck as combat modifier – variable A&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Luck variable may be either 0 or 1.00 depending if the attacking creatures gets &amp;quot;a lucky strike&amp;quot;. [[Luck]] is a combat variable, that may be 0, +1, +2 or +3, which all give a different probability for luck to occur. Verbal descriptions for variables are postivie (+1), good (+2) and excellent (+3). Respectively the probabilities are 1/24 (4.17%), 1/12 (8.33%) and 1/8 (12.5%) for the lucky strike. Players may affect the luck with artifacts, adventure map locations, spells and [[Luck (secondary skill)|Luck]] secondary skill.&lt;br /&gt;
&lt;br /&gt;
==== Creature abilities – variable A&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
Creature variable C is the last variable capable of increasing the final damage. [[Cavalier and Champion|Cavaliers and Champions]] have special ability to recieve jousting bonus when they attack. This gives them bonus which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;C = 0.05 &amp;amp;times; squares travelled&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Dread Knight]]s may cause [[Death Blow]] attack, which gives variable C value 1.00. Similarly, if [[Ballista]] causes double damage, the value variable C receives value of 1.00. Additionally, there are few creatures who [[hate]] another creature, and that gives C a value of 0.50.&lt;br /&gt;
&lt;br /&gt;
=== Defense variables ===&lt;br /&gt;
==== Secondary skill factors – variables D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;====&lt;br /&gt;
Similarly to attac variables, D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are related to secondary skill and heros who specialize in them. The difference is, that secondary skill, [[Armorer]] reduces both melee and ranged damage. Three heroes specialize in Armorer: [[Mephala]], [[Neela]] and [[Tazar]]. Armorer may give variable D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; values 0.05, 0.10 or 0.15. Heroes with Armorer specialty recieve additional bonus, which is calculated with the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 0.05 &amp;amp;times; hero level &amp;amp;times; D&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, the specialty bonus requires that the hero has Armorer secondary skill, otherwise the bonus will be 0. By default Mephala, Neela and Tazar start with Armorer, but in custom maps the map-maker may change the starting skills.&lt;br /&gt;
&lt;br /&gt;
==== Ohter factors – variables D&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;6&amp;lt;/sub&amp;gt;, D&amp;lt;sub&amp;gt;7&amp;lt;/sub&amp;gt; ====&lt;br /&gt;
* Spells&lt;br /&gt;
** Shield&lt;br /&gt;
** Air Shield&lt;br /&gt;
* Attack penalties:&lt;br /&gt;
** Range or obstacle&lt;br /&gt;
** Melee penalty&lt;br /&gt;
* Petrified&lt;br /&gt;
* Retaliate from blindness&lt;br /&gt;
* Creatures&lt;br /&gt;
** Attacker is Psychic Elemental, defender is immune to Mind spells&lt;br /&gt;
** Attacker is Magic Elemental, defender is Magic Elemental or the Black Dragon&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&#039;&#039;No heroes are assumed to be present in the battle.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;2&#039;&#039;&#039; [[Naga]]s attack a stack of [[Pikeman|Pikemen]]. &lt;br /&gt;
*The [[Naga]]s have a single unit damage value of &#039;&#039;&#039;20&#039;&#039;&#039; and their Attack skill is &#039;&#039;&#039;16&#039;&#039;&#039;. &lt;br /&gt;
*A [[Pikeman]] has &#039;&#039;&#039;10&#039;&#039;&#039; [[health]] and their Defense skill is &#039;&#039;&#039;5&#039;&#039;&#039;.&lt;br /&gt;
*The base stack damage done by the stack of [[Naga]]s is &#039;&#039;&#039;2 * 20 = 40&#039;&#039;&#039;. &lt;br /&gt;
*The [[Pikeman|Pikemen]]&#039;s Defense skill (&#039;&#039;&#039;5&#039;&#039;&#039;) is subtracted from the [[Naga]]s&#039; Attack skill (&#039;&#039;&#039;16&#039;&#039;&#039;), which gives us &#039;&#039;&#039;11&#039;&#039;&#039;, giving the [[naga]]s an att/def damage bonus.&lt;br /&gt;
*The dealt damage will after the att/def consideration thusly have the bonus percentage modificator of &#039;&#039;&#039;5%&#039;&#039;&#039;, multiplied with the damage bonus number in this case, &#039;&#039;&#039;11&#039;&#039;&#039;, resulting in &#039;&#039;&#039;55%&#039;&#039;&#039; bonus percentage of the [[Naga]]s damage towards the [[Pikeman|Pikemen]].&lt;br /&gt;
*So the damage is increased by a &#039;&#039;&#039;55%&#039;&#039;&#039; increase and the [[naga]]s through superior attack skill have &#039;&#039;&#039;155% damage&#039;&#039;&#039; on the [[Pikeman|Pikemen]] stack.  &lt;br /&gt;
*The total damage thus is &#039;&#039;&#039;40 * 1.55 = 62&#039;&#039;&#039; damage points. &lt;br /&gt;
*&#039;&#039;&#039;6&#039;&#039;&#039; [[Pikeman|Pikemen]] will be killed, and the top [[Pikeman|Pikemen]] of the remaining stack will have &#039;&#039;&#039;8&#039;&#039;&#039; health left.&lt;br /&gt;
&lt;br /&gt;
When the remaining (if any) &#039;&#039;&#039;[[Pikeman|Pikemen]]&#039;&#039;&#039; (attack points of 4) &#039;&#039;&#039;attack&#039;&#039;&#039; the &#039;&#039;&#039;[[naga]]s&#039;&#039;&#039; (sporting 13 points of defense):&lt;br /&gt;
*-22.5% damage would be dealt by the [[Pikeman|Pikemen]] to the 5 creature level higher [[naga]] chimera stack.&lt;br /&gt;
*The &#039;&#039;&#039;difference&#039;&#039;&#039; between the [[Pikeman|Pikemen]] attack (&#039;&#039;&#039;4&#039;&#039;&#039;) and the [[naga]]s defense (&#039;&#039;&#039;13&#039;&#039;&#039;) would mean &#039;&#039;&#039;9 malus points&#039;&#039;&#039; with a malus point resulting in 2.5 % each malus point (the half of the bonus points).&lt;br /&gt;
* ((2.5)*-9)% is -22.5% damage the [[Pikeman|Pikemen]] can damage the [[naga]]s with.&lt;br /&gt;
&lt;br /&gt;
[[Category: Combat]]&lt;br /&gt;
[[Category: Terms]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Tactics&amp;diff=18621</id>
		<title>Tactics</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Tactics&amp;diff=18621"/>
		<updated>2014-07-18T07:40:16Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: /* Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Secondary skills}}&lt;br /&gt;
{{Secondary skill&lt;br /&gt;
 | B_effect = allows you to rearrange your troops just before combat, within three hex rows of the commanding hero.&lt;br /&gt;
 | A_effect = allows you to rearrange your troops just before combat, within five hex rows of the commanding hero.&lt;br /&gt;
 | E_effect = allows you to rearrange your troops just before combat, within seven hex rows of the commanding hero. }}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tactics&#039;&#039;&#039; is a [[secondary skill]], that allows hero to arrange his troops on the battlefield at the beginning of combat, assuming that hero&#039;s skill level is higher than the opponent&#039;s Tactsics level. If both of the heroes have the Tactics skill, they cancel each other out, and neither of the heroes may arrange his army. If one of the heroes have higher level of Tactics, his skill is treated being on the same level as the reminder. For example, if hero with expert Tactics encounters a hero with basic Tactics the remainder becomes 2, which means that the hero&#039;s  expert level Tactics is treated as advanced level Tatctis.&lt;br /&gt;
&lt;br /&gt;
== Discussion ==&lt;br /&gt;
Tactics is one of the best secondary skills in the game. At expert level, it allows a hero&#039;s army to advance 7 hexes, which is almost half of the battlefield&#039;s total length of 15. This also allows hero to arrange his troops most suitable to the army&#039;s capabilities. Furthermore, hero may take full advantage of the obstacles on the battlefield as a tactical element. Also a valid action is to &amp;quot;turtle&amp;quot; the troops, meaning that arrange the [[melee]] units to protect the [[Ranged attack|ranged units]]. Combining Tactics with speed increasing spells like (mass) [[Haste]] or (mass) [[Prayer]], allows even the slowest army to reach enemy lines on the first round of combat.&lt;br /&gt;
&lt;br /&gt;
The downside of the skill is, that same level Tactics cancel each other out. When heroes with the same level in the skill confront each other, neither of them may benefit from the skill, and therefore have one secondary skill less to utilise during the combat.&lt;br /&gt;
&lt;br /&gt;
[[Category: Secondary skills]]&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Talk:Damage&amp;diff=18614</id>
		<title>Talk:Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Talk:Damage&amp;diff=18614"/>
		<updated>2014-07-17T21:38:43Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Edit June 23rd, 2014: Besides some minor rephrasing, I corrected the lower damage cap, which is not 72.5% damage, but 30% damage. I also added that terrain, spells and creature specialties may affect attack and defense skills.-[[User:Entelechy|Entelechy]] 11:26, 11 July 2014 (CEST) (signed later).&lt;br /&gt;
&lt;br /&gt;
:I bealieve we mean the same thing here. 70% from 100 is 70, while -30% from 100 is also 70. However, we have a disagreement in wheter it is 70%/-30% or 72.5%/-27.5%. Everywhere it is said that the the reduction is the first one, but to my recollection I tested this out and the vague truth is the latter. [http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;PID=1192104#focus Link here]. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:10, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Haha, that thread looks familiar :-). Actually, when making the above-mentioned edit, I did actually stumble upon your post and therefore I tested it again before editing this page. But again I found a maximum damage reduction of 70% (i.e., attacks do only 30% damage). I am not sure what can account for our different findings. But feel free to let me know if you get the same results when testing it again and then I am happy to try and find out what may be going on. -[[User:Entelechy|Entelechy]] 13:02, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
This page does a good job explaining base damage and how this is modified by attack and defense skills. But maybe it is a good idea to include all damage modifiers here? Perhaps just mention them and refer to their corresponding page, or even provide a full explanation here? User Ecoris from HeroesCommunity compiled a useful list of modifiers in this thread (11th post):  &lt;br /&gt;
http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;pagenumber=2. Also, a version of his general description (9th post on that page) could be included here. -[[User:Entelechy|Entelechy]] 11:26, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:Go ahead! :) I have just been too lazy to organize this page. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:10, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Ok, I will put it on my to-do list ;-). -[[User:Entelechy|Entelechy]] 13:03, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Wow, it seems this item on my to-do list has just become a lot smaller :-). Great additions so far (also on the Master Genie page by the way)!-[[User:Entelechy|Entelechy]] 20:17, 14 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Given your great and hard work on editing this page, I felt it would be inappropriate to edit it at the same time. I did find the following [http://heroescommunity.com/viewthread.php3?TID=20955&amp;amp;PID=424843#focus thread] on HeroesCommunity, though, which might be useful. But I am also happy to incorporate it here myself, of course, once you feel you are done with this page for now. -[[User:Entelechy|Entelechy]] 19:57, 15 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::One is always welcome to do changes and add more contents. Although it is sometimes good to check if another is currently working on article. Personally I like to &amp;quot;save&amp;quot; the changes from time to time. Your article seems (based on quick reading) valid, but I am not sure it has any concrete knowledge. It seems to contain more guesses than hard evidence. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 08:19, 16 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::::Thanks for the comments. Perhaps it might be an idea then to just add an External Link section on this page and also refer in it to the other above-mentioned thread. I also added some information on spell damage by the way - I hope it is useful. I am wondering about the formula, though. Shouldn&#039;t AD be added to the list with As when it is positive and to the list of Ds when it is negative? Also, I believe all Ds should be entered in separate brackets as follows: (1-D1)x(1-D2) etc. As the formula is now, it seems damage may be negative. -[[User:Entelechy|Entelechy]] 23:53, 16 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::::I have been wondering AD&#039;s place as well. In fact, I origianlly wrote them sparately, but came to a conclusion, that it such a significant factor, that it should stand alone. However, I am still not sure. Lets leave it there for awhile and finish the article. We can then make a decision wheter to put it in the brackets or not.&lt;br /&gt;
&lt;br /&gt;
:::::I believe the formula is right. Your suggestion is incorrect, because (1-x)&amp;amp;times;(1-y) is same as 1&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;-y-x+xy. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 07:08, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
== The formula ==&lt;br /&gt;
Hmm, is it so that the added up A&#039;s have a maximum of 3.00 and added up D&#039;s have a maximum of 0.70; meaning that if the sum is reduced to those numbers if the sum otherwise would go over it? --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 07:18, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:Let me just try and write down what I believe is the correct formula. We know that all bonus damage is calculated as a percentage of base damage and that all bonuses are added separately to this base damage. So if base damage is 100, then an A/D difference of +20 adds 100 base damage (A1 = 1) and luck adds another 100 (A2 = 1), for a total of 300. We could say, then, that Total Damage = Base Damage + (A1 x Base Damage + A2 x Base Damage). This can be rewritten as Total Damage = Base Damage x (1 + A1 + A2).&lt;br /&gt;
:Now, we know that defense modifiers simply multiply this whole formula of &amp;quot;Base Damage x (1 + A1 + A2 + ...)&amp;quot; with a number below 1. So if there would be a negative A/D difference of, say, -12 (D1 = 0.3), then damage would be reduced to 70% because 1 - 12 x 0.025 = 0.7. Advanced armorer, which reduces damage by 10% (D2 = 0.1), would reduce this further by multiplying this 0.7 with 1 - 0.10, which is 0.7 x 0.9 = 0.63. Defense modifiers therefore reduce damage as follows: Total damage = damage x (1-D1) x (1-D2). You are right that (1-D1) x (1-D2) is equal to 1 - D1 - D2 + D1D2, but if you substitute the values, you&#039;ll see that 1 - 0.3 - 0.1 + 0.03 is indeed the same 0.63 that we arrived at above. The formula in the above-mentioned thread therefore seems correct to me:&lt;br /&gt;
:Total Damage = Base Damage x (1+A1+A2+A3+...) x (1-D1) x (1-D2) x (1-D3) x ... . It is only a bit tricky that positive A/D difference should be included as an A, and negative A/D difference as a D. The caps of A = 3 and D = 0.7 are applied only to  A/D difference though, damage can be increased or reduced further by other factors. Feel free to let me know what you think and then we can decide how to best phrase the formula.&lt;br /&gt;
:-[[User:Entelechy|Entelechy]] 11:11, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::My reasoning is, that because there cannot be postive and negative AD-differnce affecting the result at the same time, should the factor therefore be sparate from the others. This seems more &amp;quot;beautiful to my mathematical eye&amp;quot;. :)&lt;br /&gt;
&lt;br /&gt;
::My knowledge about the calculation seems to be wrong appears to be wrong here! I have always believed, that those reductions are added up together, but it seems not to be the case. As Ecoris said  [http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;PID=366833#focus here] – short and sweet I might add – &amp;quot;&#039;&#039;damage bonuses are cumulative, while damage reductions are multiplicative&#039;&#039;&amp;quot;. I have never studied or even thought this more closely until now. That is, of course, much more logical. If expert Armorer (-15%) and expert Shield (-30%) affecting at the same time, the correct final reduction seems to be (1 - 0.15) &amp;amp;times; (1 - 0.30) = -0.595 or -41.5% not -45% (or factor 0.55) as I have believed. My apology. :) --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:38, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::Uh, but this &amp;quot;new&amp;quot; infromation also changes the calculation routine, bummer. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:40, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::::No problem, I agree that writing these articles has been quite educational. I learned, for example, that an ammo cart can be raised as a skeleton :-s. Talking about mathematical beauty, all As are basically interchangeable in the formula (only their weighting differs) and so are all Ds, so we may not even have to bother with linking the numbers to specific variable names. Identifying a modifier as an attack or defense variable and giving its weighting may also suffice. Finally, perhaps my edit about magic resistances and immunities is a bit lengthy - I wonder if it is easier to just say that modifiers of spell damage are only valid when the target does not resist the spell and is not immune to it. -[[User:Entelechy|Entelechy]] 23:38, 17 July 2014 (CEST)&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Talk:Damage&amp;diff=18605</id>
		<title>Talk:Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Talk:Damage&amp;diff=18605"/>
		<updated>2014-07-17T09:11:14Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Edit June 23rd, 2014: Besides some minor rephrasing, I corrected the lower damage cap, which is not 72.5% damage, but 30% damage. I also added that terrain, spells and creature specialties may affect attack and defense skills.-[[User:Entelechy|Entelechy]] 11:26, 11 July 2014 (CEST) (signed later).&lt;br /&gt;
&lt;br /&gt;
:I bealieve we mean the same thing here. 70% from 100 is 70, while -30% from 100 is also 70. However, we have a disagreement in wheter it is 70%/-30% or 72.5%/-27.5%. Everywhere it is said that the the reduction is the first one, but to my recollection I tested this out and the vague truth is the latter. [http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;PID=1192104#focus Link here]. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:10, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Haha, that thread looks familiar :-). Actually, when making the above-mentioned edit, I did actually stumble upon your post and therefore I tested it again before editing this page. But again I found a maximum damage reduction of 70% (i.e., attacks do only 30% damage). I am not sure what can account for our different findings. But feel free to let me know if you get the same results when testing it again and then I am happy to try and find out what may be going on. -[[User:Entelechy|Entelechy]] 13:02, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
This page does a good job explaining base damage and how this is modified by attack and defense skills. But maybe it is a good idea to include all damage modifiers here? Perhaps just mention them and refer to their corresponding page, or even provide a full explanation here? User Ecoris from HeroesCommunity compiled a useful list of modifiers in this thread (11th post):  &lt;br /&gt;
http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;pagenumber=2. Also, a version of his general description (9th post on that page) could be included here. -[[User:Entelechy|Entelechy]] 11:26, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:Go ahead! :) I have just been too lazy to organize this page. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:10, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Ok, I will put it on my to-do list ;-). -[[User:Entelechy|Entelechy]] 13:03, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Wow, it seems this item on my to-do list has just become a lot smaller :-). Great additions so far (also on the Master Genie page by the way)!-[[User:Entelechy|Entelechy]] 20:17, 14 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Given your great and hard work on editing this page, I felt it would be inappropriate to edit it at the same time. I did find the following [http://heroescommunity.com/viewthread.php3?TID=20955&amp;amp;PID=424843#focus thread] on HeroesCommunity, though, which might be useful. But I am also happy to incorporate it here myself, of course, once you feel you are done with this page for now. -[[User:Entelechy|Entelechy]] 19:57, 15 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::One is always welcome to do changes and add more contents. Although it is sometimes good to check if another is currently working on article. Personally I like to &amp;quot;save&amp;quot; the changes from time to time. Your article seems (based on quick reading) valid, but I am not sure it has any concrete knowledge. It seems to contain more guesses than hard evidence. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 08:19, 16 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::::Thanks for the comments. Perhaps it might be an idea then to just add an External Link section on this page and also refer in it to the other above-mentioned thread. I also added some information on spell damage by the way - I hope it is useful. I am wondering about the formula, though. Shouldn&#039;t AD be added to the list with As when it is positive and to the list of Ds when it is negative? Also, I believe all Ds should be entered in separate brackets as follows: (1-D1)x(1-D2) etc. As the formula is now, it seems damage may be negative. -[[User:Entelechy|Entelechy]] 23:53, 16 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::::I have been wondering AD&#039;s place as well. In fact, I origianlly wrote them sparately, but came to a conclusion, that it such a significant factor, that it should stand alone. However, I am still not sure. Lets leave it there for awhile and finish the article. We can then make a decision wheter to put it in the brackets or not.&lt;br /&gt;
&lt;br /&gt;
:::::I believe the formula is right. Your suggestion is incorrect, because (1-x)&amp;amp;times;(1-y) is same as 1&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;-y-x+xy. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 07:08, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
== The formula ==&lt;br /&gt;
Hmm, is it so that the added up A&#039;s have a maximum of 3.00 and added up D&#039;s have a maximum of 0.70; meaning that if the sum is reduced to those numbers if the sum otherwise would go over it? --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 07:18, 17 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:Let me just try and write down what I believe is the correct formula. We know that all bonus damage is calculated as a percentage of base damage and that all bonuses are added separately to this base damage. So if base damage is 100, then an A/D difference of +20 adds 100 base damage (A1 = 1) and luck adds another 100 (A2 = 1), for a total of 300. We could say, then, that Total Damage = Base Damage + (A1 x Base Damage + A2 x Base Damage). This can be rewritten as Total Damage = Base Damage x (1 + A1 + A2).&lt;br /&gt;
:Now, we know that defense modifiers simply multiply this whole formula of &amp;quot;Base Damage x (1 + A1 + A2 + ...)&amp;quot; with a number below 1. So if there would be a negative A/D difference of, say, -12 (D1 = 0.3), then damage would be reduced to 70% because 1 - 12 x 0.025 = 0.7. Advanced armorer, which reduces damage by 10% (D2 = 0.1), would reduce this further by multiplying this 0.7 with 1 - 0.10, which is 0.7 x 0.9 = 0.63. Defense modifiers therefore reduce damage as follows: Total damage = damage x (1-D1) x (1-D2). You are right that (1-D1) x (1-D2) is equal to 1 - D1 - D2 + D1D2, but if you substitute the values, you&#039;ll see that 1 - 0.3 - 0.1 + 0.03 is indeed the same 0.63 that we arrived at above. The formula in the above-mentioned thread therefore seems correct to me:&lt;br /&gt;
:Total Damage = Base Damage x (1+A1+A2+A3+...) x (1-D1) x (1-D2) x (1-D3) x ... . It is only a bit tricky that positive A/D difference should be included as an A, and negative A/D difference as a D. The caps of A = 3 and D = 0.7 are applied only to  A/D difference though, damage can be increased or reduced further by other factors. Feel free to let me know what you think and then we can decide how to best phrase the formula.&lt;br /&gt;
:-[[User:Entelechy|Entelechy]] 11:11, 17 July 2014 (CEST)&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
	<entry>
		<id>https://heroes.thelazy.net//index.php?title=Talk:Damage&amp;diff=18595</id>
		<title>Talk:Damage</title>
		<link rel="alternate" type="text/html" href="https://heroes.thelazy.net//index.php?title=Talk:Damage&amp;diff=18595"/>
		<updated>2014-07-16T21:53:38Z</updated>

		<summary type="html">&lt;p&gt;Entelechy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Edit June 23rd, 2014: Besides some minor rephrasing, I corrected the lower damage cap, which is not 72.5% damage, but 30% damage. I also added that terrain, spells and creature specialties may affect attack and defense skills.-[[User:Entelechy|Entelechy]] 11:26, 11 July 2014 (CEST) (signed later).&lt;br /&gt;
&lt;br /&gt;
:I bealieve we mean the same thing here. 70% from 100 is 70, while -30% from 100 is also 70. However, we have a disagreement in wheter it is 70%/-30% or 72.5%/-27.5%. Everywhere it is said that the the reduction is the first one, but to my recollection I tested this out and the vague truth is the latter. [http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;PID=1192104#focus Link here]. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:10, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Haha, that thread looks familiar :-). Actually, when making the above-mentioned edit, I did actually stumble upon your post and therefore I tested it again before editing this page. But again I found a maximum damage reduction of 70% (i.e., attacks do only 30% damage). I am not sure what can account for our different findings. But feel free to let me know if you get the same results when testing it again and then I am happy to try and find out what may be going on. -[[User:Entelechy|Entelechy]] 13:02, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
This page does a good job explaining base damage and how this is modified by attack and defense skills. But maybe it is a good idea to include all damage modifiers here? Perhaps just mention them and refer to their corresponding page, or even provide a full explanation here? User Ecoris from HeroesCommunity compiled a useful list of modifiers in this thread (11th post):  &lt;br /&gt;
http://heroescommunity.com/viewthread.php3?TID=11801&amp;amp;pagenumber=2. Also, a version of his general description (9th post on that page) could be included here. -[[User:Entelechy|Entelechy]] 11:26, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:Go ahead! :) I have just been too lazy to organize this page. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 12:10, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Ok, I will put it on my to-do list ;-). -[[User:Entelechy|Entelechy]] 13:03, 11 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Wow, it seems this item on my to-do list has just become a lot smaller :-). Great additions so far (also on the Master Genie page by the way)!-[[User:Entelechy|Entelechy]] 20:17, 14 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::Given your great and hard work on editing this page, I felt it would be inappropriate to edit it at the same time. I did find the following [http://heroescommunity.com/viewthread.php3?TID=20955&amp;amp;PID=424843#focus thread] on HeroesCommunity, though, which might be useful. But I am also happy to incorporate it here myself, of course, once you feel you are done with this page for now. -[[User:Entelechy|Entelechy]] 19:57, 15 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
:::One is always welcome to do changes and add more contents. Although it is sometimes good to check if another is currently working on article. Personally I like to &amp;quot;save&amp;quot; the changes from time to time. Your article seems (based on quick reading) valid, but I am not sure it has any concrete knowledge. It seems to contain more guesses than hard evidence. --[[User:Kapteeni Ruoska|Kapteeni Ruoska]] 08:19, 16 July 2014 (CEST)&lt;br /&gt;
&lt;br /&gt;
::::Thanks for the comments. Perhaps it might be an idea then to just add an External Link section on this page and also refer in it to the other above-mentioned thread. I also added some information on spell damage by the way - I hope it is useful. I am wondering about the formula, though. Shouldn&#039;t AD be added to the list with As when it is positive and to the list of Ds when it is negative? Also, I believe all Ds should be entered in separate brackets as follows: (1-D1)x(1-D2) etc. As the formula is now, it seems damage may be negative. -[[User:Entelechy|Entelechy]] 23:53, 16 July 2014 (CEST)&lt;/div&gt;</summary>
		<author><name>Entelechy</name></author>
	</entry>
</feed>