Trainer's Pokemon with specific stats

Weter 23

Novice
Member
Joined
Mar 4, 2018
Posts
12
Finding a way for a trainer's Pokemon (like a gym leader's) to have specific IVs, EV investment, and nature.
 

Scyl

Ironically Unironic Edgelord Extraordinaire
Member
Joined
Apr 4, 2018
Posts
42
As stated above, IVs and natures are already in base essentials, you just have to input the necessary information into trainers.txt. In regards to EVs, however you will need to do some custom scriptwork.

In the PTrainer_NPCTrainers script section, at the very top you should see "TPSPECIES = 0" and it goes down to "TPBALL =16", hit the nice, shiny Enter button and copy the following:

Ruby:
TPHPEV      = 17
TPATKEV     = 18
TPDEFEV     = 19
TPSPEEV     = 20
TPSPAEV     = 21
TPSPDEV     = 22

Next go to "TPDEFAULTS" and change it from TPDEFAULTS = [0,10,0,0,0,0,0,nil,nil,0,false,nil,10,70,nil,false,0] to

Ruby:
TPDEFAULTS = [0,10,0,0,0,0,0,nil,nil,0,false,nil,10,70,nil,false,0,0,0,0,0,0,0]

So basically, just add a "0" for every stat, a total of 6.

Find the excerpt in the same script section:
Ruby:
      pokemon.setNature(poke[TPNATURE])
      iv=poke[TPIV]
      for i in 0...6
        pokemon.iv[i]=iv&0x1F
        pokemon.ev[i]=[85,level*3/2].min
      end

It should be right above "pokemon.happiness=poke[TPHAPPINESS]", hit the enter key again, after the end, and insert the following.

Ruby:
evsum = poke[TPHPEV].to_i+poke[TPATKEV].to_i+poke[TPDEFEV].to_i+poke[TPSPEEV].to_i+poke[TPSPAEV].to_i+poke[TPSPDEV].to_i
if evsum<=510 && evsum>0
pokemon.ev=[poke[TPHPEV].to_i,
                    poke[TPATKEV].to_i,
                    poke[TPDEFEV].to_i,
                    poke[TPSPEEV].to_i,
                    poke[TPSPAEV].to_i,
                    poke[TPSPDEV].to_i]
elsif evsum == 0
  for i in 0...6
    pokemon.ev[i]=[85,level*3/2].min
  end
end

Finally, define the stats in the trainers.txt.

Base Essentials: http://prntscr.com/jrnpsr
Altered Essentials: http://prntscr.com/jrnrs4

To test whether or not it worked, I used one of the Shadow Pokemon trainers since all of the information stored for the Pokemon in the trainers.txt stays even when the player captures it.
Base Essentials: http://prntscr.com/jrnt0w
Altered Essentials: http://prntscr.com/jrnu2c

See if that works. uwu.
 
Top