mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.uniqueID = "base_assembly"
|
||||
ITEM.name = "Kit d'assemblage de base"
|
||||
ITEM.description = "Alongside a set of instructions, this wooden package contains a high ordeal of different component pieces for Crafting apperatus."
|
||||
ITEM.category = "Tools"
|
||||
ITEM.width = 3
|
||||
ITEM.height = 3
|
||||
ITEM.model = "models/props_junk/wood_crate001a.mdl"
|
||||
ITEM.useSound = "physics/metal/metal_box_break1.wav"
|
||||
ITEM.openedItem = "tool_craftingbench"
|
||||
ITEM.openRequirement = "tool_toolkit"
|
||||
|
||||
ITEM.functions.Assemble = {
|
||||
icon = "icon16/wrench.png",
|
||||
OnCanRun = function(item)
|
||||
return !IsValid(item.entity)
|
||||
end,
|
||||
OnRun = function(item)
|
||||
local client = item.player
|
||||
|
||||
if (client.CantPlace) then
|
||||
client:NotifyLocalized("assembleCant")
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
client.CantPlace = true
|
||||
|
||||
timer.Simple(3, function()
|
||||
if (client) then
|
||||
client.CantPlace = false
|
||||
end
|
||||
end)
|
||||
|
||||
local character = client:GetCharacter()
|
||||
local inventory = character:GetInventory()
|
||||
local requirementTable = ix.item.list[item.openRequirement]
|
||||
local requirementName = requirementTable.name or item.openRequirement
|
||||
local openerItem = inventory:HasItem(item.openRequirement)
|
||||
|
||||
if (!openerItem) then
|
||||
client:NotifyLocalized("assembleMissingRequirement", requirementName)
|
||||
|
||||
return false
|
||||
else
|
||||
if (item.openedItem) then
|
||||
local openedItemName = ix.item.list[item.openedItem].name or item.openedItem
|
||||
local openedItemWidth, openedItemHeight = ix.item.list[item.openedItem].width, ix.item.list[item.openedItem].height
|
||||
|
||||
timer.Simple(0.25, function()
|
||||
if (inventory:FindEmptySlot(openedItemWidth, openedItemHeight)) then
|
||||
inventory:Add(item.openedItem)
|
||||
|
||||
if (openerItem.isTool) then
|
||||
openerItem:DamageDurability(1)
|
||||
end
|
||||
|
||||
client:EmitSound(item.useSound)
|
||||
|
||||
client:NotifyLocalized("assembleSuccess", openedItemName)
|
||||
else
|
||||
client:NotifyLocalized("assembleNoSpace", openedItemWidth, openedItemHeight)
|
||||
|
||||
inventory:Add(item.uniqueID)
|
||||
end
|
||||
end)
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Base de composants d'artisanat"
|
||||
ITEM.description = "Just for file structuring, not an item."
|
||||
ITEM.category = "Crafting Components"
|
||||
ITEM.base = "base_stackable"
|
||||
|
||||
ITEM.maxStackSize = 4
|
||||
@@ -0,0 +1,13 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Socle factice"
|
||||
ITEM.description = "Juste pour structurer un fichier, pas un élément."
|
||||
ITEM.category = "Dummy"
|
||||
@@ -0,0 +1,13 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Expedition Base"
|
||||
ITEM.description = "Just for file structuring, not an item."
|
||||
ITEM.category = "Expedition"
|
||||
@@ -0,0 +1,16 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Ingredient Base"
|
||||
ITEM.description = "Just for file structuring, not an item."
|
||||
ITEM.category = "Ingredients"
|
||||
ITEM.base = "base_stackable"
|
||||
|
||||
ITEM.maxStackSize = 4
|
||||
@@ -0,0 +1,13 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Junk Base"
|
||||
ITEM.description = "Just for file structuring, not an item."
|
||||
ITEM.category = "Junk"
|
||||
@@ -0,0 +1,16 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Medical Components Base"
|
||||
ITEM.description = "Just for file structuring, not an item."
|
||||
ITEM.category = "Medical Components"
|
||||
ITEM.base = "base_stackable"
|
||||
|
||||
ITEM.maxStackSize = 4
|
||||
@@ -0,0 +1,187 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.name = "Workbench Base"
|
||||
ITEM.description = "It is a workbench. Can only be picked up by the first person to place it."
|
||||
ITEM.category = "Workbenches"
|
||||
ITEM.isWorkbench = true
|
||||
|
||||
ITEM.functions.place = {
|
||||
name = "Placer",
|
||||
tip = "Place the workbench",
|
||||
icon = "icon16/brick_add.png",
|
||||
OnRun = function(item)
|
||||
local client = item.player
|
||||
|
||||
if (!client:Alive()) then return false end
|
||||
client:EmitSound("physics/cardboard/cardboard_box_break3.wav")
|
||||
|
||||
client.previousWep = client:GetActiveWeapon():GetClass()
|
||||
client:Give("weapon_workbench_placer")
|
||||
client:SelectWeapon("weapon_workbench_placer")
|
||||
|
||||
local weapon = client:GetActiveWeapon()
|
||||
weapon:SetInfo(item.uniqueID, item.model)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
return (!IsValid(item.entity))
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.Use = {
|
||||
name = "Utiliser",
|
||||
icon = "icon16/wrench.png",
|
||||
OnCanRun = function(itemTable)
|
||||
return IsValid(itemTable.entity)
|
||||
end,
|
||||
OnClick = function(itemTable)
|
||||
LocalPlayer().lastSelectedSkill = itemTable.workbenchSkill
|
||||
ix.gui.lastMenuTab = 3
|
||||
|
||||
if (!IsValid(ix.gui.menu)) then
|
||||
vgui.Create("ixMenu")
|
||||
end
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.PackUp = {
|
||||
name = "Emballer",
|
||||
icon = "icon16/box.png",
|
||||
OnRun = function(item)
|
||||
local client = item.player
|
||||
local character = client and IsValid(client) and client.GetCharacter and client:GetCharacter()
|
||||
local inventory = character:GetInventory()
|
||||
local toolkit = inventory:HasItem("tool_toolkit")
|
||||
|
||||
if (!toolkit) then
|
||||
client:Notify("Vous avez besoin d'une trousse à outil pour emballer cela !")
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
if (item:GetData("bolted", false)) then
|
||||
client:Notify("Cette station est visée !")
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
local placerData = item:GetData("placer", false)
|
||||
if placerData and character:GetID() != placerData then
|
||||
client:Notify("Vous ne possédez pas cela !")
|
||||
return false
|
||||
end
|
||||
|
||||
client:SetAction("Emballage en cours...", 10, function()
|
||||
if (inventory:Add(item.uniqueID .. "_assembly")) then
|
||||
toolkit:DamageDurability(1)
|
||||
client:Notify("Station emballée.")
|
||||
else
|
||||
client:Notify("Vous n'avez pas assez de place pour emballer cela !")
|
||||
|
||||
return false
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
return !item.noPackUp
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.Bolt = {
|
||||
name = "Viser",
|
||||
icon = "icon16/wrench.png",
|
||||
OnRun = function(item)
|
||||
local client = item.player
|
||||
local inventory = client:GetCharacter():GetInventory()
|
||||
local toolkit = inventory:HasItem("tool_toolkit")
|
||||
|
||||
if (!toolkit) then
|
||||
client:Notify("Vous avez besoin d'une caisse à outil !")
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
client:SetAction("Vous vissez la station.", 10, function()
|
||||
item:SetData("bolted", true)
|
||||
|
||||
client:Notify("Vous avez visé la station.")
|
||||
end)
|
||||
|
||||
toolkit:DamageDurability(1)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
return itemTable.entity and itemTable.entity:IsValid() and !itemTable:GetData("bolted", false)
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.UnBolt = {
|
||||
name = "Déviser",
|
||||
icon = "icon16/wrench_orange.png",
|
||||
OnRun = function(item)
|
||||
local client = item.player
|
||||
|
||||
if (client:IsAdmin()) then
|
||||
item:SetData("bolted", false)
|
||||
|
||||
client:Notify("Table dévisée.")
|
||||
else
|
||||
client:Notify("Nécessite la supervision d'un Admin.")
|
||||
end
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
return itemTable.entity and itemTable.entity:IsValid() and itemTable:GetData("bolted", false)
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.postHooks.drop = function(item, result)
|
||||
if (item.player and !item:GetData("placer")) then
|
||||
item:SetData("placer", item.player:GetCharacter():GetID())
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:CanTransfer(oldInventory, newInventory)
|
||||
local placerData = self:GetData("placer", false)
|
||||
local newInvOwner = newInventory and newInventory.GetOwner and newInventory:GetOwner()
|
||||
|
||||
if newInventory and newInvOwner then
|
||||
if newInvOwner and IsValid(newInvOwner) then
|
||||
if placerData and newInvOwner.GetCharacter and newInvOwner:GetCharacter():GetID() != placerData then
|
||||
newInvOwner:Notify("Vous n'êtes pas le propriétaire !")
|
||||
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ITEM:OnEntityCreated(entity)
|
||||
timer.Simple(1, function()
|
||||
if (IsValid(entity)) then
|
||||
local physObj = entity:GetPhysicsObject()
|
||||
physObj:EnableMotion(false)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ITEM:OnEntityTakeDamage(entity, damage)
|
||||
return false
|
||||
end
|
||||
Reference in New Issue
Block a user