From 5c4ebc932d8c02522802c842d43d863d89aca162 Mon Sep 17 00:00:00 2001 From: Apickx Date: Mon, 28 Dec 2015 19:10:44 -0500 Subject: Initial commit --- gamemode/itemsystem/items/infuser.lua | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 gamemode/itemsystem/items/infuser.lua (limited to 'gamemode/itemsystem/items/infuser.lua') diff --git a/gamemode/itemsystem/items/infuser.lua b/gamemode/itemsystem/items/infuser.lua new file mode 100644 index 0000000..d2f72ad --- /dev/null +++ b/gamemode/itemsystem/items/infuser.lua @@ -0,0 +1,57 @@ +ITEM.Name = "Infuser" +ITEM.Class = "structure" +ITEM.Desc = "Cast enchantments\nPlace runes nearby to boost magical power and have different effects" +ITEM.Model = "models/props_junk/wood_crate002a.mdl" +ITEM.Icon = Material("settlement/icon_researchtable") +ITEM.Recipe = { + Resources = { + ["Log"] = 5, + ["Sap"] = 5, + }, + Tools = { + ["Crystal Hammer"] = 1, + }, +} + +ITEM.Structure = { + { + Bone = "ValveBiped.Bip01_R_Hand", + Model = "models/props_junk/wood_crate002a.mdl", + Size = Vector(0.5,0.5,0.5), + Pos = Vector(4,-3,-1), + Ang = Angle(0,0,0), + }, +} + +ITEM.Ghost = { + { + Model = "models/props_junk/wood_crate002a.mdl", + Size = Vector(1,1,1), + Pos = Vector(0,0,0), + Ang = Angle(0,0,0), + }, +} + +ITEM.Range = 200 +ITEM.CD = 0.5 + +function ITEM:OnPrimary(pl,tr) + if (CLIENT) then return end + + if (!pl:CanPlaceStructure(tr)) then pl:GhostStructure(self.Name) return end + + if (tr.Hit) then + local drop = ents.Create("ws_infuser") + drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) + drop:SetPos(tr.HitPos) + drop:Spawn() + drop:Activate() + + if (pl:HasItem(self.Name)) then pl:RemoveItem(self.Name,1) + else pl:UnEquipWeaponSlot(pl.Select,true) end + + pl:GhostRemove() + else + pl:EmitSound(Sound("weapons/iceaxe/iceaxe_swing1.wav"),100,math.random(90,110)) + end +end -- cgit v1.2.3-70-g09d2