# Spellbook of protection

spellbook of
+   protection
Appearance random
Abundance 1.83%
Base price 100 zm
Weight 50
Ink to write 5–9
Spell type clerical
Level 1
Power cost 5 Pw
Direction non-directional

In NetHack, the spellbook of protection allows the player to learn the protection spell. The spell is unrelated to protection granted by priests or praying.

## Generation

Monks have a 1/3 chance of starting with a spellbook of protection.[1]

## Effects

Casting this spell decreases your AC temporarily; the exact reduction depends on your experience level, the amount of protection already gained from this spell, and your AC before casting the spell. The protection wears off at a rate of 1 point every 10 turns, or 1 point every 20 turns if the spell was cast with expert proficiency.

### AC granted

The exact formula for determining the granted protection[2] is whichever of the following two is more:

$1 + \lfloor \log_2 (\text{XL}) \rfloor - \text{prior spell AC}$

or

$1 + \lfloor \log_2 (\text{XL}) \rfloor - \left\lfloor\frac{\text{prior spell AC}}{4-\left\lfloor\frac{\text{other AC}}{10}\right\rfloor}\right\rfloor$

where "prior spell AC" is the AC already gained from castings of the protection spell; "other AC" is 10 minus your AC but for the spell, including all armor bonuses and divine protection; and log2(XL) is just the logarithm with base 2, according to the following table:

Experience level log2(XL)
1 0
2-3 1
4-7 2
8-15 3
16-30 4

Thus you will get 1-5 AC on the first casting depending solely on level, and on subsequent castings you will get progressively less depending on your AC and protection level.

XL Other AC Total AC from n castings
1 2 3 4 5 6 7 8 9
1 10 to 1 1 2 3 4 4 4 4 4 4
1 0 to -9 1 2 3 3 3 3 3 3 3
1 -10 to -19 1 2 2 2 2 2 2 2 2
1 <-19 1 1 1 1 1 1 1 1 1
2-3 10 to 1 2 4 5 6 7 8 8 8 8
2-3 0 to -9 2 4 5 6 6 6 6 6 6
2-3 -10 to -19 2 3 4 4 4 4 4 4 4
2-3 <-19 2 2 2 2 2 2 2 2 2
4-7 10 to 1 3 6 8 9 10 11 12 12 12
4-7 0 to -9 3 5 7 8 9 9 9 9 9
4-7 -10 to -19 3 5 6 6 6 6 6 6 6
4-7 <-19 3 3 3 3 3 3 3 3 3
8-15 10 to 1 4 7 10 12 13 14 15 16 16
8-15 0 to -9 4 7 9 10 11 12 12 12 12
8-15 -10 to -19 4 6 7 8 8 8 8 8 8
8-15 <-19 4 4 4 4 4 4 4 4 4
16-30 10 to 1 5 9 12 14 16 17 18 19 20
16-30 0 to -9 5 9 11 13 14 15 15 15 15
16-30 -10 to -19 5 8 9 10 10 10 10 10 10
16-30 <-19 5 5 5 5 5 5 5 5 5

## Messages

The <air> around you begins to shimmer with a golden haze.
You cast the protection spell.
The golden haze around you becomes more dense.
You cast the spell while already protected by it.
Your skin feels warm for a moment.
You cast the spell while already at the maximum amount of protection.
The golden haze around you becomes less dense.
The spell is wearing off.
The golden haze around you disappears.
The spell has worn off completely.

## Strategy

The spell is an easy means of training skill in clerical spells. If you see a difficult or out-of-depth monster nearby and are willing to fight it, casting protection before engaging it is often a good idea. The spell is also useful if you are taking many hits from several monsters and/or already battling a difficult or out-of-depth monster.

Monks who start with this spell may find it useful to make up for their lack of armor in the early game, and should cast it before any prolonged fight.

## Variants

### dNetHack

The protection spell functions differently in dNetHack. Multiple castings of protection do not stack. When you cast the spell, it grants an AC bonus based on your experience level.

Experience level AC bonus
1 2
2 to 3 4
4 to 7 6
8 to 15 8
16 to 30 10

Casting the spell again resets your bonus to this level and refreshes the wear-off countdown. This protection wears off over time based on your casting skill at the time you cast the spell.

Casting skill 1 point wears off after
Expert 30 turns
Skilled 20 turns
Basic 15 turns
Unskilled 10 turns

If your unprotected AC is greater than 0 then it is set to 0 before this bonus is applied.

### FIQHack

In FIQHack the protection spell only works if you are not wearing body armor.