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

Gym Leader / E4 Pokemon Balancer

Zeak6464

Zeak #3205 - Discord
  • 1,101
    Posts
    12
    Years
    GYME4_TEAM_LIST is the list of Trainers
    Level = mean is the level of the pokemon
    $Trainer.numbadges is a way to check how many badges a player has
    rand(10..15) is the level it gives the pokemon based on number of badges

    Code:
    GYME4_TEAM_LIST = [
      :LEADER_BROCK,
      :LEADER_MISTY,
      :LEADER_SURGE,
      :LEADER_ERIKA,
      :LEADER_SABRINA,
      :LEADER_KOGA,
      :LEADER_BLAINE,
      :LEADER_GIOVANNI,
      :ELITE_LORELEI,
      :ELITE_BRUNO,
      :ELITE_AGATHA,
      :ELITE_LANCE,
      :ELITE_ASH
    ]
    
    Events.onTrainerPartyLoad+=proc {|sender,e|
       if e[0] # Trainer data should exist to be loaded, but may not exist somehow
         trainer=e[0][0] # A PokeBattle_Trainer object of the loaded trainer
         items=e[0][1]   # An array of the trainer's items they can use
         party=e[0][2]   # An array of the trainer's Pokémon
      # Gym Leader / E4 Battles 
      ids=GYME4_TEAM_LIST
      balance=false
      ids.each{|item|balance|=isConst?(trainer.trainertype,PBTrainers,item)
         }
         if balance
           party.each{|poke|
             mean = rand(10..15) if $Trainer.numbadges == 0
             mean = rand(16..21) if $Trainer.numbadges == 1
             mean = rand(17..24) if $Trainer.numbadges == 2
             mean = rand(20..29) if $Trainer.numbadges == 3
             mean = rand(30..43) if $Trainer.numbadges == 4
             mean = rand(35..43) if $Trainer.numbadges == 5
             mean = rand(40..47) if $Trainer.numbadges == 6
             mean = rand(40..50) if $Trainer.numbadges == 7
             mean = rand(50..75) if $Trainer.numbadges == 8
          level=mean
             poke.level=level
             poke.calcStats
           }
         end
       end
    }
     
    Last edited:
    Back
    Top