Thanks to
@Coleman_C18 we figured out how egg trades work:
First of all, eggs can't be deposited in official bank.
A newly generated egg has these values set to 0x00 while in OT savegame:
- 0xD4-0xD6 Date Met
- 0xDA-0xDB Met At Location
Whenever the egg is traded, the values are updated. Met at location is set to 0x3275 (this is direct hex view from pk6 file, you should probably use 0x7532), which corresponds to "a Link Trade (Egg)".
Date met is set to console's date (0xD4 is year (0x00-> year 2000, 0x0F-->year 2015, etc), 0xD5 is month (0x01-0C (1-12)), 0xD6 day (0x01-0x1F (1-31)).
This happens always that the egg is traded, regardless if receiver is OT or notOT. Also (obviously) checksum is updated.
I think if egg support is to be added to PHBank, the data should be set to 0x00 when receiver is OT, and simulate a link trade for anybody else. That would make PHBank effectively work only as storage for eggs from original trainer and be as traded eggs for any other trainer. But just setting the data to everyone would be legit too, since that would be as if the egg had been traded, then returned to OT.
I was finding this abnormal! D:
Edit: Is there something particular happening when transfering from OT("sugorap") to bank, to notOT("sugorap")?
Good question, I already checked that with different cartridges, but that might have some flaws.
I'll do this tests:
- Same cartridge, deposit a 0x00 pokemon, then edit save to change TID and SID, withdraw and see what happens.
- Same cartridge, deposit a 0x00 pokemon, then edit save to change trainer name, but mantain TID and SID, withdraw and see what happens.
UPDATE:
@Gocario
Made the tests, and as expected, a pokemon OT is identified by 3 components, not just TID/SID, but also name.
This makes a trainer with same name but different TID/SID to be recognized as different trainer.
Also makes a trainer with same TID/SID but different name to be recognized as different trainer.
This meanns the following check (and any other similar ones) should also compare trainer name:
Code:
// If it's going back to OT
if(pkm->TID == savedata->TID && pkm->SID == savedata->SID)
|
\/
if(pkm->TID == savedata->TID && pkm->SID == savedata->SID && strcmp(pkm->HTName, savedata->OTName) == 0)
Responding to your question (Is there something particular happening when transfering from OT("sugorap") to bank, to notOT("sugorap")?: no, nothing particular happens.
And now I've thought that maybe the bank also checks for trainer gender and geolocation data to identify it as different trainer. Need to do more tests...
EDIT: maybe it also uses the following to identify as OT:
0xDF OT Game ID --> what's that?
0xE0 Country ID
0xE1 Region ID
0xE2 3DS Region ID
0xE3 OT Language ID
Regardless of what offcial bank checks aside from TID/SID/NAME, I think that name, tid and SID are more than enough to recognize if the trainer is OT or not, it really makes no differences aside the remote possibility of setting a pokemon as being returned to its OT when in fact it is a different trainer.
EDIT2:
The following data is NOT used to detect if trainer is OT or no.
0xE0 Country ID
0xE1 Region ID
0xE2 3DS Region ID
0xE3 OT Language ID
I still don't know what GAME ID is, and pchex can't change gender for some reason.
EDIT3: well, seems like gender is also used to recognize trainer, but maybe it was the gameID thing.
EDIT 4: OK, I think GAME ID refers to if trainer was generated in pokemon X, pokemon Y, alpha shapphire or rubi omega.
Anyway, after some more tests, I can finally say this is what is checked to identify a trainer: TID, SID, Name, Gender
Note that gender is stored in the pokemon data in the following way:
0xDD Bit 7 set - Female OT Gender
When reading it on 3ds, it might be bit 0 though, due to endianess (haven't really checked)
@Gocario, I made some more edits to this post