Skip to main content

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:0x6c76 and used as level − 1 for the page list, the slot-count row and the ten-slot block of the level. DS:0x0bbb holds 32 nonzero groups and DS:0x0bdc 28 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​

DS:0x6c76 — Copy of the spell selection groups​

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 with SPELL_FLAG_GLOBAL_EFFECT_MASK: set at 0x22988 when the spell starts, cleared at 0x21b45 when it ends. The monster drawing tests bits 0x220, SPELL_EFFECT_DETECT_INVISIBLE and SPELL_EFFECT_TRUE_SEEING.
  • Used by: Lasting spell effects, Magic, Saved games (SAV)

DS:0xcd18 — Spell being cast​

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 its CharacterRuntime (0xe5a8), both set to the caster unless the spell has SPELL_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, 0x21d5f and 0x22ac1; 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 at 0x22aac; while it is nonzero the caster level routines return 9, 0x211b9 and 0x21221); and a flag that the spell's own routine sets to stop the start of the spell (0xdf38).
  • Comparative source: REF-SCUMM-013, castSpell and startSpell (_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: