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
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: