summaryrefslogtreecommitdiff
path: root/gamemode/items
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/items')
-rw-r--r--gamemode/items/ammo.lua138
-rw-r--r--gamemode/items/misc.lua546
-rw-r--r--gamemode/items/misc_explosive.lua114
-rw-r--r--gamemode/items/special.lua83
-rw-r--r--gamemode/items/supplies.lua219
-rw-r--r--gamemode/items/weapons_common.lua532
-rw-r--r--gamemode/items/weapons_special.lua128
7 files changed, 1760 insertions, 0 deletions
diff --git a/gamemode/items/ammo.lua b/gamemode/items/ammo.lua
new file mode 100644
index 0000000..a554382
--- /dev/null
+++ b/gamemode/items/ammo.lua
@@ -0,0 +1,138 @@
+
+// This is the ID given to any item that is ammunition
+ITEM_AMMO = 4
+
+// ammo constant
+PRICE_PISTOL = 5
+PRICE_BUCKSHOT = 8
+PRICE_SMGROUNDS = 5
+PRICE_RIFLEROUNDS = 10
+PRICE_SNIPERROUNDS = 10
+PRICE_ENERGYCELL = 8
+
+function FUNC_AMMO( ply, id )
+
+ local tbl = item.GetByID( id )
+
+ if not tbl.Ammo then return true end
+
+ ply:AddAmmo( tbl.Ammo, tbl.Amount )
+
+ return true
+
+end
+
+function FUNC_DROPAMMO( ply, id, drop )
+
+ local tbl = item.GetByID( id )
+
+ if not tbl.Ammo then return end
+
+ ply:AddAmmo( tbl.Ammo, -tbl.Amount, true )
+
+ return true // we don't want to override spawning the prop
+
+end
+
+item.Register( {
+ Name = "Pistol Rounds",
+ Description = "40 pistol rounds per box.",
+ Stackable = true,
+ Type = ITEM_AMMO,
+ Weight = 0.75,
+ Price = PRICE_PISTOL,
+ Rarity = 0.20,
+ Model = "models/items/357ammo.mdl",
+ Ammo = "Pistol",
+ Amount = 40,
+ PickupFunction = FUNC_AMMO,
+ DropFunction = FUNC_DROPAMMO,
+ CamPos = Vector(14,13,4),
+ CamOrigin = Vector(0,0,3)
+} )
+
+item.Register( {
+ Name = "Buckshot",
+ Description = "20 shotgun rounds per box.",
+ Stackable = true,
+ Type = ITEM_AMMO,
+ Weight = 0.75,
+ Price = PRICE_BUCKSHOT,
+ Rarity = 0.20,
+ Model = "models/items/boxbuckshot.mdl",
+ Ammo = "Buckshot",
+ Amount = 20,
+ PickupFunction = FUNC_AMMO,
+ DropFunction = FUNC_DROPAMMO,
+ CamPos = Vector(21,15,8),
+ CamOrigin = Vector(0,0,4)
+} )
+
+item.Register( {
+ Name = "SMG Rounds",
+ Description = "60 SMG rounds per box.",
+ Stackable = true,
+ Type = ITEM_AMMO,
+ Weight = 0.75,
+ Price = PRICE_SMGROUNDS,
+ Rarity = 0.50,
+ Model = "models/items/boxsrounds.mdl",
+ Ammo = "SMG",
+ Amount = 60,
+ PickupFunction = FUNC_AMMO,
+ DropFunction = FUNC_DROPAMMO,
+ CamPos = Vector(27,15,10),
+ CamOrigin = Vector(0,0,4)
+} )
+
+item.Register( {
+ Name = "Rifle Rounds",
+ Description = "60 automatic rifle rounds per box.",
+ Stackable = true,
+ Type = ITEM_AMMO,
+ Weight = 0.75,
+ Price = PRICE_RIFLEROUNDS,
+ Rarity = 0.80,
+ Model = "models/items/boxmrounds.mdl",
+ Ammo = "Rifle",
+ Amount = 60,
+ PickupFunction = FUNC_AMMO,
+ DropFunction = FUNC_DROPAMMO,
+ CamPos = Vector(29,22,10),
+ CamOrigin = Vector(0,0,5)
+} )
+
+item.Register( {
+ Name = "Sniper Rounds",
+ Description = "30 sniper rounds per box.",
+ Stackable = true,
+ Type = ITEM_AMMO,
+ Weight = 0.75,
+ Price = PRICE_SNIPERROUNDS,
+ Rarity = 0.75,
+ Model = "models/items/boxqrounds.mdl",
+ Ammo = "Sniper",
+ Amount = 30,
+ PickupFunction = FUNC_AMMO,
+ DropFunction = FUNC_DROPAMMO,
+ CamPos = Vector(-18,-14,8),
+ CamOrigin = Vector(4,0,-1)
+} )
+
+item.Register( {
+ Name = "Prototype Energy Cell",
+ Description = "15 energy charges per cell.",
+ Stackable = true,
+ Type = ITEM_AMMO,
+ Weight = 1.25,
+ Price = PRICE_ENERGYCELL,
+ Rarity = 0.85,
+ Model = "models/items/battery.mdl",
+ Ammo = "Prototype",
+ Amount = 15,
+ PickupFunction = FUNC_AMMO,
+ DropFunction = FUNC_DROPAMMO,
+ CamPos = Vector(15,15,8),
+ CamOrigin = Vector(0,0,5)
+} )
+
diff --git a/gamemode/items/misc.lua b/gamemode/items/misc.lua
new file mode 100644
index 0000000..b15db67
--- /dev/null
+++ b/gamemode/items/misc.lua
@@ -0,0 +1,546 @@
+
+// This is the ID given to any item that doesnt fit in any other category - feel free to add your own items here
+ITEM_MISC = 5 // Can be found in stores or in loot
+ITEM_BUYABLE = 6 // Only found in stores
+ITEM_LOOT = 7 // Only found in loot
+ITEM_QUEST_ZOMBIE = 421 // obsolete?
+
+function FUNC_DRINK( ply, id, client, icon )
+
+ if icon then return "icon16/cup.png" end
+ if client then return "Drink" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( table.Random{ "npc/barnacle/barnacle_gulp1.wav", "npc/barnacle/barnacle_gulp2.wav" }, 100, math.random( 90, 110 ) )
+ ply:AddHealth( 15 )
+ ply:AddStamina( 25 )
+ ply:Notice( "+15 Health", GAMEMODE.Colors.Green )
+ ply:Notice( "+25 Stamina", GAMEMODE.Colors.Green )
+
+end
+
+function FUNC_EAT( ply, id, client, icon )
+
+ if icon then return "icon16/cake.png" end
+ if client then return "Eat" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( "npc/barnacle/barnacle_crunch2.wav", 100, math.random( 90, 110 ) )
+ ply:AddHealth( 25 )
+ ply:AddStamina( 15 )
+ ply:Notice( "+25 Health", GAMEMODE.Colors.Green )
+ ply:Notice( "+15 Stamina", GAMEMODE.Colors.Green )
+
+end
+
+function FUNC_BOOZE( ply, id, client, icon )
+
+ if icon then return "icon16/drink.png" end
+ if client then return "Drink" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( table.Random{ "npc/barnacle/barnacle_gulp1.wav", "npc/barnacle/barnacle_gulp2.wav" }, 100, math.random( 90, 110 ) )
+ ply:AddRadiation( -2 )
+ ply:AddStamina( 20 )
+ ply:Notice( "+20 Stamina", GAMEMODE.Colors.Green )
+ ply:Notice( "-2 Radiation", GAMEMODE.Colors.Green )
+ ply:Notice( "+4 Intoxication", GAMEMODE.Colors.Red )
+
+ umsg.Start( "Drunk", ply )
+ umsg.Short( 4 )
+ umsg.End()
+
+end
+
+function FUNC_MOONSHINE( ply, id, client, icon )
+
+ if icon then return "icon16/drink.png" end
+ if client then return "Drink" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( table.Random{ "npc/barnacle/barnacle_gulp1.wav", "npc/barnacle/barnacle_gulp2.wav" }, 100, math.random( 90, 110 ) )
+ ply:AddRadiation( -1 )
+ ply:Notice( "-1 Radiation", GAMEMODE.Colors.Green )
+ ply:Notice( "+6 Intoxication", GAMEMODE.Colors.Red )
+
+ umsg.Start( "Drunk", ply )
+ umsg.Short( 6 )
+ umsg.End()
+
+end
+
+function FUNC_BEER( ply, id, client, icon )
+
+ if icon then return "icon16/drink.png" end
+ if client then return "Drink" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( table.Random{ "npc/barnacle/barnacle_gulp1.wav", "npc/barnacle/barnacle_gulp2.wav" }, 100, math.random( 90, 110 ) )
+ ply:AddStamina( 15 )
+ ply:Notice( "+15 Stamina", GAMEMODE.Colors.Green )
+ ply:Notice( "+2 Intoxication", GAMEMODE.Colors.Red )
+
+ umsg.Start( "Drunk", ply )
+ umsg.Short( 2 )
+ umsg.End()
+
+end
+
+function FUNC_SPACEBEER( ply, id, client, icon )
+
+ if icon then return "icon16/drink.png" end
+ if client then return "Drink" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( table.Random{ "npc/barnacle/barnacle_gulp1.wav", "npc/barnacle/barnacle_gulp2.wav" }, 100, math.random( 90, 110 ) )
+ ply:Notice( "+15 Intoxication", GAMEMODE.Colors.Red )
+
+ umsg.Start( "Drunk", ply )
+ umsg.Short( 15 )
+ umsg.End()
+
+end
+
+function FUNC_UNMUTAGEN( ply, id, client, icon )
+
+ if icon then return "icon16/pill.png" end
+ if client then return "Inject" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( "Weapon_SMG1.Special1" )
+
+ local tbl = {}
+ local inc = 0
+
+ for i=1,math.random(1,3) do
+
+ local rand = math.random(1,6)
+
+ while table.HasValue( tbl, rand ) do
+
+ rand = math.random(1,6)
+
+ end
+
+ table.insert( tbl, rand )
+
+ if rand == 1 then
+
+ ply:Notice( "You feel extremely nauseous", GAMEMODE.Colors.Red, 5, inc * 2 )
+
+ umsg.Start( "Drunk", ply )
+ umsg.Short( 20 )
+ umsg.End()
+
+ elseif rand == 2 then
+
+ local rad = math.random(2,5)
+
+ if math.random(1,2) == 1 then
+
+ ply:Notice( "+" .. rad .. " Radiation", GAMEMODE.Colors.Red, 5, inc * 2 )
+ ply:AddRadiation( rad )
+
+ else
+
+ ply:Notice( "-" .. rad .. " Radiation", GAMEMODE.Colors.Green, 5, inc * 2 )
+ ply:AddRadiation( -rad )
+
+ end
+
+ elseif rand == 3 then
+
+ if ply:IsInfected() then
+
+ ply:Notice( "Your infection has been cured", GAMEMODE.Colors.Green, 5, inc * 2 )
+ ply:SetInfected( false )
+
+ else
+
+ ply:Notice( "You were infected by the drug", GAMEMODE.Colors.Red, 5, inc * 2 )
+ ply:SetInfected( true )
+
+ end
+
+ elseif rand == 4 then
+
+ if math.random(1,2) == 1 then
+
+ ply:Notice( "You feel exhausted", GAMEMODE.Colors.Red, 5, inc * 2 )
+ ply:AddStamina( -50 )
+
+ else
+
+ ply:Notice( "+20 Stamina", GAMEMODE.Colors.Green, 5, inc * 2 )
+ ply:AddStamina( 20 )
+
+ end
+
+ elseif rand == 5 then
+
+ ply:Notice( "Your whole body aches", GAMEMODE.Colors.Red, 5, inc * 2 )
+
+ local dmg = math.random(1,5)
+
+ ply:AddHealth( dmg * -10 )
+
+ if math.random(1,20) == 1 then
+
+ local dietime = math.random( 30, 120 )
+
+ timer.Simple( dietime - 5, function() ply:Notice( "You feel a sharp pain in your chest", GAMEMODE.Colors.Red, 5 ) end )
+ timer.Simple( dietime, function() ply:Kill() end )
+
+ end
+
+ elseif rand == 6 then
+
+ ply:Notice( "Your legs begin to feel weak", GAMEMODE.Colors.Red, 5, inc * 2 )
+ ply:SetWalkSpeed( GAMEMODE.WalkSpeed - 80 )
+ ply:SetRunSpeed( GAMEMODE.RunSpeed - 80 )
+
+ local legtime = math.random( 20, 60 )
+
+ timer.Simple( legtime - 5, function() if IsValid( ply ) and ply:Team() == TEAM_ARMY then ply:Notice( "Your legs start to feel better", GAMEMODE.Colors.Green, 5 ) end end )
+ timer.Simple( legtime, function() if IsValid( ply ) and ply:Team() == TEAM_ARMY then ply:SetWalkSpeed( GAMEMODE.WalkSpeed ) ply:SetRunSpeed( GAMEMODE.RunSpeed ) end end )
+
+ end
+
+ inc = inc + 1
+
+ end
+
+end
+
+function FUNC_WRENCH( ply, id, client, icon )
+
+ if icon then return "icon16/cake.png" end
+ if client then return "Eat" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( "npc/barnacle/barnacle_crunch2.wav", 100, math.random( 90, 110 ) )
+ ply:EmitSound( "weapons/crowbar/crowbar_impact2.wav", 100, math.random( 90, 110 ) )
+ ply:TakeDamage( 20 )
+ ply:Notice( "-20 Health", GAMEMODE.Colors.Red )
+ ply:Notice( "You just ate a fucking wrench", GAMEMODE.Colors.Red )
+
+end
+
+function FUNC_OPENSUITCASE( ply, id )
+
+ ply:Notice( "You found some " .. GAMEMODE.CurrencyName .. "s", GAMEMODE.Colors.Green )
+ ply:EmitSound( Sound( "Chain.ImpactSoft" ) )
+
+ if math.random(1,10) == 1 then
+
+ ply:AddCash( math.random(5,50) )
+
+ else
+
+ ply:AddCash( math.random(2,10) )
+
+ end
+
+ return false
+
+end
+
+function FUNC_OPENBOX( ply, id )
+
+ local tbl = { ITEM_SUPPLY, ITEM_AMMO, ITEM_MISC, ITEM_SPECIAL, ITEM_WPN_COMMON, ITEM_WPN_SPECIAL }
+ local chancetbl = { 0.60, 0.20, 0.50, 0.20, 0.05, 0.03 }
+
+ local rnd = math.Rand(0,1)
+ local choice = math.random( 1, table.Count( tbl ) )
+
+ while rnd > chancetbl[ choice ] do
+
+ rnd = math.Rand(0,1)
+ choice = math.random( 1, table.Count( tbl ) )
+
+ end
+
+ local rand = item.RandomItem( tbl[choice] )
+
+ ply:AddIDToInventory( rand.ID )
+ ply:EmitSound( "Cardboard.Break" )
+
+ return false
+
+end
+
+item.Register( {
+ Name = "Cardboard Box",
+ CollisionOverride = true,
+ Type = ITEM_LOOT,
+ Rarity = 0.95,
+ Model = "models/props_junk/cardboard_box001a.mdl",
+ PickupFunction = FUNC_OPENBOX,
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Cardboard Box",
+ CollisionOverride = true,
+ Type = ITEM_LOOT,
+ Rarity = 0.95,
+ Model = "models/props_junk/cardboard_box001b.mdl",
+ PickupFunction = FUNC_OPENBOX,
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Cardboard Box",
+ CollisionOverride = true,
+ Type = ITEM_LOOT,
+ Rarity = 0.95,
+ Model = "models/props_junk/cardboard_box002a.mdl",
+ PickupFunction = FUNC_OPENBOX,
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Cardboard Box",
+ CollisionOverride = true,
+ Type = ITEM_LOOT,
+ Rarity = 0.95,
+ Model = "models/props_junk/cardboard_box002b.mdl",
+ PickupFunction = FUNC_OPENBOX,
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Cardboard Box",
+ CollisionOverride = true,
+ Type = ITEM_LOOT,
+ Rarity = 0.95,
+ Model = "models/props_junk/cardboard_box003a.mdl",
+ PickupFunction = FUNC_OPENBOX,
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Cardboard Box",
+ CollisionOverride = true,
+ Type = ITEM_LOOT,
+ Rarity = 0.95,
+ Model = "models/props_junk/cardboard_box003b.mdl",
+ PickupFunction = FUNC_OPENBOX,
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Suitcase",
+ CollisionOverride = true,
+ Type = ITEM_LOOT,
+ Rarity = 0.50,
+ Model = "models/props_c17/suitcase_passenger_physics.mdl",
+ PickupFunction = FUNC_OPENSUITCASE,
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Briefcase",
+ CollisionOverride = true,
+ Type = ITEM_LOOT,
+ Rarity = 0.50,
+ Model = "models/props_c17/briefcase001a.mdl",
+ PickupFunction = FUNC_OPENSUITCASE,
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Wood",
+ Description = "Used in building barricades.",
+ Stackable = true,
+ Type = ITEM_MISC,
+ Weight = 1.50,
+ Price = 15,
+ Rarity = 0.15,
+ Model = "models/props_debris/wood_chunk04a.mdl",
+ Functions = {},
+ CamPos = Vector(42,15,0),
+ CamOrigin = Vector(0,0,-1)
+} )
+
+item.Register( {
+ Name = "Water",
+ Description = "Restores 25 stamina and 10 health.",
+ Stackable = true,
+ Type = ITEM_MISC,
+ Weight = 0.15,
+ Price = 3,
+ Rarity = 0.05,
+ Model = "models/props/cs_office/water_bottle.mdl",
+ Functions = { FUNC_DRINK },
+ CamPos = Vector(12,12,1),
+ CamOrigin = Vector(0,0,0)
+} )
+
+item.Register( {
+ Name = "Canned Food",
+ Description = "Restores 25 health and 10 stamina.",
+ Stackable = true,
+ Type = ITEM_MISC,
+ Weight = 0.15,
+ Price = 3,
+ Rarity = 0.05,
+ Model = "models/props_junk/garbage_metalcan001a.mdl",
+ Functions = { FUNC_EAT },
+ CamPos = Vector(10,10,0),
+ CamOrigin = Vector(0,0,0)
+} )
+
+item.Register( {
+ Name = "Wrench",
+ Description = "Why would you eat this?",
+ Stackable = true,
+ Type = ITEM_LOOT,
+ Weight = 0.15,
+ Price = 3,
+ Rarity = 0.99,
+ Model = "models/props_c17/tools_wrench01a.mdl",
+ Functions = { FUNC_WRENCH },
+ CamPos = Vector(0,0,29),
+ CamOrigin = Vector(0,1,4)
+} )
+
+item.Register( {
+ Name = "Unstable Mutagen",
+ Description = "Prototype drug which may cure the infection.",
+ Stackable = true,
+ Type = ITEM_LOOT,
+ Weight = 0.30,
+ Price = 50,
+ Rarity = 0.95,
+ Model = "models/healthvial.mdl",
+ Functions = { FUNC_UNMUTAGEN },
+ CamPos = Vector(-16,0,8),
+ CamOrigin = Vector(0,0,5)
+} )
+
+item.Register( {
+ Name = "Beer",
+ Description = "Restores 15 stamina.",
+ Stackable = true,
+ Type = ITEM_LOOT,
+ Weight = 0.30,
+ Price = 5,
+ Rarity = 0.30,
+ Model = "models/props_junk/glassbottle01a.mdl",
+ Functions = { FUNC_BEER },
+ CamPos = Vector(16,12,1),
+ CamOrigin = Vector(0,0,0)
+} )
+
+item.Register( {
+ Name = "Tequila",
+ Description = "Don't drink this shit.",
+ Stackable = true,
+ Type = ITEM_LOOT,
+ Weight = 0.30,
+ Price = 5,
+ Rarity = 0.85,
+ Model = "models/props_junk/glassjug01.mdl",
+ Functions = { FUNC_SPACEBEER },
+ CamPos = Vector(19,0,6),
+ CamOrigin = Vector(0,0,5)
+} )
+
+item.Register( {
+ Name = "Vodka",
+ Description = "Releives radiation poisoning.",
+ Stackable = true,
+ Type = ITEM_MISC,
+ Weight = 0.30,
+ Price = 10,
+ Rarity = 0.10,
+ Model = "models/props_junk/garbage_glassbottle002a.mdl",
+ Functions = { FUNC_BOOZE },
+ CamPos = Vector(15,19,4),
+ CamOrigin = Vector(0,0,0)
+} )
+
+item.Register( {
+ Name = "Moonshine Vodka",
+ Description = "Weaker homebrewed vodka.",
+ Stackable = true,
+ Type = ITEM_BUYABLE,
+ Weight = 0.30,
+ Price = 5,
+ Rarity = 0.25,
+ Model = "models/props_junk/garbage_glassbottle003a.mdl",
+ Functions = { FUNC_MOONSHINE },
+ CamPos = Vector(16,17,1),
+ CamOrigin = Vector(0,0,-1)
+} )
+
+--[[item.Register( {
+ Name = "Human Skull",
+ Description = "This human skull looks pretty old. You decided to name it Murray.",
+ Stackable = true,
+ Type = ITEM_QUEST_ZOMBIE,
+ Weight = 2.50,
+ Price = 1,
+ Rarity = 0.75,
+ Model = "models/gibs/hgibs.mdl",
+ Functions = { },
+ CamPos = Vector(15,10,0),
+ CamOrigin = Vector(0,0,2)
+} )
+
+item.Register( {
+ Name = "Zombie Claw",
+ Description = "This is the claw of a zombie.",
+ Stackable = true,
+ Type = ITEM_QUEST_ZOMBIE,
+ Weight = 2.50,
+ Price = 1,
+ Rarity = 0.25,
+ Model = "models/gibs/antlion_gib_small_1.mdl",
+ Functions = { },
+ CamPos = Vector(10,15,5),
+ CamOrigin = Vector(0,0,1)
+} )
+
+item.Register( {
+ Name = "Zombie Spine",
+ Description = "This is the spine of a zombie.",
+ Stackable = true,
+ Type = ITEM_QUEST_ZOMBIE,
+ Weight = 2.50,
+ Price = 1,
+ Rarity = 0.25,
+ Model = "models/gibs/HGIBS_spine.mdl",
+ Functions = { },
+ CamPos = Vector(15,15,5),
+ CamOrigin = Vector(0,0,2)
+} )
+
+item.Register( {
+ Name = "Zombie Rib",
+ Description = "This is the rib of a zombie.",
+ Stackable = true,
+ Type = ITEM_QUEST_ZOMBIE,
+ Weight = 2.50,
+ Price = 1,
+ Rarity = 0.25,
+ Model = "models/gibs/HGIBS_rib.mdl",
+ Functions = { },
+ CamPos = Vector(10,15,3),
+ CamOrigin = Vector(0,0,0)
+} )
+
+item.Register( {
+ Name = "Zombie Flesh",
+ Description = "This is a chunk of zombie flesh.",
+ Stackable = true,
+ Type = ITEM_QUEST_ZOMBIE,
+ Weight = 2.50,
+ Price = 1,
+ Rarity = 0.25,
+ Model = "models/props_junk/watermelon01_chunk02a.mdl",
+ Functions = { },
+ CamPos = Vector(8,8,5),
+ CamOrigin = Vector(0,0,2.5)
+} )]]
diff --git a/gamemode/items/misc_explosive.lua b/gamemode/items/misc_explosive.lua
new file mode 100644
index 0000000..9584feb
--- /dev/null
+++ b/gamemode/items/misc_explosive.lua
@@ -0,0 +1,114 @@
+
+ITEM_EXPLOSIVE = 345
+
+function FUNC_OXYGEN( ply, id, client, icon )
+
+ if icon then return "icon16/arrow_turn_right.png" end
+ if client then return "Throw" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( Sound( "WeaponFrag.Throw" ) )
+
+ local oxy = ents.Create( "sent_oxygen" )
+ oxy:SetPos( ply:GetItemDropPos() )
+ oxy:SetAngles( ply:GetAimVector():Angle() )
+ oxy:Spawn()
+
+end
+
+function FUNC_DROPOXYGEN( ply, id, drop )
+
+
+ if not drop then return end
+
+ local oxy = ents.Create( "sent_oxygen" )
+ oxy:SetSpeed( 10 )
+ oxy:SetPos( ply:GetItemDropPos() )
+ oxy:SetAngles( ply:GetAimVector():Angle() )
+ oxy:Spawn()
+
+ return false // override spawning a prop for this item
+
+end
+
+item.Register( {
+ Name = "Liquid Oxygen",
+ Description = "Highly explosive liquid oxygen.",
+ TypeOverride = "sent_oxygen",
+ Stackable = true,
+ Type = ITEM_EXPLOSIVE,
+ Weight = 1.50,
+ Price = 50,
+ Rarity = 0.95,
+ Model = "models/props_phx/misc/potato_launcher_explosive.mdl",
+ Functions = { FUNC_OXYGEN },
+ DropFunction = FUNC_DROPOXYGEN,
+ CamPos = Vector(24,0,8),
+ CamOrigin = Vector(0,0,6)
+} )
+
+item.Register( {
+ Name = "Gasoline",
+ TypeOverride = "sent_fuel_gas",
+ AllowPickup = true,
+ CollisionOverride = true,
+ Type = ITEM_EXPLOSIVE,
+ Rarity = 0.50,
+ Model = "models/props_junk/gascan001a.mdl",
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Diesel Fuel",
+ TypeOverride = "sent_fuel_diesel",
+ AllowPickup = true,
+ CollisionOverride = true,
+ Type = ITEM_EXPLOSIVE,
+ Rarity = 0.50,
+ Model = "models/props_junk/metalgascan.mdl",
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Propane Canister",
+ TypeOverride = "sent_propane_canister",
+ AllowPickup = true,
+ CollisionOverride = true,
+ Type = ITEM_EXPLOSIVE,
+ Rarity = 0.50,
+ Model = "models/props_junk/propane_tank001a.mdl",
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Propane Tank",
+ TypeOverride = "sent_propane_tank",
+ AllowPickup = true,
+ CollisionOverride = true,
+ Type = ITEM_EXPLOSIVE,
+ Rarity = 0.50,
+ Model = "models/props_junk/propanecanister001a.mdl",
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Radioactive Waste",
+ TypeOverride = "sent_barrel_radioactive",
+ AllowPickup = true,
+ CollisionOverride = true,
+ Type = ITEM_EXPLOSIVE,
+ Rarity = 0.10,
+ Model = "models/props/de_train/barrel.mdl",
+ Functions = {}
+} )
+
+item.Register( {
+ Name = "Toxic Waste",
+ TypeOverride = "sent_barrel_biohazard",
+ AllowPickup = true,
+ CollisionOverride = true,
+ Type = ITEM_EXPLOSIVE,
+ Rarity = 0.10,
+ Model = "models/props/de_train/barrel.mdl",
+ Functions = {}
+} )
diff --git a/gamemode/items/special.lua b/gamemode/items/special.lua
new file mode 100644
index 0000000..8dbab7f
--- /dev/null
+++ b/gamemode/items/special.lua
@@ -0,0 +1,83 @@
+
+// This is the ID given to any item that is a SPECIALIST supply
+ITEM_SPECIAL = 3
+
+function FUNC_ANTIRAD( ply, id, client, icon )
+
+ if icon then return "icon16/pill.png" end
+ if client then return "Inject" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( "Weapon_SMG1.Special1" )
+ ply:SetRadiation( 0 )
+ ply:Notice( "-5 Radiation", GAMEMODE.Colors.Green )
+
+end
+
+--[[function FUNC_FLARE( ply, id, client, icon )
+
+ if icon then return "icon16/lightbulb.png" end
+ if client then return "Ignite" end
+
+ ply:RemoveFromInventory( id )
+
+ local prop = ents.Create( "sent_flare" )
+ prop:SetPos( ply:GetItemDropPos() )
+ prop:Spawn()
+
+end]]
+
+item.Register( {
+ Name = "Anti-Rad",
+ Description = "Releives all radiation poisoning.",
+ Stackable = true,
+ Type = ITEM_SPECIAL,
+ Weight = 0.15,
+ Price = 10,
+ Rarity = 0.20,
+ Model = "models/props_lab/jar01b.mdl",
+ Functions = { FUNC_ANTIRAD },
+ CamPos = Vector(-17,-9,0),
+ CamOrigin = Vector(0,0,-1)
+} )
+
+item.Register( {
+ Name = "Respirator",
+ Description = "Filters out chemicals and radiation.",
+ Stackable = true,
+ Type = ITEM_SPECIAL,
+ Weight = 1.75,
+ Price = 40,
+ Rarity = 0.95,
+ Model = "models/items/combine_rifle_cartridge01.mdl",
+ CamPos = Vector(13,-14,0),
+ CamOrigin = Vector(0,0,-1)
+} )
+
+--[[item.Register( {
+ Name = "Sonar Module",
+ Description = "Improves your radar detection range.",
+ Stackable = true,
+ Type = ITEM_SPECIAL,
+ Weight = 0.75,
+ Price = 30,
+ Rarity = 0.90,
+ Model = "models/gibs/shield_scanner_gib1.mdl",
+ Functions = {},
+ CamPos = Vector(2,-9,7),
+ CamOrigin = Vector(0,1,-1)
+} )
+
+item.Register( {
+ Name = "Flare",
+ Description = "Emits a bright red light.",
+ Stackable = true,
+ Type = ITEM_SPECIAL,
+ Weight = 0.35,
+ Price = 3,
+ Rarity = 0.10,
+ Model = "models/props_c17/trappropeller_lever.mdl",
+ Functions = { FUNC_FLARE },
+ CamPos = Vector(15,6,5),
+ CamOrigin = Vector(0,0,0)
+} )]] \ No newline at end of file
diff --git a/gamemode/items/supplies.lua b/gamemode/items/supplies.lua
new file mode 100644
index 0000000..122c6a5
--- /dev/null
+++ b/gamemode/items/supplies.lua
@@ -0,0 +1,219 @@
+
+// This is the ID given to any item that is an essential supply for every faction
+ITEM_SUPPLY = 2
+
+function FUNC_ENERGY( ply, id, client, icon )
+
+ if icon then return "icon16/cup.png" end
+ if client then return "Drink" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( table.Random{ "npc/barnacle/barnacle_gulp1.wav", "npc/barnacle/barnacle_gulp2.wav" }, 100, math.random( 90, 110 ) )
+ ply:AddStamina( 50 )
+ ply:Notice( "+50 Stamina", GAMEMODE.Colors.Green )
+
+end
+
+function FUNC_HEAL( ply, id, client, icon )
+
+ if icon then return "icon16/heart.png" end
+ if client then return "Use" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( "HealthVial.Touch" )
+ ply:AddHealth( 75 )
+ ply:Notice( "+75 Health", GAMEMODE.Colors.Green )
+
+end
+
+function FUNC_SUPERHEAL( ply, id, client, icon )
+
+ if icon then return "icon16/heart.png" end
+ if client then return "Use" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( "HealthVial.Touch" )
+ ply:AddHealth( 150 )
+ ply:Notice( "+150 Health", GAMEMODE.Colors.Green )
+
+end
+
+function FUNC_BANDAGE( ply, id, client, icon )
+
+ if icon then return "icon16/heart.png" end
+ if client then return "Use" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( "Cardboard.Strain" )
+ ply:SetBleeding( false )
+ ply:AddHealth( 20 )
+ ply:Notice( "+20 Health", GAMEMODE.Colors.Green )
+ ply:Notice( "Stopped bleeding", GAMEMODE.Colors.Green )
+
+end
+
+function FUNC_MUTAGEN( ply, id, client, icon )
+
+ if icon then return "icon16/pill.png" end
+ if client then return "Inject" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( "Weapon_SMG1.Special1" )
+
+ if ply:IsInfected() then
+
+ ply:Notice( "Your infection has been cured", GAMEMODE.Colors.Green, 5, 0 )
+ ply:SetInfected( false )
+
+ end
+
+ local tbl = {}
+ local inc = 0
+
+ for i=1,math.random(1,3) do
+
+ local rand = math.random(1,5)
+
+ while table.HasValue( tbl, rand ) do
+
+ rand = math.random(1,5)
+
+ end
+
+ table.insert( tbl, rand )
+
+ if rand == 1 then
+
+ ply:Notice( "You feel extremely nauseous", GAMEMODE.Colors.Red, 5, inc * 2 )
+
+ umsg.Start( "Drunk", ply )
+ umsg.Short( math.random( 10, 20 ) )
+ umsg.End()
+
+ elseif rand == 2 then
+
+ local rad = math.random(2,5)
+
+ if math.random(1,2) == 1 and ply:GetRadiation() < 1 then
+
+ ply:Notice( "+" .. rad .. " Radiation", GAMEMODE.Colors.Red, 5, inc * 2 )
+ ply:AddRadiation( rad )
+
+ else
+
+ ply:Notice( "-" .. rad .. " Radiation", GAMEMODE.Colors.Green, 5, inc * 2 )
+ ply:AddRadiation( -rad )
+
+ end
+
+ elseif rand == 3 then
+
+ ply:Notice( "Your whole body aches", GAMEMODE.Colors.Red, 5, inc * 2 )
+
+ local dmg = math.random(2,5)
+
+ ply:AddHealth( dmg * -10 )
+
+ elseif rand == 4 then
+
+ if math.random(1,2) == 1 then
+
+ ply:Notice( "You feel exhausted", GAMEMODE.Colors.Red, 5, inc * 2 )
+ ply:AddStamina( -50 )
+
+ else
+
+ ply:Notice( "+20 Stamina", GAMEMODE.Colors.Green, 5, inc * 2 )
+ ply:AddStamina( 20 )
+
+ end
+
+ elseif rand == 5 then
+
+ ply:Notice( "Your legs begin to feel weak", GAMEMODE.Colors.Red, 5, inc * 2 )
+ ply:SetWalkSpeed( GAMEMODE.WalkSpeed - 80 )
+ ply:SetRunSpeed( GAMEMODE.RunSpeed - 80 )
+
+ local legtime = math.random( 20, 40 )
+
+ timer.Simple( legtime - 5, function() if IsValid( ply ) and ply:Team() == TEAM_ARMY then ply:Notice( "Your legs start to feel better", GAMEMODE.Colors.Green, 5 ) end end )
+ timer.Simple( legtime, function() if IsValid( ply ) and ply:Team() == TEAM_ARMY then ply:SetWalkSpeed( GAMEMODE.WalkSpeed ) ply:SetRunSpeed( GAMEMODE.RunSpeed ) end end )
+
+ end
+
+ inc = inc + 1
+
+ end
+
+end
+
+item.Register( {
+ Name = "Energy Drink",
+ Description = "Restores 50 stamina.",
+ Stackable = true,
+ Type = ITEM_SUPPLY,
+ Weight = 0.25,
+ Price = 5,
+ Rarity = 0.25,
+ Model = "models/props_junk/popcan01a.mdl",
+ Functions = { FUNC_ENERGY },
+ CamPos = Vector(10,10,0),
+ CamOrigin = Vector(0,0,0)
+} )
+
+item.Register( {
+ Name = "Basic Medikit",
+ Description = "Restores 50% of your health.",
+ Stackable = true,
+ Type = ITEM_SUPPLY,
+ Weight = 1.25,
+ Price = 10,
+ Rarity = 0.65,
+ Model = "models/radbox/healthpack.mdl",
+ Functions = { FUNC_HEAL },
+ CamPos = Vector(23,8,3),
+ CamOrigin = Vector(0,0,-1)
+} )
+
+item.Register( {
+ Name = "Advanced Medikit",
+ Description = "Restores 100% of your health.",
+ Stackable = true,
+ Type = ITEM_SUPPLY,
+ Weight = 1.25,
+ Price = 20,
+ Rarity = 0.85,
+ Model = "models/radbox/healthpack2.mdl",
+ Functions = { FUNC_SUPERHEAL },
+ CamPos = Vector(23,8,3),
+ CamOrigin = Vector(0,0,-1)
+} )
+
+item.Register( {
+ Name = "Alpha Mutagen",
+ Description = "Prototype drug which cures the infection.",
+ Stackable = true,
+ Type = ITEM_SUPPLY,
+ Weight = 1.25,
+ Price = 50,
+ Rarity = 0.95,
+ Model = "models/items/healthkit.mdl",
+ Functions = { FUNC_MUTAGEN },
+ CamPos = Vector(0,0,35),
+ CamOrigin = Vector(4,0,0)
+} )
+
+item.Register( {
+ Name = "Bandage",
+ Description = "Stops all bleeding.",
+ Stackable = true,
+ Type = ITEM_SUPPLY,
+ Weight = 0.35,
+ Price = 5,
+ Rarity = 0.50,
+ Model = "models/radbox/bandage.mdl",
+ Functions = { FUNC_BANDAGE },
+ CamPos = Vector(18,10,5),
+ CamOrigin = Vector(0,0,0)
+} )
+
diff --git a/gamemode/items/weapons_common.lua b/gamemode/items/weapons_common.lua
new file mode 100644
index 0000000..a32f498
--- /dev/null
+++ b/gamemode/items/weapons_common.lua
@@ -0,0 +1,532 @@
+
+// This is the ID given to any weapon item for all teams
+ITEM_WPN_COMMON = 11
+
+function FUNC_DROPWEAPON( ply, id, client, icon )
+
+ if icon then return "icon16/arrow_down.png" end
+ if client then return "Drop" end
+
+ local tbl = item.GetByID( id )
+
+ local prop = ents.Create( "sent_droppedgun" )
+ prop:SetPos( ply:GetItemDropPos() )
+
+ if tbl.DropModel then
+
+ prop:SetModel( tbl.DropModel )
+
+ else
+
+ prop:SetModel( tbl.Model )
+
+ end
+
+ prop:Spawn()
+
+ ply:EmitSound( Sound( "items/ammopickup.wav" ) )
+ ply:RemoveFromInventory( id )
+
+ if not ply:HasItem( id ) then
+
+ ply:StripWeapon( tbl.Weapon )
+
+ end
+
+end
+
+function FUNC_REMOVEWEAPON( ply, id )
+
+ local tbl = item.GetByID( id )
+
+ if not ply:HasItem( id ) then
+
+ ply:StripWeapon( tbl.Weapon )
+
+ end
+
+end
+
+function FUNC_GRABWEAPON( ply, id )
+
+ local tbl = item.GetByID( id )
+
+ ply:Give( tbl.Weapon )
+
+ return true
+
+end
+
+item.Register( {
+ Name = "Hammer",
+ Description = "Builds barricades and bashes skulls.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 3,
+ Price = 35,
+ Rarity = 0.40,
+ Model = "models/weapons/w_hammer.mdl",
+ Weapon = "rad_hammer",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,-28,0),
+ CamOrigin = Vector(0,0,5)
+} )
+
+item.Register( {
+ Name = "Axe",
+ Description = "The messiest melee weapon.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 5,
+ Price = 50,
+ Rarity = 0.60,
+ Model = "models/weapons/w_axe.mdl",
+ Weapon = "rad_axe",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,-42,0),
+ CamOrigin = Vector(0,0,8)
+} )
+
+item.Register( {
+ Name = "Crowbar",
+ Description = "Gordon's weapon of choice.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ SaleOverride = true,
+ Weight = 5,
+ Price = 50,
+ Rarity = 0.20,
+ Model = "models/weapons/w_crowbar.mdl",
+ Weapon = "rad_crowbar",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,0,-44),
+ CamOrigin = Vector(0,0,8)
+} )
+
+item.Register( {
+ Name = "FN Five-Seven",
+ Description = "A standard issue sidearm.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ SaleOverride = true,
+ Weight = 3,
+ Price = 8,
+ Rarity = 0.90,
+ Model = "models/weapons/w_pist_fiveseven.mdl",
+ Weapon = "rad_fiveseven",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,17,5),
+ CamOrigin = Vector(2,0,3)
+} )
+
+item.Register( {
+ Name = "USP Compact",
+ Description = "A standard issue sidearm.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ SaleOverride = true,
+ Weight = 3,
+ Price = 8,
+ Rarity = 0.90,
+ Model = "models/weapons/w_pistol.mdl",
+ Weapon = "rad_usp",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,-17,0),
+ CamOrigin = Vector(-1,0,-2)
+} )
+
+item.Register( {
+ Name = "P228 Compact",
+ Description = "A standard issue sidearm.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ SaleOverride = true,
+ Weight = 3,
+ Price = 8,
+ Rarity = 0.90,
+ Model = "models/weapons/w_pist_p228.mdl",
+ Weapon = "rad_p228",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,17,5),
+ CamOrigin = Vector(2,0,3)
+} )
+
+item.Register( {
+ Name = "Glock 19",
+ Description = "A standard issue sidearm.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ SaleOverride = true,
+ Weight = 3,
+ Price = 8,
+ Rarity = 0.90,
+ Model = "models/weapons/w_pist_glock18.mdl",
+ Weapon = "rad_glock",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,17,5),
+ CamOrigin = Vector(2,0,3)
+} )
+
+item.Register( {
+ Name = "Dual Berettas",
+ Description = "A gun for each hand.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 3,
+ Price = 35,
+ Rarity = 0.20,
+ Model = "models/weapons/w_pist_elite_single.mdl",
+ DropModel = "models/weapons/w_pist_elite_dropped.mdl",
+ Weapon = "rad_berettas",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,15,-5),
+ CamOrigin = Vector(2,0,3)
+} )
+
+item.Register( {
+ Name = "Colt Python",
+ Description = "A six shooter that packs a punch.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 4,
+ Price = 40,
+ Rarity = 0.20,
+ Model = "models/weapons/w_357.mdl",
+ Weapon = "rad_revolver",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,18,0),
+ CamOrigin = Vector(6,0,0)
+} )
+
+item.Register( {
+ Name = "Desert Eagle",
+ Description = "What are you compensating for?",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 4,
+ Price = 45,
+ Rarity = 0.20,
+ Model = "models/weapons/w_pist_deagle.mdl",
+ Weapon = "rad_deagle",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,15,2),
+ CamOrigin = Vector(3,0,4)
+} )
+
+item.Register( {
+ Name = "MAC-10",
+ Description = "A compact SMG with moderate recoil.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 4,
+ Price = 50,
+ Rarity = 0.20,
+ Model = "models/weapons/w_smg_mac10.mdl",
+ Weapon = "rad_mac10",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,20,5),
+ CamOrigin = Vector(2,0,3)
+} )
+
+item.Register( {
+ Name = "UMP45",
+ Description = "A powerful SMG with a smaller magazine.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 6,
+ Price = 55,
+ Rarity = 0.30,
+ Model = "models/weapons/w_smg_ump45.mdl",
+ Weapon = "rad_ump45",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,30,5),
+ CamOrigin = Vector(-2,0,4)
+} )
+
+item.Register( {
+ Name = "CMP250",
+ Description = "A prototype burst-fire SMG.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 4,
+ Price = 60,
+ Rarity = 0.30,
+ Model = "models/weapons/w_smg1.mdl",
+ Weapon = "rad_cmp",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,27,0),
+ CamOrigin = Vector(-1,0,-1)
+} )
+
+item.Register( {
+ Name = "Winchester 1887",
+ Description = "Zombies are in season.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 6,
+ Price = 65,
+ Rarity = 0.30,
+ Model = "models/weapons/w_annabelle.mdl",
+ Weapon = "rad_shotgun",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,-50,5),
+ CamOrigin = Vector(3,0,1)
+} )
+
+item.Register( {
+ Name = "TMP",
+ Description = "A silent but deadly SMG.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 4,
+ Price = 70,
+ Rarity = 0.40,
+ Model = "models/weapons/w_smg_tmp.mdl",
+ Weapon = "rad_tmp",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,31,5),
+ CamOrigin = Vector(5,0,3)
+} )
+
+item.Register( {
+ Name = "MP5",
+ Description = "A well-rounded, reliable SMG.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 6,
+ Price = 75,
+ Rarity = 0.40,
+ Model = "models/weapons/w_smg_mp5.mdl",
+ Weapon = "rad_mp5",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,38,5),
+ CamOrigin = Vector(2,0,5)
+} )
+
+item.Register( {
+ Name = "FAMAS",
+ Description = "The least expensive assault rifle.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 9,
+ Price = 80,
+ Rarity = 0.50,
+ Model = "models/weapons/w_rif_famas.mdl",
+ Weapon = "rad_famas",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(-7,39,5),
+ CamOrigin = Vector(-6,0,5)
+} )
+
+item.Register( {
+ Name = "FN P90",
+ Description = "A powerful SMG with a large magazine.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 4,
+ Price = 85,
+ Rarity = 0.50,
+ Model = "models/weapons/w_smg_p90.mdl",
+ Weapon = "rad_p90",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,35,5),
+ CamOrigin = Vector(1,0,5)
+} )
+
+item.Register( {
+ Name = "Steyr Scout",
+ Description = "A bolt-action sniper rifle.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 9,
+ Price = 90,
+ Rarity = 0.60,
+ Model = "models/weapons/w_snip_scout.mdl",
+ Weapon = "rad_scout",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,44,5),
+ CamOrigin = Vector(0,0,4)
+} )
+
+item.Register( {
+ Name = "IMI Galil",
+ Description = "Lower accuracy, larger magazine.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 8,
+ Price = 100,
+ Rarity = 0.60,
+ Model = "models/weapons/w_rif_galil.mdl",
+ Weapon = "rad_galil",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,42,5),
+ CamOrigin = Vector(-1,0,3)
+} )
+
+item.Register( {
+ Name = "SPAS-12",
+ Description = "Useful for crowd control.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 7,
+ Price = 110,
+ Rarity = 0.70,
+ Model = "models/weapons/w_shotgun.mdl",
+ Weapon = "rad_spas12",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,-34,0),
+ CamOrigin = Vector(0,0,0)
+} )
+
+item.Register( {
+ Name = "AK-47",
+ Description = "A well-rounded assault rifle.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 7,
+ Price = 130,
+ Rarity = 0.80,
+ Model = "models/weapons/w_rif_ak47.mdl",
+ Weapon = "rad_ak47",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,43,5),
+ CamOrigin = Vector(0,0,3)
+} )
+
+item.Register( {
+ Name = "SG 552",
+ Description = "Comes with a free scope.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 8,
+ Price = 150,
+ Rarity = 0.90,
+ Model = "models/weapons/w_rif_sg552.mdl",
+ Weapon = "rad_sg552",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,37,5),
+ CamOrigin = Vector(-4,0,5)
+} )
+
+item.Register( {
+ Name = "G3 SG1",
+ Description = "An automatic sniper rifle.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 9,
+ Price = 170,
+ Rarity = 0.90,
+ Model = "models/weapons/w_snip_g3sg1.mdl",
+ Weapon = "rad_g3",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,42,5),
+ CamOrigin = Vector(-3,0,5)
+} )
+
+item.Register( {
+ Name = "HEAT Cannon",
+ Description = "An experimental long range zombie cooker.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 9,
+ Price = 190,
+ Rarity = 0.70,
+ Model = "models/weapons/w_physics.mdl",
+ Weapon = "rad_firegun",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,35,0),
+ CamOrigin = Vector(10,0,-1)
+} )
+
+item.Register( {
+ Name = "PPW-952",
+ Description = "An experimental particle projectile weapon.",
+ Stackable = false,
+ Type = ITEM_WPN_COMMON,
+ TypeOverride = "sent_droppedgun",
+ Weight = 9,
+ Price = 200,
+ Rarity = 0.70,
+ Model = "models/weapons/w_irifle.mdl",
+ Weapon = "rad_experimental",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,-40,0),
+ CamOrigin = Vector(5,0,0)
+} )
diff --git a/gamemode/items/weapons_special.lua b/gamemode/items/weapons_special.lua
new file mode 100644
index 0000000..3d9a6c3
--- /dev/null
+++ b/gamemode/items/weapons_special.lua
@@ -0,0 +1,128 @@
+
+// This is the ID given to any weapon item for SPECIAL
+ITEM_WPN_SPECIAL = 10
+
+--[[function FUNC_PLANTBOMB( ply, id, client )
+
+ if client then return "Arm" end
+
+ ply:RemoveFromInventory( id )
+ ply:EmitSound( "weapons/c4/c4_plant.wav" )
+
+ local trace = {}
+ trace.start = ply:GetShootPos()
+ trace.endpos = ply:GetShootPos() + ply:GetAimVector() * 50
+ trace.filter = ply
+ local tr = util.TraceLine( trace )
+
+ local bomb = ents.Create( "sent_c4" )
+ bomb:SetPos( tr.HitPos )
+ bomb:SetOwner( ply )
+ bomb:Spawn()
+
+end]]
+
+item.Register( {
+ Name = "M1014",
+ Description = "Turn everything into ground beef.",
+ Stackable = false,
+ Type = ITEM_WPN_SPECIAL,
+ TypeOverride = "sent_droppedgun",
+ Weight = 7,
+ Price = 160,
+ Rarity = 0.90,
+ Model = "models/weapons/w_shot_xm1014.mdl",
+ Weapon = "rad_m1014",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,38,5),
+ CamOrigin = Vector(1,0,4)
+} )
+
+item.Register( {
+ Name = "M249",
+ Description = "A belt-fed support machine gun.",
+ Stackable = false,
+ Type = ITEM_WPN_SPECIAL,
+ TypeOverride = "sent_droppedgun",
+ Weight = 10,
+ Price = 180,
+ Rarity = 0.90,
+ Model = "models/weapons/w_mach_m249para.mdl",
+ Weapon = "rad_m249",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,38,5),
+ CamOrigin = Vector(2,0,6)
+} )
+
+item.Register( {
+ Name = "AWP",
+ Description = "The very definition of overkill.",
+ Stackable = false,
+ Type = ITEM_WPN_SPECIAL,
+ TypeOverride = "sent_droppedgun",
+ Weight = 9,
+ Price = 200,
+ Rarity = 0.70,
+ Model = "models/weapons/w_snip_awp.mdl",
+ Weapon = "rad_awp",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(0,51,5),
+ CamOrigin = Vector(1,0,4)
+} )
+
+item.Register( {
+ Name = "HE Grenade",
+ Description = "The fuse lasts 3 seconds.",
+ Stackable = true,
+ Type = ITEM_WPN_SPECIAL,
+ TypeOverride = "sent_droppedgun",
+ Weight = 1,
+ Price = 5,
+ Rarity = 0.20,
+ Model = "models/weapons/w_eq_fraggrenade_thrown.mdl",
+ Weapon = "rad_grenade",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(1,12,4),
+ CamOrigin = Vector(0,0,1)
+} )
+
+item.Register( {
+ Name = "Incendiary Grenade",
+ Description = "Comes with free marshmallows.",
+ Stackable = true,
+ Type = ITEM_WPN_SPECIAL,
+ TypeOverride = "sent_droppedgun",
+ Weight = 1,
+ Price = 8,
+ Rarity = 0.40,
+ Model = "models/weapons/w_eq_flashbang.mdl",
+ Weapon = "rad_incendiarygrenade",
+ Functions = { FUNC_DROPWEAPON },
+ PickupFunction = FUNC_GRABWEAPON,
+ DropFunction = FUNC_REMOVEWEAPON,
+ CamPos = Vector(3,16,3),
+ CamOrigin = Vector(0,0,5)
+} )
+
+--[[item.Register( {
+ Name = "Timed Explosives",
+ Description = "This is a homemade timed explosive.",
+ Stackable = true,
+ Type = ITEM_WPN_SPECIAL,
+ TypeOverride = "sent_droppedgun",
+ Weight = 3,
+ Price = 10,
+ Rarity = 0.80,
+ Model = "models/weapons/w_c4.mdl",
+ Functions = { FUNC_PLANTBOMB },
+ CamPos = Vector(-12,-2,0),
+ CamOrigin = Vector(0,5,0)
+} )]] \ No newline at end of file