• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

v21.1 Random Wonder Trade From PC V1.1

This resource pertains to version 21.1 of Pokémon Essentials.
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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
Blocklist and Allowlist:

  • 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.
Optional Customization:

  • 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.
Additional Features:

  • 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.
How to Use:

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
  • Like
Reactions: TechSkylander1518
Author
drdoom76
Downloads
534
Views
1,514
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from drdoom76

Latest updates

  1. V1.1

    Changed all instances of "Blacklist" and "Whitelist" to "Blocklist" and "Allowlist" Fixed...
Back
Top