-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Make Pokemon that Require a Fateful Encounter to be Legal to Always Be Set to Legal
voloved edited this page Jan 17, 2023
·
1 revision
By devolov
To prevent people cheating, Gamefreakmade it so Mew and Deoxys must have a MON_DATA_EVENT_LEGAL
flag set to be legal, where they'd obey and be tradeable.
Adding these four lines of code will set them to legal the first time they get checked for legality and aren't.
In battle_util.c
:
static bool32 IsMonEventLegal(u8 battlerId)
{
if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT)
return TRUE;
if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS
&& GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_MEW)
return TRUE;
+ if (!GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_EVENT_LEGAL, NULL)){
+ bool32 isEventLegal = TRUE;
+ SetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_EVENT_LEGAL, &isEventLegal);
+ }
return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_EVENT_LEGAL, NULL);
}