Wikia

Pokémon Essentials Wiki

Editing a Pokémon

Talk0
191pages on
this wiki

This article describes how to edit the attributes of a Pokémon, such as its gender, owner or ribbons.

See also

Pokémon

  • The attributes of a Pokémon are listed here. Many of them can be edited, although some shouldn't be.

Manipulating Pokémon

  • This article shows, amongst other things, how to let the player choose a Pokémon in the party.

Moves

  • A known move has itself a couple of attributes that can be edited.

Editing a Pokémon

The first step is to find the Pokémon to edit. This can be done a variety of different ways depending on the circumstances. For example:

poke=$Trainer.party[0]
poke=pbFirstAblePokemon
poke=pbGetPokemon(1)

These will all return a Pokémon (if possible) and call it "poke". This article assumes that the Pokémon being edited is referred to as "poke".

Common attributes to edit

Attribute Code Description
Ability poke.setAbility(2) Sets the Pokémon's ability to be the first natural (0), second natural (1) or a hidden (2-5) ability available to its species. Use poke.setAbility(nil) to remove the override and have the ability determined by the Pokémon's personal ID.

It is not possible to give the Pokémon any ability other than those defined in the PBS file "pokemon.txt" for its species.

Ball used poke.ballused=7 Sets the type of Poké Ball the Pokémon is contained in. The list of Poké Balls and their corresponding numbers is in the script section PokémonBalls.
EVs poke.ev[2]=42 Sets the Pokémon's EVs for a given stat. Each stat should be a number between 0 and 255 inclusive. The stats are as follows:
  • 0 = HP
  • 1 = Attack
  • 2 = Defense
  • 3 = Speed
  • 4 = Special Attack
  • 5 = Special Defense
Form poke.form=1 Sets the Pokémon's form. 0 is the default form as defined in the PBS file "pokemon.txt".

Some Pokémon species determine their form automatically depending on various factors. Their form cannot be manually changed this way, as they will immediately change back.

You will likely also need to record the new form as seen, so that it will show up in the Pokédex. To do this, use pbSeenForm(poke) afterwards. This will typically only apply to Pokémon which don't ordinarily change their form, e.g. Unown.

Gender poke.setGender(1) Sets the Pokémon's gender to male (0) or female (1). It cannot give a Pokémon a gender it cannot have. Use poke.setGender(nil) to remove the override and have the gender determined by the Pokémon's personal ID.

You will also need to record the new gender as seen, so that it will show up in the Pokédex. To do this, use pbSeenForm(poke) afterwards.

Happiness poke.happiness=200 Sets the Pokémon's happiness. This should be a number between 0 and 255 inclusive.
Held item poke.item=PBItems::ORANBERRY Sets the Pokémon's held item. "0" means no item.

If the item is a mail item, then poke.mail should also be set: poke.mail=PokemonMail.new(PBItems::GRASSMAIL,"This is a message.","Dave")

If the item is a mail item which shows Pokémon on it, then this should instead be: poke.mail=PokemonMail.new(PBItems::GRASSMAIL,"This is a message.","Dave",poke1,poke2,poke3). Each "poke" should be an array of the form [species,gender,shininess,form,shadowness,is egg?].

IVs poke.iv[2]=7 Sets the Pokémon's IVs for a given stat. Each stat should be a number between 0 and 31 inclusive. The stats are as follows:
  • 0 = HP
  • 1 = Attack
  • 2 = Defense
  • 3 = Speed
  • 4 = Special Attack
  • 5 = Special Defense
Language poke.language=2 Sets the Pokémon's language. Is one of the following:
  • 0 = Unknown
  • 1 = Japanese
  • 2 = English (default)
  • 3 = French
  • 4 = Italian
  • 5 = German
  • 7 = Spanish
  • 8 = Korean
Level poke.level=42 Sets the Pokémon's current level.

What it actually does is change the Pokémon's "exp" to be the lowest possible value for that level.

Moveset poke.pbLearnMove(:TACKLE)
poke.pbDeleteMove(:TACKLE)
poke.resetMoves
The first option teaches a move to the Pokémon. This can teach any move, and will do so without informing the player. If the Pokémon already knows 4 moves, the first move will be forgotten, the other three bumped up and the new move added to the end.

The second option deletes a move from the Pokémon, if it knows it. Again, this will happen without informing the player.

The third option resets the Pokémon's moveset to what a wild Pokémon of that species/level/form would know. This can be useful when changing a Pokémon's level/form.

Nature poke.setNature(PBNatures::HASTY) Sets the Pokemon's nature. Use poke.setNature(nil) to remove the override and have the nature determined by the Pokémon's personal ID.
Nickname poke.name="Dave" Sets the Pokemon's nickname to a given phrase. Use poke.name=nil to remove the nickname.

To let the player choose their own name, simply call pbNickname(poke).

Obtain text poke.obtainText=_INTL("Day-Care Couple") Sets the phrase to use instead of the obtain map's name as the place where the Pokémon was obtained. Use poke.obtainText=nil to remove the phrase.
Pokérus poke.givePokerus
poke.givePokerus(4)
Gives the Pokémon Pokérus. The parameter is optional, and is the strain of Pokérus to give (between 1 and 15).

poke.pokerusStage will return either 0 (never infected), 1 (currently infectious), or 2 (cured/immune).

Ribbons poke.giveRibbon(:HOENNCOOL)
poke.takeRibbon(:HOENNCOOL)
Gives the Pokémon the specified ribbon (or removes it).

