6th Generation Pokemon Link Map

From ProjectPokemon Wiki
Revision as of 23:25, 2 February 2017 by UniqueGeek (talk | contribs) (Added tags)
Jump to navigation Jump to search

Overall structure

Pokémon link data is stored at block ID 0x30 of the savegame, located at offset 0x1FE00 for X/Y and 0x20DFF for OR/AS (add 0x5400 if using the referenced offsets located at http://projectpokemon.org/wiki/Pok%C3%A9mon_XY_Save_File_Structure and http://projectpokemon.org/wiki/Pok%C3%A9mon_ORAS_Save_File_Structure respectively)

Offset Description
0x00-0x? Pokémon Transfer Flags?*
0x1FF-0xC45 Pokémon Link Data
0xC46-0xDFF Unused?
  • *Pokémon Transfer flags: this value prevents receiving the same pokémon trough Pokémon Link Multiple times. If this value is cleared, the Pokémon can be received again. This has only been used for ORAS Demo Glalie/Steeliex, both of which set this value to 0x02.

Pokémon Link Data

Savegame Offsets

Pokémon Link Data starts in the following offsets for decrypted savegame files and is 2631 bytes long:

  • Pokémon X/Y: 0x1FFFF
  • Pokémon OR/AS: 0x20FFF

Modifying this data requires checksum #0x30 to be updated.

Also, for ramsav users (ramsav method does not require to fix checksum):

  • ramsav.bin offset Pokémon X/Y: 0x1CF9F
  • ramsav.bin offset Pokémon OR/AS: 0x1E05B

Pokémon Link Data Map

Offset Description
0x00 Pokémon Link flag

(0x00 disabled, 0x80 enabled)

0x01-0x6C Name of application that produce Pokémon Link Data
0x6D-0x6E NULL terminator?
0x6F-0x94 Unknown/Unused
0x95-0x98 Unknown/Unused (0x00000000)
0x99-0x9C Pokémon transfer flags?1 (see notes)
0x9D-0x13C Pokémon slot 1 (160 bytes 2 see notes)
0x13D-0x140 Unknown/Unused (0x00000000)
0x141-0x144 Pokémon transfer flags?1 (see notes)
0x145-0x1E4 Pokémon slot 2 (160 bytes 2 see notes)
0x1E5-0x1E8 Unknown/Unused (0x00000000)
0x1E9-0x1EC Pokémon transfer flags?1 (see notes)
0x1ED-0x28C Pokémon slot 3 (160 bytes 2 see notes)
0x28D-0x290 Unknown/Unused (0x00000000)
0x291-0x294 Pokémon transfer flags?1 (see notes)
0x295-0x334 Pokémon slot 4 (160 bytes 2 see notes)
0x335-0x338 Unknown/Unused (0x00000000)
0x339-0x33C Pokémon transfer flags?1 (see notes)
0x33D-0x3DC Pokémon slot 5 (160 bytes 2 see notes)
0x3DD-0x3E0 Unknown/Unused (0x00000000)
0x3E1-0x3E4 Pokémon transfer flags?1 (see notes)
0x3E5-0x484 Pokémon slot 6 (160 bytes 2 see notes)
0x485-0x488 Unknown/Unused (0x00000000)
0x489-0x48A Item 1 (3 see notes)
0x48B-0x48C Item 1 quantity
0x48D-0x48E Item 2 (3 see notes)
0x48F-0x490 Item 2 quantity
0x491-0x492 Item 3 (3 see notes)
0x493-0x494 Item 3 quantity
0x495-0x496 Item 4 (3 see notes)
0x497-0x498 Item 4 quantity
0x499-0x49A Item 5 (3 see notes)
0x49B-0x49C Item 5 quantity
0x49D-0x49E Item 6 (3 see notes)
0x49F-0x4A0 Item 6 quantity
0x4A1-0x4A2 Battle Points (max. value 9999)
0x4A3-0x4A4 Poké Miles
0x4A5-0xA44 Unknown/Unused (All 0x00)
0xA45-0xA46 CRC-16/CCITT checksum for 0x01-0xA44 data

When no Pokémon Link Data is available, 0x01-0xA46 is set to 0x00

Pokémon slot structure

Offset Description
0x00-0x01 TID
0x02-0x03 SID
0x04 Pokemon Origin Game (OT Game ID)

00 for Game Received in

0x05-0x07 Unknown/Unused (0x000000)
0x08-0x0B [Pokemon] Encryption Constant

Unset = 00000000

0x0C Primary Ribbons

Ribbon data available below.

0x0D Secondary Ribbons

Ribbon data available below.

0x0E PokéBall
0x0F Unused/Unknown
0x10-0x11 Held Item
0x12-0x13 Move ID #1
0x14-0x15 Move ID #2
0x16-0x17 Move ID #3
0x18-0x19 Move ID #4
0x1A-0x1B PokéDex Number (4 see notes)
0x1C Form No.
0x1D Language

00 for Game Received In

0x1E-0x37 Pokémon Nickname

Null terminator for last two bytes.
If no nickname, all 00.

0x38 Nature

FF - Unset

0x39 Pokémon Gender

00 - Male
01 - Female
02 - Genderless
03 - Random

0x3A Pokémon Ability

00 - Ability 1
01 - Ability 2
02 - Dream World Ability
03 - RND(Abil1, Abil2)
04 - RND(Abil1, Abil2, AbilDW)

0x3B PID Toggle

00 - Generate Specified PID (from 0x6C-0x6F)
01 - Generate Random PID (Can be shiny)
02 - Generate Shiny PID (Always shiny)
03 - Generate Random PID (Can't be shiny)

0x3C-0x3D Egg Met Location (5 see notes)
0x3E-0x3F Met Location of Pokémon (5 see notes)
0x40 Met Level
0x41-0x46 Contest Stats

Last byte is Sheen

0x47-0x4C IVs

FFs for unset IVs
FE for priority

0x4D OT Gender

00 - Male
01 - Female
03 - Recipient's Gender

0x4E-0x67 OT Name

Null terminator for last two bytes.
If no set OT, all 00.

0x68 Current Level(random if set to 0)
0x69 Egg Flag

00 - Is Not Egg
01 - Is Egg

0x6A-0x6B 'Unknown'
0x6C-0x6F PID (used if PID toogle is 00)
0x70-0x71 Relearn Move 1
0x72-0x73 Relearn Move 2
0x74-0x75 Relearn Move 3
0x76-0x77 Relearn Move 4
0x78 OT Memory Intensity
0x79 OT Memory Line
0x7A-0x7B OT Memory TextVar
0x7C OT Memory Feeling
0x7D-0x9F Unknown/Unused/Reserved bytes

Ribbon Set

Flag Value 0x74 0x75
0x01 Battle Champ Ribbon World Champ Ribbon
0x02 Regional Champ Ribbon Birthday Ribbon
0x04 National Champ Ribbon Special Ribbon
0x08 Country Ribbon Souvenir Ribbon
0x10 National Ribbon Wishing Ribbon
0x20 Earth Ribbon Classic Ribbon
0x40 World Ribbon Premier Ribbon
0x80 Event Ribbon Empty

Notes

  1. Pokémon transfer flags: for ORAS demo Glalie/Steelix this is set to 0x0001 0x0001; for Celebi and Johto starters 0x0000 0x0000. Somehow this sets a value in the XY/ORAS savegame that makes the game unable to receive the pokemon again, this is what makes Glalie/Steelix from ORAS Demo only be able to be received once per savegame. Removing that value from the savegame allows to import another Glalie/Steelix. Todo: add offset where that value is stored in XY and ORAS.
  2. The statement that pokemon data is 160 bytes long is made due to this data being essentially the same as in wondercard data, which is 160 bytes long from TID to end of file.
  3. If item is not valid, it won't be obtained.
  4. If pokemon species is not valid (i.e 0x0000), no pokemon will be generated.
  5. Pokemon link will set egg met location to "Pokemon Link" and met at location to "Pokemon Link" regardless of the value in the data.