Learning and memorizing spells
Magic · Spell slots · Casting a spell · Resting
In brief
A mage learns spells by copying scrolls carried by the party; a cleric or a paladin knows every spell of its allowed set. In the camp menu, Memorize Spells and Pray for Spells fill the character's slots, level by level, up to the slots its level allows. A chosen spell waits until a step of rest makes it ready; casting uses it, and rest makes it ready again. The menus have several anomalies, one of which erases a ready True Seeing.
Learning from scrolls
A mage can copy spells from scrolls carried by the party:1
- The game collects the candidate scrolls: for each mage spell ID, it
searches the party members and their inventory slots in order for an
item of type
ITEM_TYPE_MAGE_SCROLLwhose value is that ID, and keeps the first match. - It asks which mage copies, with the same choice of character as the memorize menu, and removes the spells that character already knows.
- When the player picks a spell, the game sets its bit in the character's known-spells mask, removes the scroll from its inventory slot and marks the item's location as removed.
- The list is rebuilt after each choice.
A known spell can then be chosen in the memorize menu, which fills the character's slots; only resting makes a chosen spell ready, and casting marks it used again. A mage of a new party starts with nine known spells and two mage scrolls; see entering the game.
Memorizing and praying
From the camp menu, Memorize Spells opens the menu for a mage and Pray for Spells for a cleric or a paladin. The player first picks the character. A character can be picked when present, of the right class, conscious and not starving (food above 0). A paladin of level 8 or less is refused ("Your Paladin is too low a level for spells."), and so is a mage without a spellbook ("The Mage has no Spell Book!"), but only when several characters could be picked; see the anomaly below.2
The menu shows one page per spell level, with tabs 1 to 6. A page lists the spells the character may choose at that level — the known spells for a mage; for a cleric or a paladin, the spells of the allowed set, and only on levels that have slots — each with the number of copies the character holds, and a counter "n of m Remaining.", the free slots of the level. The spell level of a spell is its group in the mage and cleric spells.
| Action | Mouse | Keys | Effect |
|---|---|---|---|
| Add the highlighted spell | Click on the list | Space, Enter, =, keypad 5, keypad + | One more copy, if the level has a free slot. |
| Remove the highlighted spell | — | -, keypad − | One copy fewer, if the character holds one. |
| Clear the page | Clear | C | Every copy of every spell of the page is removed, ready ones included. |
| Change page | A tab | 1 to 6; keypad 4 and 6 for the previous and next page | — |
| Move the highlight | Move the pointer over the list | Keypad 8, 2, 7 and 1 | — |
| Leave | Exit | E, Escape | The choices are kept; there is no way to cancel them. |
The menu changes nothing until the player leaves it. It then rewrites the character's slots from the counts, level by level and in the order of the spell IDs: the copies that were ready stay ready, as long as the spell still has that many copies, and every other copy is written as a used slot, which only resting makes ready. Removing a spell therefore takes its unready copies first, and taking a spell off and putting it back in the same visit keeps it ready. Writing a copy that is not ready also raises the reminder "Your party needs to rest to gain spells.", shown on leaving the camp menu.
A waiting copy and a used one are the same value in the slot: a negative spell ID. Each level has ten slots; a copy beyond the tenth would be dropped, which no level that experience reaches requires.
Turn undead takes no slot and is never offered: every cleric or paladin keeps it in the first slot of level 1, which the menu writes back each time. Only six tabs exist, so the spells of levels 7 and 8 — the mage's Finger of Death, Power Word Stun and Bigby's Fist, the cleric's Ressurection and Lay on Hands — are never offered by the tabs: those levels need a mage level of 14 or more, which experience does not reach; no cleric spell is of level 7, and the cleric and paladin tables have no level-8 slots.
A ready True Seeing is erased (ANOMALY-65).
To leave out Turn undead, cleric spell 29, the menu skips the value 29
when it counts a character's slots, for mages as well as clerics, but it
writes 29 back only into a cleric's slots. Mage spell 29 is True Seeing: a
ready copy is not shown, its slot counts as free, and leaving the menu, even
without a change, deletes it. A waiting or used copy, stored as −29, is not
affected. A faithful reimplementation skips 29 only in the cleric slots,
or, to reproduce the game, drops a mage's ready True Seeing whenever the
memorize menu is left.
- An empty page still counts an addition
(
ANOMALY-66). On a level with free slots but no spell to offer — a mage who knows no spell of that level — the highlight still points to the first, empty line. Adding then takes a slot from the counter without choosing a spell, and changes the counter of level 7; nothing is written to the character, but "Remaining" stays wrong until the menu is left, since Clear only removes listed spells. - The keyboard reaches a seventh page
(
ANOMALY-67). Keypad 4 on the first page goes to the page of level 7, for which there is no tab, and keypad 6 wraps over eight pages, of which the eighth does nothing. A mage with level-7 slots, whom experience alone does not produce, could memorize level-7 spells only this way. - A lone mage needs no spellbook
(
ANOMALY-68). When only one character can be picked, the game opens its menu without the spellbook test that it applies after a choice among several. The spells chosen then wait: resting makes a mage's spells ready only while it carries a spellbook. - The pray menu hides a paladin's Lay on Hands
(
ANOMALY-70). Every eight hours of rest, a paladin gets Lay on Hands among its level-1 slots, where the book shows it. The pray menu, when it is left, writes each spell back among the slots of its own level, and Lay on Hands is of level 8: it moves there, where no tab of the book reaches it, until the next eight-hour mark writes another copy at level 1.
The consequences in play are inferred from the code.
A spell without a level is written outside its array
(ANOMALY-151). The page lists skip a spell of
level 0, but the rewrite takes the ten slots of a spell from its level minus
one without that test. Turn undead, cleric ID 29, has level 0, as have IDs 30
to 32, which no cleric spell uses, and the count skips only the value +29. A
cleric slot holding −29, or a value from 30 to 32, would be written ten places
before the cleric array, among mage entries 70 to 79, the level-8 slots of the
mage array, and counted in the last byte of the page lists. The case is latent:
Turn undead uses no slot, so its value stays +29, and nothing writes the
others. Every mage ID has a level.
The same menu clears only 80 of the 88 bytes of its page lists, so the last eight bytes of the list of level 8 are left as they were. This has no effect: no more than two spells are of level 8, so the list never reaches them, and the count above is not read back. A faithful reimplementation has nothing to reproduce.2
Sources
Locations refer to the game executable reference.