2 Enable trade with FRLG without beating the game
FieryMewtwo edited this page 2021-10-27 07:57:52 -04:00

Unlike Ruby and Sapphire, Pokémon Emerald requires the player to become the champion in order to trade with Fire Red or Leaf Green.

You can disable this by following these steps:

In src/link.c, go to InitLocalLinkPlayer and comment the following line:

static void InitLocalLinkPlayer(void)
{
    gLocalLinkPlayer.trainerId = gSaveBlock2Ptr->playerTrainerId[0] | (gSaveBlock2Ptr->playerTrainerId[1] << 8) | (gSaveBlock2Ptr->playerTrainerId[2] << 16) | (gSaveBlock2Ptr->playerTrainerId[3] << 24);
    StringCopy(gLocalLinkPlayer.name, gSaveBlock2Ptr->playerName);
    gLocalLinkPlayer.gender = gSaveBlock2Ptr->playerGender;
    gLocalLinkPlayer.linkType = gLinkType;
    gLocalLinkPlayer.language = gGameLanguage;
    gLocalLinkPlayer.version = gGameVersion + 0x4000;
    gLocalLinkPlayer.lp_field_2 = 0x8000;
    gLocalLinkPlayer.progressFlags = IsNationalPokedexEnabled();
-   if (FlagGet(FLAG_IS_CHAMPION))
+   //if (FlagGet(FLAG_IS_CHAMPION))
    {
        gLocalLinkPlayer.progressFlags |= 0x10;
    }
}

And then, in src/link_rfu_3.c, go to InitHostRFUtgtGname and change the following line:



void InitHostRfuGameData(struct RfuGameData *data, u8 activity, bool32 startedActivity, s32 partnerInfo)
{
    s32 i;

    for (i = 0; i < 2; i++)
    {
        data->compatibility.playerTrainerId[i] = gSaveBlock2Ptr->playerTrainerId[i];
    }
    for (i = 0; i < RFU_CHILD_MAX; i++)
    {
        data->child_sprite_gender[i] = child_sprite_genders;
        child_sprite_genders >>= 8;
    }
    data->playerGender = gSaveBlock2Ptr->playerGender;
    data->activity = activity;
    data->startedActivity = startedActivity;
    data->compatibility.language = GAME_LANGUAGE;
    data->compatibility.version = GAME_VERSION;
    data->compatibility.hasNews = FALSE;
    data->compatibility.hasCard = FALSE;
    data->compatibility.unknown = FALSE;
-   data->compatibility.isChampion = FlagGet(FLAG_IS_CHAMPION);
+   data->compatibility.isChampion = TRUE;
    data->compatibility.hasNationalDex = IsNationalPokedexEnabled();
    data->compatibility.gameClear = FlagGet(FLAG_SYS_GAME_CLEAR);
}

And that's it! ~AsparagusEduardo