- 13
- Posts
- 5
- Years
- Seen Jun 22, 2022
I made a custom Pokéball and wanted to share it!
The Immune Ball has an increased catch rate on Pokémon that have a type that is immune to one of your Pokémon's types. For example, if you have a Pikachu and you're battling a Diglett, then you will have an increased chance to catch because Diglett's Ground type is immune to Pikachu's Electric type.
Here's how to put an Immune Ball in your game.
In items.txt in your PBS folder, add this (replace XXX with an unused number)
Then go to PItem_PokeBalls and at the bottom of the list under "$BallTypes={" add this (replace XX with the next unused number)
Finally, still in PItem_PokeBalls, go to the very bottom of the script and add this
And that's it as far as scripting goes. You'll need to add your own icon and ball animation.
The Immune Ball has an increased catch rate on Pokémon that have a type that is immune to one of your Pokémon's types. For example, if you have a Pikachu and you're battling a Diglett, then you will have an increased chance to catch because Diglett's Ground type is immune to Pikachu's Electric type.
Here's how to put an Immune Ball in your game.
In items.txt in your PBS folder, add this (replace XXX with an unused number)
XXX,IMMUNEBALL,Immune Ball,Immune Balls,3,1000,"A rare ball that works well on Pokémon that are immune to one of your Pokémon's types.",0,2,4,
Then go to PItem_PokeBalls and at the bottom of the list under "$BallTypes={" add this (replace XX with the next unused number)
Code:
XX=>:IMMUNEBALL
Finally, still in PItem_PokeBalls, go to the very bottom of the script and add this
Code:
BallHandlers::ModifyCatchRate.add(:IMMUNEBALL,proc{|ball,catchRate,battle,battler|
pbattler=battle.battlers[0]
pbattler2=battle.battlers[2] if battle.battlers[2]
catchRate*=7/2 if (battler.pbHasType?(:FLYING) && pbattler.pbHasType?(:GROUND)) ||
(battler.pbHasType?(:FAIRY) && pbattler.pbHasType?(:DRAGON)) ||
(battler.pbHasType?(:DARK) && pbattler.pbHasType?(:PSYCHIC)) ||
(battler.pbHasType?(:FLYING) && pbattler.pbHasType?(:GROUND)) ||
(battler.pbHasType?(:STEEL) && pbattler.pbHasType?(:POISON)) ||
(battler.pbHasType?(:GHOST) && pbattler.pbHasType?(:NORMAL)) ||
(battler.pbHasType?(:GHOST) && pbattler.pbHasType?(:FIGHTING)) ||
(battler.pbHasType?(:NORMAL) && pbattler.pbHasType?(:GHOST)) ||
(battler.pbHasType?(:GROUND) && pbattler.pbHasType?(:ELECTRIC))
next catchRate
})
And that's it as far as scripting goes. You'll need to add your own icon and ball animation.
Last edited: