mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
59 lines
1.5 KiB
Lua
59 lines
1.5 KiB
Lua
--[[
|
|
| This file was obtained through the combined efforts
|
|
| of Madbluntz & Plymouth Antiquarian Society.
|
|
|
|
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
|
| Maloy, DrPepper10 @ RIP, Atle!
|
|
|
|
|
| Visit for more: https://plymouth.thetwilightzone.ru/
|
|
--]]
|
|
|
|
local RECIPE = ix.recipe:New()
|
|
RECIPE.uniqueID = "rec_cigarette"
|
|
RECIPE.name = "Étiquette de paquet de cigarettes"
|
|
RECIPE.description = "Et si on enlevait le logo de l'Union de ce paquet..."
|
|
RECIPE.model = "models/willardnetworks/cigarettes/cigarette_pack_1.mdl"
|
|
RECIPE.category = "Anti-Citoyen"
|
|
RECIPE.subcategory = "Cigarettes"
|
|
RECIPE.tool = "tool_scissors"
|
|
RECIPE.ingredients = {["ciggie_pack"] = 1, ["comp_cloth"] = 1}
|
|
RECIPE.result = {["ciggie_pack"] = 1}
|
|
RECIPE.hidden = false
|
|
RECIPE.skill = "crafting"
|
|
RECIPE.level = 0
|
|
RECIPE.experience = {
|
|
{level = 0, exp = 15}, -- full xp
|
|
{level = 10, exp = 10}, -- half xp
|
|
{level = 15, exp = 0} -- no xp
|
|
}
|
|
|
|
function RECIPE:PlayerCraftRecipe(client)
|
|
local character = client:GetCharacter()
|
|
local inventory = character:GetInventory()
|
|
|
|
-- Take all the ingredients
|
|
for ingredient, amount in pairs(self.ingredients) do
|
|
for _ = 1, amount do
|
|
local item = inventory:HasItem(ingredient)
|
|
|
|
if (item) then
|
|
if (item.uniqueID == "ciggie_pack") then
|
|
item:SetData("relabeled", true)
|
|
else
|
|
item:Remove()
|
|
end
|
|
else
|
|
break
|
|
end
|
|
end
|
|
end
|
|
|
|
-- Set the player's next crafting time
|
|
client.ixNextCraftTime = CurTime() + 2
|
|
netstream.Start("CraftTime", client.ixNextCraftTime)
|
|
|
|
character:DoAction("recipe_" .. self.uniqueID)
|
|
end
|
|
|
|
RECIPE:Register()
|