summaryrefslogtreecommitdiff
path: root/gamemode/items/misc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/items/misc.lua')
-rw-r--r--gamemode/items/misc.lua326
1 files changed, 163 insertions, 163 deletions
diff --git a/gamemode/items/misc.lua b/gamemode/items/misc.lua
index b15db67..dda95c4 100644
--- a/gamemode/items/misc.lua
+++ b/gamemode/items/misc.lua
@@ -23,7 +23,7 @@ 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 )
@@ -37,7 +37,7 @@ 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 )
@@ -45,7 +45,7 @@ function FUNC_BOOZE( ply, id, client, icon )
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()
@@ -56,13 +56,13 @@ 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()
@@ -73,13 +73,13 @@ 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()
@@ -90,11 +90,11 @@ 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()
@@ -105,109 +105,109 @@ 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
@@ -216,7 +216,7 @@ 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 ) )
@@ -227,20 +227,20 @@ function FUNC_WRENCH( ply, id, client, icon )
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
@@ -249,112 +249,112 @@ 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 ) )
-
+ 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 ) )
-
+ 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",
+item.Register( {
+ Name = "Cardboard Box",
CollisionOverride = true,
Type = ITEM_LOOT,
Rarity = 0.95,
- Model = "models/props_junk/cardboard_box001a.mdl",
+ Model = "models/props_junk/cardboard_box001a.mdl",
PickupFunction = FUNC_OPENBOX,
Functions = {}
} )
-item.Register( {
- Name = "Cardboard Box",
+item.Register( {
+ Name = "Cardboard Box",
CollisionOverride = true,
Type = ITEM_LOOT,
Rarity = 0.95,
- Model = "models/props_junk/cardboard_box001b.mdl",
+ Model = "models/props_junk/cardboard_box001b.mdl",
PickupFunction = FUNC_OPENBOX,
Functions = {}
} )
-item.Register( {
- Name = "Cardboard Box",
+item.Register( {
+ Name = "Cardboard Box",
CollisionOverride = true,
Type = ITEM_LOOT,
Rarity = 0.95,
- Model = "models/props_junk/cardboard_box002a.mdl",
+ Model = "models/props_junk/cardboard_box002a.mdl",
PickupFunction = FUNC_OPENBOX,
Functions = {}
} )
-item.Register( {
- Name = "Cardboard Box",
+item.Register( {
+ Name = "Cardboard Box",
CollisionOverride = true,
Type = ITEM_LOOT,
Rarity = 0.95,
- Model = "models/props_junk/cardboard_box002b.mdl",
+ Model = "models/props_junk/cardboard_box002b.mdl",
PickupFunction = FUNC_OPENBOX,
Functions = {}
} )
-item.Register( {
- Name = "Cardboard Box",
+item.Register( {
+ Name = "Cardboard Box",
CollisionOverride = true,
Type = ITEM_LOOT,
Rarity = 0.95,
- Model = "models/props_junk/cardboard_box003a.mdl",
+ Model = "models/props_junk/cardboard_box003a.mdl",
PickupFunction = FUNC_OPENBOX,
Functions = {}
} )
-item.Register( {
- Name = "Cardboard Box",
+item.Register( {
+ Name = "Cardboard Box",
CollisionOverride = true,
Type = ITEM_LOOT,
Rarity = 0.95,
- Model = "models/props_junk/cardboard_box003b.mdl",
+ Model = "models/props_junk/cardboard_box003b.mdl",
PickupFunction = FUNC_OPENBOX,
Functions = {}
} )
-item.Register( {
- Name = "Suitcase",
+item.Register( {
+ Name = "Suitcase",
CollisionOverride = true,
Type = ITEM_LOOT,
Rarity = 0.50,
- Model = "models/props_c17/suitcase_passenger_physics.mdl",
+ Model = "models/props_c17/suitcase_passenger_physics.mdl",
PickupFunction = FUNC_OPENSUITCASE,
Functions = {}
} )
-item.Register( {
- Name = "Briefcase",
+item.Register( {
+ Name = "Briefcase",
CollisionOverride = true,
Type = ITEM_LOOT,
Rarity = 0.50,
- Model = "models/props_c17/briefcase001a.mdl",
+ Model = "models/props_c17/briefcase001a.mdl",
PickupFunction = FUNC_OPENSUITCASE,
Functions = {}
} )
-item.Register( {
- Name = "Wood",
+item.Register( {
+ Name = "Wood",
Description = "Used in building barricades.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_MISC,
- Weight = 1.50,
+ Weight = 1.50,
Price = 15,
Rarity = 0.15,
Model = "models/props_debris/wood_chunk04a.mdl",
@@ -363,96 +363,96 @@ item.Register( {
CamOrigin = Vector(0,0,-1)
} )
-item.Register( {
- Name = "Water",
+item.Register( {
+ Name = "Water",
Description = "Restores 25 stamina and 10 health.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_MISC,
- Weight = 0.15,
+ 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)
+ CamOrigin = Vector(0,0,0)
} )
-item.Register( {
- Name = "Canned Food",
+item.Register( {
+ Name = "Canned Food",
Description = "Restores 25 health and 10 stamina.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_MISC,
- Weight = 0.15,
+ 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)
+ CamOrigin = Vector(0,0,0)
} )
-item.Register( {
- Name = "Wrench",
+item.Register( {
+ Name = "Wrench",
Description = "Why would you eat this?",
- Stackable = true,
+ Stackable = true,
Type = ITEM_LOOT,
- Weight = 0.15,
+ 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)
+ CamOrigin = Vector(0,1,4)
} )
-item.Register( {
- Name = "Unstable Mutagen",
+item.Register( {
+ Name = "Unstable Mutagen",
Description = "Prototype drug which may cure the infection.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_LOOT,
- Weight = 0.30,
+ 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)
+ CamOrigin = Vector(0,0,5)
} )
-item.Register( {
- Name = "Beer",
+item.Register( {
+ Name = "Beer",
Description = "Restores 15 stamina.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_LOOT,
- Weight = 0.30,
+ 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)
+ CamOrigin = Vector(0,0,0)
} )
-item.Register( {
- Name = "Tequila",
+item.Register( {
+ Name = "Tequila",
Description = "Don't drink this shit.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_LOOT,
- Weight = 0.30,
+ 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)
+ CamOrigin = Vector(0,0,5)
} )
-item.Register( {
- Name = "Vodka",
+item.Register( {
+ Name = "Vodka",
Description = "Releives radiation poisoning.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_MISC,
- Weight = 0.30,
+ Weight = 0.30,
Price = 10,
Rarity = 0.10,
Model = "models/props_junk/garbage_glassbottle002a.mdl",
@@ -461,86 +461,86 @@ item.Register( {
CamOrigin = Vector(0,0,0)
} )
-item.Register( {
- Name = "Moonshine Vodka",
+item.Register( {
+ Name = "Moonshine Vodka",
Description = "Weaker homebrewed vodka.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_BUYABLE,
- Weight = 0.30,
+ 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)
+ CamOrigin = Vector(0,0,-1)
} )
---[[item.Register( {
- Name = "Human Skull",
+--[[item.Register( {
+ Name = "Human Skull",
Description = "This human skull looks pretty old. You decided to name it Murray.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_QUEST_ZOMBIE,
- Weight = 2.50,
+ Weight = 2.50,
Price = 1,
Rarity = 0.75,
Model = "models/gibs/hgibs.mdl",
Functions = { },
CamPos = Vector(15,10,0),
- CamOrigin = Vector(0,0,2)
+ CamOrigin = Vector(0,0,2)
} )
-item.Register( {
- Name = "Zombie Claw",
+item.Register( {
+ Name = "Zombie Claw",
Description = "This is the claw of a zombie.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_QUEST_ZOMBIE,
- Weight = 2.50,
+ 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)
+ CamOrigin = Vector(0,0,1)
} )
-item.Register( {
- Name = "Zombie Spine",
+item.Register( {
+ Name = "Zombie Spine",
Description = "This is the spine of a zombie.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_QUEST_ZOMBIE,
- Weight = 2.50,
+ 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)
+ CamOrigin = Vector(0,0,2)
} )
-item.Register( {
- Name = "Zombie Rib",
+item.Register( {
+ Name = "Zombie Rib",
Description = "This is the rib of a zombie.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_QUEST_ZOMBIE,
- Weight = 2.50,
+ 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)
+ CamOrigin = Vector(0,0,0)
} )
-item.Register( {
- Name = "Zombie Flesh",
+item.Register( {
+ Name = "Zombie Flesh",
Description = "This is a chunk of zombie flesh.",
- Stackable = true,
+ Stackable = true,
Type = ITEM_QUEST_ZOMBIE,
- Weight = 2.50,
+ 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)
+ CamOrigin = Vector(0,0,2.5)
} )]]