This commit is contained in:
lifestorm
2024-08-05 18:40:29 +03:00
parent 9f505a0646
commit c6d9b6f580
8044 changed files with 1853472 additions and 21 deletions

View File

@@ -0,0 +1,95 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.PrintName = "Advanced Container"
ENT.Category = "[WN7] Lootable"
ENT.Spawnable = true
ENT.bNoPersist = true
ENT.AutomaticFrameAdvance = true
ENT.models = {"models/wn7new/advcrates/n7_cabinet.mdl", "models/wn7new/advcrates/n7_drawer.mdl", "models/wn7new/advcrates/n7_locker.mdl"}
ENT.acting = 1
ENT.canBeLooted = true
local PLUGIN = PLUGIN
if (SERVER) then
function ENT:Initialize()
self:SetModel(self.models[math.random(1, #self.models)])
self:PhysicsInit(SOLID_VPHYSICS )
self:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
self.lootTable = ix.loot.tables["Advanced"]
local physObj = self:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:Sleep()
physObj:EnableMotion( false )
end
self:DropToFloor()
end
function ENT:Use( activator )
if #player.GetAll() < ix.config.Get("PlayersToLoot", 8) then
activator:Notify("Server doesn't have enough players to unblock crate looting.")
return
end
if not self.canBeLooted then return activator:Notify("Someone already looted this container!") end
local data = {act = self.acting, ent = self}
netstream.Start(activator, "ixLootInteractStart", data)
end
function ENT:FinalizeLoot(character, shouldChance, noAddLoot)
if not self.canBeLooted then return end
self:ResetSequence("locker_open_seq")
self:SetPlaybackRate(1)
self:EmitSound("items/ammocrate_open.wav")
timer.Simple(2.6, function()
if not IsValid(self) then return end
self:EmitSound("items/ammocrate_close.wav")
self:ResetSequence("locker_close_seq")
self:SetPlaybackRate(1)
end)
local items = PLUGIN:CalculateLoot(self.lootTable, shouldChance, noAddLoot)
if #items <= 1 then
self:EmitSound("physics/metal/metal_computer_impact_hard2.wav")
end
for _, item in ipairs(items) do
ix.item.Spawn(item, self:GetPos() + self:GetUp()*20 + self:GetForward()*20 + self:GetRight()*math.random(-20, 20), function(item, ent)
timer.Create("Mark for destruct " .. ent:GetCreationID(), ix.config.Get("lootDelete", 10), 1, function()
if ent:IsValid() then
ent:Remove()
end
end)
end)
end
self.canBeLooted = false
end
function ENT:Think()
self:NextThink( CurTime() + 0.1 )
return true
end
else
function ENT:OnPopulateEntityInfo(container)
local name = container:AddRow("name")
name:SetImportant()
name:SetText("Container")
name:SizeToContents()
local description = container:AddRow("Description")
description:SetText("[E] for interaction.")
description:SizeToContents()
end
function ENT:Draw()
self:DrawModel()
end
end

View File

@@ -0,0 +1,81 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.PrintName = "Ammunition Container"
ENT.Category = "[WN7] Lootable"
ENT.Spawnable = true
ENT.bNoPersist = true
ENT.AutomaticFrameAdvance = true
ENT.acting = 1
local PLUGIN = PLUGIN
if (SERVER) then
function ENT:Initialize()
self:SetModel("models/Items/item_item_crate.mdl")
self:PhysicsInit(SOLID_VPHYSICS )
self:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
self:PrecacheGibs()
self.lootTable = ix.loot.tables["Ammo"]
local physObj = self:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:Sleep()
physObj:EnableMotion( false )
end
//self:DropToFloor()
end
function ENT:Use( activator )
if #player.GetAll() < ix.config.Get("PlayersToLoot", 8) then
activator:Notify("Server doesn't have enough players to unblock crate looting.")
return
end
local data = {act = self.acting, ent = self}
netstream.Start(activator, "ixLootInteractStart", data)
end
function ENT:FinalizeLoot(character, shouldChance, noAddLoot)
self:GibBreakServer( self:GetUp() * 100 )
self:EmitSound("physics/wood/wood_plank_break1.wav")
local items = PLUGIN:CalculateLoot(self.lootTable, shouldChance, noAddLoot)
for _, item in ipairs(items) do
ix.item.Spawn(item, self:GetPos() + self:GetRight()*math.random(-20, 20), function(item, ent)
timer.Create("Mark for destruct " .. ent:GetCreationID(), ix.config.Get("lootDelete", 10), 1, function()
if ent:IsValid() then
ent:Remove()
end
end)
end)
end
self:Remove()
end
function ENT:Think()
self:NextThink( CurTime() + 0.1 )
return true
end
else
function ENT:OnPopulateEntityInfo(container)
local name = container:AddRow("name")
name:SetImportant()
name:SetText("Ammo crate")
name:SizeToContents()
local description = container:AddRow("Description")
description:SetText("[E] for interaction.")
description:SizeToContents()
end
function ENT:Draw()
self:DrawModel()
end
end

View File

@@ -0,0 +1,81 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.PrintName = "Basic Container"
ENT.Category = "[WN7] Lootable"
ENT.Spawnable = true
ENT.bNoPersist = true
ENT.AutomaticFrameAdvance = true
ENT.acting = 1
local PLUGIN = PLUGIN
if (SERVER) then
function ENT:Initialize()
self:SetModel("models/props_junk/wood_crate001a_damaged.mdl")
self:PhysicsInit(SOLID_VPHYSICS )
self:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
self:PrecacheGibs()
self.lootTable = ix.loot.tables["Basic"]
local physObj = self:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:Sleep()
physObj:EnableMotion( false )
end
//self:DropToFloor()
end
function ENT:Use( activator )
if #player.GetAll() < ix.config.Get("PlayersToLoot", 8) then
activator:Notify("Server doesn't have enough players to unblock crate looting.")
return
end
local data = {act = self.acting, ent = self}
netstream.Start(activator, "ixLootInteractStart", data)
end
function ENT:FinalizeLoot(character, shouldChance, noAddLoot)
self:GibBreakServer( self:GetUp() * 100 )
self:EmitSound("physics/wood/wood_plank_break1.wav")
local items = PLUGIN:CalculateLoot(self.lootTable, shouldChance, noAddLoot)
for _, item in ipairs(items) do
ix.item.Spawn(item, self:GetPos() + self:GetRight()*math.random(-20, 20), function(item, ent)
timer.Create("Mark for destruct " .. ent:GetCreationID(), ix.config.Get("lootDelete", 10), 1, function()
if ent:IsValid() then
ent:Remove()
end
end)
end)
end
self:Remove()
end
function ENT:Think()
self:NextThink( CurTime() + 0.1 )
return true
end
else
function ENT:OnPopulateEntityInfo(container)
local name = container:AddRow("name")
name:SetImportant()
name:SetText("Wooden crate")
name:SizeToContents()
local description = container:AddRow("Description")
description:SetText("[E] for interaction.")
description:SizeToContents()
end
function ENT:Draw()
self:DrawModel()
end
end

View File

@@ -0,0 +1,103 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.PrintName = "Combine Container"
ENT.Category = "[WN7] Lootable"
ENT.Spawnable = true
ENT.bNoPersist = true
ENT.AutomaticFrameAdvance = true
ENT.models = {"models/wn7new/advcrates/n7_crate.mdl"}
ENT.acting = 3
ENT.canBeLooted = true
ENT.lootKey = "cmbkey"
local PLUGIN = PLUGIN
if (SERVER) then
function ENT:Initialize()
self:SetModel(self.models[math.random(1, #self.models)])
self:PhysicsInit(SOLID_VPHYSICS )
self:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
self.lootTable = ix.loot.tables["CMB"]
local physObj = self:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:Sleep()
physObj:EnableMotion( false )
end
self:DropToFloor()
end
function ENT:Use( activator )
if #player.GetAll() < ix.config.Get("PlayersToLoot", 8) then
activator:Notify("Server doesn't have enough players to unblock crate looting.")
return
end
if not self.canBeLooted then return activator:Notify("Someone already looted this container!") end
local data = {act = self.acting, ent = self}
netstream.Start(activator, "ixLootInteractStart", data)
end
function ENT:FinalizeLoot(character, shouldChance, noAddLoot)
if not self.canBeLooted then return end
self:ResetSequence("locker_open_seq")
self:SetPlaybackRate(1)
self:EmitSound("buttons/button19.wav")
timer.Simple(2.6, function()
if not IsValid(self) then return end
self:EmitSound("items/ammocrate_close.wav")
self:ResetSequence("locker_close_seq")
self:SetPlaybackRate(1)
end)
local items = PLUGIN:CalculateLoot(self.lootTable, shouldChance, noAddLoot)
if #items <= 1 then
self:EmitSound("physics/metal/metal_computer_impact_hard2.wav")
end
for _, item in ipairs(items) do
ix.item.Spawn(item, self:GetPos() + self:GetUp()*20 + self:GetForward()*20 + self:GetRight()*math.random(-20, 20), function(item, ent)
timer.Create("Mark for destruct " .. ent:GetCreationID(), ix.config.Get("lootDelete", 10), 1, function()
if ent:IsValid() then
ent:Remove()
end
end)
end)
end
self.canBeLooted = false
end
function ENT:Think()
self:NextThink( CurTime() + 0.1 )
return true
end
else
function ENT:OnPopulateEntityInfo(container)
local name = container:AddRow("name")
name:SetImportant()
name:SetText("CMB Crate")
name:SizeToContents()
local description = container:AddRow("Description")
description:SetText("[E] for interaction.")
description:SizeToContents()
end
local glowMaterial = ix.util.GetMaterial("sprites/glow04_noz")
function ENT:Draw()
self:DrawModel()
if self:GetSequenceName(self:GetSequence()) == "locker_open_seq" then return end
local color = Color(0, 100, 255, 180)
local position = self:GetPos() + self:GetUp() * 12 + self:GetForward() * 13.5
render.SetMaterial(glowMaterial)
render.DrawSprite(position, 10, 10, color)
end
end

View File

@@ -0,0 +1,85 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.PrintName = "Loot spawner"
ENT.Category = "WN7"
ENT.Spawnable = false
ENT.bNoPersist = true
ENT.PhysgunDisable = true
if (SERVER) then
function ENT:Initialize()
self:PhysicsInit(SOLID_NONE)
self:SetSolid(SOLID_NONE)
self:SetUseType(SIMPLE_USE)
self:SetModel("models/props_junk/sawblade001a.mdl")
self:DrawShadow( false )
self:SetCollisionGroup(COLLISION_GROUP_WORLD)
self:SetMoveType(MOVETYPE_NONE)
self:SetNoDraw( true )
self.nextSpawn = CurTime()
local phy = self:GetPhysicsObject()
if IsValid(phy) then
phy:Sleep()
end
local id = self:EntIndex()
timer.Create("lootySpawner" .. id, 1, 0, function()
if not IsValid(self) then
timer.Remove("lootySpawner" .. id)
return
end
self:SpawnLoot()
end)
end
function ENT:GetLootEnt()
for k, v in pairs(ix.loot.entities) do
if k == self:GetLootType() then
return v
end
end
end
function ENT:SpawnLoot()
if CurTime() < self.nextSpawn then
return
end
if IsValid(self.loot) then
self.loot:Remove()
end
self:UpdateTimer()
self.loot = ents.Create(self:GetLootEnt())
self.loot:SetPos(self:GetPos() + self:GetUp()*20)
self.loot:SetAngles(self:GetAngles())
self.loot:Spawn()
end
function ENT:UpdateTimer()
self.nextSpawn = CurTime() + (ix.config.Get("lootTimer", 1) * 60)
end
function ENT:Think()
self:NextThink( CurTime() + 2 )
self:SetNetVar("lootSpawn", ix.config.Get("lootTimer", 1))
return true
end
function ENT:OnRemove()
if IsValid(self.loot) then
self.loot:Remove()
end
end
function ENT:SetLootType(type)
self:SetNetVar("lootType", type)
end
function ENT:GetLootType()
return self:GetNetVar("lootType", "Basic")
end
else
end

View File

@@ -0,0 +1,109 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.PrintName = "Infestation Container"
ENT.Category = "[WN7] Lootable"
ENT.Spawnable = true
ENT.bNoPersist = true
ENT.AutomaticFrameAdvance = true
ENT.models = {"models/wn7new/advcrates/n7_container.mdl"}
ENT.acting = 2
ENT.canBeLooted = true
local PLUGIN = PLUGIN
if (SERVER) then
function ENT:Initialize()
self:SetModel(self.models[math.random(1, #self.models)])
self:PhysicsInit(SOLID_VPHYSICS )
self:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
self.lootTable = ix.loot.tables["InfestationControl"]
local physObj = self:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:Sleep()
physObj:EnableMotion( false )
end
self:DropToFloor()
end
function ENT:Use( activator )
if #player.GetAll() < ix.config.Get("PlayersToLoot", 8) then
activator:Notify("Server doesn't have enough players to unblock crate looting.")
return
end
if not self.canBeLooted then return activator:Notify("Someone already looted this container!") end
local data = {act = self.acting, ent = self}
netstream.Start(activator, "ixLootInteractStart", data)
end
function ENT:FinalizeLoot(character, shouldChance, noAddLoot)
if not self.canBeLooted then return end
local items = PLUGIN:CalculateLoot(self.lootTable, shouldChance, noAddLoot)
self:ResetSequence("locker_open_seq")
self:SetPlaybackRate(1)
self:EmitSound("buttons/button19.wav")
self:EmitSound("buttons/lever2.wav")
local eff = EffectData()
eff:SetOrigin(self:GetPos() + self:GetForward()*15 + self:GetUp()*5)
eff:SetNormal(self:GetForward()*1)
eff:SetAngles(self:GetAngles())
util.Effect("ManhackSparks", eff)
timer.Simple(2.6, function()
if not IsValid(self) then return end
self:EmitSound("buttons/lever6.wav")
self:ResetSequence("locker_close_seq")
self:SetPlaybackRate(1)
end)
if #items <= 1 then
self:EmitSound("physics/metal/metal_computer_impact_hard2.wav")
else
self:EmitSound("items/ammocrate_close.wav")
end
for _, item in ipairs(items) do
ix.item.Spawn(item, self:GetPos() + self:GetUp()*20 + self:GetForward()*20 + self:GetRight()*math.random(-20, 20), function(item, ent)
timer.Create("Mark for destruct " .. ent:GetCreationID(), ix.config.Get("lootDelete", 10), 1, function()
if ent:IsValid() then
ent:Remove()
end
end)
end)
end
self.canBeLooted = false
end
function ENT:Think()
self:NextThink( CurTime() + 0.1 )
return true
end
else
function ENT:OnPopulateEntityInfo(container)
local name = container:AddRow("name")
name:SetImportant()
name:SetText("Infestation Control Container")
name:SizeToContents()
local description = container:AddRow("Description")
description:SetText("[E] for interaction.")
description:SizeToContents()
end
local glowMaterial = ix.util.GetMaterial("sprites/glow04_noz")
function ENT:Draw()
self:DrawModel()
if self:GetSequenceName(self:GetSequence()) == "locker_open_seq" then return end
local color = Color(255, 238, 0, 180)
local position = self:GetPos() + self:GetUp() * 15 + self:GetForward() * 9.7
render.SetMaterial(glowMaterial)
render.DrawSprite(position, 5, 5, color)
end
end

View File

@@ -0,0 +1,97 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.PrintName = "Military Container"
ENT.Category = "[WN7] Lootable"
ENT.Spawnable = true
ENT.bNoPersist = true
ENT.AutomaticFrameAdvance = true
ENT.models = {"models/wn7new/advcrates/n7_military_crate.mdl"}
ENT.acting = 3
ENT.canBeLooted = true
ENT.lootKey = "militarykey"
local PLUGIN = PLUGIN
if (SERVER) then
function ENT:Initialize()
self:SetModel(self.models[math.random(1, #self.models)])
self:PhysicsInit(SOLID_VPHYSICS )
self:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
self.lootTable = ix.loot.tables["Military"]
local physObj = self:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:Sleep()
physObj:EnableMotion( false )
end
self:DropToFloor()
end
function ENT:Use( activator )
if #player.GetAll() < ix.config.Get("PlayersToLoot", 8) then
activator:Notify("Server doesn't have enough players to unblock crate looting.")
return
end
if not self.canBeLooted then return activator:Notify("Someone already looted this container!") end
local data = {act = self.acting, ent = self}
netstream.Start(activator, "ixLootInteractStart", data)
end
function ENT:FinalizeLoot(character, shouldChance, noAddLoot)
if not self.canBeLooted then return end
self:ResetSequence("locker_open_seq")
self:SetPlaybackRate(1)
self:EmitSound("buttons/button19.wav")
timer.Simple(2.6, function()
if not IsValid(self) then return end
self:EmitSound("items/ammocrate_close.wav")
self:ResetSequence("locker_close_seq")
self:SetPlaybackRate(1)
end)
local items = PLUGIN:CalculateLoot(self.lootTable, shouldChance, noAddLoot)
if #items <= 1 then
self:EmitSound("physics/metal/metal_computer_impact_hard2.wav")
end
for _, item in ipairs(items) do
ix.item.Spawn(item, self:GetPos() + self:GetUp()*20 + self:GetForward()*20 + self:GetRight()*math.random(-20, 20), function(item, ent)
timer.Create("Mark for destruct " .. ent:GetCreationID(), ix.config.Get("lootDelete", 10), 1, function()
if ent:IsValid() then
ent:Remove()
end
end)
end)
end
self.canBeLooted = false
end
function ENT:Think()
self:NextThink( CurTime() + 0.1 )
return true
end
else
function ENT:OnPopulateEntityInfo(container)
local name = container:AddRow("name")
name:SetImportant()
name:SetText("Military crate")
name:SizeToContents()
local description = container:AddRow("Description")
description:SetText("[E] for interaction.")
description:SizeToContents()
end
function ENT:Draw()
self:DrawModel()
end
end

View File

@@ -0,0 +1,96 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.PrintName = "Supply Container"
ENT.Category = "[WN7] Lootable"
ENT.Spawnable = true
ENT.bNoPersist = true
ENT.AutomaticFrameAdvance = true
ENT.models = {"models/wn7new/advcrates/n7_supply_crate.mdl"}
ENT.acting = 1
ENT.canBeLooted = true
local PLUGIN = PLUGIN
if (SERVER) then
function ENT:Initialize()
self:SetModel(self.models[math.random(1, #self.models)])
self:PhysicsInit(SOLID_VPHYSICS )
self:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
self.lootTable = ix.loot.tables["Supply"]
local physObj = self:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:Sleep()
physObj:EnableMotion( false )
end
self:DropToFloor()
end
function ENT:Use( activator )
if #player.GetAll() < ix.config.Get("PlayersToLoot", 8) then
activator:Notify("Server doesn't have enough players to unblock crate looting.")
return
end
if not self.canBeLooted then return activator:Notify("Someone already looted this container!") end
local data = {act = self.acting, ent = self}
netstream.Start(activator, "ixLootInteractStart", data)
end
function ENT:FinalizeLoot(character, shouldChance, noAddLoot)
if not self.canBeLooted then return end
self:ResetSequence("locker_open_seq")
self:SetPlaybackRate(1)
timer.Simple(2.6, function()
if not IsValid(self) then return end
self:EmitSound("items/ammocrate_close.wav")
self:ResetSequence("locker_close_seq")
self:SetPlaybackRate(1)
end)
local items = PLUGIN:CalculateLoot(self.lootTable, shouldChance, noAddLoot)
if #items <= 1 then
self:EmitSound("physics/metal/metal_computer_impact_hard2.wav")
else
self:EmitSound("items/ammocrate_close.wav")
end
for _, item in ipairs(items) do
ix.item.Spawn(item, self:GetPos() + self:GetUp()*20 + self:GetForward()*20 + self:GetRight()*math.random(-20, 20), function(item, ent)
timer.Create("Mark for destruct " .. ent:GetCreationID(), ix.config.Get("lootDelete", 10), 1, function()
if ent:IsValid() then
ent:Remove()
end
end)
end)
end
self.canBeLooted = false
end
function ENT:Think()
self:NextThink( CurTime() + 0.1 )
return true
end
else
function ENT:OnPopulateEntityInfo(container)
local name = container:AddRow("name")
name:SetImportant()
name:SetText("Supply container")
name:SizeToContents()
local description = container:AddRow("Description")
description:SetText("[E] for interaction.")
description:SizeToContents()
end
function ENT:Draw()
self:DrawModel()
end
end