• 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.
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...
 

Mashirosakura

With my wishes frozen in time and long forgotten
Discord Mod

Maq47

Novice
Member
Joined
Sep 12, 2021
Posts
16
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:

StarWolff

Cooltrainer
Member
Joined
Aug 23, 2021
Posts
238
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
 

Mashirosakura

With my wishes frozen in time and long forgotten
Discord Mod

Mashirosakura

With my wishes frozen in time and long forgotten
Discord Mod
Back
Top