Incomplete OT check in Pokémon Crystal
Posted by: Bent`
Date: 2012-07-08 00:22:47
The game checks the species, ID number, and OT of every Pokémon in the party and PC until it finds a match (so a Raikou, Entei, or Suicune traded from another game will not match). However, it only checks the first five characters of the OT name. This worked correctly in Pocket Monsters Crystal, where player names were only five characters long, but the English version of Pokémon Crystal supports player names up to seven.
ld hl, PlayerName
ld a, [de]
cp [hl]
jr nz, .notfound
cp "@"
jr z, .found ; reached end of string
inc hl
inc de
ld a, [de]
cp [hl]
jr nz, .notfound
cp $50
jr z, .found
inc hl
inc de
ld a, [de]
cp [hl]
jr nz, .notfound
cp $50
jr z, .found
inc hl
inc de
ld a, [de]
cp [hl]
jr nz, .notfound
cp $50
jr z, .found
inc hl
inc de
ld a, [de]
cp [hl]
jr z, .found
.notfound
A quick fix would be to copy/paste two more instances of this ASM, to check two more characters.
ld a, [de]
cp [hl]
jr nz, .notfound
cp $50
jr z, .found
inc hl
inc de
Of course, this would be hard to exploit, because you would need a second game file with the same ID number anyway (165536 chance).