There are a few other methods dealing with ribbons:

  • poke.upgradeRibbon(:HOENNCOOL,:HOENNCOOLSUPER,:HOENNCOOLHYPER,:HOENNCOOLMASTER) - Any number of ribbons can be listed. Either adds the first ribbon if the Pokémon has none of them, or turns the possessed ribbon into the next one listed. Returns the number of the ribbon added/upgraded into, or 0 if nothing changed.
  • poke.ribbonCount - Returns the total number of ribbons the Pokémon has.
  • poke.hasRibbon?(:HOENNCOOL) - Returns TRUE if the Pokémon has the specified ribbon, and FALSE if not.
  • poke.clearAllRibbons - Removes all ribbons from the Pokémon.
Shadowness poke.makeShadow Makes the Pokémon a Shadow Pokémon. It is not easy to turn a Shadow Pokémon into a regular Pokémon.
Shininess poke.makeShiny
poke.makeNotShiny
Makes the Pokémon shiny, or not. Use poke.shinyflag=nil to remove the override and have the shininess determined by the Pokémon's personal ID.

Rare attributes to edit

The following are attributes you are unlikely to ever want to edit. They are included mainly for completeness.

Attribute Code Description
Contest stats poke.beauty=42
poke.cool=42
poke.cute=42
poke.smart=42
poke.tough=42
poke.sheen=42
Sets the Pokémon's contest stats. Each stat should be a number between 0 and 255 inclusive.

Note that these properties are currently unused (except beauty for Feebas' evolution).

Current HP poke.hp=42
poke.hp=poke.totalhp
poke.heal
Sets the Pokémon's current HP. The last option will also restore the Pokémon's PP and status to full/normal.
Egg steps poke.eggsteps=5355 Sets the number of steps required for the Pokémon egg to hatch.
Experience poke.exp=12345 Sets the Pokémon's Experience Points. You will usually want to add/subtract amounts from this, rather than setting it to a specific new value.
Fused Pokémon poke.fused=poke2 Sets the Pokémon which is fused with this Pokémon. poke2 is itself a Pokémon. Use poke.fused=nil to erase the fused Pokémon.
Hatched map poke.hatchedMap=42 Sets the map in which the Pokémon hatched from an egg. Is used only if the Pokémon's obtain method is "egg received".
Hatched time poke.timeEggHatched=Time.now Sets the time at which the Pokémon hatched from an egg. Is used only if the Pokémon's obtain method is "egg received".
Markings poke.markings=5 Sets the markings the Pokémon has. Each marking has a value, and the Pokémon will have the markings whose values add up to the number specified. The four markings are in order:
  • 1 = ●
  • 2 = ■
  • 4 = ▲
  • 8 = ♥

For example, if this number is 5, the values that make 5 are 1 (circle) and 4 (triangle), so the Pokémon will have those two markings.

Obtain level poke.obtainLevel=42 Sets the Level at which the Pokémon was obtained.
Obtain map poke.obtainMap=42 Sets the map in which the Pokémon was obtained.
Obtain method poke.obtainMode=1 Sets the method by which the Pokémon was obtained. The number is either nil, 0 ("met"), 1 ("egg received", i.e. it then hatched), 2 ("traded") or 4 ("fateful encounter").
Original trainer's gender poke.otgender=1 Sets the gender of the Pokémon's original trainer. The number is either 0 (male), 1 (female), 2 (mixed) or 3 (unknown).
Original trainer's ID number poke.trainerID=$Trainer.id
poke.trainerID=$Trainer.getForeignID
Sets the ID number of the Pokémon's original trainer. The first option sets it to the player's ID number, and the second option sets it to a random other ID number.

This and the original trainer's name determine whether the Pokémon originally belonged to the player or not.

Original trainer's name poke.ot="Dave" Sets the name of the Pokémon's original trainer.

This and the original trainer's ID number determine whether the Pokémon originally belonged to the player or not.

Personal ID poke.personalID=rand(2**32) Sets the Pokemon's personal ID. The example will randomise the Pokémon's personal ID, although it can also be set to any value between 0 and 4,294,967,295.

Note that the Pokémon's gender, nature, ability and shininess all depend on the value of the personal ID by default. Spinda's spot locations and the evolution methods "Silcoon" and "Cascoon" also depend on it.

Species poke.species=PBSpecies::BULBASAUR Sets the Pokemon's species.
Status poke.status=PBStatuses::POISON
poke.status=0
poke.heal
Sets the Pokémon's status. The last option will also restore the Pokémon's HP and PP to full. The possible statuses are:
  • 0 (healthy)
  • 1 (or PBStatuses::SLEEP)
  • 2 (or PBStatuses::POISON)
  • 3 (or PBStatuses::BURN)
  • 4 (or PBStatuses::PARALYSIS)
  • 5 (or PBStatuses::FROZEN)

If putting the Pokémon to sleep, then poke.statusCount=3 should also be set, where the number is the number of rounds the Pokémon will remain asleep.

What can't be changed

There are some attributes of a Pokémon that cannot be changed. These are:

  • Type 1
  • Type 2
  • Stats:
    • Maximum HP
    • Attack
    • Defense
    • Speed
    • Special Attack
    • Special Defense

The last part of editing a Pokémon

Once a Pokémon's attributes have been edited, its stats may need to be recalculated. This is done by the following code:

poke.calcStats

To be safe, you should always include this line after all other edits.

Around Wikia's network

Random Wiki