Pokecube-Development / Pokecube-Issues-and-Wiki

This is where all issues for the core pokecube mods should go, also this is where the main wiki should be maintained
MIT License
30 stars 24 forks source link

Changing Starter Levels and Starter Moves #1058

Open bassistracer opened 1 year ago

bassistracer commented 1 year ago

Was told to put my idea here.

The ability to change starter levels (and beginning moves) via data packs or an add-on would be really good -- namely for people who don't wanna start with Tackle/Scratch/Pound and Leer/Tail Whip/Growl all the time. Could be good if someone just wants their fully evolved starters already, or, taking inspiration from Pokemon Colosseum, having level 25 starters that have a couple of TM moves. Like the protagonist there has an Umbreon with Secret Power and Taunt for example.

Thanks for reading!

Thutmose commented 1 year ago

Hmm this can presently be done with a java addon via intercepting the StarterEvent.Pick event and then implementing such code there.

This is where the starter code is presently handled:

https://github.com/Pokecube-Development/Pokecube-Issues-and-Wiki/blob/da73f44c293659145668be33dd9914bdaaa7f9c0/src/main/java/pokecube/core/network/packets/PacketChoose.java#L122-L172

Presently after making the itemstack containing the pokemob, it puts it into a list, and fires a StarterEvent.Pick event. The starterPack list in this event only contains the pokecube containing the pokemob. You can listen for this event, and adjust the nbt of that item accordingly (or remove the item and add your custom made pokemob)

Here is the default code for generating the pokemob's item:

https://github.com/Pokecube-Development/Pokecube-Issues-and-Wiki/blob/da73f44c293659145668be33dd9914bdaaa7f9c0/src/main/java/pokecube/core/utils/PokecubeSerializer.java#L347-L366

There you have access to the pokemob itself before it puts it into the cube, so you can adjust it however you want.

If you need a different gui instead, that would need a client-side addon, and currently doesn't have a good event to replace, I can add one of those though.