spel-322.txt  Final version 3 for NetHack 3.2.2
Compiled by Kevin Hugo <hugo@cae.wisc.edu>.

SPELLBOOK          COST  WGT  PROB   LVL  READ  MRKR  BONUS  APPEARANCE
~~~~~~~~~~~~~~~~ : ~~~~  ~~~  ~~~~ : ~~~  ~~~~  ~~~~  ~~~~~  ~~~~~~~~~~
blank paper      : $  0   50   20  :  0     0     0          plain
detect monsters  :  100   50   45  :  1     1    10
force bolt       :  100   50   35  :  1     2    10
healing          :  100   50   40  :  1     2    10     +
knock            :  100   50   36  :  1     1    10
light            :  100   50   45  :  1     1    10
sleep            :  100   50   50  :  1     1    10
confuse monster  :  200   50   37  :  2     2    20
create monster   :  200   50   37  :  2     3    20
cure blindness   :  200   50   27  :  2     2    20     +
detect food      :  200   50   37  :  2     3    20
magic missile    :  200   50   45  :  2     3    20    W
slow monster     :  200   50   37  :  2     2    20
wizard lock      :  200   50   35  :  2     3    20
cause fear       :  300   50   25  :  3     6    30
charm monster    :  300   50   20  :  3     6    30    T
clairvoyance     :  300   50   15  :  3     6    30    S
cure sickness    :  300   50   32  :  3     6    30    H+
detect unseen    :  300   50   20  :  3     8    30    E
extra healing    :  300   50   35  :  3    10    30     +
haste self       :  300   50   33  :  3     8    30    B
detect treasure  :  400   50   25  :  4    15    40    R
fireball         :  400   50   20  :  4    18    40
invisibility     :  400   50   32  :  4    15    40
levitation       :  400   50   20  :  4    12    40
restore ability  :  400   50   25  :  4    15    40     +
cone of cold     :  500   50   10  :  5    40    50    V
dig              :  500   50   22  :  5    30    50    C
identify         :  500   50   25  :  5    40    50
magic mapping    :  500   50   18  :  5    35    50    A
remove curse     :  500   50   25  :  5    25    50    P+
create familiar  :  600   50   10  :  6    42    60
polymorph        :  600   50   10  :  6    48    60
teleport away    :  600   50   15  :  6    36    60
turn undead      :  600   50   17  :  6    48    60    K
cancellation     :  700   50   15  :  7    64    70
finger of death  :  700   50    5  :  7    80    70
Book of the Dead : 3500   20    0  :  7     0     0          papyrus

Spellbooks are listed above by increasing level, then alphabetically.
The COST field denotes the base price of each item.  WGT specifies the
weight (100 zorkmids weighs 1).

