Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Settings
- #The game variable that stores the player's choice of starter
- STARTER_CHOICE = 7
- #The starters used by the rival, depending on the variable.
- #Remember, it starts at 0.
- RIVAL_STARTERS = [:CHARMANDER,:BULBASAUR,:SQUIRTLE]
- #The starter uses pbBalancedLevel to get its level.
- #pbBalancedLevel is the average level of the party +2.
- #LEVEL_BOOST will be added to increase it further.
- LEVEL_BOOST = 50
- end
- def pbRivalStarter(pkmn)
- GameData::Stat.each_main do |s|
- pkmn.iv[s.id] = 31
- end
- case $game_variables[Settings::STARTER_CHOICE]
- when 0
- pkmn.item = :CHARCOAL if pkmn.level > 30
- when 1
- pkmn.item = :MYSTICWATER if pkmn.level > 30
- when 2
- pkmn.item = :MIRACLESEED if pkmn.level > 30
- end
- end
- Events.onTrainerPartyLoad += proc { |_sender, trainer|
- if trainer
- party = trainer[0].party
- if party.length < 6
- species = Settings::RIVAL_STARTERS[$game_variables[Settings::STARTER_CHOICE]]
- level = pbBalancedLevel(party) + Settings::LEVEL_BOOST
- pkmn = Pokemon.new(species,level)
- loop do
- newspecies = pkmn.check_evolution_on_level_up
- if newspecies
- pkmn.species = newspecies
- else
- break
- end
- end
- pkmn.reset_moves
- pkmn.calc_stats
- pbRivalStarter(pkmn)
- party.push(pkmn)
- end
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement