Essentials Docs Wiki

The Essentials wiki has moved and is now at: Essentials Engine wiki

This wiki will no longer be updated.

READ MORE

Essentials Docs Wiki
Advertisement
Evolution

Pikachu is evolving!

For defining evolutions for particular species, see Defining a species.

This page describes Pokémon evolution. It details the different evolution methods available by default, and explains how to create new evolution methods.

Evolution methods[]

Pokémon can evolve in a variety of different ways, such as gaining a level or gaining a new owner, or if it just really likes you. Nearly all evolution methods that exist in the Pokémon games have been coded into Essentials. You can even invent a few new methods of your own.

The evolution paths for a species are listed in the PBS files "pokemon.txt" and "pokemon_forms.txt" as a series of comma-separated triplets. Each triplet describes one evolution branch, and contains the following information:

  1. The ID of the species to evolve into.
  2. The name of the evolution method used.
  3. A special parameter the evolution method may use, such as a level number or item's ID.

Each evolution method is checked in the order they are listed in the PBS file. If the Pokémon being checked can evolve through several different methods, and fulfils the criteria for more than one of them at the same time (e.g. Eevee can fulfil both happiness and location at the same time), it will evolve using the one that is listed first and ignore the others.

The code for all evolution methods is in the script section Evolution. The code is modular, however, and can be placed in another script section, e.g. to help you keep track of new things you've added. Note that some of the defined evolution methods are unused by default.

Levelling-up evolution methods[]

Most evolution methods are checked when a Pokémon levels up. They have a "level_up_proc" defined. They are:

Method Parameter Description
Level Level The Pokémon will evolve if its level is greater than or equal to the parameter.
LevelMale Level The Pokémon will evolve if it is male and its level is greater than or equal to the parameter.
LevelFemale Level The Pokémon will evolve if it is female and its level is greater than or equal to the parameter.
LevelDay Level The Pokémon will evolve if its level is greater than or equal to the parameter and it is currently daytime.
LevelNight Level The Pokémon will evolve if its level is greater than or equal to the parameter and it is currently night-time.
LevelMorning Level The Pokémon will evolve if its level is greater than or equal to the parameter and it is currently the morning.
LevelAfternoon Level The Pokémon will evolve if its level is greater than or equal to the parameter and it is currently the afternoon.
LevelEvening Level The Pokémon will evolve if its level is greater than or equal to the parameter and it is currently the evening.
LevelNoWeather Level The Pokémon will evolve if its level is greater than or equal to the parameter and the overworld weather is clear (i.e. there is no weather).
LevelSun Level The Pokémon will evolve if its level is greater than or equal to the parameter and the overworld weather is strong sunlight.
LevelRain Level The Pokémon will evolve if its level is greater than or equal to the parameter and the overworld weather is rain, heavy rain or stormy.
LevelSnow Level The Pokémon will evolve if its level is greater than or equal to the parameter and the overworld weather is snow or a blizzard.
LevelSandstorm Level The Pokémon will evolve if its level is greater than or equal to the parameter and the overworld weather is a sandstorm.
LevelCycling Level The Pokémon will evolve if its level is greater than or equal to the parameter and the player is currently cycling.
LevelSurfing Level The Pokémon will evolve if its level is greater than or equal to the parameter and the player is currently surfing.
LevelDiving Level The Pokémon will evolve if its level is greater than or equal to the parameter and the player is currently diving.
LevelDarkness Level The Pokémon will evolve if its level is greater than or equal to the parameter and the player is currently in a map that has a darkness circle (regardless of whether Flash has expanded it).
LevelDarkInParty Level The Pokémon will evolve if its level is greater than or equal to the parameter and the player has a Dark-type Pokémon in their party.
AttackGreater Level The Pokémon will evolve if its level is greater than or equal to the parameter and its Attack stat is greater than its Defense stat.
AtkDefEqual Level The Pokémon will evolve if its level is greater than or equal to the parameter and its Attack stat is equal to its Defense stat.
DefenseGreater Level The Pokémon will evolve if its level is greater than or equal to the parameter and its Attack stat is lower than its Defense stat.
Silcoon Level The Pokémon will evolve if its level is greater than or equal to the parameter and the last digit of the upper half of its decimalised personal ID number is between 0 and 4 inclusive.
Cascoon Level The Pokémon will evolve if its level is greater than or equal to the parameter and the last digit of the upper half of its decimalised personal ID number is between 5 and 9 inclusive.
Ninjask Level Identical to "Level".
Happiness - The Pokémon will evolve if its happiness is 220 or higher. This number is hardcoded.
HappinessMale - The Pokémon will evolve if it is male and its happiness is 220 or higher. This number is hardcoded.
HappinessFemale - The Pokémon will evolve if it is female and its happiness is 220 or higher. This number is hardcoded.
HappinessDay - The Pokémon will evolve if its happiness is 220 or higher (this number is hardcoded) and it is currently daytime.
HappinessNight - The Pokémon will evolve if its happiness is 220 or higher (this number is hardcoded) and it is currently night-time.
HappinessMove Move The Pokémon will evolve if its happiness is 220 or higher (this number is hardcoded) and it knows the move given in the parameter.
HappinessMoveType Type The Pokémon will evolve if its happiness is 220 or higher (this number is hardcoded) and it knows any move of the type given in the parameter.
HappinessHoldItem Item The Pokémon will evolve if its happiness is 220 or higher (this number is hardcoded) and it is holding the item given in the parameter. The item is consumed.
MaxHappiness - The Pokémon will evolve if its happiness is 255. This number is hardcoded.
Beauty Number The Pokémon will evolve if its beauty is equal to or higher than the parameter.
HoldItem Item The Pokémon will evolve if it is holding the item given in the parameter. The item is consumed.
HoldItemMale Item The Pokémon will evolve if it is male and is holding the item given in the parameter. The item is consumed.
HoldItemFemale Item The Pokémon will evolve if it is female and is holding the item given in the parameter. The item is consumed.
DayHoldItem Item The Pokémon will evolve if it is holding the item given in the parameter and it is currently daytime. The item is consumed.
NightHoldItem Item The Pokémon will evolve if it is holding the item given in the parameter and it is currently night-time. The item is consumed.
HoldItemHappiness Item The Pokémon will evolve if its happiness is 220 or higher (this number is hardcoded) and it is holding the item given in the parameter. The item is consumed.
HasMove Move The Pokémon will evolve if it knows the move given in the parameter.
HasMoveType Type The Pokémon will evolve if it knows any move of the type given in the parameter.
HasInParty Species The Pokémon will evolve if the player's party contains a Pokémon whose species is given in the parameter.
Location Number The Pokémon will evolve if the player is currently in a map whose ID number is given in the parameter.
LocationFlag String The Pokémon will evolve if the player is currently in a map whose map metadata contains a flag that matches the parameter.
Region Number The Pokémon will evolve if the player is currently in a map that is part of a region whose ID number is given in the parameter.

Using an item evolution methods[]

These evolution methods are checked when an item (typically an evolution stone) is used on a Pokémon. They have a "use_item_proc" defined. Evolutions triggered this way cannot be cancelled. They are:

Method Parameter Description
Item Item The Pokémon will evolve if the item used is given in the parameter.
ItemMale Item The Pokémon will evolve if it is male and the item used is given in the parameter.
ItemFemale Item The Pokémon will evolve if it is female and the item used is given in the parameter.
ItemDay Item The Pokémon will evolve if it is currently daytime and the item used is given in the parameter.
ItemNight Item The Pokémon will evolve if it is currently night-time and the item used is given in the parameter.
ItemHappiness Item The Pokémon will evolve if its happiness is 220 or higher (this number is hardcoded) and the item used is given in the parameter.

Trade evolution methods[]

These evolution methods are checked when a Pokémon is received in a trade. They have an "on_trade_proc" defined. Evolutions triggered this way cannot be cancelled. They are:

Method Parameter Description
Trade - The Pokémon will evolve.
TradeMale - The Pokémon will evolve if it is male.
TradeFemale - The Pokémon will evolve if it is female.
TradeDay - The Pokémon will evolve if it is currently daytime.
TradeNight - The Pokémon will evolve if it is currently night-time.
TradeItem Item The Pokémon will evolve if it is holding the item given in the parameter. The item is consumed.
TradeSpecies Species The Pokémon will evolve if the other Pokémon that was traded away was the species given in the parameter and wasn't holding an Everstone.

After every battle evolution methods[]

These evolution methods are checked after every battle (if the setting CHECK_EVOLUTION_AFTER_ALL_BATTLES is set to true) or after every battle the player wins/finishes by catching a Pokémon. They have an "after_battle_proc" defined. There is only one such evolution method, which is:

Method Parameter Description
BattleDealCriticalHit Number The Pokémon will evolve if the number of critical hits dealt by the Pokémon during the battle is greater than or equal to the number given in the parameter.

Manually triggered evolution methods[]

These evolution methods are triggered manually, usually by an event. The trigger is calling the script pbEvolutionEvent(number), where number is an identifying number for a particular triggering event (such as reading a scroll or walking under a bridge). The same number should not be used by multiple evolution methods of this kind.

