NIFE: Lootboxes Plugin
Posted: Posted March 15th by Xhin
This plugin introduces Lootboxes, which are fixtures that will give looters some kind of random item (depending on what you set).
First thing to do is to choose a room.
Here you can add lootboxes. Straightforward enough.
Lootboxes can be hidden and can have events that trigger whenever they're looted.
They can also have a global stock.. every time a character loots an item from them this stock goes down. If it reaches 0, the lootbox can't be looted anymore. If the global stock is -1, however, the character can continue looting from the box as much as they want.
There's a global max, which only really affects lootbox events.
Clicking "Edit Lootbox" goes here:
Here you assign various item properties to the lootbox. Each of these has a weight and a chance.
The way this works, in the above example, items with a "Damage" stat have a 3/6 chance of being looted, items with a "Potion id" stat have a 1/6 chance of being looted, and items with a "Bomb Damage" stat have a 2/6 chance of being looted. Overall you're likely to pull out a weapon or maybe a bomb, and rarely a potion.
The chance then determines whether an item will actually be pulled out once it's selected... If it doesn't, the stock doesn't go down but the player might still get annoyed because they'll have to loot the box again.
You can also remove loot (wasn't shown in the preview because I added it in after I made it)
Here's the actual auto-action. Pretty straightforward, I put it after Take since it's similar.
I introduced some new events concerning lootboxes:
Hide, Show, Move (should be straightforward)
Refill -- refills a lootbox's stock to its max
Clear -- sets a lootbox's stock to 0.
Increase max, increase stock, set max, set stock -- should be straightforward
Make infinite -- makes the stock infinite (shorthand for set stock to -1).
Add loot (box, property, weight, chance) -- adds a new loot type to the lootbox.
Remove loot (box, property) -- removes a loot type from the lootbox.
You'll find these events in the new Lootbox object. The #boxid hashtag can refer to the lootbox which is being looted, while #user is the character doing the looting.
I have some additions to this plugin, but it's like 3pm and I don't want to only do this plugin today, so I'll leave them off for later.
There are 7 Replies
Reply to: NIFE: Lootboxes Plugin