• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Resource icon

Resource Hidden Abilities by Percentage 2.1

Mashirosakura

With my wishes frozen in time and long forgotten
Discord Mod
Mashirosakura submitted a new resource:

Making wild Pokémon have their Hidden Abilities by percentage - No need for events, or adding to their natural ability pool!

Have you ever wanted to make wild Pokémon have their Hidden Ability, but not by event, or adding it in the PBS alongside their normal abilities? To have a smaller chance of finding the ability?
Well, looks like I have the thing for you. It's a really simple code, but it's easy to modify the percentage to make it easier or harder to obtain.

Post the following code at the bottom of PField_EncounterModifiers:
Code:
Expand Collapse Copy
# Make all wild Pokémon have a chance to have their hidden ability...

Read more about this resource...
 
For anyone that wants to have gifted Pokemon have a 5% chance of Hidden Ability as well, follow the following steps (note that if you have Pokemon that have more than one Hidden Abiliity, then this script will only set the first listed one; there is a fix for that at the end of the section for each version):

In "PokemonUtilities", search for "pbSeenForm(pokemon) if seeform" (without quotes), then add the following lines immediately after the first result's line:

Ruby:
Expand Collapse Copy
  if rand(20) < 1
    pokemon.setAbility(2)
  end

If you have Pokemon with more than 1 Hidden Ability, then you'll need to use this code instead:

Ruby:
Expand Collapse Copy
  if rand(20) < 1
    pokemon.setAbility(rand(4)+2)
  end

Note that if any Pokemon has only 1, 2, or 3 Hidden Abilities, and it hits a number higher than that number, it will default to the first regular Ability, so be sure to fill all empty Hidden Ability slots with duplicates if possible to remedy this.

And then you're done!

In "PSystem_PokemonUtilities", search for "pbSeenForm(pokemon) if seeform" (without quotes), then add the following lines immediately after the first result's line:

Ruby:
Expand Collapse Copy
  if rand(20) < 1
    pokemon.setAbility(2)
  end

If you have Pokemon with more than 1 Hidden Ability, then you'll need to use this code instead:

Ruby:
Expand Collapse Copy
  if rand(20) < 1
    pokemon.setAbility(rand(4)+2)
  end

Note that if any Pokemon has only 1, 2, or 3 Hidden Abilities, and it hits a number higher than that number, it will default to the first regular Ability, so be sure to fill all empty Hidden Ability slots with duplicates if possible to remedy this.

And then you're done!

In Utilities_Pokemon, search for "register(pkmn) if see_form" (without quotes), then add the following lines immediately after the first result's line:

Ruby:
Expand Collapse Copy
  if rand(20) < 1
    pkmn.ability_index = 2
  end

If you have Pokemon with more than 1 Hidden Ability, then you'll need to use this code instead:

Ruby:
Expand Collapse Copy
  if rand(20) < 1
    pkmn.ability_index = rand(4)+2
  end

Note that if any Pokemon has only 1, 2, or 3 Hidden Abilities, and it hits a number higher than that number, it will default to the first regular Ability, so be sure to fill all empty Hidden Ability slots with duplicates if possible to remedy this.

And then you're done!

You're welcome!
 
Last edited:
Does anyone know how to make it work in pokemon essentials v20?
# Make all wild Pokémon have a chance to have their hidden ability.
EventHandlers.add(:on_wild_pokemon_created, :give_hidden_ability,
proc { |pkmn|
pkmn.ability_index = 2 if rand(20) <1
}
)

I tested and it works for me
 
Back
Top