po-devs/rpg-scripts

Need an option to generate a pokemon at level X

Closed this issue · 2 comments

The generated pokemon will have random IVs, 0 EVs, random ability (not DW ability though), random gender, random nature, and the moveset fitting the level.

Some code may need to be added to the main pokemon online repo to get gender ratio from scripts.

The Pokemon/Team objects in scripts/teamChanger.js may need global exposure, since for now you can only access them with User.getTeam etc.

In my idea pokeinfo.js would see something like Pokemon.prototype.generate = function(id, level){...} but it's only an idea.

To test if it works you can add a test command that also sets the pokemon 0 of your team to the generated pokemon: var team = User.getTeam(0); team.pokes[0].generate(1, 5); team.pokes[0].syncToUser(src,0).

About the gender thing, there's this:
/* Returns an array of "male", "female", "neutral" with percentages associated */
Q_INVOKABLE QScriptValue pokeGenders(int poke);

But when I tried it it returned undefined!

coyotte508/pokemon-online@aa666c2 should fix it. If it works, I'll update the RPG server when the issue is done.