Healers, monks, priests and wizards are roles which begin the game with knowledge of one or more spells and are often able to cast them; other classes must find at least one spellbook and read it first.
When you are prompted to select a spell to cast, a menu will appear of the spells you know, accompanied by their chance of failure. The + key brings up this same menu and allows you to rearrange the spells so you can place them on more convenient letters.
A spell's chance of failure is affected by either intelligence or wisdom, experience level, skill level, your role's innate magical affinity, and what armor you are wearing: metal armor in particular can impact chances of success, as well as the type of shield if applicable. Failure rates can be reduced by wearing a robe, and additionally reduced further if the spell is an emergency spell or your role's special spell.
When you attempt to cast a spell, the game rolls for success or failure. If you fail, you will receive the message "You fail to cast the spell correctly." Otherwise, the spell takes effect.
Each successful cast of a spell trains its associated spell skill by an amount equal to its level, regardless of whether the spell affected anything.
Technically, using teleport at will is also considered to be a cast of a spell, and follows many but not all of the same rules as casting teleport away (it bypasses the percentage failure rate calculation, for instance).
- 1 Prerequisites for casting a spell
- 2 Forgotten spells
- 3 Spellcasting cost
- 4 Calculating spell success rate
- 5 Effects
- 6 Strategy
- 7 Variants
- 8 History
- 9 External links
- 10 References
Prerequisites for casting a spell
If any of the following conditions are true, you will not be able to cast any spells at all:
- You don't know any spells.
- You are stunned.
- You are incapable of chanting the spell. This can be due to any of:
- Both of your hands have cursed gear stuck to them (either through wielding a cursed two-handed weapon or through wearing a cursed shield and wielding a cursed one-handed weapon). For some reason, being polymorphed into a form without hands does not prevent you from casting spells.
- You have forgotten the spell you chose to cast (see below).
- You are weak and very close to fainting, and you are trying to cast something other than detect food.
- Your Strength is below 4, and you are trying to cast something other than restore ability.
- You are Overtaxed or worse.
- You don't have enough energy to cast the spell you picked.
- You are confused. (This is the last thing checked, and if it is the only reason you are unable to cast, you lose half of the spell's normal energy cost).
Spell knowledge only lasts for 20,000 turns after reading a spellbook. Once this time is up the spell is forgotten, and is marked with an asterisk * in the casting menu. Spellbooks may be re-read once the timeout is at or below 1,000 turns. This will reset the timeout to 20,000 turns. Attempting to read a spellbook before the timeout is low enough will produce the message "You know <spell> quite well already". This will not use up a reading of the spellbook, and if read while owned by a shopkeeper, will not result in a use fee.
Attempting to cast a forgotten spell will not check any of the usual casting prerequisites except stunning, and will consume neither nutrition nor power. It will instead make you confused, stunned, or both. The duration of confusion and stunning is dependent on the level of the forgotten spell, but the choice of effects is not.
The exact effect of casting a forgotten spell is as follows:
Casting a spell costs energy points, equal to 5 times the spell's level . If you are carrying the Amulet of Yendor, it drains an amount of energy between 1 point and 2 times the usual cost as you attempt to cast (“You feel the amulet draining your energy away.”) . If you do not have the required energy after this (“You don't have enough energy to cast that spell.”), nothing happens; this only uses a move if the Amulet drained energy. If the attempt fails (“You fail to cast the spell correctly.”), only half of that energy is used up, rounded down .
Casting any spell other than detect food uses nutrition equal to two times the energy cost (including the Amulet penalty), which means that it is usually 10 times the spell's level. If you are a wizard with sufficiently high intelligence, you might be able to take advantage of hungerless or reduced-hunger casting. A failed cast costs just as much nutrition as a successful one. If you are fainting, you cannot cast any spells other than detect food, whether or not you have hungerless casting.
As an example, casting a level 3 spell normally requires 15 energy and 30 nutrition. If you fail to cast it, only 7 energy is used, but you still lose 30 nutrition. When carrying the Amulet of Yendor, there is an energy penalty of 1 to 30 points, so the total energy cost varies from 16 to 45, but the nutrition cost is still 30.
Calculating spell success rate
To calculate spell failure you can use the tool referenced in the External Links section below.
The algorithm is as follows. An increasing total penalty is worse for spellcasting, and is limited to a maximum of 20. You first need to add together the penalties listed below:
- The "Base" value from the table below, depending on the character's class.
- If an "emergency" spell, the "Emergency" field. Spells considered emergency spells are all healing spells except for stone to flesh, and remove curse. 
- If wearing any shield, the amount in the "Shield" field.
- If wearing metallic body armor, the amount in the "Suit" field.
- If also wearing a robe, only add half the amount (rounded down). 
- If wearing a robe without metallic armor, subtract the amount in the "Suit" field. 
- If wearing a metallic helmet other than the helm of brilliance, add 4. (Metal helmets interfere with the mind.)  
- Metallic gloves add 6 (casting channels through the hands). 
- Metallic boots add 2 (all metal interferes to some degree). 
- If casting the corresponding special spell for your role (see table), subtract 4.
|Valkyrie||10||-2||0||9||Wis||Cone of cold|
Next, calculate a base chance of success, which is 5.5 times either your intelligence or wisdom, depending on your class (see the "Stat" field). The maximum natural human Int/Wis of 18 gives a 99% base success rate. This chance is modified by the following factors:
- SKILL level (Unskilled = 0, Basic = 1, Skilled = 2, Expert = 3)
- spell level (LVL)
- experience level (XL)
according to this formula:
- difficulty = (LVL * 4) - (SKILL * 6) - (XL/3) - 5
If difficulty is positive, the spell is considered difficult. Your chance is reduced according to the following formula. A difficulty of 1 therefore gives a 53% penalty, and a difficulty of 9 gives a 100% penalty.
If it is negative, it will be increased with diminishing returns: the absolute value is multiplied by (15/LVL), capped at 20, and added to the base chance. A level 1 spell therefore achieves the full 20% bonus with a difficulty of -2. A level 7 spell cannot achieve a better difficulty than -5, which gives a bonus of 10%.
The resulting chance is clipped to the range of 0% to 120% success. If you are wearing a shield larger than a small shield, the chance is then reduced to 1/4 its amount (except if it is the special spell for your class -- then it is only halved).
Finally, the chance of success is adjusted by your total penalty using the following formula:
The result is clipped to the range of 0% to 100% success.
One nonobvious consequence of this calculation is that sometimes gaining an experience level divisible by 3 can have a very large effect on the success rate of some spells.
|Spell Level||Skill Level||XL for large improvement|
The chance of hitting versus an armor class (ac) is based on a d20 equivalent (a random number 0-19 is generated).
Also a spell bonus is calculated as the sum of the skill penalty/bonus and the dexterity penalty/bonus. These are the same as used in physical combat.
If the chance is 0, success is d10 < ac + spell bonus
Otherwise, negative ac is weakened to a random number between -1 and the actual ac; success is 3 - chance < ac + spell bonus
A spell damage bonus based on intelligence (INT) and experience level (XL) is used in most attack spell damage calculations.
|INT <= 9||-3|
|INT <= 13 OR XL < 5||0|
|INT <= 18||+1|
|INT <= 24 OR XL < 14||+2|
|INT = 25||+3|
- base d8
- + spell damage bonus
- if monster resists: half damage
- otherwise double damage and damage to max HP
- If monster resists: no damage!
- base = XL / 2 + 1
- base d 6
- Cone of Cold and monster has fire resistance: + base d 3
- + spell damage bonus
- one explosion centered at the monster
- base 12d6 damage
- no spell damage bonus
- modified like skilled below
- 2 to 9 explosions covering a 3 x 3 space, the first centered on a starting point up to 10 steps away, remaining centered randomly 9 spaces centered on starting point
- base + spell damage on each monster in affected space for each explosion
- Cone of Cold and monster has fire resistance or Fireball and monster has cold resistance: double damage
- Monster resists: 1/2 damage
- additional damage for destroyed items
There are three main ways to improve your spellcasting chances: increase your spellcasting stat, gain more skill and experience levels, and wear armor appropriate to your role's spellcasting abilities.
Skill and experience strategy
Spells are much easier to cast when their difficulty is zero or less. The following table lists the most difficult spell level that is still considered easy (no penalty for spell level) given particular experience and skill levels.
|Highest easy spell level|
If your Intelligence or Wisdom is high, spells of this level or below are likely to have a near-100% base success rate. It is still possible to cast non-easy spells, but they tend to have much lower success rates.
Equipment and role strategy
If you have raised your experience level, skill, and spellcasting stat high enough to reach a 100% or higher base success rate, your role and equipment will be the limiting factor in achieving low failure rates.
With a base success rate of 120%, your spellcasting penalty must be 6 or less to achieve an overall 100% success rate. Roles that can achieve this without a robe are archeologist, tourist, healer, priest, and wizard. The last three can retain 100% success while also wearing a small shield. Roles that can achieve this when casting emergency spells or their special spell are knight and monk. Roles that can achieve this with their special spell only are ranger, samurai, rogue, and valkyrie. The remaining two roles, barbarian and caveman, cannot achieve 100% success without a robe.
SLASH'EM makes several changes to NetHack's spellcasting system. New spells have been added, and several existing ones have been reshuffled. SLASH'EM roles tend to be more proficient in spell skills than their vanilla counterparts.
FIQHack has many changes to hows spellcasting works.
- Monsters use the same spellcasting system as players, which means that high-level spellcasting monsters have a lot of energy and can cast multiple spells quickly. Monsters can also pick up and read spellbooks to gain new spells.
- There are new spells, all of which are level 7:
- charging (enchantment), which is equivalent to an uncursed scroll of charging.
- phase (escape), which gives 21-60 (additional) turns of phasing.
- astral eyesight (divination), gives 11-30 turns of astral vision.
- summon nasty (clerical) which is equivalent to the vanilla monster spell and summons tame monsters if you target a hostile monster.
- Some spells can be maintained, which slowly drains energy but provides a continuous effect.
- The curse items monster spell no longer exists but certain curse effects are more common/serious.
- Bones ghosts can be replaced by equivalent player monsters with the same spells as the late player.
- Identity Spell Changes
- Unskilled only identifies object type, appearance, and artifacts.
- Basic also IDs enchantment, object properties, charge count, tin content and egg type.
- Expert identifies fooproof state.
- Changed spell levels
- Dig is level 2
- Identify is level 2
- Cancellation is level 5
- Teleport away is level 5
- Polymorph is level 7
- Create familiar is level 2
- Magic missile does less damage if cast at levels lower than expert.
- Instead of a spell failure percentage, the amount of power required to cast a spell changes.
- Spell cost is (base cost) * 100 / success%. Force bolt costs 5pw at 0% fail, 10pw at 50% fail, 20pw at 75% fail, 500pw at 99% fail, 1000pw at 100% fail (treated as 99.5%)
- The Amulet doubles spell cost, instead of randomly draining 2-3x energy per spell.
- Spellcasting does not exercise wisdom.
- The spell of create monster is replaced with the spell of summoning. Summoned monsters disappear after a set number of turns, based on casting skill.
Before NetHack 3.6.1, the Amulet of Yendor would increase the cost of casting a spell, instead of draining energy as you tried to cast it. This meant that it would also increase the nutrition cost, and it would not prevent emergency uses of a spell. In the example above of casting a level 3 spell, if you had only 16 energy left, you could still try again and again, without using any time, until the random penalty is rolled as 1.
- src/spell.c in NetHack 3.6.6, line 644
- src/spell.c in NetHack 3.6.6, line 644
- src/spell.c in NetHack 3.6.2, line 1018
- src/spell.c in NetHack 3.6.0, line 379: Refreshing or learning a spell.
- src/spell.c in NetHack 3.6.0, line 376: Reading book of keenly known spell.
- spell_backfire in src/spell.c in NetHack 3.6.0: Casting a forgotten spell.
- src/spell.c in NetHack 3.6.0, line 908: Spell cost.
- src/spell.c in NetHack 3.6.1, line 952: Amulet of Yendor's penalty on spell cost.
- src/spell.c in NetHack 3.6.1, line 956: Attempting to cast a remembered spell without enough energy uses a move if Amulet drain occurred.
- src/spell.c in NetHack 3.6.0, line 982: Failing to correctly cast a spell wastes only half of casting cost.
- src/spell.c in NetHack 3.6.0, line 929: Detect food has no casting hunger cost.
- src/spell.c in NetHack 3.6.0, line 1618: List of emergency spells.
- src/spell.c in NetHack 3.6.0, line 1601: Robe worn over metallic armor halves the spellcasting penalty of the armor.
- src/spell.c in NetHack 3.6.0, line 1603: Robe worn without metallic body armor increases spellcasting chance.
- src/spell.c in NetHack 3.6.0, line 95: Metal helmets interfere with the mind.
- src/spell.c in NetHack 3.6.0, line 1608: Helm of brilliance imposes no spellcasting penalty.
- src/spell.c in NetHack 3.6.0, line 96: Casting channels through the hands.
- src/spell.c in NetHack 3.6.0, line 97: All metal interferes to some degree.
- src/spell.c in NetHack 3.6.0, line 1643: Spellcasting chance formula.
- src/spell.c in NetHack 3.6.0, line 1673: Big shields significantly impair spellcasting.
- src/spell.c in NetHack 3.6.0, line 1044: wand similar
- src/spell.c in NetHack 3.6.0, line 1096: scroll similar
- src/spell.c in NetHack 3.6.0, line 1112: potion similar
- src/zap.c in NetHack 3.6.0, line 2849: beam spell range
- src/zap.c in NetHack 3.6.0, line 3846: ray spell range
- src/dig.c in NetHack 3.6.0, line 1442: dig spell range
- src/zap.c in NetHack 3.6.0, line 3733: spell to hit calculation
- src/zap.c in NetHack 3.6.0, line 2906: spell hit bonus
- src/hack.c in NetHack 3.6.0, line 294: negative ac weakened
- spell_damage_bonus in src/zap.c in NetHack 3.6.0: spell damage bonus
- src/zap.c in NetHack 3.6.0, line 160: force bolt damage
- src/zap.c in NetHack 3.6.0, line 371: drain life damage
- monhp_per_lvl in src/makemon.c in NetHack 3.6.0: drain life damage routine
- zhitm in src/zap.c in NetHack 3.6.0: routine containing mm and cold damage
- zap.c in NetHack 3.6.1, line 4035
- src/spell.c in NetHack 3.6.0, line 1010: skilled cold and fireball
- src/explode.c in NetHack 3.6.0, line 400: skilled cold and fireball resistance adjustments
- explode.c in NetHack 3.6.1, line 445
This page is based on a spoiler by Dylan O'Donnell. The original license is:
Redistribution, copying, and editing of these spoilers, with or without modification, are permitted provided that the following conditions are met:
- The original contributors to any spoiler must continue to be credited.
- Any modifications to the spoiler must be acknowledged and credited.