summaryrefslogtreecommitdiff
path: root/GSC/Trainers.mdwn
blob: 06590ec56647a71d930b76f86dd643b637a3d63f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Editing trainer data is extremely simple. First, let's find the trainer we wish to edit.

Trainers are sorted by class: all Fishers are in a group, all Youngsters are in another group, and so on. A list of the classes is below:

 * 01 Leader [Falkner]
 * 02 Leader [Whitney]
 * 03 Leader [Bugsy]
 * 04 Leader [Morty]
 * 05 Leader [Pryce]
 * 06 Leader [Jasmine]
 * 07 Leader [Chuck]
 * 08 Leader [Clair]
 * 09 Silver [1]
 * 0A Pokémon Prof.
 * 0B Elite Four [Will]
 * 0C PKMN Trainer [Cal]
 * 0D Elite Four [Bruno]
 * 0E Elite Four [Karen]
 * 0F Elite Four [Koga]
 * 10 Champion
 * 11 Leader [Brock]
 * 12 Leader [Misty]
 * 13 Leader [Lt.Surge]
 * 14 Scientist
 * 15 Leader [Erika]
 * 16 Youngster
 * 17 Schoolboy
 * 18 Bird Keeper
 * 19 Lass
 * 1A Leader [Janine]
 * 1B Cooltrainer♂
 * 1C Cooltrainer♀
 * 1D Beauty
 * 1E Pokémaniac
 * 1F Rocket [Male Grunt]
 * 20 Gentleman
 * 21 Skier
 * 22 Teacher
 * 23 Leader [Sabrina]
 * 24 Bug Catcher
 * 25 Fisher
 * 26 Swimmer♂
 * 27 Swimmer♀
 * 28 Sailor
 * 29 Super Nerd
 * 2A Silver [2]
 * 2B Guitarist
 * 2C Hiker
 * 2D Biker
 * 2E Leader [Blaine]
 * 2F Burglar
 * 30 Firebreather
 * 31 Juggler
 * 32 Blackbelt
 * 33 Rocket [Male Executive]
 * 34 Psychic
 * 35 Picnicker
 * 36 Camper
 * 37 Rocket [Female Executive]
 * 38 Sage
 * 39 Medium
 * 3A Boarder
 * 3B Pokéfan [Male]
 * 3C Kimono Girl
 * 3D Twins
 * 3E Pokéfan [Female]
 * 3F PKMN Trainer [Red]
 * 40 Leader [Blue]
 * 41 Officer
 * 42 Rocket [Female Grunt]
 * 43 Mysticalman [Eusine] (Crystal only)

To find where each group is stored, follow its two‐byte pointer from the array at offset 0x3993E (Gold/Silver) or 0x39999 (Crystal).

Next, load the table file in your hex editor and search for the trainer’s name. You should be taken immediately to the trainer data, which is stored like this:

    <Trainer Name> <0x50> <Data type> <Pokémon Data>+ <0xFF>

The Pokémon data format varies based on the Data Type.

 * Data type <0x00>: Pokémon Data is &lt;Level> &lt;Species>. Used by most trainers.
 * Data type <0x01>: Pokémon Data is &lt;Level> &lt;Pokémon> &lt;Move1> &lt;Move2> &lt;Move3> &lt;Move4>. Used often for Gym Leaders.
 * Data type <0x02>: Pokémon Data is &lt;Level> &lt;Pokémon> &lt;Held Item>. Used mainly by Pokéfans.
 * Data type <0x03>: Pokémon Data is &lt;Level> &lt;Pokémon> &lt;Held Item> &lt;Move1> &lt;Move2> &lt;Move3> &lt;Move4>. Used by a few Cooltrainers.

# Example 1

I want to replace Youngster Mikey’s Rattata with a Pikachu. I see the bytes 0xA4 0x5D at [0x3993E + (0x16 − 1) × 2 = 0x39968], so Youngsters are kept at offset 0x39DA4. I go there and search for “MIKEY”, winding up at 0x39DAD.

The bytes there are:

    8c 88 8a 84 98 50 00 02 10 04 13 ff

Which translate to:

 * MIKEY
 * 0x50
 * Data type 0x00
 * Level 2 Pidgey
 * Level 4 Rattata

So I replace the 0x13 representing Rattata with 0x19 for Pikachu.

# Example 2

I want to give Falkner a Hoothoot. Falkner’s class is the first, so I follow the pointer at 0x3993E to 0x399C2. Since there is only one Falkner, the data here are what I want to change:

    85 80 8b 8a 8d 84 91 50 01 07 10 21 bd 00 00 09 11 21 bd 10 00 ff

 * FALKNER
 * 0x50
 * Data type 0x01
 * Level 7 Pidgey: Tackle, Sand‐Attack
 * Level 9 Pidgeotto: Tackle, Sand‐Attack, Mud Slap

I just need to add some Hoothoot data near the end:

    85 80 8b 8a 8d 84 91 50 01 07 10 21 bd 00 00 09 11 21 bd 10 00 0a a3 21 2d c1 00 ff

But wait! This is longer than the original, so just adding those bytes will make the data clash with Whitney’s data at 0x399D8. Instead, I put Falkner’s new trainer data in some free space in the same bank: offset 0x3B800. Then I change the pointer at 0x3993E to 00 78 in order to point to it.