Edit items, skills and shops
Items, equipment, abilities (skills and magic), shop stock and level growth sit in eight fixed tables in one entry, GAME.EMI#0. The game finds a row by multiplying its index by the table’s stride. Field layouts: game records.
Where the data is
Section titled “Where the data is”GAME.EMI#0 loads at 0x80195800 and holds the item, vital item, weapon, armor, accessory, shop, ability and level-growth tables. The table of offsets gives the archive offset, payload offset, runtime address, row count and row size of each.
Two things live elsewhere:
- Enemy drops are the two item rows of the enemy record (characters and enemies).
- A description is a 16-bit resource id into the table that loads at
0x8001A000. Changing a description is a text edit, not a table edit.
What to change
Section titled “What to change”- Find the table and the row: payload offset plus row index times row size.
- Edit the fields of the row in place. A name is 12 bytes in the text encoding and ends with
0x00padding unless it fills the field. - Write the table back at the same payload offset in entry 0, then follow the editing cycle.
What the common fields do:
- Equipment rows carry an equipability mask with one bit per character (masks) and a weight. Weapons and armor also carry a power.
- Weapons carry a
soundbyte that indexes the cue table, so a new value must name an existing cue (sound effects). - Abilities carry a type, a cost, a power, an element and targeting flags (ability targeting).
- A shop row holds an item count and eleven two-byte references, each an item type and an item index. Only the first
countreferences are valid.
Limits and pitfalls
Section titled “Limits and pitfalls”- Row counts are fixed. The tables hold 92 items, 16 vital items, 83 weapons, 68 armor pieces, 52 accessories, 40 shops and 228 abilities. A new row has no documented reader, so reuse an existing row.
- The entry keeps its size and address. Entry 0 loads at a fixed address, and every table sits at a fixed payload offset from it. A table that changes size moves its neighbors.
- Row 0 is empty. Each equipment table starts with a
Nothingrow, and ability 0 is zeroed. Leave them. - The gap before the abilities. A 232-byte block lies between the shops and the abilities. Its use is
[unknown]. Leave it as it is. - Unnamed bytes. One byte of the item row, the high nibble of
kindand the ability flag bits beyond the named ones are[unknown]. - Shops by town. Which shop row a town uses is not documented.
Check in the game
Section titled “Check in the game”Items and equipment show their name and price in their menus. A changed ability shows its cost in the ability list and its effect in battle. A wrong stride shows names from a neighboring row.
Related
Section titled “Related”- Game records: the row layouts, masks and targeting flags.
- Edit text and dialogue: descriptions and names.
- Edit characters and enemies: level growth and enemy drops.
- Edit sound and music: the cue table that a weapon sound names.
- Edit the game: the editing cycle and the limits that apply to every edit.