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

Altering Pokémons' HP before fight?

  • 60
    Posts
    11
    Years
    • Seen Jul 9, 2015
    It may be a stupid question or a feature I missed but, is there any way to alter a trainer's pokemon's HP? For instace, having an ace trainer start the battle with a damaged pokémon (say 20/24 HP)?

    I figured out I could just make a copy of that pokémon so to have two same pokémons but with different starting HP (if that can even be done) but I was wondering if there's a "less dirty" way to accomplish the same thing (such as a script call to deal X damage to the trainer's pokémons before battle).

    Thanks in advance for any help!
     
    Hope I'm not too late with the answer : )
    In method pbTrainerBattle (PokemonTrainers script, line 306), there's a line that says

    trainer=pbLoadTrainer(trainerid,trainername,trainerparty)

    After this line, 'trainer' will contain loaded info about a trainer. Specifically, trainer[2] will contain trainer's Pokemon party. Now, you could play around and add an if block after that line that says something like,

    if $alter_trainer_party_hp
    for i in 0...trainer[2].length
    trainer[2].hp = 0.8 * trainer[2].totalhp
    end
    end

    Which will, if the global variable $alter_trainer_party_hp is set to 'true', set hp of all trainer's pokemon to 80% of total hp. With a few more global and/or game variables, you could customize this to do whatever you like.
     
    Back
    Top