Advertisement
TechSkylander1518

Poké Ball Swap (v20

May 19th, 2022
830
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RECEIVE_OLD = true
  2. RECEIVE_MASTER = false
  3. ItemHandlers::UseOnPokemon.addIf(proc { |item| GameData::Item.get(item).is_poke_ball? },
  4.   proc { |item, qty, pkmn, scene|
  5.     ballname = GameData::Item.get(item).name
  6.     if pkmn.poke_ball != item
  7.       if pbConfirmMessage(_INTL("Place {1} in the {2}?",pkmn.name,ballname))  { scene.pbUpdate }
  8.         pbSEPlay("Battle recall")
  9.         pbMessage(_INTL("{1} was placed in the {2}.",pkmn.name,ballname))  { scene.pbUpdate }
  10.         if RECEIVE_OLD == true
  11.           newitem = pkmn.poke_ball
  12.           newname = GameData::Item.get(newitem).name
  13.           if pkmn.poke_ball!=:MASTERBALL || RECEIVE_MASTER == true
  14.             pbSEPlay("Battle catch click")
  15.             pbMessage(_INTL("Took {1}'s old {2}.",pkmn.name,newname))  { scene.pbUpdate }
  16.             $bag.add(newitem)
  17.           else
  18.             pbSEPlay("Battle damage weak")
  19.             pbMessage(_INTL("{1}'s old {2} broke when you tried to remove it!",pkmn.name,newname))  { scene.pbUpdate }
  20.           end
  21.         end
  22.         pkmn.poke_ball = item
  23.         next true
  24.       end
  25.     end
  26.     pbMessage(_INTL("{1} is already stored in a {2}.",pkmn.name,ballname))  { scene.pbUpdate }
  27.     next false
  28.   }
  29. )
Advertisement
RAW Paste Data Copied
Advertisement