{ -- EXAMPLE
id = 'drug_id', -- unique identifier for the drug
name = 'Drug Name', -- name of the drug
description = 'Description of the drug', -- description of the drug
icon = 'fa-icon-name', -- FontAwesome icon (without the "fas" prefix)
color = 'blue', -- Valid colors: 'blue', 'pink', 'orange', 'green'
ingredients = { -- list of ingredients required to make the drug
-- Must have a minimum of 1 ingredient, no maximum amount
-- id: item name of the ingredient (string)
-- name: display name of the ingredient for UI (string)
-- amount: amount of the ingredient required (number)
{ id = 'ingredient_id1', name = 'Ingredient Name 1', amount = 1},
{ id = 'ingredient_id2', name = 'Ingredient Name 2', amount = 2},
{ id = 'ingredient_id3', name = 'Ingredient Name 3', amount = 3}
{ id = 'ingredient_id4', name = 'Ingredient Name 4', amount = 4}
{ id = 'ingredient_id5', name = 'Ingredient Name 5', amount = 5}
},
-- optional: define a custom ideal formula (must match number of ingredients)
-- if not provided, the server will generate this randomly on startup
idealMix = {40, 30, 30, 20, 10},
effects = 'Effects description for UI display' -- effects of the drug (string, for UI)
},
So, based on this example we could add a new Drug called "Molly":
{
id = 'molly',
name = 'Molly',
description = 'Pure MDMA in crystalline form',
icon = 'fa-heart',
color = 'pink',
ingredients = {
{ id = 'safrole_oil', name = 'Safrole Oil', amount = 5},
{ id = 'methylamine', name = 'Methylamine', amount = 3},
{ id = 'hydrogen_peroxide', name = 'Hydrogen Peroxide', amount = 2}
},
idealMix = {70, 50, 20},
effects = "Pure euphoria in crystalline form. Users experience waves of bliss, enhanced sensations, and boundless energy. The comedown is just as legendary as the high."
},
We can specify an idealMix here, defining the formula for a player to use of the ingredients. In this example, a formula of 70 Safrole Oil, 50 Methylamine and 20 Hydrogen Peroxide would make a package with the perfect purity. These do not need to add up to 100.
If you don't define an idealMix, the server will generate it automatically every restart. I would recommend allowing this to happen, as it makes sure your players need to experiment everyday to find the perfect formula.
The ingredients you add must also exist in your inventory resource. So for our example, safrole_oil, methylamine and hydrogen_peroxide should be added to ox_inventory/data/items.lua (or your custom inventory) like the example below:
-- MDMA/Molly ingredients
['safrole_oil'] = {
label = 'Safrole Oil',
weight = 180,
stack = true,
degrade = 4320, -- 3 days
decay = true,
description = 'An essential oil extracted from sassafras plants, used in MDMA production.',
client = {
image = 'safrole_oil.png',
}
},
['methylamine'] = {
label = 'Methylamine',
weight = 220,
stack = true,
degrade = 5760, -- 4 days
decay = true,
description = 'A colorless gas derivative of ammonia used in various drug syntheses.',
client = {
image = 'methylamine.png',
}
},
['hydrogen_peroxide'] = {
label = 'Hydrogen Peroxide',
weight = 150,
stack = true,
degrade = 8640, -- 6 days
decay = true,
description = 'A strong oxidizer used in chemical reactions and drug manufacturing.',
client = {
image = 'hydrogen_peroxide.png',
}
},
Finally, add your new drug type to the DrugPriceModifiers table, for example:
["molly"] = 1.4, -- Molly sells for 40% more than base price
It's your choice what you choose for weight, decay, etc. I would recommend setting realistic weights and decay values. It ensures your players can't stockpile ingredients, and makes for some reasonable inventory management. You will need to either make your own inventory images, or find them online.
That's it, you're done! After saving your changes and restarting the resource, this new drug will appear in the Drug Processing UI: both on the products tab with the information you supplied, and on the mixing tab for players to begin creating them.