mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
--[[
|
||||
| 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.Base = "base_gmodentity";
|
||||
ENT.Author = "gb";
|
||||
ENT.PrintName = "Factory Valve";
|
||||
ENT.Spawnable = false;
|
||||
ENT.AdminSpawnable = true;
|
||||
ENT.Category = "Gathering System";
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
if (SERVER) then
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/props_pipes/valvewheel002a.mdl");
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS);
|
||||
self:PhysicsInit(SOLID_VPHYSICS);
|
||||
self:SetUseType(SIMPLE_USE);
|
||||
self:SetSolid(SOLID_VPHYSICS);
|
||||
|
||||
local physicsObject = self:GetPhysicsObject();
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake();
|
||||
physicsObject:EnableMotion(false);
|
||||
end;
|
||||
end;
|
||||
|
||||
function ENT:UpdateTransmitState()
|
||||
return TRANSMIT_ALWAYS;
|
||||
end;
|
||||
|
||||
function ENT:StartOverheating()
|
||||
if self.overheating ~= true then
|
||||
self.overheating = true;
|
||||
self.sound = CreateSound(self, "ambient/gas/steam_loop1.wav", RecipientFilter():AddPVS(self:GetPos()));
|
||||
self.sound:PlayEx(1, 150);
|
||||
|
||||
self.steam = ents.Create("prop_physics");
|
||||
self.steam:SetPos(self:GetPos());
|
||||
self.steam:SetModel("models/hunter/blocks/cube025x025x025.mdl");
|
||||
self.steam:Spawn();
|
||||
self.steam:SetCollisionGroup(COLLISION_GROUP_WORLD);
|
||||
self.steam:SetRenderMode(RENDERMODE_TRANSALPHA);
|
||||
self.steam:SetColor(Color(0, 0, 0, 0));
|
||||
self.steam:DrawShadow(false);
|
||||
|
||||
local physicsObject = self.steam:GetPhysicsObject();
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake();
|
||||
physicsObject:EnableMotion(false);
|
||||
end;
|
||||
|
||||
ParticleEffect("steam_jet_80_steam", self.steam:GetPos(), self.steamAngles or self:GetAngles(), self.steam);
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StopOverheating()
|
||||
self.overheating = false;
|
||||
|
||||
if IsValid(self.steam) then
|
||||
self.steam:Remove();
|
||||
end
|
||||
|
||||
if self.sound then
|
||||
self.sound:Stop();
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function ENT:Use(activator, caller)
|
||||
end;
|
||||
|
||||
function ENT:OnRemove()
|
||||
if IsValid(self.steam) then
|
||||
self.steam:Remove();
|
||||
end
|
||||
|
||||
if self.sound then
|
||||
self.sound:Stop();
|
||||
end
|
||||
end;
|
||||
else
|
||||
function ENT:OnPopulateEntityInfo(container)
|
||||
if self.overheating == true then
|
||||
local name = container:AddRow("name")
|
||||
name:SetImportant()
|
||||
name:SetText(L("Valve"))
|
||||
name:SizeToContents()
|
||||
|
||||
local description = container:AddRow("description")
|
||||
description:SetText(L("Press [E] to interact"))
|
||||
description:SizeToContents()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,71 @@
|
||||
--[[
|
||||
| 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 PLUGIN = PLUGIN
|
||||
|
||||
ENT.Type = "anim";
|
||||
ENT.Base = "base_gmodentity";
|
||||
ENT.Author = "gb";
|
||||
ENT.PrintName = "Furnace";
|
||||
ENT.Spawnable = false;
|
||||
ENT.AdminSpawnable = true;
|
||||
ENT.Category = "Gathering System";
|
||||
|
||||
|
||||
if (SERVER) then
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/willard/smelter.mdl")
|
||||
self:SetMoveType(MOVETYPE_NONE)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self.IsProcessing = false
|
||||
local physObj = self:GetPhysicsObject()
|
||||
if IsValid(physObj) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Wake()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StartTouch( hitEnt )
|
||||
|
||||
if (hitEnt:GetClass() == "ix_item") && self.IsProcessing == false then
|
||||
if (hitEnt:GetItemID() != "iron_ore") then
|
||||
return
|
||||
end
|
||||
|
||||
hitEnt:Remove()
|
||||
self:EmitSound("npc/stalker/laser_burn.wav")
|
||||
|
||||
PLUGIN:StartProcessing()
|
||||
self.IsProcessing = true
|
||||
timer.Simple(25, function()
|
||||
self:StopSound("npc/stalker/laser_burn.wav")
|
||||
self.IsProcessing = false
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Use(activator, caller, useType, value)
|
||||
local zap1 = ents.Create("point_tesla")
|
||||
zap1:SetParent(self)
|
||||
zap1:SetKeyValue("m_SoundName", "DoSpark")
|
||||
zap1:SetKeyValue("texture", "sprites/physbeam.vmt")
|
||||
zap1:SetKeyValue("m_flRadius", "1")
|
||||
zap1:SetPos(self:GetPos() + self:GetRight() * -9 + self:GetUp() * 45)
|
||||
zap1:Spawn()
|
||||
zap1:Fire("DoSpark", "", 0.1)
|
||||
zap1:Fire("DoSpark", "", 0.4)
|
||||
zap1:Fire("DoSpark", "", 1.7)
|
||||
zap1:Fire("DoSpark", "", 2.5)
|
||||
zap1:Fire("DoSpark", "", 2.7)
|
||||
zap1:Fire("kill", "", 3)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,115 @@
|
||||
--[[
|
||||
| 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.Base = "base_gmodentity";
|
||||
ENT.Author = "gb";
|
||||
ENT.PrintName = "Ore Spawner";
|
||||
ENT.Spawnable = true;
|
||||
ENT.AdminSpawnable = true;
|
||||
ENT.Category = "Gathering System";
|
||||
|
||||
if SERVER then
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/props_junk/Shoe001a.mdl")
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetCollisionGroup(COLLISION_GROUP_WORLD)
|
||||
self:SetNoDraw(true)
|
||||
local phys = self:GetPhysicsObject()
|
||||
phys:SetMass(120)
|
||||
|
||||
self:SetupNextSpawn()
|
||||
|
||||
self:CallOnRemove(
|
||||
"KillParentTimer",
|
||||
function(ent)
|
||||
ent.dead = true
|
||||
timer.Remove("spawner_ore_"..ent:EntIndex())
|
||||
|
||||
if self.oreEnt then
|
||||
self.oreEnt:Remove()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:SetupNextSpawn()
|
||||
if (self.dead) then return end
|
||||
|
||||
local variation = ix.config.Get("Ore Respawn Variation") * 60
|
||||
local duration = math.max(ix.config.Get("Ore Respawn Timer") * 60 + math.random(-variation, variation), 60)
|
||||
self:SetNetVar("ixNextOreSpawn", CurTime() + duration)
|
||||
self:SetNetVar("ixSelectedOre", self:GetRandomVein())
|
||||
local uniqueID = "spawner_ore_"..self:EntIndex()
|
||||
if (timer.Exists(uniqueID)) then timer.Remove(uniqueID) end
|
||||
|
||||
timer.Create(uniqueID, duration, 1, function()
|
||||
if (IsValid(self)) then
|
||||
self:SetNetVar("ixNextOreSpawn", -1)
|
||||
self.oreEnt = ents.Create(self:GetNetVar("ixSelectedOre"))
|
||||
if (IsValid(self.oreEnt)) then
|
||||
local ang = self:GetAngles()
|
||||
self.oreEnt:SetPos(self:GetPos())
|
||||
ang:RotateAroundAxis(ang:Right(), math.random(10, 100))
|
||||
ang:RotateAroundAxis(ang:Up(), math.random(10, 80))
|
||||
self.oreEnt:SetAngles(ang)
|
||||
|
||||
self.oreEnt.ixSpawner = self
|
||||
self.oreEnt:Spawn()
|
||||
self.oreEnt:CallOnRemove(
|
||||
"RestartOreTimer",
|
||||
function(ent)
|
||||
if (IsValid(ent.ixSpawner)) then
|
||||
ent.ixSpawner:SetupNextSpawn()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:UpdateTransmitState()
|
||||
return TRANSMIT_PVS
|
||||
end
|
||||
|
||||
function ENT:PhysicsUpdate(physicsObject)
|
||||
if (!self:IsPlayerHolding() and !self:IsConstrained()) then
|
||||
physicsObject:SetVelocity( Vector(0, 0, 0) )
|
||||
physicsObject:Sleep()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Use(activator, caller)
|
||||
return
|
||||
end
|
||||
|
||||
function ENT:CanTool(player, trace, tool)
|
||||
return false
|
||||
end
|
||||
|
||||
function ENT:GetRandomVein()
|
||||
local coalChance = ix.config.Get("Ore Spawn Chance Coal", 50)
|
||||
local ironChance = ix.config.Get("Ore Spawn Chance Iron", 30)
|
||||
local goldChance = ix.config.Get("Ore Spawn Chance Gold", 20)
|
||||
|
||||
local totalChance = coalChance + ironChance + goldChance
|
||||
local randomChance = math.random(1, totalChance)
|
||||
|
||||
if randomChance <= coalChance then
|
||||
return "ix_vein_coal"
|
||||
elseif randomChance <= coalChance + ironChance then
|
||||
return "ix_vein_iron"
|
||||
else
|
||||
return "ix_vein_gold"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,91 @@
|
||||
--[[
|
||||
| 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.Base = "base_gmodentity";
|
||||
ENT.Author = "gb";
|
||||
ENT.PrintName = "Coal Pile";
|
||||
ENT.Spawnable = true;
|
||||
ENT.AdminSpawnable = true;
|
||||
|
||||
ENT.Category = "Gathering System";
|
||||
|
||||
if (SERVER) then
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/willard/work/coalrock.mdl");
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS);
|
||||
self:PhysicsInit(SOLID_VPHYSICS);
|
||||
self:SetUseType(SIMPLE_USE);
|
||||
self:SetSolid(SOLID_VPHYSICS);
|
||||
self.BreakSounds = {"physics/concrete/boulder_impact_hard1.wav", "physics/concrete/boulder_impact_hard2.wav", "physics/concrete/boulder_impact_hard3.wav", "physics/concrete/boulder_impact_hard4.wav"};
|
||||
|
||||
local physicsObject = self:GetPhysicsObject();
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake();
|
||||
physicsObject:EnableMotion(false);
|
||||
end;
|
||||
end;
|
||||
|
||||
function ENT:OnTakeDamage(damageInfo)
|
||||
local player = damageInfo:GetAttacker();
|
||||
|
||||
if IsValid(player) and player:IsPlayer() then
|
||||
local activeWeapon = tostring(player:GetActiveWeapon())
|
||||
|
||||
if string.find(activeWeapon, "tfa_nmrih_pickaxe") then
|
||||
local activeWeapon = player:GetActiveWeapon();
|
||||
|
||||
self:EmitSound(self.BreakSounds[math.random(1, #self.BreakSounds)]);
|
||||
|
||||
if !self.oreLeft then
|
||||
self.oreLeft = math.random(6, 8);
|
||||
end
|
||||
|
||||
if !self.strikesRequired then
|
||||
self.strikesRequired = math.random(5, 10);
|
||||
end
|
||||
|
||||
self.strikesRequired = self.strikesRequired - 1;
|
||||
|
||||
|
||||
if self.strikesRequired <= 0 then
|
||||
local entPos = self:GetPos();
|
||||
local character = player:GetCharacter()
|
||||
local inventory = character:GetInventory()
|
||||
local pickaxe = inventory:HasItem("pickaxe")
|
||||
|
||||
if (pickaxe:GetData("equip")) then
|
||||
pickaxe:DamageDurability(1)
|
||||
end
|
||||
|
||||
if (!character:GetInventory():Add("coal_ore")) then
|
||||
ix.item.Spawn("coal_ore", player)
|
||||
end
|
||||
|
||||
ix.chat.Send(player, "me", "extracts some ore from the vein!")
|
||||
self:EmitSound("physics/concrete/concrete_break2.wav");
|
||||
|
||||
|
||||
self.oreLeft = self.oreLeft - 1;
|
||||
self.strikesRequired = math.random(5, 10);
|
||||
end
|
||||
|
||||
if self.oreLeft <= 0 then
|
||||
self:EmitSound("physics/concrete/concrete_break2.wav");
|
||||
self:Remove();
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
end;
|
||||
end
|
||||
@@ -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.Base = "base_gmodentity";
|
||||
ENT.Author = "gb";
|
||||
ENT.PrintName = "Gold Pile";
|
||||
ENT.Spawnable = true;
|
||||
ENT.AdminSpawnable = true;
|
||||
ENT.Category = "Gathering System";
|
||||
|
||||
if (SERVER) then
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/willard/work/goldrock.mdl");
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS);
|
||||
self:PhysicsInit(SOLID_VPHYSICS);
|
||||
self:SetUseType(SIMPLE_USE);
|
||||
self:SetSolid(SOLID_VPHYSICS);
|
||||
self.BreakSounds = {"physics/concrete/boulder_impact_hard1.wav", "physics/concrete/boulder_impact_hard2.wav", "physics/concrete/boulder_impact_hard3.wav", "physics/concrete/boulder_impact_hard4.wav"};
|
||||
|
||||
local physicsObject = self:GetPhysicsObject();
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake();
|
||||
physicsObject:EnableMotion(false);
|
||||
end;
|
||||
end;
|
||||
|
||||
function ENT:UpdateTransmitState()
|
||||
return TRANSMIT_ALWAYS;
|
||||
end;
|
||||
|
||||
|
||||
function ENT:OnTakeDamage(damageInfo)
|
||||
local player = damageInfo:GetAttacker();
|
||||
|
||||
if IsValid(player) and player:IsPlayer() then
|
||||
local activeWeapon = tostring(player:GetActiveWeapon())
|
||||
|
||||
if string.find(activeWeapon, "tfa_nmrih_pickaxe") then
|
||||
local activeWeapon = player:GetActiveWeapon();
|
||||
|
||||
self:EmitSound(self.BreakSounds[math.random(1, #self.BreakSounds)]);
|
||||
|
||||
if !self.oreLeft then
|
||||
self.oreLeft = math.random(6, 8);
|
||||
end
|
||||
|
||||
if !self.strikesRequired then
|
||||
self.strikesRequired = math.random(5, 10);
|
||||
end
|
||||
|
||||
self.strikesRequired = self.strikesRequired - 1;
|
||||
|
||||
|
||||
if self.strikesRequired <= 0 then
|
||||
local entPos = self:GetPos();
|
||||
local character = player:GetCharacter()
|
||||
local inventory = character:GetInventory()
|
||||
local pickaxe = inventory:HasItem("pickaxe")
|
||||
|
||||
if (pickaxe:GetData("equip")) then
|
||||
pickaxe:DamageDurability(1)
|
||||
end
|
||||
|
||||
if (!character:GetInventory():Add("gold_ore")) then
|
||||
ix.item.Spawn("gold_ore", player)
|
||||
end
|
||||
|
||||
ix.chat.Send(player, "me", "extracts some ore from the vein!")
|
||||
self:EmitSound("physics/concrete/concrete_break2.wav");
|
||||
|
||||
|
||||
self.oreLeft = self.oreLeft - 1;
|
||||
self.strikesRequired = math.random(5, 10);
|
||||
end
|
||||
|
||||
if self.oreLeft <= 0 then
|
||||
self:EmitSound("physics/concrete/concrete_break2.wav");
|
||||
self:Remove();
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
end;
|
||||
end
|
||||
@@ -0,0 +1,89 @@
|
||||
--[[
|
||||
| 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.Base = "base_gmodentity";
|
||||
ENT.Author = "gb";
|
||||
ENT.PrintName = "Iron Pile";
|
||||
ENT.Spawnable = true;
|
||||
ENT.AdminSpawnable = true;
|
||||
ENT.Category = "Gathering System";
|
||||
|
||||
if (SERVER) then
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/willard/work/copperrock.mdl");
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS);
|
||||
self:PhysicsInit(SOLID_VPHYSICS);
|
||||
self:SetUseType(SIMPLE_USE);
|
||||
self:SetSolid(SOLID_VPHYSICS);
|
||||
self.BreakSounds = {"physics/concrete/boulder_impact_hard1.wav", "physics/concrete/boulder_impact_hard2.wav", "physics/concrete/boulder_impact_hard3.wav", "physics/concrete/boulder_impact_hard4.wav"};
|
||||
|
||||
local physicsObject = self:GetPhysicsObject();
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake();
|
||||
physicsObject:EnableMotion(false);
|
||||
end;
|
||||
end;
|
||||
|
||||
function ENT:OnTakeDamage(damageInfo)
|
||||
local player = damageInfo:GetAttacker();
|
||||
|
||||
if IsValid(player) and player:IsPlayer() then
|
||||
local activeWeapon = tostring(player:GetActiveWeapon())
|
||||
|
||||
if string.find(activeWeapon, "tfa_nmrih_pickaxe") then
|
||||
local activeWeapon = player:GetActiveWeapon();
|
||||
|
||||
self:EmitSound(self.BreakSounds[math.random(1, #self.BreakSounds)]);
|
||||
|
||||
if !self.oreLeft then
|
||||
self.oreLeft = math.random(6, 8);
|
||||
end
|
||||
|
||||
if !self.strikesRequired then
|
||||
self.strikesRequired = math.random(5, 10);
|
||||
end
|
||||
|
||||
self.strikesRequired = self.strikesRequired - 1;
|
||||
|
||||
|
||||
if self.strikesRequired <= 0 then
|
||||
local entPos = self:GetPos();
|
||||
local character = player:GetCharacter()
|
||||
local inventory = character:GetInventory()
|
||||
local pickaxe = inventory:HasItem("pickaxe")
|
||||
|
||||
if (pickaxe:GetData("equip")) then
|
||||
pickaxe:DamageDurability(1)
|
||||
end
|
||||
|
||||
if (!character:GetInventory():Add("iron_ore")) then
|
||||
ix.item.Spawn("iron_ore", player)
|
||||
end
|
||||
|
||||
ix.chat.Send(player, "me", "mines some ore!")
|
||||
self:EmitSound("physics/concrete/concrete_break2.wav");
|
||||
|
||||
self.oreLeft = self.oreLeft - 1;
|
||||
self.strikesRequired = math.random(5, 10);
|
||||
end
|
||||
|
||||
if self.oreLeft <= 0 then
|
||||
self:EmitSound("physics/concrete/concrete_break2.wav");
|
||||
self:Remove();
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
end;
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
| 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 = "Coal Ore"
|
||||
ITEM.model = "models/props_junk/rock001a.mdl"
|
||||
ITEM.skin = 0
|
||||
ITEM.color = Color(50,50,50)
|
||||
ITEM.uniqueID = "coal_ore";
|
||||
ITEM.description = "A big lump of coal.";
|
||||
ITEM.category = "misc"
|
||||
ITEM.width = 2
|
||||
ITEM.height = 2
|
||||
@@ -0,0 +1,22 @@
|
||||
--[[
|
||||
| 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 = "Gold Ore"
|
||||
ITEM.model = "models/props_junk/rock001a.mdl"
|
||||
ITEM.skin = 0
|
||||
ITEM.color = Color(229,184,11)
|
||||
ITEM.uniqueID = "gold_ore";
|
||||
ITEM.description = "A chunk of a metalic ore that needs to be refined before anything useful can be made with it.";
|
||||
ITEM.category = "misc"
|
||||
ITEM.width = 2
|
||||
ITEM.height = 2
|
||||
|
||||
ITEM.outlineColor = Color(255, 204, 0, 100)
|
||||
ITEM.colorAppendix = {["blue"] = "It could only be refined in a proper factory with the right equipment."}
|
||||
@@ -0,0 +1,22 @@
|
||||
--[[
|
||||
| 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 = "Iron Ore"
|
||||
ITEM.model = "models/props_junk/rock001a.mdl"
|
||||
ITEM.skin = 0
|
||||
ITEM.color = Color(155,47,28)
|
||||
ITEM.uniqueID = "iron_ore";
|
||||
ITEM.description = "A chunk of a metalic ore that needs to be refined before anything useful can be made with it.";
|
||||
ITEM.category = "misc"
|
||||
ITEM.width = 2
|
||||
ITEM.height = 2
|
||||
|
||||
ITEM.outlineColor = Color(255, 204, 0, 100)
|
||||
ITEM.colorAppendix = {["blue"] = "It could only be refined in a proper factory with the right equipment."}
|
||||
78
gamemodes/ixhl2rp/plugins/gathering_system/sh_plugin.lua
Normal file
78
gamemodes/ixhl2rp/plugins/gathering_system/sh_plugin.lua
Normal file
@@ -0,0 +1,78 @@
|
||||
--[[
|
||||
| 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 PLUGIN = PLUGIN
|
||||
|
||||
PLUGIN.name = "Gathering System"
|
||||
PLUGIN.description = "A system that allows you to gather materials and refine them!"
|
||||
PLUGIN.author = "gb"
|
||||
PLUGIN.version = 0.1
|
||||
|
||||
ix.util.Include("sv_plugin.lua")
|
||||
|
||||
|
||||
ix.config.Add("Ore Respawn Timer", 60, "On average, how many minutes there should be in between ore spawns.", nil,
|
||||
{
|
||||
data = {min = 1, max = 240},
|
||||
category = "Gathering"
|
||||
}
|
||||
)
|
||||
|
||||
ix.config.Add("Ore Respawn Variation", 30, "How many minutes of variation there should be in the spawning.", nil,
|
||||
{
|
||||
data = {min = 1, max = 240},
|
||||
category = "Gathering"
|
||||
}
|
||||
)
|
||||
|
||||
ix.config.Add("Ore Spawn Chance Coal", 50, "Chance percentage for spawning coal.", nil, {
|
||||
data = {min = 0, max = 100},
|
||||
category = "Gathering"
|
||||
})
|
||||
|
||||
ix.config.Add("Ore Spawn Chance Iron", 30, "Chance percentage for spawning iron.", nil, {
|
||||
data = {min = 0, max = 100},
|
||||
category = "Gathering"
|
||||
})
|
||||
|
||||
ix.config.Add("Ore Spawn Chance Gold", 20, "Chance percentage for spawning gold.", nil, {
|
||||
data = {min = 0, max = 100},
|
||||
category = "Gathering"
|
||||
})
|
||||
|
||||
|
||||
if (CLIENT) then
|
||||
function PLUGIN:InitializedPlugins()
|
||||
local color = Color(120,0,240)
|
||||
local function drawOreEsp(client, entity, x, y, factor)
|
||||
local text = ""
|
||||
local nextSpawn = entity:GetNetVar("ixNextOreSpawn")
|
||||
local oreSpawn = entity:GetNetVar("ixSelectedOre")
|
||||
if (nextSpawn) then
|
||||
if (nextSpawn == -1) then
|
||||
text = " (x)" .. oreSpawn
|
||||
elseif (nextSpawn > 0) then
|
||||
local timeLeft = nextSpawn - CurTime()
|
||||
if (timeLeft <= 60) then
|
||||
text = " (<1m)" .. oreSpawn
|
||||
else
|
||||
text = " ("..math.Round(timeLeft / 60).."m)" .. oreSpawn
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ix.util.DrawText("Ore Spawner"..text, x, y - math.max(10, 32 * factor), color,
|
||||
TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, nil, math.max(255 * factor, 80))
|
||||
end
|
||||
|
||||
ix.observer:RegisterESPType("ix_ore_spawner", drawOreEsp, "ore")
|
||||
end
|
||||
end
|
||||
51
gamemodes/ixhl2rp/plugins/gathering_system/sv_plugin.lua
Normal file
51
gamemodes/ixhl2rp/plugins/gathering_system/sv_plugin.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
--[[
|
||||
| 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 PLUGIN = PLUGIN
|
||||
|
||||
function PLUGIN:RegisterSaveEnts()
|
||||
ix.saveEnts:RegisterEntity("ix_ore_spawner", true, true, true, {
|
||||
OnSave = function(entity, data) --OnSave
|
||||
return {pos = data.pos, angles = data.angles, motion = false}
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- Called just after data should be saved.
|
||||
function PLUGIN:SaveData()
|
||||
local oreSpawns = {}
|
||||
|
||||
local entities = ents.GetAll()
|
||||
for i = 1, #entities do
|
||||
if (entities[i]:GetClass() != "ix_ore_spawner") then continue end
|
||||
local v = entities[i]
|
||||
oreSpawns[#oreSpawns + 1] = {
|
||||
angles = v:GetAngles(),
|
||||
position = v:GetPos(),
|
||||
}
|
||||
end
|
||||
|
||||
ix.data.Set("oreSpawns", oreSpawns)
|
||||
end
|
||||
|
||||
-- Called when Helix has loaded all of the entities.
|
||||
function PLUGIN:InitPostEntity()
|
||||
if (!ix.config.Get("SaveEntsOldLoadingEnabled")) then return end
|
||||
|
||||
local oreSpawns = ix.data.Get("oreSpawns")
|
||||
if oreSpawns then
|
||||
for _, v in pairs(oreSpawns) do
|
||||
local entity = ents.Create("ix_ore_spawner")
|
||||
entity:SetAngles(v.angles)
|
||||
entity:SetPos(v.position)
|
||||
entity:Spawn()
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user