Loot

Imagine exploring a cave or dungeon, and finding a treasure chest full of random items for the taking - that's what RPGx's loot system is designed for. Loot is set up using text files (similar to the shop system), which allows you to group loot items together in categories (i.e. common loot, uncommon, rare, special, etc.). One of the text files can be referenced via the RPGx_SetLoot event, which will then add the items to a brick's / vehicle's inventory.

Loot File Setup
To add a loot file, navigate over to the config/serve r/RPGx_Beta/Loot/ folder (which is where they are stored), and create a new text file. Name the file whatever you want your loot category to be called (which will be referenced by the output event). Then, add the UI name (they way it appears in the wrench menu, when adding an item to a brick) of an you want to add in the file. Hit "Tab" on your keyboard and enter a "stack limit" for that item (any value between 1 and 999). Hit "Tab" again and enter a frequency for how often that item will be used - this is a percentage (%) value between 1 and 100. Enter new items below the previous ones on a new line, using the same format. Each line should appear like this:

Item UIname [TAB] Stack Limit [TAB] Frequency

Event Setup
Once you're finished with the loot file, start up Blockland an d host a server. Once in the server, plant an RPGx storage brick and open the wrench events GUI. Add the following event to the brick:

onActivate -> Self -> RPGx_SetLoot -> Add "FileName"

Replace "FileName" with the name of the file you set up in config/server/RPGx_Beta/Loot/ (make sure you don't include quotes in the name; the file path and extension are not necessary). Once the event is applied, a randomized inventory will appear for the brick - the stack amounts for each stack will also be randomized, relative to the stack limit you set for each item in the reference file. Some items may also appear more often then others (based on their frequency values).

Note: Once you use the "RPGx_SetLoot" event on a storage brick, it will then be labeled as a "loot brick", which will randomize it's inventory during each loot "tick" (which you can customize under Server Settings in the Drafting Table GUI). However, you can prevent the brick from receiving future updates by selecting Remove instead of Add in the event's output parameters, and then by activating the event.