Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://reliccastle.com/resources/817/
- #Whether the player should receive the Pokemon's old Poke Ball to use again
- RECEIVE_OLD = true
- #Whether the player should receive a Master Ball doing this. (Note that they could have unlimited Master Balls doing this)
- RECEIVE_MASTER = false
- ItemHandlers::UseOnPokemon.addIf(proc { |item| GameData::Item.get(item).is_poke_ball? },
- proc { |item,pkmn,scene|
- ballname = GameData::Item.get(item).name
- if pkmn.poke_ball != item
- if pbConfirmMessage(_INTL("Place {1} in the {2}?",pkmn.name,ballname))
- pbMessage(_INTL("{1} was placed in the {2}.",pkmn.name,ballname))
- if RECEIVE_OLD == true
- newitem = pkmn.poke_ball
- newname = GameData::Item.get(newitem).name
- if pkmn.poke_ball!=:MASTERBALL || RECEIVE_MASTER == true
- pbMessage(_INTL("Took {1}'s old {2}.",pkmn.name,newname))
- $PokemonBag.pbStoreItem(newitem)
- else
- pbMessage(_INTL("{1}'s old {2} broke when you tried to remove it!",pkmn.name,newname))
- end
- end
- pkmn.poke_ball = item
- next true
- end
- end
- pbMessage(_INTL("{1} is already stored in a {2}.",pkmn.name,ballname))
- next false
- }
- )
- #Remember to set the usability outside of battle for all Poke Balls to 1 (use on a Pokemon, consumed after use)
Add Comment
Please, Sign In to add comment