• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist 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.

Pokeballs after battle - Like in LGPE

#Not Important

All hail the wishmaker
  • 905
    Posts
    5
    Years
    Makes trainers give you pokeballs after you beat them...
    Short script

    Make sure that any trainer you want to give balls out has pbTrainerEnd at the end of its event

    Code:
    #-------------------------------------------------------------------------------
    #     Pokeballs after battle script by #NI
    #
    #     No need to credit
    #
    #-------------------------------------------------------------------------------
    ACTIVE = true #if the script is active...
    #-------------------------------------------------------------------------------
    #                                  </>
    module InterpreterFieldMixin
      def pbTrainerEnd
        pbGlobalUnlock
        e = get_character(0)
        e.erase_route if e
        if ACTIVE
          amt = rand(3)
          Kernel.pbItemBall(:POKEBALL,amt)
        end
      end
    end
     
    Last edited:
    Hello!

    Is it normal that I get the pokéballs even when the player has lost the battle?

    How could I change that?
     
    Change to this:
    Code:
    CHANCE = 20 #The chance that the player will get the pokéballs (/100)
    module InterpreterFieldMixin
      def pbTrainerEnd
        pbGlobalUnlock
        e = get_character(0)
        e.erase_route if e
        if ACTIVE
          chance = rand(10)
          schance = (CHANCE/10).floor
          amt = rand(3)
          Kernel.pbItemBall(:POKEBALL,amt) if chance<=schance
        end
      end
    end
     
    Hello
    I have already asked the question but no one has answered.
    Is it possible that the player does not win Pokéball when he loses the battle?
    And, is it possible to create an exception for certain trainer classes such as Rival or Gyms Leaders ?

    Tanks!
     
    Change to this:
    Code:
    CHANCE = 20 #The chance that the player will get the pokéballs (/100)
    module InterpreterFieldMixin
      def pbTrainerEnd
        pbGlobalUnlock
        e = get_character(0)
        e.erase_route if e
        if ACTIVE
          chance = rand(10)
          schance = (CHANCE/10).floor
          amt = rand(3)
          Kernel.pbItemBall(:POKEBALL,amt) if chance<=schance
        end
      end
    end

    Thank you so much :D
     
    Back
    Top