• 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] Adding Level Adjuster to custom Poké Ball

Adding Level Adjuster to custom Pok? Ball

Been awhile since I last need help with something in Essentials. Anyway, I made up a custom Pok? Ball that is in-line with what my OC uses when I do battles against him in Essentials or basically what he uses when I roleplay.

It is known as a Limiter Ball, and it essentially can allow the user to adjust the level of their Pokemon freely when captured in it, as well as have superior catch rate over the Ultra Ball, but still below the Master Ball in terms of catch-rate.

How would I go about adding a script to where I can access a menu to adjust the Pokemon that was captured in a Limiter Ball, similar to the Debug Menu function of changing the Pok?mon's level without the need of the Debug Menu to do the changes?
 
I threw together a whole reply for adjusting the pokemon's level upon being caught and then I realize you wanted a modification to the party screen.
In that case, we'll want to go to def pbPokemonScreen in PScreen_Party.
We'll need to add a new variable, so under
Code:
cmdItem    = -1
add
Code:
cmdLimiterBall    = -1
Now we need to decide where the command will be put in. I'll stick it in under the summary command (making it Summary, Limiter Ball, Debug, etc). So under
Code:
commands[cmdSummary=commands.length]      = _INTL("Summary")
we stick in
Code:
commands[cmdLimiterBall=commands.length]      = _INTL("Limiter Ball") if pkmn.ballused==pbGetBallType(:LIMITERBALL)
This makes it so that this option only shows up if the used pokeball is the Limiter Ball. Finally, under
Code:
      if cmdSummary>=0 && command==cmdSummary
        @scene.pbSummary(pkmnid)
(the position doesn't matter, I just want to be sure that we don't make a mistake)
Code:
      elsif cmdLimiterBall>=0 && command==cmdLimiterBall
        params=ChooseNumberParams.new
        params.setRange(1,PBExperience::MAXLEVEL)
        params.setDefaultValue(pkmn.level)
        level=Kernel.pbMessageChooseNumber(
           _INTL("Set the Pok?mon's level (max. {1}).",PBExperience::MAXLEVEL),params) { @scene.update }
        if level!=pkmn.level
          pkmn.level=level
          pkmn.calcStats
          pbDisplay(_INTL("{1}'s level was set to {2}.",pkmn.name,pkmn.level))
          pbRefreshSingle(pkmnid)
        end
This bit was literally copied from the debug stuff.
 
What if I want to force player so that he can't set the Newly caught Pokemon's level more than that of the Highest level pokemon in the Party
 
Why is your text so big? Feels like your shouting at me.
Whatever. Change this section
Code:
      elsif cmdLimiterBall>=0 && command==cmdLimiterBall
        params=ChooseNumberParams.new
        params.setRange(1,PBExperience::MAXLEVEL)
        params.setDefaultValue(pkmn.level)
        level=Kernel.pbMessageChooseNumber(
           _INTL("Set the Pokémon's level (max. {1}).",PBExperience::MAXLEVEL),params) { @scene.update }
        if level!=pkmn.level
          pkmn.level=level
          pkmn.calcStats
          pbDisplay(_INTL("{1}'s level was set to {2}.",pkmn.name,pkmn.level))
          pbRefreshSingle(pkmnid)
        end
to this
Code:
      elsif cmdLimiterBall>=0 && command==cmdLimiterBall
        params=ChooseNumberParams.new
        highlevel=1
        $Trainer.pokemonParty.for_each{|poke| highlevel=poke.level if poke.level>highlevel} if $Trainer.partyCount>0
        highlevel=PBExperience::MAXLEVEL if highlevel==1
        params.setRange(1,highlevel)
        params.setDefaultValue(pkmn.level)
        level=Kernel.pbMessageChooseNumber(
           _INTL("Set the Pokémon's level (max. {1}).",highlevel),params) { @scene.update }
        if level!=pkmn.level
          pkmn.level=level
          pkmn.calcStats
          pbDisplay(_INTL("{1}'s level was set to {2}.",pkmn.name,pkmn.level))
          pbRefreshSingle(pkmnid)
        end
 
Last edited:
Back
Top