PKHeX icon indicating copy to clipboard operation
PKHeX copied to clipboard

Gen 2 MysteryGiftIsUnlocked is seen as False after using Mystery Gift

Open MrPerson0 opened this issue 1 year ago • 2 comments

Describe the bug In GSC, after you unlock the Mystery Gift feature by talking to the girl in Goldenrod, the Block Data for 'MysteryGiftIsUnloocked' is set to True. However, after performing a Mystery Gift, the value is set to False.

To Reproduce Steps to reproduce the behavior: Mystery Gift with another Gen 2 game, whether it is GSC or Stadium 2. Load the save to the latest dev build of PKHeX and check the block data mentioned above.

Expected behavior After Mystery Gifting with someone, value should remain True.

Additional context Here's a zip of sav files during the process: SilverMysteryGiftSaves.zip

I have included saves up to Mystery Gifting with a fifth trainer since it seems that BE3 and BE5 keep on incrementing up until then.

MrPerson0 avatar Dec 15 '23 02:12 MrPerson0

Both 0xBE3 and 0xBE5 are checked as sbyte values in-game. The only value that is considered as 'locked' is actually -1.

Valid values range from 0 to 5, based on how many different OT you have interacted. It resets to 0 when all the timers from previous interactions has expired.

The setter is fine, it mimics what the game does when first unlocking.

The getter needs to only check if it's not -1 to consider it as unlocked.

fattard avatar Dec 15 '23 02:12 fattard

Found Korean GS Offsets

MysteryGiftIsUnlocked = 0xFE3; // And 0xFE5;

fattard avatar Dec 24 '23 00:12 fattard