mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
114
gamemodes/darkrp/plugins/wn7farming/items/base/sh_seeds.lua
Normal file
114
gamemodes/darkrp/plugins/wn7farming/items/base/sh_seeds.lua
Normal file
@@ -0,0 +1,114 @@
|
||||
--[[
|
||||
| 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 = "Seeds Base"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.useSound = {"player/footsteps/dirt1.wav", "player/footsteps/dirt2.wav", "player/footsteps/dirt3.wav", "player/footsteps/dirt4.wav"}
|
||||
ITEM.PlantModel = "models/props/de_inferno/claypot03_damage_01.mdl"
|
||||
ITEM.GrowTime = {14400, 14600}
|
||||
ITEM.Harvest = "fruit_apple"
|
||||
ITEM.baseHarvest = {5, 15}
|
||||
ITEM.outlineColor = Color(0, 255, 0, 100)
|
||||
ITEM.functions.plant = {
|
||||
name = "Plant",
|
||||
icon = "icon16/brick_add.png",
|
||||
OnRun = function(item)
|
||||
local client = item.player
|
||||
local trace = client:GetEyeTraceNoCursor()
|
||||
if (trace.HitPos:DistToSqr(client:GetShootPos()) > 192 * 192) then
|
||||
client:Notify("You can't plant it that far away!")
|
||||
return false
|
||||
end
|
||||
|
||||
if (trace.Entity:GetModel() != "models/wn7new/advcrates/n7_planter_dirt.mdl") then
|
||||
client:Notify("This can only be planted in suitable soil.")
|
||||
return false
|
||||
end
|
||||
|
||||
local check = true
|
||||
|
||||
for k, v in pairs(ents.FindInSphere(trace.HitPos, 10)) do
|
||||
if v:GetClass() == "cw_plant" then
|
||||
check = false
|
||||
end
|
||||
end
|
||||
|
||||
if (!check) then
|
||||
client:Notify("You can't plant this close to another plant!")
|
||||
return false
|
||||
end
|
||||
|
||||
local seed = ents.Create("cw_plant")
|
||||
local growtimeItem = math.random(item.GrowTime[1], item.GrowTime[2])
|
||||
local baseHarvest = math.random(item.baseHarvest[1], item.baseHarvest[2])
|
||||
local character = client:GetCharacter()
|
||||
local cookingSkill = character:GetSkillLevel("cooking")
|
||||
local growtime = growtimeItem - (cookingSkill * 10)
|
||||
character:DoAction("plant_seed")
|
||||
|
||||
seed:SetPos(trace.HitPos + trace.HitNormal + trace.Entity:GetUp() * -3)
|
||||
seed.Harvest = item.Harvest
|
||||
seed.baseHarvest = baseHarvest
|
||||
seed.GrowthPercent = 0
|
||||
seed.GrowTime = growtime
|
||||
seed.InitialGrowTime = growtime
|
||||
seed.BaseHarvest = baseHarvest
|
||||
seed.Fertilizer = 0
|
||||
seed.Hydration = 10
|
||||
seed:Spawn()
|
||||
|
||||
seed:SetModel(item.PlantModel)
|
||||
|
||||
client:Notify("You have successfully planted the seeds")
|
||||
|
||||
local startPos = seed:GetPos() + Vector(0, 0, 10)
|
||||
local endPos = startPos + Vector(0, 0, 32768)
|
||||
local skyCheckTrace = util.TraceLine({
|
||||
start = startPos,
|
||||
endpos = endPos,
|
||||
mask = MASK_SOLID_BRUSHONLY
|
||||
})
|
||||
|
||||
seed.HasSun = skyCheckTrace.HitSky
|
||||
|
||||
for _, ent in pairs(ents.FindInSphere(self:GetPos(), 1500)) do
|
||||
if IsValid(ent) and ent:GetClass() == "wn_sunlamp" and ent:GetNetVar("enabled") then
|
||||
seed.HasSun = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if !seed.HasSun then
|
||||
client:ChatNotify("The plant won't survive for long as it's not in an open area with sunlight.")
|
||||
end
|
||||
return true
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
if (IsValid(item.entity)) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:PopulateTooltip(tooltip)
|
||||
local data = tooltip:AddRow("data")
|
||||
data:SetBackgroundColor(derma.GetColor("Error", tooltip))
|
||||
data:SetText("You can plant these seeds in a special garden.")
|
||||
data:SizeToContents()
|
||||
end
|
||||
|
||||
|
||||
-- Called when a player drops the item.
|
||||
function ITEM:OnDrop(player, position) end
|
||||
@@ -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 = "Graines de Pomme"
|
||||
ITEM.description = "Une petite boîte avec quelques pépins de pomme à l'intérieur."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/props/de_dust/hr_dust/foliage/olive_tree_small_01.mdl"
|
||||
ITEM.GrowTime = {14000, 14400}
|
||||
ITEM.baseHarvest = {2, 3}
|
||||
ITEM.Harvest = "fruit_apple"
|
||||
|
||||
|
||||
|
||||
@@ -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 = "Graines de Banane"
|
||||
ITEM.description = "Une boîte avec quelques pépins de banane à l'intérieur."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/props/de_dust/hr_dust/foliage/banana_plant_01.mdl"
|
||||
ITEM.GrowTime = {14000, 14400}
|
||||
ITEM.baseHarvest = {3, 6}
|
||||
ITEM.Harvest = "fruit_banana"
|
||||
|
||||
|
||||
|
||||
@@ -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 = "Graines de Baies"
|
||||
ITEM.description = "Une petite boîte avec quelques graines de baies à l'intérieur."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/props/de_inferno/claypot03_damage_01.mdl"
|
||||
ITEM.GrowTime = {14280, 14628}
|
||||
ITEM.baseHarvest = {3, 6}
|
||||
ITEM.Harvest = "fruit_berries"
|
||||
|
||||
@@ -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 = "Graines d'orange"
|
||||
ITEM.description = "Quelques graines d'orange, à l'intérieur d'une boîte."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/props/de_dust/hr_dust/foliage/olive_tree_small_01.mdl"
|
||||
ITEM.GrowTime = {14568, 14975}
|
||||
ITEM.baseHarvest = {4, 6}
|
||||
ITEM.Harvest = "fruit_orange"
|
||||
|
||||
|
||||
|
||||
@@ -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 = "Graines de poire"
|
||||
ITEM.description = "Une petite boîte avec quelques graines de poire à l'intérieur."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/props/de_dust/hr_dust/foliage/olive_tree_small_01.mdl"
|
||||
ITEM.GrowTime = {14833, 15277}
|
||||
ITEM.baseHarvest = {4, 6}
|
||||
ITEM.Harvest = "fruit_pear"
|
||||
|
||||
|
||||
|
||||
@@ -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 = "Graines d'ananas"
|
||||
ITEM.description = "Une petite boîte avec quelques graines d'ananas à l'intérieur."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/props/de_dust/hr_dust/foliage/palm_tree_small_04.mdl"
|
||||
ITEM.GrowTime = {15118, 15591}
|
||||
ITEM.baseHarvest = {4, 5}
|
||||
ITEM.Harvest = "fruit_pineapple"
|
||||
|
||||
|
||||
|
||||
@@ -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 = "Graines de pomme de terre"
|
||||
ITEM.description = "Une petite boîte avec quelques graines de pomme de terre à l'intérieur."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/props/de_inferno/claypot03_damage_01.mdl"
|
||||
ITEM.GrowTime = {15413, 15915}
|
||||
ITEM.baseHarvest = {4, 6}
|
||||
ITEM.Harvest = "veg_potato"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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 = "Graines de tomate"
|
||||
ITEM.description = "Une boîte avec quelques graines de tomate à l'intérieur. Elles ne sont pas rouges."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/props/de_inferno/claypot03_damage_01.mdl"
|
||||
ITEM.GrowTime = {15718, 16250}
|
||||
ITEM.baseHarvest = {4, 6}
|
||||
ITEM.Harvest = "veg_tomato"
|
||||
|
||||
|
||||
|
||||
@@ -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 = "Graines de pastèque"
|
||||
ITEM.description = "Une petite boîte avec quelques graines de pastèque à l'intérieur."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/props/de_inferno/claypot03_damage_01.mdl"
|
||||
ITEM.GrowTime = {16034, 16596}
|
||||
ITEM.baseHarvest = {2, 3}
|
||||
ITEM.Harvest = "fruit_watermelon"
|
||||
|
||||
|
||||
|
||||
@@ -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 = "Graines de baies de Xen"
|
||||
ITEM.description = "Une boîte fluorescente avec des graines étranges à l'intérieur..."
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.category = "Farming"
|
||||
ITEM.PlantModel = "models/jq/hlvr/props/xenpack/xen_vort_plant.mdl"
|
||||
ITEM.GrowTime = {17430, 18346}
|
||||
ITEM.baseHarvest = {4, 6}
|
||||
ITEM.Harvest = "xen_berries"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
--[[
|
||||
| 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 = "Engrais avancé"
|
||||
ITEM.description = "Un petit sac rempli de petits morceaux d'engrais, de salpêtre et de tous les bons produits de jardinage dont vous avez besoin pour obtenir une récolte abondante et réussie. Celui-ci a été fabriqué avec maîtrise pour répondre à tous les besoins des plantes."
|
||||
ITEM.model = "models/props/de_dust/hr_dust/dust_flour_sack/dust_flour_sack.mdl"
|
||||
ITEM.category = "Farming"
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PopulateTooltip(tooltip)
|
||||
local data = tooltip:AddRow("data")
|
||||
data:SetBackgroundColor(derma.GetColor("Error", tooltip))
|
||||
data:SetText("Vous pouvez utiliser cet article pour augmenter la fertilité et l'hydratation d'une plante.")
|
||||
data:SizeToContents()
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.Water = {
|
||||
name = "Fertiliser",
|
||||
icon = "icon16/brick.png",
|
||||
OnRun = function(item)
|
||||
local player = item.player
|
||||
local trace = player:GetEyeTraceNoCursor()
|
||||
|
||||
if (trace.HitPos:Distance(player:GetShootPos()) <= 192) then
|
||||
if (trace.Entity:GetClass() == "cw_plant") then
|
||||
trace.Entity.Fertilizer = 100
|
||||
trace.Entity.Hydration = 100
|
||||
|
||||
player:ChatNotify("Vous avez épandu de l'engrais autour de la plante... la plante est contente !!")
|
||||
return true
|
||||
else
|
||||
player:Notify("Vous ne regardez pas une plante valide.")
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
48
gamemodes/darkrp/plugins/wn7farming/items/sh_fertilizer.lua
Normal file
48
gamemodes/darkrp/plugins/wn7farming/items/sh_fertilizer.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
--[[
|
||||
| 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 = "Fertilisant"
|
||||
ITEM.description = "Un petit sac rempli de petits morceaux d'engrais, de salpêtre et de toutes les bonnes choses de jardinage dont vous avez besoin pour obtenir une récolte réussie et abondante."
|
||||
ITEM.model = "models/props/de_dust/hr_dust/dust_flour_sack/dust_flour_sack.mdl"
|
||||
ITEM.category = "Farming"
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PopulateTooltip(tooltip)
|
||||
local data = tooltip:AddRow("data")
|
||||
data:SetBackgroundColor(derma.GetColor("Error", tooltip))
|
||||
data:SetText("Vous pouvez utiliser cet objet pour augmenter le niveau de fertilité d'une plante.")
|
||||
data:SizeToContents()
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.Water = {
|
||||
name = "Fertiliser",
|
||||
icon = "icon16/brick.png",
|
||||
OnRun = function(item)
|
||||
local player = item.player
|
||||
local trace = player:GetEyeTraceNoCursor()
|
||||
|
||||
if (trace.HitPos:Distance(player:GetShootPos()) <= 192) then
|
||||
if (trace.Entity:GetClass() == "cw_plant") then
|
||||
trace.Entity.Fertilizer = math.min(trace.Entity.Fertilizer + 25, 100)
|
||||
trace.Entity:SetNWInt("Fertilizer", math.min(trace.Entity:GetNWInt("Fertilizer", 0) + 25, 100))
|
||||
|
||||
|
||||
player:ChatNotify("Vous avez répandu de l'engrais autour de la plante....")
|
||||
return true
|
||||
|
||||
else
|
||||
player:Notify("Vous ne regardez pas une plante valide.")
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
117
gamemodes/darkrp/plugins/wn7farming/items/sh_water_bucket.lua
Normal file
117
gamemodes/darkrp/plugins/wn7farming/items/sh_water_bucket.lua
Normal file
@@ -0,0 +1,117 @@
|
||||
--[[
|
||||
| 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 = "Arrosoir"
|
||||
ITEM.description = "Un petit seau d'eau qui peut être rempli d'eau, spécialement conçu pour arroser les plantes."
|
||||
ITEM.model = "models/props/de_inferno/hr_i/inferno_gardening_tools/inferno_watering_can.mdl"
|
||||
ITEM.category = "Farming"
|
||||
|
||||
if (CLIENT) then
|
||||
local color_green = Color(0, 255, 0, 255)
|
||||
local color_red = Color(255, 50, 50, 255)
|
||||
|
||||
function ITEM:PopulateTooltip(tooltip)
|
||||
local data = tooltip:AddRow("data")
|
||||
data:SetBackgroundColor(derma.GetColor("Error", tooltip))
|
||||
data:SetText("You can use this bucket directly on plants to water them and increase their Hydration levels\nYou can fill it at bodies of water or Water Caches.")
|
||||
data:SizeToContents()
|
||||
|
||||
local water = tooltip:AddRow("water")
|
||||
water:SetBackgroundColor(derma.GetColor("Error", tooltip))
|
||||
water:SetText("Water: " ..self:GetData("water", 0).. "%")
|
||||
water:SizeToContents()
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.Water = {
|
||||
name = "Arroser la plante",
|
||||
icon = "icon16/drink.png",
|
||||
OnRun = function(item)
|
||||
local player = item.player
|
||||
local trace = player:GetEyeTraceNoCursor()
|
||||
|
||||
if item:GetData("water") > 0 then
|
||||
if (trace.HitPos:Distance(player:GetShootPos()) <= 192) then
|
||||
if (trace.Entity:GetClass() == "cw_plant") then
|
||||
|
||||
local hydration = trace.Entity.Hydration
|
||||
trace.Entity.Hydration = math.min(hydration + 25, 100)
|
||||
|
||||
local newValue = item:GetData("water", 0) - 25
|
||||
item:SetData("water", newValue)
|
||||
player:EmitSound("ambient/water/water_spray1.wav")
|
||||
player:ChatNotify("You water the plant with the contents of the bucket!")
|
||||
else
|
||||
player:Notify("You are not looking at a valid plant.")
|
||||
end
|
||||
end
|
||||
else
|
||||
player:Notify("There's not enough water on the bucket!")
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.fill = {
|
||||
name = "Remplir d'eau",
|
||||
tip = "applyTip",
|
||||
icon = "icon16/arrow_in.png",
|
||||
OnRun = function(item)
|
||||
if (SERVER) then
|
||||
local client = item.player
|
||||
local targetEnt = client:GetEyeTraceNoCursor().Entity
|
||||
|
||||
if item:IsWaterDeepEnough(client) then
|
||||
if item:GetData("water") != 100 then
|
||||
local newValue = item:GetData("water", 0) + 25
|
||||
client:ChatNotify("You've refilled the Water Bucket to the brim with the waters from the wasteland to "..newValue.."%")
|
||||
|
||||
item:SetData("water", newValue)
|
||||
client:EmitSound("ambient/water/water_spray1.wav")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if targetEnt:GetClass() == "ix_watercache" or (targetEnt:GetClass() == "ix_cleanwatercache" and targetEnt:GetNetVar("broken", false)) then
|
||||
if item:GetData("water") != 100 then
|
||||
local newValue = item:GetData("water", 0) + 25
|
||||
client:ChatNotify("You've refilled the Watering Can to "..newValue.."%")
|
||||
|
||||
item:SetData("water", newValue)
|
||||
client:EmitSound("ambient/water/water_spray1.wav")
|
||||
else
|
||||
client:ChatNotify("The bucket is full!")
|
||||
end
|
||||
else
|
||||
client:ChatNotify("You are not looking at a valid Water Source!")
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:IsWaterDeepEnough(client)
|
||||
local pos = client:GetPos() + Vector(0, 0, 15)
|
||||
local trace = {}
|
||||
trace.start = pos
|
||||
trace.endpos = pos + Vector(0, 0, 1)
|
||||
trace.mask = bit.bor( MASK_WATER )
|
||||
local tr = util.TraceLine(trace)
|
||||
|
||||
return tr.Hit
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced(index, x, y, item)
|
||||
self:SetData("water", 0)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user