Seeking a loot system

Hello there, fellow gamers.


I find myself in need of a system that will allow me to have multiple random loot tables.


The whole idea is that players can find treasures which are random and level appropriate.


I realize that I could build them myself using a bunch of common events, but I wanted to come to the community and see if anybody knows of a loot table plugin or trick that may be more efficient.


It doesn't have to work for enemy drops, but if it was, I wouldn't say no. Mainly it's purpose is for treasure events.
I've moved this thread to RPGMaker MV. Please be sure to post your threads in the correct forum next time. Thank you.


I don't think at this stage that it should be in Plugin Requests, as there may well be a solution without having to have one.
Well there's no real trick to it, either with a plugin or in a common event you'll have to build the loot tables yourself.


If you go the eventing way use script calls. Giving items by their id, and storing their name and quantity gained in variables for displaying in a message will save you hundreds of conditionnals in complex loot tables.


Using arrays and a bit of javascript it's actually fairly straightforward. Here's how I did it in one of my projects:

Spoiler
Set a loot table as an array of items : [itemId, quantity, percentage]


Then you generate a random number from 0 to the sum of all the items percentage in the loot table.


Ex loot table: [[1,5,30],[2,1,20]]


You roll for a number between 1 and 50 (30+20).


Roll 45: you get 1 of item n*2.


Roll 15: you get 5 of item n*1.


Giving gold or having a chance to give nothing is just a few conditionnals after the calculations (if (item[0] === "gold") {add item[1] gold}, if (item[0] === 0)  {do nothing} ).


By using script calls you can give items by their ids and that last step can be fully automated. Else, if your loot table is big, you'll have use a lot of conditionnals.





I don't know about any plugin doing that, so can't help you on that part.

Original thread: https://forums.rpgmakerweb.com/threads/seeking-a-loot-system.71665/