Trainer Tower data structures in Generation III
All memory addresses refer to the addresses used in the US version of the games.
In the Japanese release of Pokémon FireRed and LeafGreen, players could scan in e-Reader cards from the Battle-e FireRed and LeafGreen series to customize the layout of Trainer Tower. In the international releases, the data from all 32 of the regular cards are folded into the game ROM; none of the Japanese promotional cards are present. The four battle modes (Single, Double, Knockout, and Mixed) each have a hard-coded order of eight Trainers, exactly as if their corresponding cards have been scanned.
Note that not all 32 cards are used in international releases; notably, all 8 of the Knockout battle cards are used in the Knockout mode, some of which are reused in Mixed mode. A few singles and doubles cards are also reused in Trainer Tower.
The card data is stored in memory location 0x0847ABAC (FireRed) and 0x0847A488 (LeafGreen).
Each Trainer Card is stored as a 992-byte structure, laid out as follows:
|0x02||1||uint8_t||Battle Type - 0 for Single Battles, 1 for Double Battles, and 2 for knockout battles|
|0x03||1||uint8_t||Reward Item - This is the reward item that is obtained when players defeat Trainer Hill, provided that this card represents the first Trainer. The values are indices in a special 15-entry array.|
|0x04||984||Trainer Data||The data for up to three Trainers and their Pokémon.|
Trainer Data is a 328-byte structure, laid out as follows:
|0x0E||48||Easy Chat Quote||Challenge, win, and lose quotes (in that order) - each of these are built in accordance to the easy chat system.|
|0x3E||2||Padding bytes resulting from alignment|
|0x40||264||Trainer's Pokémon||Trainer's Pokémon Lineup|
Trainer's Pokémon is a 44-byte structure, laid out as follows:
|0x00||2||uint16_t||Species - see List of Pokémon by index number (Generation III) for values.|
|0x02||2||uint16_t||Held Item - see List of items by index number (Generation III) for values.|
|0x04||8||uint16_t||Moves - see List of moves for values.|
|0x20||11||char||Nickname - Note that none of the Pokémon on any of these cards are actually nicknamed; the species name is placed here instead.|
If a Trainer is unused (the second and third Trainers in a Single Battle card, or the third Trainer in a Double battle card), the entire structure, with the exception of the easy chat quotes, is zeroed out; the easy chat quote area is filled with 0xFF instead.
The floor plan is simply a list of eight pointers to the various cards that will be used in each mode. There are four such lists, one for each mode. Their locations are as follows:
The reward items used on each card corresponds to indices in an array of 15 items (as indices to the master item list). This array is stored in location 0x0847A2B4 (FireRed) and 0x08479B90 (LeafGreen). For convenience, it is reproduced here.
|8||Mental Herb||Choice Band||King's Rock||Scope Lens|
|C||Metal Coat||Dragon Scale||Up-Grade|
|This data structure article is part of Project Games, a Bulbapedia project that aims to write comprehensive articles on the Pokémon games.|