I mean, I know I'm pretty good at coding, but the code is commented with what each of those variables are. Checking them should be pretty straightforward.
You should be creating a Lass Crissy the normal way, by modifying your trainers PBS file. Then you can check to see if the trainer passed is Crissy, and modify the party accordingly.
Code:
if trainer.trainertype==PBTrainers::LASS && trainer.name=="Crissy"
if party[0].species == PBSpecies::PURRLOIN
party[0].level=pbBalancedLevel($Trainer.party) - 4 + rand(5) # For variety
party[0].calcStats
party[0].resetMoves
end
end
Note: I did not test the above code.
Fun side note for the maintainers of Essentials: this onTrainerPartyLoad has a bit of an oversight, in that the way we identify trainers is via their trainer class, trainer name, and party id. We're missing two out of those three inside this method: we only have trainer class. The name in
trainer.name is the localized trainer name, but we use the unlocalized trainer name as the trainer's identifier, and you can't "unlocalize" a name. And of course we aren't passed the party id. So it's impossible to pin down exactly which trainer we're given in this function. The most it can be used for, really, is general modifications.
(Also, the comment above
onTrainerPartyLoad in PField_EncounterModifiers is patently false: the function is handed the trainer, items, and party every time it is generated, so you can modify all of that in the function perfectly fine. Everything is generated from scratch every battle, but the function is called after every time it is generated.)