Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #== New Variables, add these just below EVODISABLESWITCH ==#
- MINIMUMHACHAIN = 10
- FIRSTIV = 10
- SECONDIV = 20
- THIRDIV = 30
- #== The add-ons themselves, add at the very bottom of the script ==#
- #== Gives a chance for Hidden Abilities to occur in a chain ==#
- Events.onWildPokemonCreate+=proc{|sender,e| #Hidden Ability
- next if !$PokemonTemp.rescuechain
- pokemon =e[0]
- family=pbGetBabySpecies(pokemon.fSpecies)
- next if family != $PokemonTemp.rescuechain[1]
- if rand($PokemonTemp.rescuechain[0]) > MINIMUMHACHAIN
- pokemon.setAbility(2)
- end
- }
- #== Gives a chance for up to three guaranteed perfect IVs in a chain ==#
- Events.onWildPokemonCreate+=proc{|sender,e| #IVs
- next if !$PokemonTemp.rescuechain
- pokemon =e[0]
- family=pbGetBabySpecies(pokemon.fSpecies)
- next if family != $PokemonTemp.rescuechain[1]
- randomivs = rand($PokemonTemp.rescuechain[0]) #used to determine how many ivs will be perfect
- if randomivs >= FIRSTIV && randomivs < SECONDIV # One perfect IV
- setIVOne = rand(5)
- pokemon.iv[setIVOne] = 31
- end
- if randomivs >= SECONDIV && randomivs < THIRDIV # Two perfect IVs
- setIVOne,setIVTwo = [rand(5),rand(5)]
- while setIVOne == setIVTwo
- setIVTwo = rand(5)
- end
- pokemon.iv[setIVOne] = 31
- pokemon.iv[setIVTwo] = 31
- end
- if randomivs >= THIRDIV # Three perfect IVs (maximum)
- setIVOne,setIVTwo,setIVThree = [rand(5),rand(5),rand(5)]
- while setIVOne == setIVTwo || setIVOne == setIVThree || setIVTwo == setIVThree
- setIVOne,setIVTwo,setIVThree = [rand(5),rand(5),rand(5)]
- end
- pokemon.iv[setIVOne] = 31
- pokemon.iv[setIVTwo] = 31
- pokemon.iv[setIVThree] = 31
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement