Custom Mixing Table


Introduction

Drug Mixing plugin is basically custom made mixing table which works pretty much same as "vanilla" Mixing Table. Worth mentioning detail, vanilla mixing table interface is no longer accessible while using this plugin although you can still list "teas" in DrugMixing and make them craft-able this way. Plugin comes together with extension for customizable buffs. These buffs are activated uppon using consumable item with custom item name listed in data file. Buffs can modify only base metabolism values like health, bleeding, hunger etc. or apply TeaBuff with customized values (time, value, type).

Plugin comes with basic configuration to demonstrate functionality. To utilize plugin to it's full potential you will have to configure your own drugs, create your own images and write your own item descriptions.

Requires

Image Library
Custom Skins Stacks Fix

Standard plugin installation by dropping files into appropriate oxide folders
Plugin package includes default data files, using them first is recommended.

After successfull installation you should be able to access these files.

plugins/DrugMixing.cs
config/DrugMixing.json
data/DrugMixing/Recipies.json

plugins/ConsumableBuffs.cs
config/ConsumableBuffs.json
data/ConsumableBuffs/Buffs.json

At this point you are ready to go, plugin has no permissions. You just have to open mixing table.

Configuration file data/DrugMixing/Recipies.json

This file handles all items you want to craft at Mixing Table. Recipe entry has to start with item shortname. Any shortname can be used but if crafted item is suppose to be usable and apply buff after consuming, then you have to use consumable item or medical syringe (water bottle can't be used). If you want use same shortname for multiple recipies, make sure you leave {id} as unique identifier, for example "antiradpills{1}", "antiradpills{2}"... It's just to prevent duplicates in data file.

Name field is assigned to crafted item same as SkinID. Description and Stats are basically text fields. They are displayed after clicking on info button at Drug Mixing menu.

For Ingredients you can use shortname or skin id. If you use skin id, table will take any item using that specific skin. If you use shortname, table will take any item with that shortname if skin id is 0.

Recipe entry example

"antiradpills": {
  "Name": "Epinephrine Pills",
  "Image": "https://rustplugins.net/products/consumables/pse.png",
  "SkinID": 2561876619,
  "Description": "description text field",
  "Stats": "stats text field",
  "Ingredients": {
    "2705552875": 5,
    "bleach": 2,
    "lowgradefuel": 35
    }
 }

Mixing time is handled in config/DrugMixing.json
There is option to set global timer and then also separately for each recipe.

"Mixing Timers": {
  "Global Timer": 5.0,
  "Specific Timers": {
    "syringe.medical": 10.0,
    "antiradpills": 7.0,
    "antiradpills{1}": 35.0
    }
 }

Configuration file data/ConsumableBuffs/Buffs.json

Metabolism and Boosts

Buffs are applied when item is consumed. To connect buff from data file with specific crafted item you have to meet two conditions.
It has to be consumable item or medical syringe and consumed item has to match display name with any buff entry from data file.
If this conditions are met, item is removed uppon consuming and instead of "vanilla" stats, new stats are applied based off data file.

With buffs you can modify any metabolism value or available tea boosts from game. Here you can find more infomations about Tea Boosts

Calories

Hydratation

Poison

Health

Health Regen

Bleeding

Radiation

Dirtyness

Tea Boosts


boost type names for configuration
% value and duration can be customized too
"ore" ➞ increase the rate at which you can mine ore
"wood" ➞ increase the rate at which you can harvest wood
"scrap" ➞ increase the rate at which you can collect scrap
"health" ➞ increase the maximum to which your health points can be raised past 100
"radiation_resistance" ➞ increase radiation resistance
"radiation_exposure_resistance" ➞ increase radiation resistance

Overdose (Dirty)

Dirty/Dirtyness is part of rust metabolism system but it was never used. I decided to utilize it as status for overdosing. Dirty status is optional, can be disabled in config.
When player reach overdose value, consumed item won't have any effect on him. Optionally you can add buff which will be applied when player is trying to consume items while overdosed. I recommend use some negative values on this buff so it's actually punish player for using "drugs" while overdosed. You can also choose if dirty status will preserve after player dies.

Settings for Overdose config/ConsumableBuffs.json

"Overdose Enabled?": false,
"Overdose Limit (applies debuff called 'dirty')": 150.0,
"Buff applied when overdose limit is reached (from data file)": "overdose_debuff",
"Reset 'dirtyness' on death": true


Data file example data/ConsumableBuffs/Buffs.json

"Health Boost Syringe": { ⇚ this is the name you have to match with crafted recipe
  "calories": -20.0,
  "hydration": -50.0,
  "health": 40.0,
  "healthRegen": 0.0,
  "bleeding": -30.0,
  "poison": 0.0,
  "radiation": 30.0,
  "dirtyness": 0.0,
  "TeaBoost_enabled": true,
  "boostType": "health",
  "boostValue": 0.3,
  "boostDuration": 20.0,
  "tooltipText": "tooltip text which shows up when you item is held as active item",
  "effects": [
     "assets/prefabs/misc/xmas/snowball/effects/strike_screenshake.prefab", ⇚ prefab effects which are played when item is consumed
     "assets/bundled/prefabs/fx/gestures/take_pills.prefab",
     "healing_overlay" ⇚ custom overlay effect, customizable in config file
   ]
},


Overlays and Prefab Effects

As mentioned above, overlays and effects can be played when item is consumed. These "effects" are played only at moment when item is consumed.
Currently there is no option to make those effects play continuously after consuming, although you can always commision other developer to create
custom effects and I can list them in api for buffs.

You can find list of prefab effects here. There quite few prefabs which will not work so you have to try them first.
Effects Panel and PlayFx are plugins which can help you speed up whole procces of testing each prefab.

Overlays can be set up in config/ConsumableBuffs.json. Overlay is basically sprite ui asset with color
which will be displayed on player's screen after while consuming item.

"overlay name": "rust sprite asset(rust color code)"
"hurt_overlay": "assets/content/ui/overlay_poisoned.png(0.56 0.20 0.15 1.0)",

assets/content/ui/overlay_poisoned.png
assets/content/ui/overlay_freezing.png
assets/content/ui/ui.background.transparent.radial.psd
assets/content/ui/ui.background.transparent.linear.psd


Some of you might have question how players can get by those customs materials to mix/craft items. This is the part where common knowledge of rust items and plugins is required most. There are multiple paid/free plugins which can be used for this purpose but you need to be able configure them. I do NOT provide support with configuring loot tables or else, it's not part of my plugin/service however I will try to give you pointers of what you can use.

To distribute custom resources, plugin has to provide you with 3 options to modify.
shortname
skin id
display name


General Item Modifier

This plugin is modifying items after they are created. This means that whenever item is crafted, bought, dropped or found, item name and skin id will change based on what you configure. This plugin is required if you want add custom materials into loot containers with help of BetterLoot or AlphaLoot. As far as I know, those two plugins does not provide option for display name. Also keep in mind that this plugin will globably change all items with specific shortname. It's best practice to use items which are not used ingame, like sticks, bleach, paper, geiger, submarine etc...


Static Lootables

This plugin is creating new lootable objects while giving you option to change both, skin id and display name.
I would say this is "go to" plugin for roleplay servers. Can't recommend it enough.


Extra Gather Bonuses

With this plugin you can set chance to receive extra item when gathering any resource. For example, when you picking up hemp you can set chance to recive extra item. Shortname, display name, skin, chance to drop and amount can be modified in settings. Also great addition to any roleplay server, you just have to be bit creative to come up with some interesting combinations.


Custom Vending Setup

This plugin allows you customize what is sold at Outpost/Bandit Camp.


User interface phrases
config/DrugMixing.json

Recipe description and stats
data/DrugMixing/Recipies.json

Crafted item tooltip
data/ConsumableBuffs/Buffs.json

Ingredience custom names
data/ConsumableBuffs/Custom_Names(ingredients).json