Before we start discussing the actual combat, it is good to know some basic information about how players and monsters function. Each monster and player can exist in one of several possible states. Such states include things like walking, standing, attacking, casting spells, doing a hit recover, being stoned, and dying. A character or monster must finish the current action before it can start a new one. An exception to this is when you get hit. A hit will generally abort your or the monster's current action, and if the damage is high enough, put the victim into hit recovery (or if even greater into dying mode). Players, but never monsters, can also be put into a blocking state if carrying a shield. For information about how long it takes to do various actions, see chapter 2.3 for players and chapter 5.3.4 for monsters.
The detailed information below will generally be given as a numbered list which one steps through, step by step. At some points there will be notes that certain steps are skipped under some conditions or are only done in specific cases. It is therefore wise to read through all of the part that applies to the situation before drawing any conclusions as some actions are only valid if some specific conditions, which may be presented later, are met.
|Most combat situations can be divided into a few specific main steps:|
|A. Pre-hit||This checks for things like if the target in question is really possible as a target. A player is, for example, mostly immune to attacks from himself, and monsters are similarly also immune to attacks from other monsters. It also includes checks if a target is available at all. For example, a bow may lose durability even if there is no target present, but for a melee weapon to lose durability it actually needs to hit something. This step will generally not be discussed here as it is quite uninteresting as a player of the game, but some things actually done in this step have instead been included in other steps.|
|B. To Hit||Here the game checks for the probability of hitting to see if a hit is really acquired. If no hit is acquired, the next steps are generally not done.|
|C. Blocking||When a player is hit, the game will check if he or she managed to block the attack or not. If a block was done, the Damage step is generally skipped.|
|D. Damage||Here the game will calculate the damage and take into consideration all the applicable modifications. It will also deal the damage to the target.|
|E. Hit consequences||This will do all the necessary checks for things that will affect both the target and the attacker if a hit occurs. This includes checks for hit recovery, life and mana stealing, death, and so on.|
Some or all the steps above may be performed when an attack is done, and there might be additional steps not mentioned above under some circumstances.
There are also some steps done only in Hellfire or only in Diablo, in that case this is clearly mentioned at the start of the step in italic.
Mana Shield is a spell that causes damage to your life to be taken instead from your mana. In the process it will also reduce the amount of damage taken. To avoid confusion on how the Mana Shield spell affects combat, it will be described in detail here. For information about such things like mana cost and requirements to read books, see chapter 4.
As already said, Mana Shield is a magical effect, and as such, it is handled in the step when all other magical effects are handled (see above) although it is processed after all other effects. It is very important to realize that the Mana Shield never affects any combat directly; that is, any attack, be it magical or melee, will be carried out normally and will do any damage to your life. Any attack will also put the target into any applicable status such as hit recovery or dying. It is not until the game processes the magical effects and reaches the Mana Shield that it actually changes the normal course of action. Unfortunately, as explained below, this will result in some bugs regarding the player status.
So, lets see in more detail how the Mana Shield works.
As can be seen from the above, if the player was set to dying mode during the normal attacks, it will be put into standing mode by the Mana Shield, and thus avoid, for example, hit recovery, which would in some cases had been the more correct mode. It also prevents knock backs as it is not checked in the normal attack routines if the player died. Finally, it avoids any further attacks done in the last turn while the player was dead. An example of this would be if 3 monsters hit you all at the same time; the first one kills you, and the other two monsters' attacks are then not done as you are already dead. Later in the turn when the magical effects are processed, the Mana Shield restores your life, reduces the damage from mana instead, and puts you back into life. You have then effectively avoided the attack from the last two monsters. This does not happen too often, as the attacks of the monsters need to be done at the exact same time.
In Hellfire, there are some additional bugs related to the Mana Shield (those bugs were fixed in Diablo, version 1.07). When you run out of mana, and the Mana Shield is terminated, you will take excessive damage (up to twice the damage of the latest attack). It is also possible to cast more than one Mana Shield and although this will not affect the efficiency of the Mana Shield, you will take excessive damage from each Mana Shield when you run out of mana and all the Mana Shields are terminated.
Fire Wall and Flame Wave are special in that they are the only spells that can hurt the caster of the spells. They are also special in that when attacking players (including the caster), they will attack as if they where magic traps, that is, the To Hit is always 40%. When attacking monsters, they will use the normal To Hit calculations.
Actually, the Reflect spell is handled properly in the step by step lists later on. I just wanted to mention that Reflect, contrary to Mana Shield, is handled within the actual damage routines by a flag set on the character. If set, the damage will be reduced properly and reflected back to the monster. This is how the Mana Shield should have been implemented to avoid all the problems and bugs associated with it.
Items with the effect of life stealing and mana stealing work independently of each other. An item with the 5% stealing will always supersede the 3% stealing and they are thus not cumulative (you can still have one item with 3% mana stealing and one with 5% life stealing though). Similarly, two items with 3% stealing or two with 5% stealing are not cumulative either.
The random life stealing effect only found on The Undead Crown is cumulative with other life stealing though as it is handled separately from normal life stealing. Life and mana stealing only work against monsters, never against players (the exception is the random life stealing, but as The Undead Crown only exists in single player it doesn't matter).
The table below summarizes the end result when you have two items of life or mana stealing. If there is any way to get three items with life or mana stealing, simply do it as a two step process, first checking two of the items, then take the end result and check it with the third effect.
|3% mana||5% mana||3% life||5% life||random life1|
|3% mana||3% mana||5% mana||3% mana
|5% mana||5% mana||5% mana||5% mana
|3% life||3% mana
|3% life||5% life||3-15.5% life|
|5% life||3% mana
|5% life||5% life||5-17.5% life|
|random life1||3% mana
|3-15.5% life||5-17.5% life||0-12.5% life|
|1Steals a random amount of life between 0 and 12.5% each time you hit.|
When you do an attack that does additional fire or lightning damage, this will be handled by the game separately. Upon hit (even if the actual attack misses), the game will spawn an additional magical effect of the appropriate type, which will then be handled normally during the magical effect update. When hitting, the effect will use normal magical To Hit, and all resistance and other effects that normally work against magic apply normally. It will then deal the amount of fire or lighting damage your character currently does. The magical effect will only hit once but it will try to hit up to 7 times (9 if fire) before it ends.
Fire and lightning attacks on bows work pretty much the same as the ones on melee weapons. There are some exceptions. As arrows to start with are already effects, there is no need to spawn a special effect for the extra fire and lightning damage like there is for melee weapons. Instead, as soon as the fire or lightning arrow hits and has done its non magical damage, the effect will switch into a fire or lightning damage attack, quite similar to the one spawned for melee attacks. This extra fire or lightning attack will, as opposed to with melee attacks, hit more than once and will try 7 times (9 if fire) before it ends. Any extra fire or lightning damage from any item other than the bow will be added despite the fact that this is a ranged attack.
Fire and lightning arrows are quite buggy and the list below tries to summarize some of the bugs related to them.
Note that in the chapters below, the bugs regarding fire and lightning arrows will not be mentioned. The list above should be sufficient for knowing the end effects.
Charges are special in that they are treated as magical effects while the actual charge is conducted; that is, the monster moves during the effect update phase, but as soon as it hits, it turns into an almost normal melee attack. Below are listed what special conditions apply to Charge attacks.
Either intentionally or due to a bug, monsters that are charging, can at times cross lava that is otherwise impassable in the caves.
Before we go into detail about the actual attacks, it might be good to learn some basic information on how the game handles spells. This chapter will try to briefly explain this so that it not only gets easier to understand the chapter about non-melee attacks, but also how spells really work. Non-melee attacks are basically magic in nature. An exception is arrows, but think of them as any other projectile, like fireball, and you will see that there is really not much difference. Each spell or missile in the game is an effect, and in the effect update procedure each effect is processed and can do a number of things.
Easiest to understand are the missile spells, the ones like Fireball, Charged Bolt, or Holy Bolt. They are basically an effect that moves around in the dungeon at a certain speed and often in a straight line. As soon as it enters a location it checks if it contains a potential target (monsters are immune to other monsters and players are often immune to their own spells and so on). If there is a potential target, it will try to attack, and it is this attack this chapter on Battle will explain in more detail. It will also check if it has hit a wall or some other dungeon feature and, if so, terminate. Some spells like Elemental and Flame Wave (which are in fact several flames, each an effect, moving side by side) will not terminate if they hit a target like a Fireball does. They will, regardless of if they hit or not, continue to move, and can thus hit multiple targets. Some spells consist of multiple missiles, such as Nova and Charged bolt. A Fire Wall is a typical example of a spell that can hit a target repeatedly.
Sometimes a spell can actually consist of several effects. The Lightning spell is such an example. The main spell is totally invisible and starts at the position of the source and travels away at a certain speed (see chapter 4.1.2). Each time it enters a new location it will spawn a new effect, a non moving lighting bolt with a certain duration that will sit in the location and try to hit anything in the location until its duration is over at which time it is removed. As the individual bolts are spawned with a certain delay the further away they are from the original source, they will also disappear with the same delay. The total effect is a seemingly moving stream of lighting bolts when in fact it is stationary bolts, where the duration of the individual bolts determines what looks like the length of the lighting stream. The speed of the stream is actually the speed of the initial invisible moving spell effect that spawns the bolts. Many other spells work in a similar way.
As already said, a spell can either be terminated upon hitting or go on even if it hits. In addition to that, most spells have a duration after which they will also be terminated. Most missile spells will also be terminated when they hit a wall or other dungeon feature. In addition to the above, each effect, when it attacks, can be set to be blockable or not. The check for blocking will only be done for those spells that are blockable. See chapter 4.1.2 for information about blockable spells. Finally, each effect can be either Fire, Lightning, Magic, or other (arrows are special).
Some effects will, of course, never attack; examples of such effects are Mana Shield and Infravision.
As already explained, an attack will typically always hit a specific location (with some exceptions). Normally, only a single monster or player can occupy a location at any time (although, due to bug, at times a monster and a player may end up in the same location, this is usually due to using the Teleport or Phasing spell). As long as a monster or a player is not moving between locations, it is always attackable in the location it occupies, regardless of what it do. Some activities will make the monster or player not hitable, but that is a different matter, examples of such things are an Illusion Weaver retreating, a player during the first 0.5 seconds upon entry of a new dungeon level. But what about when a monster or a player is walking between two locations. Where can it be attacked? The answer is that it depends on the type of attack and the direction of the walk. In the table below are listed all the various cases that may exist. It also tells in what location the monster or player is put in case the walk is interrupted, that is, when the target go into a hit recovery.
|Target locations depending on direction of walk of target1|
|Situation||NW, N or NE2||SW, S or SE2||W or E2|
|Player attack monster in melee||Both||Both||Both|
|Player attack player in melee||Both||Both||Both|
|Monster attack player in melee||Special||Special||Special|
|Monster attack monster in melee||Both3||Both3||Both3|
|Spells4 attacking player||Leaving||Entering||None|
|Spells4 attacking monsters not Stone Cursed||Both||Both||Both|
|Spells4 attacking monsters Stone Cursed||Leaving||Entering||None|
|Fire Wall, Flame Wave or Ring of Fire attacking player or monster||Leaving||Entering||None|
|Hit recovery location for player||Leaving||Entering||Leaving|
|Hit recovery location for monster||Leaving||Leaving||Leaving|
|Location used for distance calculations||Leaving||Entering5||Leaving|
1Both means that the target can be hit in both the location he is leaving and the location he is entering, leaving means that the target can only be hit in the location it is leaving, entering means that the target can only be hit in the location it is entering, none means that it can't be hit in any of the locations. Monsters attacking players are handled in a special way explained below.
2For the definition of north, see chapter 1.3.
3A monster that attack another monster will always check for To Hit no matter where the target is at the time to check for To Hit. A monster will never initiate a melee attack unless the target at that time is in an adjacent location which means that usually it can hit in both locations and in addition further away in the rare occasions that the target has managed to get further away.
4Excluding Fire Wall, Flame Wave and Ring of Fire.
5Distance to a golem is measured to the Leaving location.
Monsters attacking players in melee does not specifically check for the location of the attack. Instead, upon attack it will check for the distance from the monster to the player. The locations used to calculate the distance is for the monster the location it is occupying and for the player it depends on the direction it is walking. When walking W, NW, N, NE or E, it is always the location the player is leaving and while walking SW, S or SE it is always the location the player is entering.
This has some important consequences that it is good to know about. When walking away from a monster it will thus always miss the check for the To Hit is done after you have started walking downwards on the screen and it will always have a normal chance of hitting you until you have completely reach your new location while walking upwards or sideways from the monster. Further more, if the walk is aborted by an attack, the player will be put in the location as indicated in the table above which means if you walk downwards, you will in such cases always be "pushed" downwards (regardless of the direction of the attacker) but when walking in other directions, you will be "pushed" back into the location you were leaving. Further more, when deciding upon what action to perform, see chapter 5.5 the distance is similarly always calculated in the same way. This result in the situation that when you are walking towards a monster it will only initiate a melee attack while you are walking, if you are walking SW, S or SE. If you walk in any other direction towards the monster it will consider you non adjacent up until you have reached the location adjacent to the monster.
Finally, as it is the distance from the monster to the player that counts when a monster attack a player, a monster will always check for To Hit against a player in those cases they occupy the same locations (can happen due to a bug) but a player will only be able to hit an adjacent location when doing a melee attack and can thus not attack the monster within its location.
In the rest of the Guide, the speed of spells and arrows are given with a number in the 16 - 63 range (rarely going below 8). Here, a brief description is made in an attempt to convert those speeds to real speeds in the dungeon measured in reference to the tiles in the dungeon. This is also useful for estimating the distance penalty of arrows.
Any missile in the game (be it an arrow or a spell) will use true trigonometrical calculations for its movement, both for location and speed. Thus, it takes a missile longer to move through a location diagonally than straight along a side (roughly 40% longer) as opposed to character and monster movement which takes the same time regardless of it being diagonally or not. In addition, missiles actually move in small jumps each frame. That is, depending on their speed, they will move a certain distance each frame. For the purpose of keeping track of missiles, the game actually uses 22 extra bits of precision for its location, think of it as each location actually being divided in roughly 92 680 times 92 680 smaller locations. This higher precision is used for smooth movement only, for actual To Hit purposes the missile is simply considered to be in one location, regardless of where in the location it is. This have a few implications though. If the distance a missile is moved each frame is smaller than a location, it may end up staying in a location for more than one frame. In addition, it may, when not moving in straight angles along the locations, only enter the corner of some locations and may thus never really exist in a location that it in fact should pass through (for movement straight along the locations, this should never happen as it requires a speed value above 64 which does not exists in the game).
Some missile types prevents trying to hit the same location more than once (should it not manage to move into a new location when updated each frame) while most do not and may thus try to hit a target in a location more than once. This will of course make the total chance of hitting a target somewhat higher than it should be. This phenomenon is not that uncommon but extremely hard to predict or give exact numbers on as it depends both on the exact speed of the missile and in what direction you fire it. As you can virtually fire a missile in any direction, the possibilities are numerous. One should be aware of this phenomenon though as it might affect the result if anyone would actually measure the actual hit percentages of missiles.
To calculate the distance a missile of a specific speed travels, only examples of movement straight along the locations in the dungeon will be considered. It should be easy to apply to movement in any direction with true trigonometry. A missile with a speed value of 64, will travel exactly diagonally through one location each frame. This corresponds to traveling 1.4 locations in a straight line along the locations side. Alternatively you may say that a speed of 45.3 travels a location in one frame straight along the side of a location. The distance traveled per second can thus easily be calculated as:
|Locations a missile travel per second:||25·speed/45.3|
As the distance penalty of an arrow is increased by 1 each frame, the total distance penalty per location (see chapter 2.1.4 and 5.1 for more information) can be calculated as:
|For characters:||distance·distance/2 = (45.3/speed)·(45.3/speed)/2 = 1 048/(speed·speed)|
|For monsters:||distance·distance = (45.3/speed)·(45.3/speed) = 2 048/(speed·speed)|
As noted, for some locations, the fact that the missile will try to hit more than once may make the actual To Hit be slightly different. Also note that a missile will actually start traveling in the location where the player or monster it originates from is currently standing in. It may at times take more than one frame to reach the next location but in no case will a missile make a To Hit check in its location of origin.
In most cases it should be obvious from whom the stat in a formula should be taken. Monsters do not have Dex or clvl for example. In some cases, for example with players attacking players or when there is some bonus, it might not be so obvious and there is an additional note telling if it is from the target or the attacker (or if it is for the monster or player as appropriate). This is also done when it is not obvious what value should be used, for example if it is a base To Hit or a modified To Hit.
Any part of the formula that is only applicable in Hellfire is shown in italic.