venom12314

PokemonCLoning v1.0.1

Oct 30th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. class PokemonGlobalMetadata
  2. attr_accessor :clone_backup
  3. def clone_backup ; @clone_backup=[] if !@clone_backup ; return @clone_backup ; end
  4. end
  5.  
  6. ITEM_CLONE=true
  7.  
  8. def pbClonePokemon(ableProc=nil,allowIneligible=nil)
  9. chosen=0
  10. pbFadeOutIn(99999){
  11. scene = PokemonParty_Scene.new
  12. screen = PokemonPartyScreen.new(scene,$Trainer.party)
  13. if ableProc
  14. chosen=screen.pbChooseAblePokemon(ableProc,allowIneligible)
  15. else
  16. screen.pbStartScene(_INTL("Choose a Pokémon."),false)
  17. chosen = screen.pbChoosePokemon
  18. screen.pbEndScene
  19. end
  20. }
  21. if chosen>=0
  22. $PokemonGlobal.clone_backup=[]
  23. $PokemonGlobal.clone_backup.push($Trainer.party[chosen])
  24. p $PokemonGlobal.clone_backup
  25. poke=PokeBattle_Pokemon.new($PokemonGlobal.clone_backup[0].species,$PokemonGlobal.clone_backup[0].level,$Trainer)
  26. poke.setAbility($PokemonGlobal.clone_backup[0].ability)
  27. poke.status=$PokemonGlobal.clone_backup[0].status
  28. poke.setGender($PokemonGlobal.clone_backup[0].otgender)
  29. for i in 0...6
  30. poke.iv[i]=$PokemonGlobal.clone_backup[0].iv[i]
  31. poke.ev[i]=$PokemonGlobal.clone_backup[0].ev[i]
  32. poke.ev[i]-=4 if poke.ev[i]>4
  33. end
  34. for moves in 0...4
  35. poke.moves[moves]=$PokemonGlobal.clone_backup[0].moves[moves]
  36. end
  37. poke.item=$PokemonGlobal.clone_backup[0].item if ITEM_CLONE
  38. poke.ballused=$PokemonGlobal.clone_backup[0].ballused
  39. poke.happiness=$PokemonGlobal.clone_backup[0].happiness
  40. poke.setNature($PokemonGlobal.clone_backup[0].nature)
  41. pbAddPokemon(poke)
  42. $PokemonGlobal.clone_backup.clear
  43. else
  44. return false
  45. end
  46. end
Advertisement
Add Comment
Please, Sign In to add comment