• 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

Tutorial Proper Wild Item Drops (Based on Cilerba's Wild Item Drop Resource) 2021-01-11

TungstenBasilisk

Rookie
Member
Joined
Dec 29, 2020
Posts
3
TungstenBasilisk submitted a new resource:

Proper Wild Item Drops (Based on Cilerba's Wild Item Drop Resource) - Proper Wild Item Drops

This is a Proper Wild Item Drop script. I based my script on the work of Cilerba (https://eeveeexpo.com/threads/1332/)
I'd also like to say thank you to ThatWelshOne_ and Golisopod User for helping with parts of the script and pointing me in the right direction, respectively!

Essentially, what this does is read the pokemon.txt PBS file and generate a list of items that can be "dropped" by a wild pokemon at the end of a battle. These items are completely separate from Wild Hold...

Read more about this resource...
 

TungstenBasilisk

Rookie
Member
Joined
Dec 29, 2020
Posts
3
I've made a small change to the script for those of you who are using it or plan to use it. As it currently stands in the OP, there is only 1 random number generated for all 3 drops (Common, Uncommon, and Rare) so that means that if you get a rare drop, you will always get the common and uncommon drops as well. And if you get the uncommon drop, you will always get the common drop as well. It also means you can't get just the uncommon or rare drops by themselves. So to remedy this, I just created a droprnd variable for each drop (droprndC, droprndU, and droprndR) like so:

Ruby:
Expand Collapse Copy
droprndC = rand(100)
droprndU = rand(100)
droprndR = rand(100)

then below, it should look like this:

Ruby:
Expand Collapse Copy
if droprndC<chances[0]
        if $PokemonBag.pbStoreItem(wildDrop[0],firstqty)
          itemname = PBItems.getName(wildDrop[0])
          pocket = pbGetPocket(wildDrop[0])
          @battle.pbDisplayPaused(_INTL("{1} dropped\n{2} <icon=bagPocket#{pocket}> x{3}!",b.pbThis,itemname,firstqty))
        end
      end
      if droprndU<chances[1]
        if $PokemonBag.pbStoreItem(wildDrop[1],secondqty)
          itemname = PBItems.getName(wildDrop[1])
          pocket = pbGetPocket(wildDrop[1])
          @battle.pbDisplayPaused(_INTL("{1} dropped\n{2} <icon=bagPocket#{pocket}> x{3}!",b.pbThis,itemname,secondqty))
        end
      end
      if droprndR<chances[2]
        if $PokemonBag.pbStoreItem(wildDrop[2],thirdqty)
          itemname = PBItems.getName(wildDrop[2])
          pocket = pbGetPocket(wildDrop[2])
          @battle.pbDisplayPaused(_INTL("{1} dropped\n{2} <icon=bagPocket#{pocket}> x{3}!",b.pbThis,itemname,thirdqty))
        end
      end

P.S: I also removed the part that said
Ruby:
Expand Collapse Copy
(wildDrop[0]==wildDrop[1] && wildDrop[1]==wildDrop[2]) ||
, this is not necessary, it's just personal preference. All this part does is guarantee a 100% chance to drop an item if all 3 drop items are the same in the PBS, and I just don't like that part personally anymore so I removed it.
 

TimeWarpHero

Novice
Member
Joined
Aug 31, 2021
Posts
24
Hi! I love this because its perfect for my game! Thanks for providing it!

I was curious though if this would work for 19.1?
 
Back
Top