• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other] Changing the base shiny odds

  • 5
    Posts
    8
    Years
    • Seen Aug 25, 2024
    Hi, I've been looking to change the shiny odds in Pokeemerald. I found this line in \include\contstants\pokemon.h :
    Code:
    #define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536

    However, there are a bunch of other files (mainly in \src) that contain strings/references to a Pokemon being shiny, like this block in \src\pokemon.c :

    Code:
    bool8 IsMonShiny(struct Pokemon *mon)
    {
        u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
        u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
        return IsShinyOtIdPersonality(otId, personality);
    }
    
    bool8 IsShinyOtIdPersonality(u32 otId, u32 personality)
    {
        bool8 retVal = FALSE;
        u32 shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
        if (shinyValue < SHINY_ODDS)
            retVal = TRUE;
        return retVal;
    }

    I'd like to change it to something like 1/512, so I figured I could change the value in pokemon.h to 64. Can anyone tell me if this actually affects the odds of a pokemon being shiny? If it matters: I applied the RNG fix. Thanks in advance.
     
    I think the number you're looking for is 128 (if you want exactly 1/512), but yeah, I think changing that number should work.
     
    Hi, I've been looking to change the shiny odds in Pokeemerald. I found this line in \include\contstants\pokemon.h :
    Code:
    #define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536

    However, there are a bunch of other files (mainly in \src) that contain strings/references to a Pokemon being shiny, like this block in \src\pokemon.c :

    Code:
    bool8 IsMonShiny(struct Pokemon *mon)
    {
        u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
        u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
        return IsShinyOtIdPersonality(otId, personality);
    }
    
    bool8 IsShinyOtIdPersonality(u32 otId, u32 personality)
    {
        bool8 retVal = FALSE;
        u32 shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
        if (shinyValue < SHINY_ODDS)
            retVal = TRUE;
        return retVal;
    }

    I'd like to change it to something like 1/512, so I figured I could change the value in pokemon.h to 64. Can anyone tell me if this actually affects the odds of a pokemon being shiny? If it matters: I applied the RNG fix. Thanks in advance.
    Setting SHINY_ODDS to 64 would change the rate from 1/8191 to 1/1024.
    If you want the shiny rate to become 1/512, you want to set it to 128 instead I believe.

    But yes, that does modify the chance of a wild Pokémon to be generated as a shiny Pokémon.
     
    Back
    Top