By default, the numbers are:

  • 1: Kubfu -> Urshifu (Kubfu's form should be manually set before calling pbEvolutionEvent(1) to ensure it evolves into the appropriate form of Urshifu)
  • 2: Galarian Yamask -> Runerigus (uses "EventAfterDamageTaken")

They have an "event_proc" defined. They are:

Method Parameter Description
Event Number The Pokémon will evolve when pbEvolutionEvent(number) is called, and number is equal to the number given in the parameter.
EventAfterDamageTaken Number The Pokémon will evolve when pbEvolutionEvent(number) is called, and number is equal to the number given in the parameter, but only if pkmn.ready_to_evolve is true. pkmn.ready_to_evolve is set to true after a battle in which the Pokémon took 49 or more total damage (this number is hardcoded) from direct attacks, and is reset to false if the Pokémon is fully healed at a Poké Center or if it faints.

Code run after evolution[]

Some evolution methods run additional code after they successfully evolve a Pokémon. This additional code is defined in an "after_evolution_proc". After the evolution happens, every evolution path for the old species is checked, and the first one whose evolution method has an "after_evolution_proc" defined for it and that evolution path produces the new species will have that "after_evolution_proc" code run.

This additional code is usually to remove the Pokémon's held item if the evolution method involved it, but there is one evolution method which only has this additional code:

Method Parameter Description
Shedinja - If there is an empty space in the player's party and there is a regular Poké Ball in the Bag, the Pokémon that just evolved is duplicated and the copy is turned into the species given for this method (e.g. Shedinja). The Poké Ball is consumed.

Examples[]

Evolutions = IVYSAUR,Level,16

The evolution path of Bulbasaur. It has only one evolution method, which is evolving through level up at Level 16 (or higher) into Ivysaur.

Evolutions = TOGETIC,Happiness,

The evolution path of Togepi. It has only one evolution method, which is evolving when happy enough into Togetic. Note the comma at the end of this line - the third entry of this triplet is still included, even though it is blank. Every evolution path must be a triplet (i.e. contain two commas).

Evolutions = VAPOREON,Item,WATERSTONE,JOLTEON,Item,THUNDERSTONE,FLAREON,Item,FIRESTONE,LEAFEON,LocationFlag,MossRock,LEAFEON,Item,LEAFSTONE,GLACEON,LocationFlag,IceRock,GLACEON,Item,ICESTONE,SYLVEON,HappinessMoveType,FAIRY,ESPEON,HappinessDay,,UMBREON,HappinessNight,

The evolution paths of Eevee. It has ten evolution methods, as follows:

  • Use a Water Stone on it to evolve into Vaporeon.
  • Use a Thunder Stone on it to evolve into Jolteon.
  • Use a Fire Stone on it to evolve into Flareon.
  • Level up on a map whose metadata contains the "MossRock" flag to evolve into Leafeon.
  • Use a Leaf Stone on it to evolve into Leafeon.
  • Level up on a map whose metadata contains the "IceRock" flag to evolve into Glaceon.
  • Use an Ice Stone on it to evolve into Glaceon.
  • Level up when happy enough and knowing a Fairy-type move to evolve into Sylveon.
  • Level up when happy enough during the day to evolve into Espeon.
  • Level up when happy enough during the night to evolve into Umbreon.

Note the order in which these are listed. They are checked in order, so evolving into Leafeon/Glaceon takes priority over evolving into Sylveon, which in turn takes priority over evolving into Espeon/Umbreon. Note that evolving into Leafeon/Glaceon can be done in two different ways.

Evolutions = NINJASK,Ninjask,20,SHEDINJA,Shedinja,20

The evolution paths of Nincada. It uses the twin evolution methods of "Ninjask" and "Shedinja":

  • "Ninjask" evolves the Nincada into a Ninjask at/above Level 20, just like "Level" does.
  • "Shedinja" immediately duplicates the Ninjask (if there is an empty spot in the player's party and a spare Poké Ball), and turns the duplicate into a Shedinja.

Note that these methods are named after members of the Nincada family only because they are the only Pokémon that exhibit this behaviour. Fakemon can use these methods just as easily.

Creating a new evolution method[]

The evolution methods are defined in the script section Evolution. Each one is registered in GameData::Evolution, and has multiple properties which are:

Property Description
:id The ID of the evolution method. This is written in the PBS file "pokemon.txt"/"pokemon_forms.txt".
:parameter Determines what the parameter defined for this evolution method represents.
  • Integer (a whole number 0 or greater; could be a level number, a map ID, a region number, etc.)
  • String (a piece of text, usually the name of a flag defined in a PBS file)
  • A GameData class written as a symbol, e.g. :Move, :Type, :Item, :Species, :Ability (other GameData classes can be used, but the in-game "pokemon.txt" editor will not allow you to choose a property from that GameData class for an evolution path for a species)

If undefined, then the parameter will be a number.

If nil, the parameter will be blank and unused.

:any_level_up If true, the evolution method does not care about the Pokémon's level, only that it levelled up. If false or undefined, the "parameter" property is assumed to be a level number (it is the minimum level that the evolved species can be). This only needs to be defined for evolution methods using the "level_up_proc" property.

This is only used for generating Pokémon for Battle Facility challenges, to ensure Pokémon with illegal levels are not used.

:level_up_proc Code that is run after a Pokémon levels up (at the end of battle, or after using a Rare Candy or other Exp-adding item). It will next true if the Pokémon can evolve with that method, and next false if it cannot.
:use_item_proc Code that is run to determine whether an evolution-inducing item can be used on a Pokémon. It will next true if the Pokémon can evolve with that method, and next false if it cannot.
:on_trade_proc Code that is run after a Pokémon is received in a trade. It will next true if the Pokémon can evolve with that method, and next false if it cannot. The other Pokémon involved in that trade is also provided as an argument, if needed.
:after_battle_proc Code that is run after every battle that didn't end in a loss/draw for the player (or after every battle if the setting CHECK_EVOLUTION_AFTER_ALL_BATTLES is true). It will next true if the Pokémon can evolve with that method, and next false if it cannot.
:event_proc Code that is run by calling pbEvolutionEvent(number), where number is an identifying number for the particular event that triggers the evolution. It will next true if the Pokémon can evolve with that method, and next false if it cannot.
:after_evolution_proc Code that is run after a Pokémon evolves. It may remove the Pokémon's held item (if the evolution method is one that required a held item), or it may duplicate the Pokémon and change its species (i.e. for Shedinja).

Here are some examples:

GameData::Evolution.register({
  :id            => :Level,
  :parameter     => Integer,
  :level_up_proc => proc { |pkmn, parameter|
    next pkmn.level >= parameter
  }
})
GameData::Evolution.register({
  :id            => :Happiness,
  :any_level_up  => true,   # Needs any level up
  :level_up_proc => proc { |pkmn, parameter|
    next pkmn.happiness >= (Settings::APPLY_HAPPINESS_SOFT_CAP ? 160 : 220)
  }
})
GameData::Evolution.register({
  :id                   => :HoldItem,
  :parameter            => :Item,
  :any_level_up         => true,   # Needs any level up
  :level_up_proc        => proc { |pkmn, parameter|
    next pkmn.item == parameter
  },
  :after_evolution_proc => proc { |pkmn, new_species, parameter, evo_species|
    next false if evo_species != new_species || !pkmn.hasItem?(parameter)
    pkmn.item = nil   # Item is now consumed
    next true
  }
})
GameData::Evolution.register({
  :id            => :Item,
  :parameter     => :Item,
  :use_item_proc => proc { |pkmn, parameter, item|
    next item == parameter
  }
})
GameData::Evolution.register({
  :id            => :TradeSpecies,
  :parameter     => :Species,
  :on_trade_proc => proc { |pkmn, parameter, other_pkmn|
    next pkmn.species == parameter && !other_pkmn.hasItem?(:EVERSTONE)
  }
})
GameData::Evolution.register({
  :id                => :BattleDealCriticalHit,
  :parameter         => Integer,
  :after_battle_proc => proc { |pkmn, party_index, parameter|
    next $game_temp.party_critical_hits_dealt &&
         $game_temp.party_critical_hits_dealt[party_index] &&
         $game_temp.party_critical_hits_dealt[party_index] >= parameter
  }
})
GameData::Evolution.register({
  :id         => :Event,
  :parameter  => Integer,
  :event_proc => proc { |pkmn, parameter, value|
    next value == parameter
  }
})

As mentioned above, this code is modular, which means you can write the code for your new evolution methods in a new script section to help keep track of content you have added.

Possible new evolution methods[]

There is a great deal of flexibility in what an evolution method can be. You can check any aspect of the Pokémon wanting to evolve (pkmn), use any kind of GameData class to determine what the parameter represents (parameter), or refer to any recorded aspect in the game (e.g. weather, location). You can even keep track of additional factors, such as the number of critical hits dealt or amount of damage taken in a battle.

The exact code you'll need to use for your custom evolution method will obviously depend on what you want it to do. This wiki page cannot describe at a general level what to do; however, some ideas are:

  • Create variants of existing methods, e.g. one that occurs if the Pokémon has a certain happiness value or less (i.e. the opposite of "Happiness").
  • Merge two or more existing methods together into a new one. Remember that you only have one parameter to work with, though.
  • Evolution that depends on the Pokémon's nature or form or total EVs, or if a given stat has risen above a particular value.
  • Fusion evolution (e.g. for Magnemite/Slowpoke). Check that there is a Shellder in the party, and if so, delete it and evolve the levelled-up Slowpoke. The deletion would occur in an "after_evolution_proc".
  • Change the Pokémon's form depending on how it evolves. This is done by setting the form as part of the check. This assumes the unevolved Pokémon doesn't have multiple forms, only the evolved species.
  • Disable all evolutions for a time by inserting the line return nil if $game_switches[42] at the very beginning of def check_evolution_internal (in the script section Pokemon, next to similar lines for the Everstone and Battle Bond) and setting Game Switch 42 to ON whenever you want to forbid all evolutions. The number of the Game Switch you use may vary.

As well as creating new evolution methods, you could also/instead make a few changes to existing methods.

Evolution screen[]

When a Pokémon evolves, it is displayed on screen with some messages ("What? Pikachu is evolving!", etc.). The player has the chance to cancel some evolutions by pressing a button during the animation.

The animation itself is described in class PokemonEvolutionScene in the script section UI_Evolution. It shows the Pokémon's sprite fade to white, then grow bigger and smaller while alternating with the sprite of its evolved form, before the evolved form's sprite colours in.

The background used for the evolution screen is located in the "Graphics/UI" folder, and is called "evolution_bg.png". This image will be tiled across the entire background. If there is no picture with this name, a blank white background will be shown instead.

Advertisement