• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Randomized Pokemon Script

2
Posts
3
Years
  • Age 26
  • Seen Dec 15, 2022
Is this working for v20? I turned the switch on and it still doesn't randomize. I don't get any errors though. Except the whitelist didn't need 'PBSpecies:'
 
4
Posts
1
Years
  • Age 16
  • Seen Apr 29, 2023
Just as the title states, it randomizes any and all pokemon you encounter. Whether it's a gift, a wild pokemon, or a trainer battle it'll all be random.

Although, you must activate a switch (see the comments on how to edit the switch number) for it to become active.

Code:
################################################################################
# Randomized Pokemon Script
# By Umbreon
################################################################################
# Used for a randomized pokemon challenge mainly.
# 
# By randomized, I mean EVERY pokemon will be random, even interacted pokemon
#   like legendaries. (You may easily disable the randomizer for certain
#    situations like legendary battles and starter selecting.)
#
# To use: simply activate Switch Number X
#  (X = the number listed After "Switch = ", default is switch number 36.)
#
# If you want certain pokemon to NEVER appear, add them inside the black list.
#  (This does not take into effect if the switch stated above is off.)
#
# If you want ONLY certain pokemon to appear, add them to the whitelist. This
#   is only recommended when the amount of random pokemon available is around
#   32 or less.(This does not take into effect if the switch stated above is off.)
#
################################################################################

########################## You may edit any settings below this freely.
module RandomizedChallenge
  Switch = 36 # switch ID to randomize a pokemon, if it's on then ALL
              # pokemon will be randomized. No exceptions.
                        
  BlackListedPokemon = [PBSpecies::MEW, PBSpecies::ARCEUS]
  # Pokemon to Black List. Any pokemon in here will NEVER appear.
  
  WhiteListedPokemon = []
  # Leave this empty if all pokemon are allowed, otherwise only pokemon listed
  # above will be selected.
end

######################### Do not edit anything below here.
class PokeBattle_Pokemon
  
  alias randomized_init initialize
  
  def initialize(species,level,player=nil,withMoves=true)

    species = RandomizedChallenge::WhiteListedPokemon.shuffle[0]
    
    if $game_switches && $game_switches[RandomizedChallenge::Switch]
      if RandomizedChallenge::WhiteListedPokemon.length == 0
        species = rand(PBSpecies.maxValue - 1) + 1
        while RandomizedChallenge::BlackListedPokemon.include?(species)
          species = rand(PBSpecies.maxValue - 1) + 1
        end
      end
    end
    
    randomized_init(species, level, player, withMoves)
  end
end

where to i put the code?
 
1
Posts
334
Days
  • Age 30
  • Seen Jun 23, 2023
Hello,

The randomization script seems to be working perfectly. However I'm running into a weird bug where wild pokemon's moves are perfectly fine, but trainers seem to have random moves (for example, there was a dialga that had spider web and u-turn). I have the code in place that's supposed to reset the moves if the switch for randomization is on, but it doesn't seem to be working.
 
Back
Top