Advertiser Content

Vendily

Female
Online now
Posted 1 Day Ago
959 posts
4.2 Years
There's an example in the Pokemon Fan Club map in the example maps that come with Essentials. It does require using a different method though: pbChooseTradablePokemon (Actually the method in the script is mistyped, so the included example crashes. There's an extra e.)
This is the one that appears on that map
pbChooseTradeablePokemon(1,2,
proc {|pkmn|
 pkmn.isFemale? &&
 isConst?(pkmn.species,PBSpecies,
    :DRAGONAIR)
})
The code takes 4 arguments, but you'll only need the first 3. The first two arguments are the same as pbChoosePokemonForTrade, the party index and party member name variable numbers, but the third is where we get fancy! It's a proc that takes a pokemon object and spits out true or false depending on its requirements. The example proc is a female Dragonair, but you have different requirements, any ice type pokemon. So our proc will look different.
proc {|pkmn| pkmn.hasType?(:ICE)}
That's it! If it has at least 1 ice type, it'll be allowed to trade.

The fourth argument is a true/false, for if the selection will allow pokemon that don't match the requirements to be chosen.

Advertiser Content