Difference between revisions of "Spellcasting"

From NetHackWiki
Jump to navigation Jump to search
(Calculating spell success rate)
(Merging Fail into == Calculating spell success rate ==)
Line 53: Line 53:
  
 
== Calculating spell success rate ==
 
== Calculating spell success rate ==
First, find your base spellcasting percentage. This is 5.5 times your spellcasting stat, rounded down. (Your spellcasting stat is either [[intelligence]] or [[wisdom]], depending on your role.) The maximum natural human Int/Wis of 18 gives a 99% base success rate.
+
When '''[[spellcasting]]''' the '''Fail''' column appears in the menu which occurs when using the {{kbd|Z}} [[commands|command]].
  
=== Skills and experience ===
+
To calculate [[spell]] '''failure''', you first need to sum together the penalties marked with a number sign (#) below. An increasing total penalty is worse for spellcasting, and is limited to a maximum of 20.
  
Now determine whether the spell is difficult or easy, given your current skills and experience. The following formula is used:
+
*  The "BASE" value from the table below, depending on the character's class.
''difficulty'' = (''spell-level'' * 4) - (''skill-level'' * 6) - (''experience-level'' / 3) - 5
+
*  If an "[[emergency]]" spell, the "EMERG" field. Emergency spells are [[spellbook of remove curse|remove curse]], as well as all [[healing spells]] except for [[spellbook of stone to flesh|stone to flesh]].
 +
*  If wearing any [[shield]], the amount in the "SHIELD" field.
 +
*  If wearing metallic [[armor|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 armour, '''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).
 +
*  Subtract 4 if the spell is [[special spell|special]] to that class (see table).
  
For this calculation, ''unskilled'' maps to 0, ''basic'' to 1, ''skilled'' to 2, and ''expert'' to 3.
+
{| class="prettytable striped"
 +
!CLASS
 +
!BASE
 +
!EMERG
 +
!SHIELD
 +
!SUIT
 +
!STAT
 +
!SPECIAL SPELL
 +
|-
 +
| Archeologist
 +
| 5#
 +
| 0#
 +
| 2#
 +
| 10#
 +
| Int
 +
| [[Magic mapping]]
 +
|-
 +
| Barbarian
 +
| 14#
 +
| 0#
 +
| 0#
 +
| 8#
 +
| Int
 +
| [[Haste self]]
 +
|-
 +
| Caveman
 +
| 12#
 +
| 0#
 +
| 1#
 +
| 8#
 +
| Int
 +
| [[Dig]]
 +
|-
 +
| Healer
 +
| 3#
 +
| -3#
 +
| 2#
 +
| 10#
 +
| Wis
 +
| [[Cure sickness]]
 +
|-
 +
| Knight
 +
| 8#
 +
| -2#
 +
| 0#
 +
| 9#
 +
| Wis
 +
| [[Turn undead]]
 +
|-
 +
| Monk
 +
| 8#
 +
| -2#
 +
| 2#
 +
| 20#
 +
| Wis
 +
| [[Restore ability]]
 +
|-
 +
| Priest
 +
| 3#
 +
| -2#
 +
| 2#
 +
| 10#
 +
| Wis
 +
| [[Remove curse]]
 +
|-
 +
| Ranger
 +
| 9#
 +
| 2#
 +
| 1#
 +
| 10#
 +
| Int
 +
| [[Invisibility]]
 +
|-
 +
| Rogue
 +
| 8#
 +
| 0#
 +
| 1#
 +
| 9#
 +
| Int
 +
| [[Detect treasure]]
 +
|-
 +
| Samurai
 +
| 10#
 +
| 0#
 +
| 0#
 +
| 8#
 +
| Int
 +
| [[Clairvoyance]]
 +
|-
 +
| Tourist
 +
| 5#
 +
| 1#
 +
| 2#
 +
| 10#
 +
| Int
 +
| [[Charm monster]]
 +
|-
 +
| Valkyrie
 +
| 10#
 +
| -2#
 +
| 0#
 +
| 9#
 +
| Wis
 +
| [[Cone of cold]]
 +
|-
 +
| Wizard
 +
| 1#
 +
| 0#
 +
| 3#
 +
| 10#
 +
| Int
 +
| [[Magic missile]]
 +
|}
  
If ''difficulty'' is positive, the spell is considered difficult. Your success chance is decreased by <math>\sqrt{900 \times \mbox{difficulty} + 2000}</math>, with the penalty rounded down.
 
A difficulty of 1 therefore gives a 53% penalty, and a difficulty of 9 gives a 100% penalty.
 
  
If ''difficulty'' is zero or negative, the spell is considered easy. Your success chance is increased by <math>15 \times -\mbox{difficulty} / \mbox{spell-level}</math>, but this bonus will not exceed 20.
+
Next, calculate a base chance of success, which is 5.5 times your
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%.
+
intelligence or wisdom STAT, depending on your class. 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:
 +
:<math>difficulty = (LVL * 4) - (SKILL * 6) - (XL/3) - 5</math>
  
The resultant value is then clamped to lie between 0% and 120% inclusive.
+
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.
 +
:<math>chance = base chance - \sqrt{(900 * difficulty) + 2000}</math>
 +
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%.
  
=== Equipment and role penalties ===
+
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).
  
If you are wearing a [[shield]] that is not a [[small shield]], divide the success chance by 4. (If you are casting your role's special spell, divide it by 2 instead.)
+
Finally, the chance of success is adjusted by your total penalty using
 
+
the following formula:
Call the value calculated so far ''rate''. Now, add up all the other penalties. These are:
+
:<math>chance = (chance * (20-penalty) / 15) - penalty</math>
 
+
The result is clipped to the range of 0% to 100% success.
* Your role's base spellcasting penalty, between 1 and 14.
 
* Your role's body armor penalty, between 8 and 20, if wearing metallic body armor.
 
** If wearing a [[robe]], this penalty is halved.
 
** If wearing a robe ''without'' metallic body armour, subtract the body armor penalty instead of adding it.
 
* Your role's shield penalty, between 0 and 3, if wearing any shield.
 
** Note that larger shields also impose the larger penalty described above.
 
* The helm (4), gloves (6), and boots (2) penalties, if wearing metallic items in those slots.
 
** A [[helm of brilliance]] does not count as metallic for this purpose.
 
* Your role's emergency spell bonus/penalty, between a -3 bonus and a +2 penalty, if casting an eligible spell.
 
** Emergency spells are [[spellbook of remove curse|remove curse]], as well as all [[healing spells]] except for [[spellbook of stone to flesh|stone to flesh]].
 
** [[Healer]]s have a -3 success bonus.
 
** [[Knight]]s, [[monk]]s, [[priest]]s and [[valkyrie]]s have a -2 success bonus.
 
** [[Ranger]]s have a special +2 failure penalty, and [[tourist]]s +1, when casting these spells.
 
** For [[archeologist]]s, [[barbarian]]s, [[caveman]]s, [[rogue]]s, [[samurai]] and [[wizard]]s these spells have no "emergency" bonus or penalty to casting.
 
* A bonus of -4 if casting your role's special spell.
 
 
 
The penalty is then capped at 20.
 
 
 
The final chance of spellcasting success is then <math>[\mbox{rate} \times (20 - \mbox{penalty}) / 15] - \mbox{penalty}</math>, clamped to lie between 0% and 100% inclusive.
 
  
 
== Strategy ==
 
== Strategy ==
Line 187: Line 299:
 
[[Category:Spellcasting| ]]
 
[[Category:Spellcasting| ]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 +
 +
{{DOD}}

Revision as of 06:46, 16 May 2011

For monsters' spellcasting mechanics, see monster spells.

Spellcasting is using the Z command to wield innate magical abilities during gameplay. More rarely a player can use the #monster, ctrl + t and #turn commands to unleash quasi-magics.

The first prerequisite for spellcasting is knowing at least one spell. Healers, monks, priests and wizards are roles which begin the game with knowledge of one or more spells, other classes must find at least one spellbook and read it first.

Pressing Z without knowing any spells will produce a message to this effect. Otherwise a menu will appear of the spells you know, accompanied by their chance of failure. The + key reorders it.

This chance of failure is affected by intelligence (or wisdom), experience level, skill level, innate magical ability of the role, armour: especially metal but also shields and robes, whether it is an emergency spell or your special spell.

Unless you cancel, the game will first check if you have enough power (magical energy) for the spell selected. If you have enough power then the game will roll for success or failure. If you succeed your spell will take effect - see spellbook for an index. If you fail you will receive the message "You fail to cast the spell correctly."

Spellcasting will burn nutrition with the exception of detect food, and each spell cast will produce skill points equal to its level.

Forgotten spells

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[1]. 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 usage fee[2].

Attempting to cast a forgotten spell will not check any of the usual casting prerequisites, 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:[3]

Probability Effect
40%
  • confused for (spell-level + 1) * 3 turns
30%
  • confused for (spell-level + 1) * 2 turns
  • stunned for (spell-level + 1) * 3 turns
20%
  • confused for (spell-level + 1) * 3 turns
  • stunned for (spell-level + 1) * 2 turns
10%
  • stunned for (spell-level + 1) * 3 turns

Forgotten spells are a common way to deliberately become confused, in order to invoke the alternative effects of certain scrolls. "Casting" them does not cost power or nutrition.

Spellcasting cost

Casting a spell costs an amount of power equal to 5 times the spell's level. If you are carrying the Amulet of Yendor, there is an additional penalty of between 1 and 2n power points, where n is the usual power cost. If you do not have enough power you will not cast the spell, and you will not use up any power or nutrition in your attempt. A failed cast will only use half the amount of power, rounded down.

Casting any spell other than detect food also costs nutrition. The nutrition cost is twice the power 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.

Calculating spell success rate

When spellcasting the Fail column appears in the menu which occurs when using the Z command.

To calculate spell failure, you first need to sum together the penalties marked with a number sign (#) below. An increasing total penalty is worse for spellcasting, and is limited to a maximum of 20.

  • The "BASE" value from the table below, depending on the character's class.
  • If an "emergency" spell, the "EMERG" field. Emergency spells are remove curse, as well as all healing spells except for stone to flesh.
  • 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 armour, 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).
  • Subtract 4 if the spell is special to that class (see table).
CLASS BASE EMERG SHIELD SUIT STAT SPECIAL SPELL
Archeologist 5# 0# 2# 10# Int Magic mapping
Barbarian 14# 0# 0# 8# Int Haste self
Caveman 12# 0# 1# 8# Int Dig
Healer 3# -3# 2# 10# Wis Cure sickness
Knight 8# -2# 0# 9# Wis Turn undead
Monk 8# -2# 2# 20# Wis Restore ability
Priest 3# -2# 2# 10# Wis Remove curse
Ranger 9# 2# 1# 10# Int Invisibility
Rogue 8# 0# 1# 9# Int Detect treasure
Samurai 10# 0# 0# 8# Int Clairvoyance
Tourist 5# 1# 2# 10# Int Charm monster
Valkyrie 10# -2# 0# 9# Wis Cone of cold
Wizard 1# 0# 3# 10# Int Magic missile


Next, calculate a base chance of success, which is 5.5 times your intelligence or wisdom STAT, depending on your class. 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.

chance = base chance - \sqrt{(900 * difficulty) + 2000}

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:

chance = (chance * (20-penalty) / 15) - penalty

The result is clipped to the range of 0% to 100% success.

Strategy

There are three main ways to improve your spellcasting chances: increase your spellcasting stat, gain more skill and experience levels, and wear armour appropriate to your role's spellcasting abilities.

An Intelligence or Wisdom score of 19 or more is needed to reach 100% base success rate, but human characters cannot reach these levels without a helm of brilliance.

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
Xlvl Unskilled Basic Skilled Expert
1–2 1 2 4 5
3–8 1 3 4 6
9–14 2 3 5 6
15–20 2 4 5 7
21–26 3 4 6 7
27–30 3 5 6 7

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, healer, priest, tourist, and wizard. 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.

Role penalties

Role Stat Base Body armor Shield Emergency Special
Archeologist Int 5 10 2 0 magic mapping -4
Barbarian Int 14 8 0 0 haste self -4
Caveman Int 12 8 1 0 dig -4
Healer Wis 3 10 2 -3 cure sickness -4
Knight Wis 8 9 0 -2 turn undead -4
Monk Wis 8 20 2 -2 restore ability -4
Priest Wis 3 10 2 -2 remove curse -4
Rogue Int 8 9 1 0 detect treasure -4
Ranger Int 9 10 1 2 invisibility -4
Samurai Int 10 8 0 0 clairvoyance -4
Tourist Int 5 10 2 1 charm monster -4
Valkyrie Wis 10 9 0 -2 cone of cold -4
Wizard Int 1 10 3 0 magic missile -4


SLASH'EM

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.

External links

References

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:

  1. The original contributors to any spoiler must continue to be credited.
  2. Any modifications to the spoiler must be acknowledged and credited.