This resource here automatically makes your v16 PBS compatible with v17.
As for generating a random species, you could try
1 + rand(PBSpecies.maxValue)
This is the species (a number). You could use that with, say, pbGenPoke(species, level), pbWildBattle(species, level), or even...