Skip to content
Clément Gallet edited this page Jun 25, 2014 · 1 revision

During battle startup, the spell list is compressed and stored for each character. The table starts at $208E and each spell (and lores also) takes 4 bytes:

  1. Spell id
  2. Spell availability (see function C2/5763).
  3. Aiming byte (from $C46AC0 + 14*spell_id)
  4. Spell MP cost (from $C46AC5 + 14*spell_id)

Here is the content of the spell aiming byte:

  • Bit 0 = Cursor Moveable
  • Bit 1 = One Side Only
  • Bit 2 = Autoselect both parties
  • Bit 3 = Autoselect one party
  • Bit 4 = Auto Confirm
  • Bit 5 = Manual Party Select
  • Bit 6 = Cursor Start on Enemy
  • Bit 7 = Randomize selection

Here is the list of all aiming bytes available and the corresponding spells:

  • 0b00000000 (Self): Warp
  • 0b00000001 (Allies or enemies, single): Safe, Haste, Bserk, Rflect, Shell, Vanish, Life, Life 2
  • 0b00000010 (Self): Quick
  • 0b00000011 (Allies, single target): Antdot, Remedy, Regen, Life 3
  • 0b00000100 (Allies and enemies, multi target): Quake, W Wind, Merton
  • 0b00100001 (Allies or enemies, single or multi target): Float, Cure, Cure 2, Cure 3
  • 0b00101001 (Allies or enemies, multi or single target): Haste 2
  • 0b01000001 (Enemies or allies, single target): Poison, Drain, Break, Doom, Pearl, Flare, Scan, Slow, Rasp, Mute, Sleep, Muddle, Stop, Imp, Osmose, Dispel
  • 0b01000011 (Enemies, single target): Demi
  • 0b01100001 (Enemies or allies, single or multi target): Fire, Ice, Bolt, Fire 2, Ice 2, Bolt 2, Bio, Fire 3, Ice 3, Bolt 3
  • 0b01101001 (Enemies or allies, multi or single target): Slow 2
  • 0b01101010 (Enemies, multi target, cancel if press right?): X-Zone
  • 0b01101110 (Enemies, multi target): Quartr, Meteor, Ultima

At the battle startup and after each turn, function C2/083F is called. For a given entity, if his Imp status is toggled, the attack/spell costs him MP to cast, or the attack itself affects his MP because he's a target [or the caster, if it's a draining attack]), then it updates availability of entries on Esper, Magic and Lore menus (function C2/5763).

In function C2/5763, carry is set if Imped and spell not Imp, or insufficient MP. Then, spell availability is rotated right, putting the carry in bit 7.

Clone this wiki locally