- Pokémon Essentials Version
- v21.1 ✅
I was wanting to build a Wonder Trade in my game and ran across Sploopo's WT script, but didn't like the idea of having to individually fill lists. So I made one that will automatically populate Pokemon depending on the Pokemon already coded to your game.
How it Works:
Simply call the pbWonderTrade method to initiate the Wonder Trade. Customize the trade parameters using optional arguments.
Sample Code:
Using without optional arguments:
pbWonderTrade
Using with optional arguments:
pbWonderTrade(nickName, trainerName, trainerGender)
Happy Trading!
Let me know if you have any questions or issues using my plugin.
How it Works:
- Automatic Pokemon Population:
- The script scans all maps in your game and compiles encounter data from each map.
- For every encounter, it builds lists of Pokemon species and tracks how many times each Pokemon can be encountered in your game.
- Assigning "Weights":
- Each Pokemon is given a "weight" based on their availability.
- These weights are later used to calculate the probability of encountering each Pokemon.
- Sorting by Rarity:
- The Pokemon and their weights are categorized into six rarity levels, determined by their respective weights.
- A random number is generated to select a rarity based on predefined rarity probabilities.
- Selecting a Pokemon:
- Within the chosen rarity level, the script selects a random number.
- It iterates through the list until it finds a Pokemon whose weight meets or exceeds the selected number.
- The chosen Pokemon becomes the trade option.
- The script supports Blocklist and Allowlist features.
- Blocklist: Exclude specific Pokemon from being considered for trade.
- Format: [:POKEMON1, :POKEMON2]
- Allowlist: Increase the chances of encountering specific Pokemon in trades.
- Format:
- ALLOWLIST_POKEMON = {
:MELOETTA => 5,
:RATTATA => 10,
:PIKACHU => 30
} - The numbers indicate the number of "chances" for each Pokemon, equivalent to their encounter frequency.
- Blocklist: Exclude specific Pokemon from being considered for trade.
- Optional arguments are available for further customization:
- Nickname: Provide a specific Pokemon nickname.
- Trainer Name: Specify a Trainer name.
- Trainer Gender: Define the Trainer's gender.
- Note: If you specify these arguments, they will be applied to all NPC-initiated trades. Otherwise, the script will generate random values.
- The script includes default male and female name lists for Trainers. If you don't specify a Trainer name, the script will randomly select one.
- An option to enable or disable automatic Pokemon nicknames.
- The trade screen operates within the PC interface, retaining access to your party.
- Full compatibility with the Charm Case and Trading Charm.
- A default greeting message that adapts to Trainer gender and modifies text color accordingly.
Simply call the pbWonderTrade method to initiate the Wonder Trade. Customize the trade parameters using optional arguments.
Sample Code:
Using without optional arguments:
pbWonderTrade
Using with optional arguments:
pbWonderTrade(nickName, trainerName, trainerGender)
Happy Trading!
Let me know if you have any questions or issues using my plugin.
- Credits
- Dr.Doom76