• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Random Egg species

  • 96
    Posts
    6
    Years
    • Seen Nov 17, 2024
    This is an example of a black market type functionality for stolen eggs. Now, obviously it's not difficult to add an egg for a particular species. But if these are stolen eggs, the seller may not know which species is contained within a particular egg. In my example, I am using theft as the plot explanation, but it can obviously be adapted for other plot scenarios in which it makes sense for the species to be unknown.

    In my example, I chose only the 18 species of baby pokemon, but again, you can choose whatever you like. I also weighted them to account for rarity, so a Pichu is six times as likely to be picked as a Happiny.

    The script is basically like so:

    Code:
    def pbGenerateRandomBabyEgg
    	babySpecies = Array.new
    	babySpecies.concat([:PICHU]*6)
    	babySpecies.concat([:AZURILL]*6)
    	babySpecies.concat([:BUDEW]*6)
    	babySpecies.concat([:WYNAUT]*6)
    	babySpecies.concat([:TYROGUE]*4)
    	babySpecies.concat([:SMOOCHUM]*4)
    	babySpecies.concat([:MIMEJR]*4)
    	babySpecies.concat([:BONSLY]*4)
    	babySpecies.concat([:MANTYKE]*4)
    	babySpecies.concat([:CHINGLING]*4)
    	babySpecies.concat([:MAGBY]*3)
    	babySpecies.concat([:ELEKID]*3)
    	babySpecies.concat([:RIOLU]*3)
    	babySpecies.concat([:MUNCHLAX]*3)
    	babySpecies.concat([:CLEFFA]*2)
    	babySpecies.concat([:IGGLYBUFF]*2)
    	babySpecies.concat([:TOGEPI])
    	babySpecies.concat([:HAPPINY])
    	speciesIndex = rand(babySpecies.length)
    	speciesSelection = babySpecies[speciesIndex]
    	return pbGenerateEgg(speciesSelection)
    end


    As you can see, you can set the rarity by multiplying by a number of your choosing. No need to multiply by one for obvious reasons.

    You can then create an event that looks like this:

    [PokeCommunity.com] Random Egg species


    And that's all there is to it. I recommend putting the method in your own script section to make it easier to update Essentials in the future.
     
    It is possible to give them a specific nature (or a random nature but in a little group (like, for example, pichu only can has timid, jolly, modest or adamant)) and perfect iv?
     
    Back
    Top