Spellbooks comprise 4% of all randomly-generated items in the main
dungeon, 12% in containers, 0% in Roguelike bones piles, and 0% in hell.
PROB is the relative probability of each subtype.  They appear 1/34
cursed, 16/17 uncursed, and 1/34 blessed.  There is also a chance of
obtaining a spellbook (one you don't know yet if possible) from praying
when your god is pleased.

The level (LVL) of a spell controls how difficult it is to cast and
how much energy is required.  Normal spellbooks cost 100 times their
level.  READ indicates the number of turns needed to successfully read a
particular spellbook.

MRKR specifies the maximum number of magic marker charges needed to write
a spellbook of that type, or zero if it cannot be written.  You may note
that this number is 10 times the spell level.  The actual number of
charges used will be a random amount from MRKR/2 to MRKR-1.  Wizards have
a 1/3 chance of writing an unknown spellbook, and all other classes have
a 1/15 chance; your chance improves with your luck.  You can only write on
spellbooks of blank paper, which can be made by getting any spellbook wet,
cancelling any spellbook (except spellbooks of cancellation), or reading
a spellbook until it is too faint to be read anymore.  The Book of the
Dead can't be blanked by any means.  You can select non-blank spellbooks
to write on, but this will abuse your wisdom and you will be told, "That
spellbook is not blank!"

Some spells provide a BONUS against spell failure.  Each character
class has a particular spell that they are good at casting (noted with
capital letters).  In addition, the spells marked with a plus (+) are
emergency spells that grant an additional bonus.  See the section on
calculating spell failure below for details.  Note that this column
does NOT list which spellbooks a character may start with.

Some types of spellbooks have the same APPEARANCE when unidentified.
The appearance of the remaining spellbooks are are randomized from the
following descriptions:
    parchment    vellum      ragged      dog eared    mottled
    stained      cloth       leather     white        pink
    red          orange      yellow      light green  dark green
    turquoise    cyan        light blue  dark blue    indigo
    magenta      purple      violet      tan          plaid
    light brown  dark brown  gray        wrinkled     dusty
    bronze       copper      silver      gold         glittering
    shining      dull        thin        thick


Reading spellbooks
~~~~~~~~~~~~~~~~~~
Each spellbook takes a certain number of turns to READ it, noted above.
If the spellbook is cursed, you will fail to learn the spell, will be
paralyzed for the given number of turns, and will be teleported, aggravate
monsters, be blinded, lose your gold, become confused, be poisoned, get
radiated by explosive energy, or get your inventory randomly cursed.
There is a 1/3 chance that the book then crumbles to dust.  If the spellbook
is uncursed, there is a random chance of the above happening depending on
your intelligence, your experience level, and the spellbooks's level.
Blessed spellbooks never cause these bad effects.  You will never learn a
spellbook while confused, and attempting while you are has a 1/3 chance
of destroying the spellbook (except the Book of the Dead).  If you are
interrupted while reading, you may continue your efforts by reading the
same spellbook again.

When you succesfully read a spellbook, there are four outcomes.  If you
do not yet know the spell, "You add the spell to your repertoire",
identify the spellbook, get a number of uses of the spell equal to 30
minus the spell's level, and increment the number of times you've studied
that particular spellbook.  For spells already known, there is a (spell
level + number of times you've studied that particular book) in 30 chance
that "This spellbook is too faint to be read anymore" and the spellbook
turns into blank paper.  Otherwise, if your number of uses left of the
spell was less than 20 minus the spell's level, then "Your knowledge of
that spell is keener", you get 10 minus the spell's level more uses of
the spell, you exercise your wisdom, and the number of times you've studied
that particular spellbook is incremented.  But if "You know that spell
quite well already", then there is no further effect and the number of
times you've read the spellbook is unchanged.

Reading a spellbook will give you a certain number of attempts to use the
spell.  This number can be predicted from the above information.  As you
use the spell, you will get warning messages when the number of uses left
approaches zero:
  7 or more  No message.
  4 to 6     "This spell is starting to be over-used."
  1 to 3     "Your nerves tingle warningly."
When you have no uses left, "...you have overloaded and burned out this
spell" and will become confused for a number of turns equal to three
times the spell's level.  Of course, you may read the spellbook again to
get more uses of the spell.


Spell failure
~~~~~~~~~~~~~
Starting in Nethack 3.2.0, shields and metallic armor began to hinder
spellcasting.  Many characters would have 100% spell failure even for
low-level spells.  The solution is simple: take off the troublesome
armor before spellcasting.

There are some preliminary needs that must be met for any spellcasting.
The spell must be already known and have at least one use left.  You
need at least 10 nutrition (weak, near fainting) unless you are
casting a spell of detect food.  You must have a strength of at least
4, must have a free hand (both can't be welded to weapons and/or a
shield), and must not be overtaxed.  Finally, each attempt to cast a
spell drains energy equal to 5 times the spell's level (randomly up
to three times this amount if you have the Amulet).  Your hunger
increases by twice the amount of energy drained, but it will not make
you faint.

There are three factors that cause spells to fail:

-   Your armor.  Metallic body armor, metallic helmets (except helm of
    brilliance), metallic gloves, metallic shoes, and any shield
    (although a small shield is not as bad) will penalize you.  Fighter-
    type classes are not penalized as much as the other classes.  The
    following items are "safe" for spellcasting:
        All shirts
        All dragon scales and dragon scale mails
        Leather jacket, leather armor, studded leather armor
        Crystal plate mail
        All cloaks
        Elven leather helm, fedora, helm of brilliance
        Cornuthaum
        All gloves except gauntlets of power
        All boots except iron shoes
    So the "best" armor class you could achieve for spellcasting -- not
    including your intrinsic protection or item enchantments -- is with
    any shirt, any dragon scale mail, a cloak of protection, a helm of
    brilliance, gauntlets of dexterity, and high boots.  Of course, there
    are other combinations that yield a lower AC or spellcasting ability
    but have strategic advantages.

-   The level of the spell, as shown above (LVL).

-   If you are confused, the spell will always fail.

There are five factors that improve spellcasting success:

+   Your class.  Each class has its own base ability, armor penalties,
    bonuses for emergency spells, and a spell that they are especially
    good at.  See the table below.

+   Your intelligence (ABCERSTW) or wisdom (HKPV).

+   Your experience level.

+   Certain "emergency" spells get an extra bonus.  They are noted with
    a plus (+) in the above BONUS column.  The amount of the bonus
    depends on your class.  Note that the tourist is actually penalized
    for these spells.

+   If you have the teleport intrinsic ("teleportitis"), you may be able
    to perform a self-teleport (^T) without using the teleport away spell.
    You also must be at least experience level 12 (8 if a wizard) or be
    polymorphed into a teleporting monster, may not be overtaxed, must
    have at least 6 strength, and need 100 nutrition and 19 energy (both
    of which are consumed).  If you fall into water with teleportitis or
    as a teleporting monster, you may automatically attempt to cast a
    self-teleport to get out.  Finally, players with teleportitis will
    always teleport at random intervals.

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 (noted with a + above), the "EMERG" field.
#   If wearing any shield, the amount in the "SHIELD" field.
#   If wearing metallic body armor, the amount in the "SUIT" field.
#   If wearing metallic helmets 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).
#   Add -4 if the spell is special to that class (see table).

CLASS   BASE    EMERG   SHIELD  SUIT    STAT    SPECIAL SPELL
~~~~~   ~~~~    ~~~~~   ~~~~~~  ~~~~    ~~~~    ~~~~~~~~~~~~~
  A       5#      0#      2#     10#    Int     Magic mapping
  B      14#      0#      0#      8#    Int     Haste self
  C      12#      0#      1#      8#    Int     Dig
  E       5#      0#      1#     10#    Int     Detect unseen
  H       3#     -3#      2#     10#    Wis     Cure sickness
  K       8#     -2#      0#      9#    Wis     Turn undead
  P       3#     -2#      2#     10#    Wis     Remove curse
  R       8#      0#      1#      9#    Int     Detect treasure
  S      10#      0#      0#      8#    Int     Clairvoyance
  T       5#      1#      2#     10#    Int     Charm monster
  V      10#     -2#      0#      9#    Wis     Cone of cold
  W       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.  Now, you need
to gain 4 experience levels for each spell level (e.g., 1 for a level
1 spell, 5 for a level 2 spell, 9 for a level 3 spell).  Your chance
will be reduced by 7 times the square of this difference if you haven't,
and increased with diminishing returns if you have.  The result is
clipped to the range of 0% to 120% success.  If you are wearing a shield
larger than a small shield, the chance is reduced to 1/4 its amount
(except if it is your class' special spell -- 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.


Spell effects
~~~~~~~~~~~~~
cancellation
  Same effect as a wand of cancellation.

cause fear
  Same effect as reading an uncursed scroll of scare monster:
    You will cause monsters within your visual range to flee.  Some
    monsters can resist the effect.
    "You hear maniacal laughter in the distance." (no creature affected)

charm monster
  Same effect as an uncursed scroll of taming:
    Tames monsters within a one square radius.  Also calms shopkeepers.
    Some monsters can resist.

clairvoyance
  You immediately map a rectangle around you up to 12 rows by 20 columns.
  Clairvoyance can be blocked.
    "You sense a pointy hat on top of your <head>."  (if wearing
    cornuthaum)

cone of cold
  Same effect as a wand of cold.

confuse monster
  If not human/elf,
    You are confused for 1 to 100 (more) turns.
      "You feel confused."
  Otherwise, same effect as uncursed scroll of confuse monster:
    You will confuse the next (one more) monster you hit.
      "Your hands glow red."  (unblind)
      "Your hands glow red even more."  (unblind, more)
      "Your hands tingle."  (blind)
      "Your hands tingle even more."  (blind, more)

create familiar
  A monster of your preferred pet type (dog or cat; 1/3 chance) or
  random monster (2/3 chance) is created.  In any case, it becomes your
  pet if it is capable of being tamed.

create monster
  Same effect as an uncursed scroll of create monster:
    Creates one (72/73 chance) or 2 to 5 (1/73 chance) monsters around
    you.

cure blindness
  Cures all forms of blindness not due to a blindfold or towel.
    "Far out!  Everything is all cosmic again!"  (hallucinating)
    "You can see again."  (not hallucinating)

cure sickness
  Cures all forms of sickness, including illness and food poisoning.
    "What a relief!"

detect food
  Same effect as an uncursed scroll of food detection:
    If no food on that level,
      "You sense a lack of food nearby."  (saw some before)
      "You have a strange feeling for a moment, then it passes."
      (beginner not hallucinating)
      "You have a normal feeling for a moment, then it passes."
      (beginner hallucinating)
      "Your nose twitches."  (otherwise)
    Otherwise, you detect comestibles on that level.
      "You smell food nearby."  (if just on your square)
      "Your nose tingles and you smell food."  (if elsewhere)

detect monsters
  If no monsters on the level (other than you), no effect.
    "You have a strange feeling for a moment, then it passes."
    (beginner not hallucinating)
    "You have a normal feeling for a moment, then it passes."
    (beginner hallucinating)
    "You feel threatened."  (not hallucinating)
    "You get the heebie jeebies."  (hallucinating)
  Otherwise, same effect as an uncursed potion of monster detection:
    You briefly see monsters on that level and exercise your wisdom.
      "You sense the presence of monsters."

detect treasure
  If no objects on level and none had appeared on the map, no effect.
    "You have a strange feeling for a moment, then it passes."
    (beginner not hallucinating)
    "You have a normal feeling for a moment, then it passes."
    (beginner hallucinating)
    "You feel a lack of something."  (otherwise)
  If there are only objects in your inventory, you exercise your wisdom.
    "You sense objects nearby."  (not hallucinating)
    "You sense something nearby."  (hallucinating)
  Otherwise, same effect as an uncursed potion of object detection:
    You detect objects on that level and exercise your wisdom.
      "You sense the presence of objects."  (not hallucinating)
      "You sense the presence of something."  (hallucinating)
      "You sense the absence of objects."  (not hallucinating)
      "You sense the absence of something."  (hallucinating)

detect unseen
  Same effect as a wand of secret door detection.

dig
  Same effect as a wand of digging.

extra healing
  When zapped at yourself,
    You are healed by 6d8 hit points, but not beyond maximum.
    Blindness is cured.
    "You feel much better."
  For each monster hit,
    Heals monster by 6d8 hit points, but not beyond maximum.
    Adjusts alignment by +1 for Healers and lawfuls, -1 for chaotics.
    "<monster> looks much better."  (if seen)

finger of death
  Same effect as a wand of death.

fireball
  If you zap at yourself, you are caught in a 6d6 explosion.
    "You explode a fireball on top of yourself!"
  Otherwise, same effect as a wand of fire.

force bolt
  Same effect as a wand of striking.

haste self
  You become very fast (like speed boots) for 100 to 109 (more) turns
  and exercise your dexterity.
    "You are suddenly moving much faster."  (was slow)
    "You are suddenly moving faster."  (was fast)
    "Your <legs> get new energy."  (was already very fast)

healing
  When zapped at yourself,
    You are healed by 6d4 hit points, but not beyond maximum.
    "You feel better."
  For each monster hit,
    Heals monster by 6d4 hit points, but not beyond maximum.
    Adjusts alignment by +1 for Healers and lawfuls, -1 for chaotics.
    "<monster> looks better."  (if seen)

identify
  Same effect as a blessed scroll of identify with luck ignored:
    You can identify items from your inventory:
      # items:  1    2    3    4   all
      chance:  1/5  1/5  1/5  1/5  1/5

invisibility
  Same effect as an uncursed potion of invisibility:
    You become invisible for 31 to 45 (more) turns.
    "You have a peculiar feeling for a moment, then it passes."
    (already invisible or see invisible, and not hallucinating)
    "You have a normal feeling for a moment, then it passes."
    (already invisible or see invisible, and hallucinating)
    "You feel rather airy."  (blind or wearing mummy wrapping)
    "Gee!  All of a sudden, you can't see yourself." (not hallucinating)
    "Far out, man!  You can see right through yourself!" (hallucinating)

knock
  Same effect as a wand of opening.

levitation
  Same effect as an uncursed potion of levitation:
    You levitate for 10 to 149 (more) turns.
      "You start to float in the air!"  (not hallucinating)
      "Up, up, and awaaaay!  You're walking on air!"  (hallucinating)
      "You float up, out of the pit!"  (were trapped in pit)
      "You float up, only your <leg> is still stuck."
      (still in beartrap)
      "It feels as though you'd lost some weight."  (Water Plane)
      "You gain control over your movements."  (Air Plane)

light
  Same effect as a wand of light.

magic mapping
  Non-mappable level:
    You become confused for 1 to 30 (more) turns.
    "Your head spins as something blocks the spell!"
  Otherwise, same effect as an uncursed scroll of magic mapping:
    You map the entire level.
    "A map coalesces in your mind!"

magic missile
  Same effect as a wand of magic missile.

polymorph
  Same effect as a wand of polymorph.

remove curse
  Same effect as an uncursed scroll of remove curse:
    All cursed worn or wielded items (weapons, armor, amulets, rings,
    and blindfolds) and loadstones are uncursed.
    Removes a ball and chain (punishment).
    "You feel like someone is helping you."

restore ability
  Same effect as an uncursed potion of restore ability:
    Restores one random lost statistic to its previous maximum amount.
    "Wow!  This makes you feel good!"

sleep
  Same effect as a wand of sleep.

slow monster
  Same effect as a wand of slow monster.

teleport away
  Same effect as a wand of teleportation.

turn undead
  Same effect as a wand of undead turning.

wizard lock
  Same effect as a wand of locking.


Acknowledgements
~~~~~~~~~~~~~~~~
Thanks to Bruce Cox <bruce@maths.usyd.edu.au> for proofreading this file.
Suggestions by Sascha Wostmann <wostmann@geocities.com> and Petrosky
<ios@inet.it>.
Create familiar corrected by Dylan O'Donnell <dylanw@demon.net>.
Spelling correction by Monte Mitzelfelt <monte@gonefishing.org>.
Luck correction by Pat Rankin <rankin@eql.caltech.edu>.
