Evolution Based On Caught Pokeball - pret/pokeemerald GitHub Wiki
Evolution Based On Caught Pokeball
Want to evolve a Pokemon into different mons based on what Pokeball its caught in?
Now you can.
Poke ball
Great ball
Ultra ball
Premier ball
Luxury ball
include/constants/pokemon.h
add this line to the evolution sectiion (increase the number by 1 from the last entry, 16 used for this example)
#define EVO_POKEBALL 16 // catch with a specific pokeball and level up
src/pokemon.c
in section u16 GetEvolutionTargetSpecies
add to EVO_NORMAL section:
case EVO_POKEBALL:
if (GetMonData(mon, MON_DATA_POKEBALL, NULL)
== gEvolutionTable[species][i].param)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
src/data/pokemon/evolution.c
add the evolution method to a Pokemon and choose a specific pokeball from the valid balls in your hack
(Eevee and Poke/Great/Ultra/Premier/Luxury balls chosen for this example)
[SPECIES_EEVEE] = {{EVO_POKEBALL, ITEM_POKE_BALL, SPECIES_JOLTEON},
{EVO_POKEBALL, ITEM_GREAT_BALL, SPECIES_VAPOREON},
{EVO_POKEBALL, ITEM_ULTRA_BALL, SPECIES_FLAREON},
{EVO_POKEBALL, ITEM_PREMIER_BALL, SPECIES_ESPEON},
{EVO_POKEBALL, ITEM_LUXURY_BALL, SPECIES_UMBREON}},