• 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!
  • 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.

Pokemon Generations

Zeak6464

Zeak #3205 - Discord
  • 1,101
    Posts
    12
    Years
    Pick what Gen that you want to find in your game !
    This script uses Switches

    Script OC: Umbreon
    Code:
    ################################################################################
    # Pokemon Level Balancing - By Umbreon
    # Modded - Zeak6464
    ################################################################################
    # Balances any and all pokemon's levels towards the player's party level.
    #
    # NOTE: This won't affect any pokemon the player owns.
    #
    # To use: simply activate Switch Number X
    #  (X = the number listed After "Switch = ", default is switch number 37.)
    #
    #
    ################################################################################
    
    module LevelBalance
      Switch = 226 # The switch used to activate/deactivate the level balancing
    end
    
    module Random
      Switch = 227 # The switch used to activate/deactivate the Randomizer
    end
    
    module G1
      Switch = 201 # The switch used to activate/deactivate the Gen 1 Randomizer 
    end
    
    module G2
      Switch = 202 # The switch used to activate/deactivate the Gen 2 Randomizer 
    end
    
    module G3
      Switch = 203 # The switch used to activate/deactivate the Gen 3 Randomizer 
    end
    
    module G4
      Switch = 204 # The switch used to activate/deactivate the Gen 4 Randomizer 
    end
    
    module G5
      Switch = 205 # The switch used to activate/deactivate the Gen 5 Randomizer 
    end
    
    module G6
      Switch = 206 # The switch used to activate/deactivate the Gen 6 Randomizer 
    end
    
    module G7
      Switch = 207 # The switch used to activate/deactivate the Gen 7 Randomizer 
    end
    
    
    class PokeBattle_Pokemon
      
      alias balanced_level_init initialize
      
      def initialize(species,level,player=nil,withMoves=true)
        
        if $game_switches && $game_switches[LevelBalance::Switch] && $Trainer && $Trainer.party.length > 0
            level = pbBalancedLevel($Trainer.party)
        end
        
        if  $game_switches &&  $game_switches[Random::Switch]
          level = pbBalancedLevel($Trainer.party)
          species = 1+ rand(PBSpecies.maxValue)
        end
        
        if  $game_switches &&  $game_switches[G1::Switch]
          level = pbBalancedLevel($Trainer.party)
          species = rand(1..151)
        end
        
        if  $game_switches &&  $game_switches[G2::Switch]
          level = pbBalancedLevel($Trainer.party)
          species = rand(152..251)
        end
        
        if  $game_switches &&  $game_switches[G3::Switch]
          level = pbBalancedLevel($Trainer.party)
          species = rand(252..386)
        end
        
        if  $game_switches &&  $game_switches[G4::Switch]
          level = pbBalancedLevel($Trainer.party)
          species = rand(387..493)
        end
        
        if  $game_switches &&  $game_switches[G5::Switch]
          level = pbBalancedLevel($Trainer.party)
          species = rand(494..649)
        end
        
        if  $game_switches &&  $game_switches[G6::Switch]
          level = pbBalancedLevel($Trainer.party)
          species = rand(650..721)
        end
        
        if  $game_switches &&  $game_switches[G7::Switch]
          level = pbBalancedLevel($Trainer.party)
          species = rand(722..809)
        end
        
        
        balanced_level_init(species, level, player, withMoves)
      end
    end
     
    Last edited:
    A possible improvement would be to let the Gen switches stack up, so e.g. having G1 and G3 activated would mean a Pokémon from either gen 1 or gen 3 could appear, but no others.

    Something like (untested):

    Code:
      species = []
    
      if $game_switches && $game_switches[LevelBalance::Switch] && $Trainer && $Trainer.party.length > 0
          level = pbBalancedLevel($Trainer.party)
      end
    
      if $game_switches && $game_switches[Gen1::Switch]
        species += (1..151).to_a
      end
    
      if $game_switches && $game_switches[Gen2::Switch]
        species += (152..251).to_a
      end
    
      # etc
    
      if !species.empty?
        balanced_level_init(species.sample, level, player, withMoves)
      end

    Also my suggestion separates level balance from gens.

    (And are your modules called Gen1/Gen2/etc but your code looks at G1::Switch/G2::Switch/etc, does that work? It's early so I might be misreading)
     
    Last edited:
    Back
    Top