SkinLoot

SkinLoot 1.2.3

SkinLoot can easily create a loot table for skins, without interfering with your current loot plugin.
Tested with all current loot plugins including: AlphaLoot, BetterLoot, LootConfig, MagicLoot and SimpleLoot as well as working with the vanilla loot system. With no major degradation in server performance.

Dependecies
For optimal use, I recommend a third-party loot plugin, in particular AlphaLoot due to the fact you can easily manipulate loot tables.
This plugin was made in particular for https://www.chaoscode.io/resources/skin-perks.55/ in order to easily distribute different skins with varying rarity.

Plugin Features:
  • Applies skins to current items inside loot containers, with varying rarity.
  • View all current skinned items inside containers as well as their percentage and theoretical percentage.
  • Easily set a skin's weight from either player or server console.
  • Automatically refreshes containers.
Upcoming Features:
  • Separate Loot tables for different containers

Permission: authlevel 2

Commands
In server console or player f1 console.
<> - required fields | [] - optional fields
skinloot.help - displays help menu, along with display formatting for skinloot.set, skinloot.view and skinloot.table.
skinloot.refresh - refreshed all skinable items in loot containers
skinloot.set <item name> <skinID> <weight> - sets a skin's weighted probability, and displays updated table. Item name can be either the shortname or full name, also can be partial.
skinloot.view [item name / item category] - displays composition for each item's skins present in current loot containers along with their theoretical percentage. Can be refined by searching for item name or category. If searching with item name, it can be partial and either be the shortname or full name.
skinloot.table [item name / item category] - displays loot table for item(s). Can be refined by searching for item name or category. If searching with item name, it can be partial and either be the shortname or full name.
skinloot.import [accepted / skinperks] - imports skins from the specified source, if no source is specified the plugin will import from both accepted skins and SkinPerks (if installed).
Where to find the skinID?
Open the Rust Work Shop and select desired skin.
In the URL you find id=number. This number is your skin id.


Config
JavaScript:
//Default Configuration
{
  "Additional Items": { //Additional skinnable items to include in loot table
    "Items": [
      "rifle.lr300"
    ]
  },
  "Import": {
    "Automatically import accepted skins": false, //Setting to 'true' will make automatically update loot tables with new accepted/added skins
    "Automatically import SkinPerk skins": false,
    "Default import loot weight": 1, //The default rarity imported items will have
    "Enable random import loot weight": false, //Setting to 'true' will override 'Default import loot weight' and generate a number within the range below
    "Random Weight Range": {
      "Max": 20,
      "Min": 1
    }
  },
  "Settings": {
    "Enabled": true,
    "Refresh Skins (Seconds)": 600.0 //How often loot containers are refreshed with skins
  }
}
Data File
Two data files are generated, one of which contains all names of skinable items* and the other is the loot table. See section "How The Plugin Works", for more info of the Loot table's structure.
*Only items with officially added skins, to add additional skins add their shortname to the config file.

Recommendations

Set "refresh skins" to either the same time as your loot plugin or a fraction of the time.
Eg: Loot Plugin is 500, set SkinLoot's to 250. The more frequently the skins are refreshed the better the distribution of them will be.
I also recommend using commands through the server console, as the Rust Console doesn't always display the formats correctly.

How the Plugin Works
Example (For simplicity, I have substituted letters for skinIDs in this example) :
JavaScript:
//From LootTable.json
"rifle.ak": {
      "Skins": {
        "A": 15, //common 60%
        "B": 6, //rare 24%
        "C": 3, //very rare 12%
        "D": 1 // extremely rare 4%
      }
    }
For the item above there is a total of 4 skins with the total sum of the weights being 25.
A lower number means the skin will show less often.
A high number means the skin will show more often.

Calculating Percentage
  1. Add all numbers together
    15 + 6 + 3 + 1 = 25
  2. Divide the number for the skin by the sum
    A: 15 / 25 (Can spawn 15 out of 25 times 60%)
    B: 6 / 25 (Can spawn 6 out of 25 times 24%)
    C: 3 / 25 (Can spawn 3 out of 25 times 12%)
    D: 1 / 25 Can spawn 3 out of 25 times 4%)

Information

Author
4lex
First release
Last update
Rating
1.00 star(s) 2 ratings

Latest Release v1.2.3

Released
Apr 25, 2018 at 8:35 AM
Rating
1.00 star(s) 2 ratings



SkinLoot by 4lex
© chaoscode.io Dec 2, 2017

Latest reviews

Do not work!
never got it to work........