Help Making Custom Pokeball Script

DamonaArcana

Rookie
Member
Posts
1
#1
I am making a new game where there are crystals instead of pokeballs and they have certain elements to them, but I have been working on the script for three days and I haven't been able to make a "masterball effect" to certain types and fail on others. Example I want a pokeball or crystal that 100% catches poison types but 100% fails in others. Do you guys have a script I can use?
 

Vendily

Trainer
Member
Posts
80
#2
In that case, what you are looking for the IsUnconditional handler. While the master ball just returns true, no questions asked, we do get the battle and battler objects, so we can check the type.

Ruby:
BallHandlers::IsUnconditional.add(:POISONCRYSTAL,proc{|ball,battle,battler|
   next battler.pbHasType?(:POISON)
})
This would make it unconditional in the case of the pokemon having at least one type as poison. But you also want it to always fail if its not. We'd have to edit this bit here in PokeBattle_Battle to not do any shakes if x equals 0 or something. That way we can make a modify capture rate to always return 0 but because of the isUnconditional?, it will still activate properly.
Ruby:
if x>255 || BallHandlers.isUnconditional?(ball,self,battler)
          shakes=4
        else
          x=1 if x<1
          y = ( 65536 / ((255.0/x)**0.1875) ).floor
          if USECRITICALCAPTURE && pbRandom(256)<c
            critical=true
            shakes=4 if pbRandom(65536)<y
          else
            shakes+=1 if pbRandom(65536)<y
            shakes+=1 if pbRandom(65536)<y && shakes==1
            shakes+=1 if pbRandom(65536)<y && shakes==2
            shakes+=1 if pbRandom(65536)<y && shakes==3
          end
        end
Change that to this instead
Ruby:
if x>255 || BallHandlers.isUnconditional?(ball,self,battler)
          shakes=4
        elsif x != 0
          x=1 if x<1
          y = ( 65536 / ((255.0/x)**0.1875) ).floor
          if USECRITICALCAPTURE && pbRandom(256)<c
            critical=true
            shakes=4 if pbRandom(65536)<y
          else
            shakes+=1 if pbRandom(65536)<y
            shakes+=1 if pbRandom(65536)<y && shakes==1
            shakes+=1 if pbRandom(65536)<y && shakes==2
            shakes+=1 if pbRandom(65536)<y && shakes==3
          end
        end
 
Top