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

[Scripting Question] Adding Level Adjuster to custom Poké Ball

142
Posts
15
Years
  • 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?
     
    1,682
    Posts
    8
    Years
    • Seen today
    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.
     
    3
    Posts
    6
    Years
  • 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
     
    1,682
    Posts
    8
    Years
    • Seen today
    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