• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
    10
    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!
     
  • 453
    Posts
    10
    Years
    • Seen Apr 17, 2024
    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