View Single Post
Old January 4th, 2015 (6:53 PM). Edited January 4th, 2015 by Deokishisu.
Deokishisu's Avatar
Deokishisu Deokishisu is offline
Mr. Magius
    Join Date: Feb 2006
    Location: If I'm online, it's a safe bet I'm at a computer.
    Gender: Male
    Nature: Relaxed
    Posts: 859
    Originally Posted by DoesntKnowHowToPlay View Post
    In-game trades in FR are at 0x26CF8C. The scripts relating to them store very little information, and just index into this table. Each entry is 0x3C bytes, used as such:

    0x0 - Nickname, limited to ten characters + 0xFF.
    0xC - Half-word, ID of the NPC's pokemon.
    0xE - IVs, stored in HP/Atk/Def/Speed/SAtk/SDef order. One byte each.
    0x14 - An entire word dedicated to the ability bit.
    0x18 - NPC's trainer ID. Only the low bits are visible on the status screen.
    0x1C - Five bytes; four of them are 5 and one is 0x1E. Not sure what they do if anything.
    0x24 - Personality value; influences nature, gender, etc; more info here:
    0x28 - Hold item.
    0x2A - 0x00 if the mon carries mail (only ZYNX has mail in FR), 0xFF otherwise.
    0x2B - Original trainer's name. Limited to seven characters + 0xFF.
    0x36 - 0x00 if original trainer is male, 0x01 if original trainer is female. Only visible in RSE.
    0x37 - Always 0xA. Not sure what it controls if anything.
    0x38 - Half-word, ID of the species the NPC is looking for.
    0x3A - Half-word, seems unused.
    I'm taking an educated guess without actually looking into it, but I believe that one of those unknowns are values for the received Pokemon's contest stats. In the third gen, all in game trades (even in FR/LG) give Pokemon with some contest stats built in. I'm going to guess that the bytes at 0x1C are it, as there are 5 contest stats. The byte at 0x37 may be sheen.

    Again, just a guess.

    EDIT: There has to be more to that mail byte too. Where is Zynx's mail message stored?

    EDIT2: According to this Bulbapedia article, Pokemon given in ingame trades have contest stats all at 5, save for one that's set at 30. This all but confirms that the bytes at 0x1C are the Pokemon's contest stats. It also says that all ingame trade Pokemon have a sheen of ten. The byte at 0x37 is then probably sheen like I thought, since it's always set at 0xA.
    Reply With Quote