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

[Scripting Question] Custom Ability that Increases Capture Rate.

  • 41
    Posts
    4
    Years
    • Seen Sep 19, 2023
    Hey everyone,
    I've had the idea for a Pokemon whose main purpose is to assist its trainer in catching other Pokemon. Giving it good status moves, false swipe, and a custom signature false swipe move that's more powerful. However, I also wanted to give it a signature Ability that increases the capture rate of wild pokemon while it is the one on the field. Is there a way to script this?

    I'm not the best with scripting so explaining it to me like i'm an idiot would be helpful.
     
    Last edited:
    I'll assume you want the ability to increase the capture rate by a certain percentage. The function "def pbCaptureCalc(pkmn,battler,rareness,ball)" inside the script section PokeBattle_BattleCommon calculates the capture chance any time you try to catch a Pokemon. Find this function, then find this line and add the code under it:
    Code:
    y = ( 65536 / ((255.0/x)**0.1875) ).floor # FIND this line
    # ADD this code below
    eachSameSideBattler do |b|
      y = (y*1.5).floor if b.hasActiveAbility?(:YOURNEWABILITY)
    end
    The way this works is that it checks all Pokemon you have on your side, so in a single battle, it checks the one Pokemon you sent out, in a double battle, it checks the two that you sent out, and so on. If it finds a Pokemon with your new ability, it will increase the catch rate by 50% (done by multiplying y by 1.5, but you can change this number to whatever you like). This means that in a double battle, if both of the Pokemon you sent out have this ability, then it will actually increase by 125% (1.5 * 1.5 * y = 2.25 * y = 125% increase), but if only one of the two Pokemon have this ability then it will only be 50% (same for a single battle).
     
    Back
    Top