• 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!
  • 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] Mom PC Gift Pokemon

  • 3
    Posts
    3
    Years
    • Seen Feb 20, 2023
    Hi all,

    I would like an event that triggers after deafeating a gym leader that automatically runs and deposites a pokemon into an empty spot in the PC (not the party) without any notification that this has happened. Than Mom calls (not sure on the timing here) using the phone and tells you that she has emailed you a [pokemon species].

    I believe I could event this and figure out the phone call, the only issue I have is an actual script that automatically deposites the pokemon into the PC and that does so without a notification (most likly meaning the player can not give nicknames). All the scripts I have seen on the Wiki will give the pokemon directly to the player if they have room in the party.

    Any help is appreciated.
     
    You'll need to add a new script for this functionality.
    Either add this code after pbAddPokemonSilent or add it in a new section above main.

    Code:
    #===============================================================================
    # Giving Pokémon to the player (silent and will send straight to storage)
    #===============================================================================
    def pbAddPokemonSilentPC(pkmn, level = 1, see_form = true)
      return false if !pkmn || pbBoxesFull?
      pkmn = Pokemon.new(pkmn, level) if !pkmn.is_a?(Pokemon)
      $Trainer.pokedex.register(pkmn) if see_form
      $Trainer.pokedex.set_owned(pkmn.species)
      pkmn.record_first_moves
      $PokemonStorage.pbStoreCaught(pkmn)
      return true
    end

    Use pbAddPokemonSilentPC as you would pbAddPokemonSilent (see wiki).
    This is untested but it should work.
     
    Back
    Top