mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-18 06:03:47 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
--[[
|
||||
| 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 = "TFA Weapons"
|
||||
ITEM.base = "base_weapons"
|
||||
ITEM.description = "A Weapon."
|
||||
ITEM.category = "Weapons"
|
||||
ITEM.model = "models/weapons/w_pistol.mdl"
|
||||
ITEM.class = "weapon_pistol"
|
||||
ITEM.width = 2
|
||||
ITEM.height = 2
|
||||
ITEM.isWeapon = true
|
||||
ITEM.isGrenade = false
|
||||
ITEM.weaponCategory = "sidearm"
|
||||
ITEM.useSound = "items/ammo_pickup.wav"
|
||||
|
||||
ITEM.atts = {}
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local description = {self.description}
|
||||
return table.concat(description, "")
|
||||
end
|
||||
|
||||
function ITEM:GetBaseInfo()
|
||||
local baseInfo = {}
|
||||
if (self.balanceCat) then
|
||||
baseInfo[#baseInfo + 1] = "Weapon Category: "
|
||||
baseInfo[#baseInfo + 1] = self.balanceCat
|
||||
if (self.isMelee) then
|
||||
baseInfo[#baseInfo + 1] = " melee"
|
||||
end
|
||||
if (CLIENT) then
|
||||
baseInfo[#baseInfo + 1] = "\nBase crit chance: "
|
||||
if (self.isMelee) then
|
||||
baseInfo[#baseInfo + 1] = math.max(math.floor(ix.weapons:GetMeleeWeaponBaseHitChance(LocalPlayer():GetCharacter(), self.class) * ix.weapons:GetWeaponAimPenalty(self.class) * 100), 0)
|
||||
else
|
||||
baseInfo[#baseInfo + 1] = math.floor(ix.weapons:GetWeaponSkillMod(LocalPlayer():GetCharacter(), self.class) * ix.weapons:GetWeaponAimPenalty(self.class) * 100)
|
||||
end
|
||||
baseInfo[#baseInfo + 1] = "%%"
|
||||
end
|
||||
end
|
||||
|
||||
return table.concat(baseInfo, "")
|
||||
end
|
||||
|
||||
function ITEM:GetExtendedInfo()
|
||||
local extendedInfo = {}
|
||||
if (self.balanceCat) then
|
||||
if (self.isMelee) then
|
||||
extendedInfo[#extendedInfo + 1] = "Base damage: "
|
||||
extendedInfo[#extendedInfo + 1] = ix.weapons:GetMeleeWeaponBaseDamage(self.class)
|
||||
else
|
||||
extendedInfo[#extendedInfo + 1] = "Base damage: "
|
||||
extendedInfo[#extendedInfo + 1] = ix.weapons:GetWeaponBaseDamage(self.class)
|
||||
|
||||
local min, max, bFlat = ix.weapons:GetWeaponSkillRequired(self.class)
|
||||
if (!bFlat) then
|
||||
extendedInfo[#extendedInfo + 1] = "\nSkill range: "
|
||||
extendedInfo[#extendedInfo + 1] = min.."-"..max
|
||||
else
|
||||
extendedInfo[#extendedInfo + 1] = "\nSkill required: "
|
||||
extendedInfo[#extendedInfo + 1] = min
|
||||
end
|
||||
|
||||
local minR, effR = ix.weapons:GetWeaponEffectiveRanges(self.class)
|
||||
extendedInfo[#extendedInfo + 1] = "\nMinimum effective range: "
|
||||
extendedInfo[#extendedInfo + 1] = minR.."m"
|
||||
extendedInfo[#extendedInfo + 1] = "\nMaximum effective range: "
|
||||
extendedInfo[#extendedInfo + 1] = effR.."m"
|
||||
|
||||
extendedInfo[#extendedInfo + 1] = "\nShots per action point: "
|
||||
extendedInfo[#extendedInfo + 1] = ix.weapons:GetWeaponNumShots(self.class)
|
||||
extendedInfo[#extendedInfo + 1] = "\nArmor Penetration: "
|
||||
extendedInfo[#extendedInfo + 1] = math.floor(ix.weapons:GetArmorPen(self.class) * 100).."%%"
|
||||
end
|
||||
end
|
||||
|
||||
return table.concat(extendedInfo, "")
|
||||
end
|
||||
|
||||
function ITEM:GetColorAppendix()
|
||||
if self.balanceCat then
|
||||
return {["blue"] = self:GetBaseInfo(), ["red"] = self:GetExtendedInfo()}
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:OnRegistered()
|
||||
if (self.balanceCat and ix.weapons) then
|
||||
if (self.isMelee) then
|
||||
ix.weapons:RegisterMeleeWeapon(self.class, self.balanceCat)
|
||||
else
|
||||
ix.weapons:RegisterWeapon(self.class, self.balanceCat)
|
||||
end
|
||||
|
||||
ix.weapons:RegisterWeaponExceptions(self.class, self.baseDamage, self.armorPen, self.aimPenalty, self.numShots)
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:OnEquipWeapon(client, weapon)
|
||||
if (self:GetData("BioLocked") or self:GetData("tfa_atts") or !table.IsEmpty(self.atts)) then
|
||||
timer.Simple(0.5, function()
|
||||
weapon:SetNetVar("ixItemAtts", self.atts)
|
||||
|
||||
if (!IsValid(weapon)) then return end
|
||||
weapon:InitAttachments()
|
||||
|
||||
for _, v in pairs(self.atts) do
|
||||
if (self:GetData("tfa_default_atts_uneq", {})[v]) then continue end
|
||||
|
||||
weapon:Attach(v)
|
||||
end
|
||||
|
||||
if (self:GetData("tfa_atts")) then
|
||||
for _, v in pairs(self:GetData("tfa_atts")) do
|
||||
if (istable(v) and v.att) then
|
||||
weapon:Attach(v.att)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (self:GetData("BioLocked")) then
|
||||
weapon:SetNetVar("BioLocked", true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| 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 = "Baseball Bat"
|
||||
ITEM.description = "For all your batting needs... as long as you even allowed to have such fun anymore."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_bat_metal.mdl"
|
||||
ITEM.class = "tfa_nmrih_bat"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "medium"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.62, 400.03, 0),
|
||||
fov = 0.58
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| 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 = "Claw Hammer"
|
||||
ITEM.description = "A standard claw hammer used for hammering nails."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_tool_barricade.mdl"
|
||||
ITEM.class = "tfa_nmrih_bcd"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "light"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 3
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.69, 400, 0),
|
||||
fov = 0.35
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
--[[
|
||||
| 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 = "Cleaver"
|
||||
ITEM.description = "A cleaver to chop up meat."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_cleaver.mdl"
|
||||
ITEM.class = "tfa_nmrih_cleaver"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "light"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 3
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.73, 400.09, 0),
|
||||
fov = 0.35
|
||||
}
|
||||
|
||||
ITEM.maxDurability = 20
|
||||
ITEM.isTool = true
|
||||
|
||||
local color_green = Color(100, 255, 100)
|
||||
local color_red = Color(200, 25, 25)
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PaintOver(item, w, h)
|
||||
if (item:GetData("equip")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawRect(w - 14, h - 20, 8, 8)
|
||||
end
|
||||
local maxDurability = item:GetMaxDurability()
|
||||
local durability = item:GetDurability()
|
||||
local width = w - 8
|
||||
local cellWidth = math.Round(width / maxDurability)
|
||||
local color = ix.util.ColorLerp(1 - durability / maxDurability, color_green, color_red)
|
||||
surface.SetDrawColor(color)
|
||||
|
||||
for i = 0, durability - 1 do
|
||||
surface.DrawRect(5 + i * cellWidth, h - 8, cellWidth - 1, 4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.SetMaxDurability = {
|
||||
name = "Set max durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter max durability value", itemTable:GetMaxDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0) then
|
||||
netstream.Start("ixSetToolMaxDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.SetDurability = {
|
||||
name = "Set durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter durability value for this tool here", itemTable:GetDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0 and amount <= itemTable:GetMaxDurability()) then
|
||||
netstream.Start("ixSetToolDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local maxDurability = self:GetMaxDurability()
|
||||
local durability = self:GetDurability()
|
||||
return self.description .. "\n\nDurability: " .. durability .. "/" .. maxDurability
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced(index, x, y, item)
|
||||
self:SetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:DamageDurability(amount)
|
||||
self:SetData("durability", math.max(0, self:GetDurability() - 1))
|
||||
|
||||
if (self:GetDurability() == 0) then
|
||||
self:OnBreak()
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:GetBreakSound()
|
||||
return "weapons/crowbar/crowbar_impact"..math.random(1, 2)..".wav"
|
||||
end
|
||||
|
||||
function ITEM:OnBreak()
|
||||
local breakSound = self:GetBreakSound()
|
||||
|
||||
if (IsValid(self.player)) then
|
||||
self.player:EmitSound(breakSound, 65)
|
||||
elseif (IsValid(self.entity)) then
|
||||
self.entity:EmitSound(breakSound, 65)
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ITEM:GetDurability()
|
||||
return self:GetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:GetMaxDurability()
|
||||
return self:GetData("maxDurability", self.maxDurability)
|
||||
end
|
||||
@@ -0,0 +1,152 @@
|
||||
--[[
|
||||
| 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 = "Crowbar"
|
||||
ITEM.description = "Hmm... a crowbar. Now don't go whacking the Civil Protection to death with it."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_crowbar.mdl"
|
||||
ITEM.class = "tfa_nmrih_crowbar"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "medium"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(25.07, 400.05, 0),
|
||||
fov = 0.58
|
||||
}
|
||||
ITEM.maxDurability = 25
|
||||
ITEM.isTool = true
|
||||
|
||||
local color_green = Color(100, 255, 100)
|
||||
local color_red = Color(200, 25, 25)
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PaintOver(item, w, h)
|
||||
if (item:GetData("equip")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawRect(w - 14, h - 20, 8, 8)
|
||||
end
|
||||
local maxDurability = item:GetMaxDurability()
|
||||
local durability = item:GetDurability()
|
||||
local width = w - 8
|
||||
local cellWidth = math.Round(width / maxDurability)
|
||||
local color = ix.util.ColorLerp(1 - durability / maxDurability, color_green, color_red)
|
||||
surface.SetDrawColor(color)
|
||||
|
||||
for i = 0, durability - 1 do
|
||||
surface.DrawRect(5 + i * cellWidth, h - 8, cellWidth - 1, 4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.SetMaxDurability = {
|
||||
name = "Set max durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter max durability value", itemTable:GetMaxDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0) then
|
||||
netstream.Start("ixSetToolMaxDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.SetDurability = {
|
||||
name = "Set durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter durability value for this tool here", itemTable:GetDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0 and amount <= itemTable:GetMaxDurability()) then
|
||||
netstream.Start("ixSetToolDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local maxDurability = self:GetMaxDurability()
|
||||
local durability = self:GetDurability()
|
||||
return self.description .. "\n\nDurability: " .. durability .. "/" .. maxDurability
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced(index, x, y, item)
|
||||
self:SetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:DamageDurability(amount)
|
||||
self:SetData("durability", math.max(0, self:GetDurability() - 1))
|
||||
|
||||
if (self:GetDurability() == 0) then
|
||||
self:OnBreak()
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:GetBreakSound()
|
||||
return "weapons/crowbar/crowbar_impact"..math.random(1, 2)..".wav"
|
||||
end
|
||||
|
||||
function ITEM:OnBreak()
|
||||
local breakSound = self:GetBreakSound()
|
||||
|
||||
if (IsValid(self.player)) then
|
||||
self.player:EmitSound(breakSound, 65)
|
||||
elseif (IsValid(self.entity)) then
|
||||
self.entity:EmitSound(breakSound, 65)
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ITEM:GetDurability()
|
||||
return self:GetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:GetMaxDurability()
|
||||
return self:GetData("maxDurability", self.maxDurability)
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| 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 = "Fire Axe"
|
||||
ITEM.description = "A fireaxe for breaking open walls or doors when people are in danger, or used for self-defense."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_axe_fire.mdl"
|
||||
ITEM.class = "tfa_nmrih_fireaxe"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "heavy"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.94, 400.02, 0),
|
||||
fov = 0.68
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
--[[
|
||||
| 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 = "Fubar"
|
||||
ITEM.description = "A large tool used for engineering. I think you see the CEC holding these at times."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_fubar.mdl"
|
||||
ITEM.class = "tfa_nmrih_fubar"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "heavy"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.82, 400.04, 0),
|
||||
fov = 0.84
|
||||
}
|
||||
ITEM.maxDurability = 40
|
||||
ITEM.isTool = true
|
||||
|
||||
local color_green = Color(100, 255, 100)
|
||||
local color_red = Color(200, 25, 25)
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PaintOver(item, w, h)
|
||||
if (item:GetData("equip")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawRect(w - 14, h - 20, 8, 8)
|
||||
end
|
||||
local maxDurability = item:GetMaxDurability()
|
||||
local durability = item:GetDurability()
|
||||
local width = w - 8
|
||||
local cellWidth = math.Round(width / maxDurability)
|
||||
local color = ix.util.ColorLerp(1 - durability / maxDurability, color_green, color_red)
|
||||
surface.SetDrawColor(color)
|
||||
|
||||
for i = 0, durability - 1 do
|
||||
surface.DrawRect(5 + i * cellWidth, h - 8, cellWidth - 1, 4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.SetMaxDurability = {
|
||||
name = "Set max durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter max durability value", itemTable:GetMaxDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0) then
|
||||
netstream.Start("ixSetToolMaxDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.SetDurability = {
|
||||
name = "Set durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter durability value for this tool here", itemTable:GetDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0 and amount <= itemTable:GetMaxDurability()) then
|
||||
netstream.Start("ixSetToolDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local maxDurability = self:GetMaxDurability()
|
||||
local durability = self:GetDurability()
|
||||
return self.description .. "\n\nDurability: " .. durability .. "/" .. maxDurability
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced(index, x, y, item)
|
||||
self:SetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:DamageDurability(amount)
|
||||
self:SetData("durability", math.max(0, self:GetDurability() - 1))
|
||||
|
||||
if (self:GetDurability() == 0) then
|
||||
self:OnBreak()
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:GetBreakSound()
|
||||
return "weapons/crowbar/crowbar_impact"..math.random(1, 2)..".wav"
|
||||
end
|
||||
|
||||
function ITEM:OnBreak()
|
||||
local breakSound = self:GetBreakSound()
|
||||
|
||||
if (IsValid(self.player)) then
|
||||
self.player:EmitSound(breakSound, 65)
|
||||
elseif (IsValid(self.entity)) then
|
||||
self.entity:EmitSound(breakSound, 65)
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ITEM:GetDurability()
|
||||
return self:GetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:GetMaxDurability()
|
||||
return self:GetData("maxDurability", self.maxDurability)
|
||||
end
|
||||
@@ -0,0 +1,154 @@
|
||||
--[[
|
||||
| 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 = "Hatchet"
|
||||
ITEM.description = "Your standard hatchet used to cut down trees or people."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_hatchet.mdl"
|
||||
ITEM.class = "tfa_nmrih_hatchet"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "light"
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_hatchet.mdl"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 3
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.97, 400.05, 0),
|
||||
fov = 0.48
|
||||
}
|
||||
|
||||
ITEM.maxDurability = 12
|
||||
ITEM.isTool = true
|
||||
|
||||
local color_green = Color(100, 255, 100)
|
||||
local color_red = Color(200, 25, 25)
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PaintOver(item, w, h)
|
||||
if (item:GetData("equip")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawRect(w - 14, h - 20, 8, 8)
|
||||
end
|
||||
local maxDurability = item:GetMaxDurability()
|
||||
local durability = item:GetDurability()
|
||||
local width = w - 8
|
||||
local cellWidth = math.Round(width / maxDurability)
|
||||
local color = ix.util.ColorLerp(1 - durability / maxDurability, color_green, color_red)
|
||||
surface.SetDrawColor(color)
|
||||
|
||||
for i = 0, durability - 1 do
|
||||
surface.DrawRect(5 + i * cellWidth, h - 8, cellWidth - 1, 4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.SetMaxDurability = {
|
||||
name = "Set max durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter max durability value", itemTable:GetMaxDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0) then
|
||||
netstream.Start("ixSetToolMaxDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.SetDurability = {
|
||||
name = "Set durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter durability value for this tool here", itemTable:GetDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0 and amount <= itemTable:GetMaxDurability()) then
|
||||
netstream.Start("ixSetToolDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local maxDurability = self:GetMaxDurability()
|
||||
local durability = self:GetDurability()
|
||||
return self.description .. "\n\nDurability: " .. durability .. "/" .. maxDurability
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced(index, x, y, item)
|
||||
self:SetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:DamageDurability(amount)
|
||||
self:SetData("durability", math.max(0, self:GetDurability() - 1))
|
||||
|
||||
if (self:GetDurability() == 0) then
|
||||
self:OnBreak()
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:GetBreakSound()
|
||||
return "weapons/crowbar/crowbar_impact"..math.random(1, 2)..".wav"
|
||||
end
|
||||
|
||||
function ITEM:OnBreak()
|
||||
local breakSound = self:GetBreakSound()
|
||||
|
||||
if (IsValid(self.player)) then
|
||||
self.player:EmitSound(breakSound, 65)
|
||||
elseif (IsValid(self.entity)) then
|
||||
self.entity:EmitSound(breakSound, 65)
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ITEM:GetDurability()
|
||||
return self:GetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:GetMaxDurability()
|
||||
return self:GetData("maxDurability", self.maxDurability)
|
||||
end
|
||||
@@ -0,0 +1,154 @@
|
||||
--[[
|
||||
| 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 = "Kitchen Knife"
|
||||
ITEM.description = "A sharpened kitchen knife, compared to the standard knife that Combine offers... this one is most certainly not allowed."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_kitknife.mdl"
|
||||
ITEM.class = "tfa_nmrih_kknife"
|
||||
ITEM.isMelee = true
|
||||
ITEM.baseDamage = 17
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "light"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 2
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(0.77, -5.3, 199.95),
|
||||
ang = Angle(91.56, 278.2, 0),
|
||||
fov = 1.73
|
||||
}
|
||||
|
||||
ITEM.maxDurability = 9
|
||||
ITEM.isTool = true
|
||||
|
||||
local color_green = Color(100, 255, 100)
|
||||
local color_red = Color(200, 25, 25)
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PaintOver(item, w, h)
|
||||
if (item:GetData("equip")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawRect(w - 14, h - 20, 8, 8)
|
||||
end
|
||||
local maxDurability = item:GetMaxDurability()
|
||||
local durability = item:GetDurability()
|
||||
local width = w - 8
|
||||
local cellWidth = math.Round(width / maxDurability)
|
||||
local color = ix.util.ColorLerp(1 - durability / maxDurability, color_green, color_red)
|
||||
surface.SetDrawColor(color)
|
||||
|
||||
for i = 0, durability - 1 do
|
||||
surface.DrawRect(5 + i * cellWidth, h - 8, cellWidth - 1, 4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.SetMaxDurability = {
|
||||
name = "Set max durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter max durability value", itemTable:GetMaxDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0) then
|
||||
netstream.Start("ixSetToolMaxDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.SetDurability = {
|
||||
name = "Set durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter durability value for this tool here", itemTable:GetDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0 and amount <= itemTable:GetMaxDurability()) then
|
||||
netstream.Start("ixSetToolDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local maxDurability = self:GetMaxDurability()
|
||||
local durability = self:GetDurability()
|
||||
return self.description .. "\n\nDurability: " .. durability .. "/" .. maxDurability
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced(index, x, y, item)
|
||||
self:SetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:DamageDurability(amount)
|
||||
self:SetData("durability", math.max(0, self:GetDurability() - 1))
|
||||
|
||||
if (self:GetDurability() == 0) then
|
||||
self:OnBreak()
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:GetBreakSound()
|
||||
return "weapons/crowbar/crowbar_impact"..math.random(1, 2)..".wav"
|
||||
end
|
||||
|
||||
function ITEM:OnBreak()
|
||||
local breakSound = self:GetBreakSound()
|
||||
|
||||
if (IsValid(self.player)) then
|
||||
self.player:EmitSound(breakSound, 65)
|
||||
elseif (IsValid(self.entity)) then
|
||||
self.entity:EmitSound(breakSound, 65)
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ITEM:GetDurability()
|
||||
return self:GetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:GetMaxDurability()
|
||||
return self:GetData("maxDurability", self.maxDurability)
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| 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 = "Lead Pipe"
|
||||
ITEM.description = "A pipe for you to use as a standard weapon, just don't go ripping pipes out of walls now."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_pipe_lead.mdl"
|
||||
ITEM.class = "tfa_nmrih_lpipe"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "medium"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(25, 400.02, 0),
|
||||
fov = 0.53
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
--[[
|
||||
| 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 = "Machete"
|
||||
ITEM.description = "A sharp machete for you to use... but what do you plan to do with it?"
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_machete.mdl"
|
||||
ITEM.class = "tfa_nmrih_machete"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "medium"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(0, 200, 0),
|
||||
ang = Angle(-0.01, 270.06, 0),
|
||||
fov = 2.51
|
||||
}
|
||||
|
||||
ITEM.maxDurability = 15
|
||||
ITEM.isTool = true
|
||||
|
||||
local color_green = Color(100, 255, 100)
|
||||
local color_red = Color(200, 25, 25)
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PaintOver(item, w, h)
|
||||
if (item:GetData("equip")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawRect(w - 14, h - 20, 8, 8)
|
||||
end
|
||||
local maxDurability = item:GetMaxDurability()
|
||||
local durability = item:GetDurability()
|
||||
local width = w - 8
|
||||
local cellWidth = math.Round(width / maxDurability)
|
||||
local color = ix.util.ColorLerp(1 - durability / maxDurability, color_green, color_red)
|
||||
surface.SetDrawColor(color)
|
||||
|
||||
for i = 0, durability - 1 do
|
||||
surface.DrawRect(5 + i * cellWidth, h - 8, cellWidth - 1, 4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.SetMaxDurability = {
|
||||
name = "Set max durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter max durability value", itemTable:GetMaxDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0) then
|
||||
netstream.Start("ixSetToolMaxDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.SetDurability = {
|
||||
name = "Set durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter durability value for this tool here", itemTable:GetDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0 and amount <= itemTable:GetMaxDurability()) then
|
||||
netstream.Start("ixSetToolDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local maxDurability = self:GetMaxDurability()
|
||||
local durability = self:GetDurability()
|
||||
return self.description .. "\n\nDurability: " .. durability .. "/" .. maxDurability
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced(index, x, y, item)
|
||||
self:SetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:DamageDurability(amount)
|
||||
self:SetData("durability", math.max(0, self:GetDurability() - 1))
|
||||
|
||||
if (self:GetDurability() == 0) then
|
||||
self:OnBreak()
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:GetBreakSound()
|
||||
return "weapons/crowbar/crowbar_impact"..math.random(1, 2)..".wav"
|
||||
end
|
||||
|
||||
function ITEM:OnBreak()
|
||||
local breakSound = self:GetBreakSound()
|
||||
|
||||
if (IsValid(self.player)) then
|
||||
self.player:EmitSound(breakSound, 65)
|
||||
elseif (IsValid(self.entity)) then
|
||||
self.entity:EmitSound(breakSound, 65)
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ITEM:GetDurability()
|
||||
return self:GetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:GetMaxDurability()
|
||||
return self:GetData("maxDurability", self.maxDurability)
|
||||
end
|
||||
@@ -0,0 +1,155 @@
|
||||
--[[
|
||||
| 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 = "Pickaxe"
|
||||
ITEM.description = "Want to go mining? Well now you can with this pickaxe. Careful not to wake the Antlions."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_pickaxe.mdl"
|
||||
ITEM.class = "tfa_nmrih_pickaxe"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "heavy"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.57, 400.01, 0),
|
||||
fov = 0.86
|
||||
}
|
||||
|
||||
ITEM.maxDurability = 20
|
||||
--ITEM.isTool = true
|
||||
|
||||
local color_green = Color(100, 255, 100)
|
||||
local color_red = Color(200, 25, 25)
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PaintOver(item, w, h)
|
||||
if (item:GetData("equip")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawRect(w - 14, h - 20, 8, 8)
|
||||
end
|
||||
local maxDurability = item:GetMaxDurability()
|
||||
local durability = item:GetDurability()
|
||||
local width = w - 8
|
||||
local cellWidth = math.Round(width / maxDurability)
|
||||
local color = ix.util.ColorLerp(1 - durability / maxDurability, color_green, color_red)
|
||||
surface.SetDrawColor(color)
|
||||
|
||||
for i = 0, durability - 1 do
|
||||
surface.DrawRect(5 + i * cellWidth, h - 8, cellWidth - 1, 4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.SetMaxDurability = {
|
||||
name = "Set max durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter max durability value", itemTable:GetMaxDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0) then
|
||||
netstream.Start("ixSetToolMaxDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.SetDurability = {
|
||||
name = "Set durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter durability value for this tool here", itemTable:GetDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0 and amount <= itemTable:GetMaxDurability()) then
|
||||
netstream.Start("ixSetToolDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local maxDurability = self:GetMaxDurability()
|
||||
local durability = self:GetDurability()
|
||||
return self.description .. "\n\nDurability: " .. durability .. "/" .. maxDurability
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced(index, x, y, item)
|
||||
self:SetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:DamageDurability(amount)
|
||||
self:SetData("durability", math.max(0, self:GetDurability() - 1))
|
||||
|
||||
if (self:GetDurability() == 0) then
|
||||
self:OnBreak()
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:GetBreakSound()
|
||||
return "weapons/crowbar/crowbar_impact"..math.random(1, 2)..".wav"
|
||||
end
|
||||
|
||||
function ITEM:OnBreak()
|
||||
local breakSound = self:GetBreakSound()
|
||||
|
||||
if (IsValid(self.player)) then
|
||||
self.player:EmitSound(breakSound, 65)
|
||||
elseif (IsValid(self.entity)) then
|
||||
self.entity:EmitSound(breakSound, 65)
|
||||
end
|
||||
|
||||
self.player:StripWeapon("tfa_nmrih_pickaxe")
|
||||
self:SetData("equip", false)
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ITEM:GetDurability()
|
||||
return self:GetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:GetMaxDurability()
|
||||
return self:GetData("maxDurability", self.maxDurability)
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| 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 = "Riot Shield"
|
||||
ITEM.description = "A riot shield made for special use by the Civil Protection."
|
||||
ITEM.model = "models/weapons/tfa_mw2cr/riotshield/w_riotshield.mdl"
|
||||
ITEM.class = "tfa_mw2cr_riotshield"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "heavy"
|
||||
ITEM.width = 2
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.57, 400.01, 0),
|
||||
fov = 0.86
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
--[[
|
||||
| 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 = "Sledge Hammer"
|
||||
ITEM.description = "Heavy and powerful. Careful not to hit anyone with this."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_sledge.mdl"
|
||||
ITEM.class = "tfa_nmrih_sledge"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "heavy"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.76, 400, 0),
|
||||
fov = 0.77
|
||||
}
|
||||
ITEM.maxDurability = 50
|
||||
ITEM.isTool = true
|
||||
|
||||
local color_green = Color(100, 255, 100)
|
||||
local color_red = Color(200, 25, 25)
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PaintOver(item, w, h)
|
||||
if (item:GetData("equip")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawRect(w - 14, h - 20, 8, 8)
|
||||
end
|
||||
local maxDurability = item:GetMaxDurability()
|
||||
local durability = item:GetDurability()
|
||||
local width = w - 8
|
||||
local cellWidth = math.Round(width / maxDurability)
|
||||
local color = ix.util.ColorLerp(1 - durability / maxDurability, color_green, color_red)
|
||||
surface.SetDrawColor(color)
|
||||
|
||||
for i = 0, durability - 1 do
|
||||
surface.DrawRect(5 + i * cellWidth, h - 8, cellWidth - 1, 4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.SetMaxDurability = {
|
||||
name = "Set max durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter max durability value", itemTable:GetMaxDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0) then
|
||||
netstream.Start("ixSetToolMaxDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.SetDurability = {
|
||||
name = "Set durability",
|
||||
icon = "icon16/wrench.png",
|
||||
OnClick = function(itemTable)
|
||||
local client = itemTable.player
|
||||
Derma_StringRequest("Set durability", "Enter durability value for this tool here", itemTable:GetDurability(), function(text)
|
||||
local amount = tonumber(text)
|
||||
|
||||
if (amount and amount > 0 and amount <= itemTable:GetMaxDurability()) then
|
||||
netstream.Start("ixSetToolDurability", itemTable:GetID(), math.floor(amount))
|
||||
else
|
||||
client:Notify("Invalid number")
|
||||
end
|
||||
end)
|
||||
end,
|
||||
OnRun = function(itemTable)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
if (IsValid(itemTable.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!CAMI.PlayerHasAccess(itemTable.player, "Helix - Basic Admin Commands")) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local maxDurability = self:GetMaxDurability()
|
||||
local durability = self:GetDurability()
|
||||
return self.description .. "\n\nDurability: " .. durability .. "/" .. maxDurability
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced(index, x, y, item)
|
||||
self:SetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:DamageDurability(amount)
|
||||
self:SetData("durability", math.max(0, self:GetDurability() - 1))
|
||||
|
||||
if (self:GetDurability() == 0) then
|
||||
self:OnBreak()
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:GetBreakSound()
|
||||
return "weapons/crowbar/crowbar_impact"..math.random(1, 2)..".wav"
|
||||
end
|
||||
|
||||
function ITEM:OnBreak()
|
||||
local breakSound = self:GetBreakSound()
|
||||
|
||||
if (IsValid(self.player)) then
|
||||
self.player:EmitSound(breakSound, 65)
|
||||
elseif (IsValid(self.entity)) then
|
||||
self.entity:EmitSound(breakSound, 65)
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ITEM:GetDurability()
|
||||
return self:GetData("durability", self:GetMaxDurability())
|
||||
end
|
||||
|
||||
function ITEM:GetMaxDurability()
|
||||
return self:GetData("maxDurability", self.maxDurability)
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| 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 = "Spade"
|
||||
ITEM.description = "A spade for digging up dirt or whatever else. Nothing too special."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_spade.mdl"
|
||||
ITEM.class = "tfa_nmrih_spade"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "medium"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 4
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(0, -200, 0),
|
||||
ang = Angle(-0.66, 449.91, 0),
|
||||
fov = 3.36
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| 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 = "Pipe Wrench"
|
||||
ITEM.description = "Wrench to tighten bolts, could be used as a blunt weapon too."
|
||||
ITEM.model = "models/weapons/tfa_nmrih/w_me_wrench.mdl"
|
||||
ITEM.class = "tfa_nmrih_wrench"
|
||||
ITEM.isMelee = true
|
||||
ITEM.weaponCategory = "melee"
|
||||
ITEM.balanceCat = "light"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 3
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-509.64, -427.61, 310.24),
|
||||
ang = Angle(24.64, 400.03, 0),
|
||||
fov = 0.38
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--[[
|
||||
| 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 = "Flash Grenade"
|
||||
ITEM.description = "M84 stun grenade also known as 'Flashbang'. Emits blinding flash and deafening blast upon detonation."
|
||||
ITEM.model = "models/weapons/w_eq_flashbang_dropped.mdl"
|
||||
ITEM.class = "tfa_csgo_flash"
|
||||
ITEM.grenadeEntityClass = "tfa_csgo_thrownflash"
|
||||
ITEM.weaponCategory = "grenade"
|
||||
ITEM.isGrenade = true
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
@@ -0,0 +1,20 @@
|
||||
--[[
|
||||
| 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 = "Frag Grenade"
|
||||
ITEM.description = "MK3A2 offensive frag grenade."
|
||||
ITEM.model = "models/items/grenadeammo.mdl"
|
||||
ITEM.class = "tfa_mmod_grenade"
|
||||
ITEM.grenadeEntityClass = "mmod_frag"
|
||||
ITEM.weaponCategory = "grenade"
|
||||
ITEM.isGrenade = true
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
@@ -0,0 +1,20 @@
|
||||
--[[
|
||||
| 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 = "Incendiary Grenade"
|
||||
ITEM.description = "AN-M14 incendiary grenade filled with thermate mixture, which burns at 4,000 degrees Fahrenheit."
|
||||
ITEM.model = "models/weapons/arccw_go/w_eq_incendiarygrenade_thrown.mdl"
|
||||
ITEM.class = "tfa_csgo_incen"
|
||||
ITEM.grenadeEntityClass = "tfa_csgo_thrownincen"
|
||||
ITEM.weaponCategory = "grenade"
|
||||
ITEM.isGrenade = true
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
@@ -0,0 +1,20 @@
|
||||
--[[
|
||||
| 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 = "Smoke Grenade"
|
||||
ITEM.description = "Model 5210 smoke grenade. Produces a gray smoke screen."
|
||||
ITEM.model = "models/weapons/w_eq_smokegrenade_dropped.mdl"
|
||||
ITEM.class = "tfa_csgo_smoke"
|
||||
ITEM.grenadeEntityClass = "tfa_csgo_thrownsmoke"
|
||||
ITEM.weaponCategory = "grenade"
|
||||
ITEM.isGrenade = true
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
Reference in New Issue
Block a user