- 39.78 kB
Populate npc corpses, containers, and barrels with custom loot.
Users can create as many loottables as required, and assign them to npc/container types by name.
To create a new loot table, simply set the "lootTable" entry for some container type in config to a new made up name.
This will create a new /data file of that name, which you can customise.
The same loot table can be used for multiple corpse types.
New categories and items are added automatically so, hopefully, data should never need to be wiped.
Default loottable has all probabilities set to zero and will required customisation.
I intend to provide some sample loottables for free download in the near future.
Item choice is done by two-tier probability.
For each spawned item a category is chosen, based on your category probabilities,
then an item is chosen from that category, based on your item probabilities for that category.
See notes at bottom for further info on probabilities.
Optional dependencies -
- BotSpawn - V2.0.5 or later.
- corpseTypePerBotSpawnProfile - true/false
- allowDuplicates - true/false
- Include_DM_Crates - true/false
- Military Tunnel
- Junkpile Scientist
- Mounted Scientist (CH47)
- Compound Scientist
- BotSpawn *
*if Global option 1 is true, this entry is replaced with one entry per existing BotSpawn profile, by name.
Eg, The Dome 0, Airfield 0, LaunchSite 0, etc.
- dm ammo
- dm c4
- dm construction resources
- dm construction tools
- dm food
- dm medical
- dm res
- dm tier1 lootbox
- dm tier2 lootbox
- dm tier3 lootbox
Options per type:
- "enabled": true/false (governs corpse loot-giving)
- "lootTable": "default"
- "minItems": 6
- "maxItems": 6
- "gunsWithAmmo": true/false
- "noGuns": true/false
- "MaxBps": 3
- "WaterPreFillPercent": 20
- "ClearContainerFirst": true/false
By default there is one data file : /data/CustomLoot/default.json
If you specify a unique lootTable name for any corpse or container type,
a new file will be created in the same folder, by name.
- Eg /CustomLoot/JunkPileLootTable.json
Each data file contains:
Blacklist :  - These items will never spawn, and are removed from loottable.
Setting to  will repopulate with default blacklist.
- AlwaysSpawnList :  - These items will always spawn, regardless of probabilities.
- allowChristmas = false
- allowHalloween = false
allowKeycards = false
By default all Christmas, Halloween and Keycard items are disabled.
Items, grouped by category.
*Each item has:*
- "probability": 5
- "minStack": 10
- "maxStack": 50
- "blueprintChancePerfect": 0 - where applicable
- "skins":  - where applicable
- "IncludeAllApprovedSkins" - false
- "MinConditionPercent": 90 - where applicable
- "MaxConditionPercent": 100 - where applicable
Options per category:
- "probability": 5
- "allowBlueprints": true
If the called config profile doesn't exist CustomLoot will create it under 'API'.
[PluginReference] private Plugin CustomLoot; var lootcall = NPC?.Call("MakeLoot", "Npc_Config_Profile_Name"; if (lootcall is string) PrintWarning(string)lootcall);
Object hooks are provided to prevent this plugin giving loot to your spawned npcs, or containers.
Return non-null for the following.
*Probability, in both cases above, is relative; There is no scale.
If there were two categories with probabilities of 9 and 1,
the first would have a 9 out of 10 chance of being picked.
Probability of zero effectively means the item, or category is disabled.
Categories with no enabled items will never be chosen. Their probability is irrelevant.
Disabled categories will never be chosen. Their probability is irrelevant.
Users should never have to manually add, or remove, items in the /data files.
New items in Rust should be added automatically.
The blacklist can be used to remove entries from the data file, if that's preferred.
Reloading is not required to catch up with profile changes made in BotSpawn.