Magic data
Data · Routines · Address index
Spell names and selection groups, the party's spell effects and the state of a spell being cast. The data page explains how the entries are written.
DS:0x0bbb, DS:0x0bdc — Spell selection groups
- Layout: one byte per spell
- Role: Spell level of each mage and cleric spell, its group in the
selection interface, copied to DS:
0x6c76and used as level − 1 for the page list, the slot-count row and the ten-slot block of the level.DS:0x0bbbholds 32 nonzero groups andDS:0x0bdc28 nonzero groups, each followed by a zero, so cleric IDs 29 to 32 have level 0. - Used by: Mage and cleric spells › Special entries
DS:0x1fe1, DS:0x2065 — Spell name tables
- Layout: 33 and 30 far pointers
- Role: Names of the mage and cleric spells; see
SpellNamePointer. - Used by: Magic › How the game stores spells, Mage and cleric spells › Special entries, Spell name entry › In brief, Texts
DS:0x6c76 — Copy of the spell selection groups
- Layout: bytes
- Role: Working copy of the spell selection groups.
- Used by: —
DS:0x6d42 — Spell reminder flag
- Layout: word
- Role: Set to 1 by the slot writer for a
copy that is not ready (
0x42c2f); cleared by the camp menu when the rest returns 0 (0x44894); tested on leaving a camp menu (0x4495d), which then shows string 44. These are file offsets of overlay code. - Used by: Camp menus › The camp menu
DS:0x6ddc — Party spell effects
- Layout: dword,
SpellEffectFlags - Role: The party-wide target of the
effect_mask(field+0x13) of a spell definition withSPELL_FLAG_GLOBAL_EFFECT_MASK: set at0x22988when the spell starts, cleared at0x21b45when it ends. The monster drawing tests bits0x220,SPELL_EFFECT_DETECT_INVISIBLEandSPELL_EFFECT_TRUE_SEEING. - Used by: Lasting spell effects, Magic, Saved games (SAV)
DS:0xcd18 — Spell being cast
- Status: no reader has been found.
- Role: Written by casting a spell during the block
event
0x800dispatch. - Used by: Events that start scripts
DS:0xd0b0, DS:0xcbc2, DS:0xe5a8, DS:0xe4c6, DS:0x71c8, DS:0xdf38 — Spell casting state
- Layout:
0xd0b0,0xcbc2,0xe4c6,0xdf38: bytes;0xe5a8: far pointer;0x71c8: word - Role: The caster's party slot (
0xd0b0); the target's slot (0xcbc2) and a far pointer to itsCharacterRuntime(0xe5a8), both set to the caster unless the spell hasSPELL_FLAG_CHOOSE_TARGET; the spell book shown, whose value 1 makes the timer use the caster's cleric level (0xe4c6: 1 when the cleric book was opened from a holy symbol or an item casts a definition above 33,0x21d5fand0x22ac1; 0 for the spellbook and around a scripted magic launch,0x25e67; not written when the book closes); the hand slot plus 1 while an item casts, 0 for a spell from a book slot (0x71c8, set at0x22aac; while it is nonzero the caster level routines return 9,0x211b9and0x21221); and a flag that the spell's own routine sets to stop the start of the spell (0xdf38). - Comparative source: REF-SCUMM-013,
castSpellandstartSpell(_openBookType,_castScrollSlot,_returnAfterSpellCallback). - Used by: Casting a spell › The steps of a cast
DS:0xdf2e — Copied spell handler
- Layout: far pointer
- Role: Handler copied from the spell definition being cast; called when it is not zero, between the "already under the effect" checks and the setting of the lasting effect.
- Used by: