• 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 Trading Card Game 2 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.

[Scripting Question] How do I change the IVs of wild Pokemon encountered?

  • 1
    Posts
    2
    Years
    • Seen Jul 30, 2022
    Pretty much the title. I am on v20 and I want to change the IVs of all wild Pokemon to be 31 (as a test). How do I do it?
     
    Go to the "Overworld_EncounterModifiers" script, and add this just before the "random dungeon map" line.
    Code:
    EventHandlers.add(:on_wild_pokemon_created, :max_full_iv,
      proc { |pkmn|
      if $game_switches[XX]
        pkmn.iv[:HP] = 31
        pkmn.iv[:ATTACK] = 31
        pkmn.iv[:DEFENSE] = 31
        pkmn.iv[:SPECIAL_ATTACK] = 31
        pkmn.iv[:SPECIAL_DEFENSE] = 31
        pkmn.iv[:SPEED] = 31
      end
    }
    )
    In the line "if $game_switches[XX]", replace XX by the number of the game switch you want to active before you fight the wilf Pokémon. Turn this switch off after the battle, or in case of defeat, turn it off in an event like the nurse in Pokémon Centers.
     
    Back
    Top