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
BAN_LIST = [:SPECIES1, :SPECIES2, ...]
if $game_switches[XXX]
for i in 0...party.length
new_species = rand(PBSpecies.maxValue) + 1
while BAN_LIST.include?(new_species)
new_species = rand(PBSpecies.maxValue) + 1
end
new_poke = pbNewPkmn(new_species, LEVEL, trainer)
party[i] = new_poke
end
end
end
}