• 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!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Scripting Question] Trigger Held Items (Max Ether, Elixir, Max Elixir, Full Restore)

  • 4
    Posts
    5
    Years
    Hello everybody!
    I am trying to make some items that when held give the same effect of "man-made" medicines (like potions, ethers, antidotes, etc...).
    With most of them I had no problem since I just copied the script of the corresponding berries, but I'm having a few problems with the trigger and the effect of max ether, elixir, max elixir and full restore because I am really ignorant script-wise.
    Could anybody help me? I guess the easiest way is to start from the leppa berry script in the PokeBattle_Battler section but then how should I modify the script to obtain the effect I am looking for?

    Code:
    elsif isConst?(berry,PBItems,:NEWITEM)
          found=[]
          for i in [email protected]
            if @pokemon.moves[i].id!=0
              if (consume && @pokemon.moves[i].pp==0) ||
                 (!consume && @pokemon.moves[i].pp<@pokemon.moves[i].totalpp)
                found.push(i)
              end
            end
          end
          if found.length>0
            choice=(consume) ? found[0] : found[@battle.pbRandom(found.length)]
            [email protected][choice]
            pokemove.pp+=10
            pokemove.pp=pokemove.totalpp if pokemove.pp>pokemove.totalpp 
            self.moves[choice].pp=pokemove.pp
            movename=PBMoves.getName(pokemove.id)
            @battle.pbDisplay(_INTL("{1}'s {2} restored {3}'s PP!",pbThis,berryname,movename)) 
            consumed=true
          end

    Thank you in advance if anyone can help me and stay safe!
     
    Back
    Top