Advertisement
JoelMatthews

Vendily's Rescue Script Add-ons

Jun 29th, 2019
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.70 KB | None | 0 0
  1. #== New Variables, add these just below EVODISABLESWITCH ==#
  2. MINIMUMHACHAIN      = 10
  3. FIRSTIV             = 10
  4. SECONDIV            = 20
  5. THIRDIV             = 30
  6.  
  7. #== The add-ons themselves, add at the very bottom of the script ==#
  8. #== Gives a chance for Hidden Abilities to occur in a chain ==#
  9. Events.onWildPokemonCreate+=proc{|sender,e| #Hidden Ability
  10.    next if !$PokemonTemp.rescuechain
  11.    pokemon =e[0]
  12.    family=pbGetBabySpecies(pokemon.fSpecies)
  13.    next if family != $PokemonTemp.rescuechain[1]
  14.    if rand($PokemonTemp.rescuechain[0]) > MINIMUMHACHAIN
  15.      pokemon.setAbility(2)
  16.    end
  17. }
  18.  
  19. #== Gives a chance for up to three guaranteed perfect IVs in a chain ==#
  20. Events.onWildPokemonCreate+=proc{|sender,e| #IVs
  21.   next if !$PokemonTemp.rescuechain
  22.   pokemon =e[0]
  23.   family=pbGetBabySpecies(pokemon.fSpecies)
  24.   next if family != $PokemonTemp.rescuechain[1]
  25.   randomivs = rand($PokemonTemp.rescuechain[0]) #used to determine how many ivs will be perfect
  26.   if randomivs >= FIRSTIV && randomivs < SECONDIV # One perfect IV
  27.     setIVOne = rand(5)
  28.     pokemon.iv[setIVOne] = 31
  29.   end
  30.   if randomivs >= SECONDIV && randomivs < THIRDIV # Two perfect IVs
  31.     setIVOne,setIVTwo = [rand(5),rand(5)]
  32.     while setIVOne == setIVTwo
  33.       setIVTwo = rand(5)
  34.     end
  35.     pokemon.iv[setIVOne] = 31
  36.     pokemon.iv[setIVTwo] = 31  
  37.     end
  38.   if randomivs >= THIRDIV # Three perfect IVs (maximum)
  39.     setIVOne,setIVTwo,setIVThree = [rand(5),rand(5),rand(5)]
  40.     while setIVOne == setIVTwo || setIVOne == setIVThree || setIVTwo == setIVThree
  41.       setIVOne,setIVTwo,setIVThree = [rand(5),rand(5),rand(5)]
  42.     end
  43.     pokemon.iv[setIVOne] = 31
  44.     pokemon.iv[setIVTwo] = 31
  45.     pokemon.iv[setIVThree] = 31
  46.   end
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement