Item Allocator System #
The item allocator is a component responsible for restocking the inventory component on an actor. It restocks the inventory after a certain period of inactivity, configurable to your preferences. It chooses the correct list to restock from based on whether the actor has a vendor component or not.
Loot Chest #
A loot chest is essentially an inventory component combined with an item allocator component. Since it does not have a vendor component, it uses the loot list from the item allocator. The system includes low, medium, and high-quality loot chests, defined in the loot lists data table. The loot is determined by chance per category and even per item.
Restocking Logic #
When the restock is triggered, the item allocator attempts to restock items into the inventory. It checks if the item should be restocked and if it has reached the maximum amount allowed. Adding items overrides the max stack size of the inventory item.
Reset Time #
Each item allocator can have a reset time, which clears and refills the entire inventory when reached.