This commit is contained in:
lifestorm
2024-08-04 22:55:00 +03:00
parent 0e770b2b49
commit 94063e4369
7342 changed files with 1718932 additions and 14 deletions

View File

@@ -0,0 +1,58 @@
--[[
| 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/
--]]
AddCSLuaFile()
-- the main object
ArcCW = {}
ArcCWInstalled = true
ArcCW.GenerateAttEntities = true
for _, v in pairs(file.Find("arccw/shared/*", "LUA")) do
include("arccw/shared/" .. v)
AddCSLuaFile("arccw/shared/" .. v)
end
for _, v in pairs(file.Find("arccw/client/*", "LUA")) do
AddCSLuaFile("arccw/client/" .. v)
if CLIENT then
include("arccw/client/" .. v)
end
end
-- TODO: Remove SP check after upcoming June 2023 update
if SERVER or game.SinglePlayer() then
for _, v in pairs(file.Find("arccw/server/*", "LUA")) do
include("arccw/server/" .. v)
end
end
-- if you want to override arccw functions, put your override files in the arccw/mods directory so it will be guaranteed to override the base
for _, v in pairs(file.Find("arccw/mods/shared/*", "LUA")) do
include("arccw/mods/shared/" .. v)
AddCSLuaFile("arccw/mods/shared/" .. v)
end
for _, v in pairs(file.Find("arccw/mods/client/*", "LUA")) do
AddCSLuaFile("arccw/mods/client/" .. v)
if CLIENT then
include("arccw/mods/client/" .. v)
end
end
-- TODO: Remove SP check after upcoming June 2023 update
if SERVER or game.SinglePlayer() then
for _, v in pairs(file.Find("arccw/mods/server/*", "LUA")) do
include("arccw/mods/server/" .. v)
end
end

View File

@@ -0,0 +1,79 @@
--[[
| 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/
--]]
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.Foley1",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/m249_armmovement_01.wav"
})
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.Open",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/wpn_g2a4_reload_empty_charge_fr49_2ch_v1_01.wav"
})
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.Out",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/magout.wav"
})
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.Foley2",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/m249_shoulder.wav"
})
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.In",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/magin.wav"
})
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.Chain",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/charge.wav"
})
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.Close",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/wpn_r101_emptyreload_boltback_fr51_2ch_v1_01.wav"
})
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.Hit",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/wpn_r101_emptyreload_boltforward_fr55_2ch_v1_01.wav"
})
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.Bolt1",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/bolt_back.wav"
})
sound.Add({
name = "ARCCW_FML_VOLKED_PKP.Bolt2",
channel = CHAN_ITEM,
volume = 1.0,
sound = "weapons/fml_pkp_volk/bolt_forward.wav"
})

125
lua/autorun/aw2_hooks.lua Normal file
View File

@@ -0,0 +1,125 @@
--[[
| 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/
--]]
AW2_HEALTHY = 0
AW2_CRASHING = 1
AW2_DEAD = 2
hook.Add("Initialize", "aw2_setup", function()
CreateConVar("aw2_chopper_health", 2500, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines the amount of HP the hunter chopper has when spawned, only applies to newly spawned instances")
CreateConVar("aw2_chopper_speedmult", 1000, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines how fast the hunter chopper moves, only applies to newly spawned instances")
CreateConVar("aw2_chopper_rocketonly", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Whether or not the chopper only takes damage from explosives")
CreateConVar("aw2_gunship_health", 2500, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines the amount of HP the gunship has when spawned, only applies to newly spawned instances")
CreateConVar("aw2_gunship_speedmult", 1000, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines how fast the hunter chopper moves, only applies to newly spawned instances")
CreateConVar("aw2_gunship_rocketonly", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Whether or not the gunship only takes damage from explosives")
CreateConVar("aw2_hk_health", 2500, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines the amount of HP the gunship has when spawned, only applies to newly spawned instances")
CreateConVar("aw2_hk_speedmult", 1000, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines how fast the hunter chopper moves, only applies to newly spawned instances")
CreateConVar("aw2_hk_rocketonly", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Whether or not the HK-Aerial only takes damage from explosives")
CreateConVar("aw2_dropship_speedmult", 1000, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines how fast the hunter chopper moves, only applies to newly spawned instances")
CreateConVar("aw2_manhack_health", 100, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines the amount of HP the manhack has when spawned, only applies to newly spawned instances")
CreateConVar("aw2_manhack_speedmult", 300, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines how fast the hunter chopper moves, only applies to newly spawned instances")
CreateConVar("aw2_alwayson", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Whether or not entities remain 'on' when empty")
end)
if SERVER then
hook.Add("PlayerLeaveVehicle", "aw2_eject", function(ply, vehicle)
if vehicle.aw2Ent and vehicle.aw2Ent:IsValid() then
vehicle.aw2Ent:ejectPlayer(ply, vehicle)
end
end)
hook.Add("KeyPress", "aw2_keypress", function(ply, key)
local ent = ply.aw2Ent
if ent and ent:IsValid() then
ent:keyPress(ply, key)
end
end)
end
if CLIENT then
hook.Add("CalcView", "aw2_calcview", function(ply, pos, ang, fov)
local ent = ply.aw2Ent
local vehicle = ply:GetVehicle()
if not vehicle or not vehicle:IsValid() then
return
end
if ply:GetViewEntity() ~= ply then
return
end
if ent and ent:IsValid() then
local view = {}
view.origin, view.angles = ent:getViewData(ply)
return view
end
end)
hook.Add("HUDPaint", "aw2_crosshair", function()
local ply = LocalPlayer()
local ent = ply.aw2Ent
if not IsValid(ent) or not ent.GetGunOperator then
return
end
local gunner = ent:GetGunOperator()
if ply == gunner then
local x = ScrW() / 2
local y = ScrH() / 2
local gap = 5
local len = gap + 5
local col = Color(255, 0, 0)
if ent:hasLOS() then
col = Color(0, 255, 0)
end
surface.SetDrawColor(col)
surface.DrawLine(x - len, y, x - gap, y)
surface.DrawLine(x + len, y, x + gap, y)
surface.DrawLine(x, y - len, x, y - gap)
surface.DrawLine(x, y + len, x, y + gap)
if ent.GetWeaponMode then
local mode = ent:GetWeaponMode()
local fancyMode = ""
if mode == WEAPON_BOMBSINGLE then
fancyMode = "1"
elseif mode == WEAPON_BOMBCARPET then
fancyMode = "3"
elseif mode == WEAPON_ROCKET then
fancyMode = "R"
end
surface.SetFont("Default")
surface.SetTextColor(col)
surface.SetTextPos(x + 5, y + 2)
surface.DrawText(fancyMode)
end
end
end)
end

28
lua/autorun/aw2_net.lua Normal file
View File

@@ -0,0 +1,28 @@
--[[
| 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/
--]]
if SERVER then
util.AddNetworkString("aw2Enter")
util.AddNetworkString("aw2Eject")
end
if CLIENT then
net.Receive("aw2Enter", function(len)
local ent = net.ReadEntity()
local ang = Angle(0, ent:GetAngles().y, 0)
LocalPlayer().aw2Ent = ent
LocalPlayer():SetEyeAngles(ang)
end)
net.Receive("aw2Eject", function(len)
LocalPlayer().aw2Ent = nil
end)
end

515
lua/autorun/base_npcs.lua Normal file
View File

@@ -0,0 +1,515 @@
--[[
| 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/
--]]
-- Don't try to edit this file if you're trying to add new NPCs.
-- Just make a new file and copy the format below.
local function AddNPC( t, class )
if ( !t.Name ) then t.Name = "#" .. ( class or t.Class ) end
list.Set( "NPC", class or t.Class, t )
end
local Category = "Humans + Resistance"
AddNPC( {
Class = "npc_alyx",
Category = Category,
Weapons = { "weapon_alyxgun", "weapon_smg1", "weapon_shotgun" },
KeyValues = { SquadName = "resistance" }
} )
AddNPC( {
Class = "npc_barney",
Category = Category,
Weapons = { "weapon_smg1", "weapon_shotgun", "weapon_ar2" },
KeyValues = { SquadName = "resistance" }
} )
AddNPC( {
Class = "npc_breen",
Category = Category
} )
AddNPC( {
Class = "npc_dog",
Category = Category
} )
AddNPC( {
Class = "npc_eli",
Category = Category
} )
AddNPC( {
Class = "npc_gman",
Category = Category
} )
-- Did you know that this MAN can shoot annabelle like he's been doing it his whole life?
AddNPC( {
Class = "npc_kleiner",
Category = Category
} )
AddNPC( {
Class = "npc_mossman",
Category = Category
} )
-- I don't trust these Vorts, but I'll let em stay in this category until they mess up
AddNPC( {
Class = "npc_vortigaunt",
Category = Category,
KeyValues = { SquadName = "resistance" }
} )
AddNPC( {
Name = "Vortigaunt Slave",
Class = "npc_vortigaunt",
Category = Category,
Model = "models/vortigaunt_slave.mdl"
}, "VortigauntSlave" )
AddNPC( {
Class = "npc_citizen",
Category = Category,
KeyValues = { citizentype = CT_DOWNTRODDEN, SquadName = "resistance" },
Weapons = { "" } -- Tells the spawnmenu that this NPC can use weapons
} )
AddNPC( {
Name = "Rebel",
Class = "npc_citizen",
Category = Category,
SpawnFlags = SF_CITIZEN_RANDOM_HEAD,
KeyValues = { citizentype = CT_REBEL, SquadName = "resistance" },
Weapons = { "weapon_pistol", "weapon_ar2", "weapon_smg1", "weapon_ar2", "weapon_shotgun" }
}, "Rebel" )
AddNPC( {
Name = "Odessa Cubbage",
Class = "npc_citizen",
Category = Category,
Model = "models/odessa.mdl",
KeyValues = { citizentype = CT_UNIQUE, SquadName = "resistance" },
Weapons = { "" }
}, "npc_odessa" )
AddNPC( {
Name = "Rebel Medic",
Class = "npc_citizen",
Category = Category,
SpawnFlags = SERVER and bit.bor( SF_NPC_DROP_HEALTHKIT, SF_CITIZEN_MEDIC ) or nil,
KeyValues = { citizentype = CT_REBEL, SquadName = "resistance" },
Weapons = { "weapon_pistol", "weapon_smg1", "weapon_ar2", "weapon_shotgun" }
}, "Medic" )
AddNPC( {
Name = "Refugee",
Class = "npc_citizen",
Category = Category,
KeyValues = { citizentype = CT_REFUGEE, SquadName = "resistance" },
Weapons = { "weapon_pistol", "weapon_smg1" }
}, "Refugee" )
if ( IsMounted( "ep2" ) ) then
AddNPC( {
Name = "Uriah",
Class = "npc_vortigaunt",
Category = Category,
Model = "models/vortigaunt_doctor.mdl",
KeyValues = { SquadName = "resistance" }
}, "VortigauntUriah" )
AddNPC( {
Class = "npc_magnusson",
Category = Category
} )
end
if ( IsMounted( "lostcoast" ) ) then
AddNPC( {
Class = "npc_fisherman",
Category = Category,
Weapons = { "weapon_oldmanharpoon" }
} ) -- Has no death sequence
end
Category = "Zombies + Enemy Aliens"
AddNPC( {
Class = "npc_zombie",
Category = Category,
KeyValues = { SquadName = "zombies" }
} )
AddNPC( {
Class = "npc_zombie_torso",
Category = Category,
KeyValues = { SquadName = "zombies" }
} )
AddNPC( {
Class = "npc_poisonzombie",
Category = Category,
KeyValues = { SquadName = "poison" }
} )
AddNPC( {
Class = "npc_antlion",
Category = Category,
KeyValues = { SquadName = "antlions" }
} )
AddNPC( {
Class = "npc_antlionguard",
Category = Category,
KeyValues = { SquadName = "antlions" }
} )
AddNPC( {
Class = "npc_barnacle",
Category = Category,
OnCeiling = true,
Offset = 2
} )
AddNPC( {
Class = "npc_fastzombie",
Category = Category,
KeyValues = { SquadName = "zombies" }
} )
AddNPC( {
Class = "npc_headcrab",
Category = Category,
KeyValues = { SquadName = "zombies" }
} )
AddNPC( {
Class = "npc_headcrab_black",
Category = Category,
KeyValues = { SquadName = "poison" }
} )
AddNPC( {
Class = "npc_headcrab_fast",
Category = Category,
KeyValues = { SquadName = "zombies" }
} )
AddNPC( {
Class = "npc_fastzombie_torso",
Category = Category,
KeyValues = { SquadName = "zombies" }
} )
if ( IsMounted( "episodic" ) or IsMounted( "ep2" ) ) then
AddNPC( {
Class = "npc_zombine",
Category = Category,
KeyValues = { SquadName = "zombies" }
} )
end
if ( IsMounted( "ep2" ) ) then
game.AddParticles( "particles/grub_blood.pcf" )
game.AddParticles( "particles/antlion_gib_02.pcf" )
game.AddParticles( "particles/antlion_worker.pcf" )
AddNPC( {
Name = "Antlion Guardian",
Class = "npc_antlionguard",
Category = Category,
KeyValues = { cavernbreed = 1, incavern = 1, SquadName = "antlions" },
Material = "Models/antlion_guard/antlionGuard2"
}, "npc_antlionguardian" )
AddNPC( {
Class = "npc_antlion_grub",
Category = Category,
NoDrop = true,
Offset = 1
} )
AddNPC( {
Class = "npc_antlion_worker",
Category = Category,
KeyValues = { SquadName = "antlions" }
} )
end
Category = "Animals"
AddNPC( {
Class = "npc_monk",
Category = Category,
Weapons = { "weapon_annabelle" }
} )
AddNPC( {
Class = "npc_crow",
Category = Category,
NoDrop = true
} )
AddNPC( {
Class = "npc_pigeon",
Category = Category,
NoDrop = true
} )
AddNPC( {
Class = "npc_seagull",
Category = Category,
NoDrop = true
} )
Category = "Combine"
AddNPC( {
Class = "npc_metropolice",
Category = Category,
Weapons = { "weapon_stunstick", "weapon_pistol", "weapon_smg1" },
SpawnFlags = SF_NPC_DROP_HEALTHKIT,
KeyValues = { SquadName = "overwatch" }
} )
AddNPC( {
Class = "npc_rollermine",
Category = Category,
Offset = 20,
KeyValues = { SquadName = "overwatch" },
NoDrop = true
} )
AddNPC( {
Class = "npc_turret_floor",
Category = Category,
OnFloor = true,
TotalSpawnFlags = 0,
Rotate = Angle( 0, 180, 0 ),
Offset = 2,
KeyValues = { SquadName = "overwatch" }
} )
AddNPC( {
Class = "npc_combine_s",
Category = Category,
Model = "models/combine_soldier.mdl",
Skin = 0,
Weapons = { "weapon_smg1", "weapon_ar2" },
KeyValues = { SquadName = "overwatch", Numgrenades = 5 }
} )
AddNPC( {
Name = "Shotgun Soldier",
Class = "npc_combine_s",
Category = Category,
Model = "models/combine_soldier.mdl",
Skin = 1,
Weapons = { "weapon_shotgun" },
KeyValues = { SquadName = "overwatch", Numgrenades = 5 }
}, "ShotgunSoldier" )
AddNPC( {
Name = "Prison Guard",
Class = "npc_combine_s",
Category = Category,
Model = "models/combine_soldier_prisonguard.mdl",
Skin = 0,
Weapons = { "weapon_smg1", "weapon_ar2" },
KeyValues = { SquadName = "novaprospekt", Numgrenades = 5 }
}, "CombinePrison" )
AddNPC( {
Name = "Prison Shotgun Guard",
Class = "npc_combine_s",
Category = Category,
Model = "models/combine_soldier_prisonguard.mdl",
Skin = 1,
Weapons = { "weapon_shotgun" },
KeyValues = { SquadName = "novaprospekt", Numgrenades = 5 }
}, "PrisonShotgunner" )
AddNPC( {
Name = "Combine Elite",
Class = "npc_combine_s",
Category = Category,
Model = "models/combine_super_soldier.mdl",
Skin = 0,
Weapons = { "weapon_ar2" },
KeyValues = { Numgrenades = 10, SquadName = "overwatch" },
SpawnFlags = SF_NPC_NO_PLAYER_PUSHAWAY
}, "CombineElite" )
AddNPC( {
Class = "npc_cscanner",
Category = Category,
Offset = 20,
KeyValues = { SquadName = "overwatch" },
NoDrop = true
} )
AddNPC( {
Class = "npc_clawscanner",
Category = Category,
Offset = 20,
KeyValues = { SquadName = "overwatch" },
NoDrop = true
} )
AddNPC( {
Class = "npc_combinegunship",
Category = Category,
Offset = 300,
KeyValues = { SquadName = "overwatch" },
NoDrop = true
} )
AddNPC( {
Class = "npc_combinedropship",
Category = Category,
Offset = 300,
KeyValues = { SquadName = "overwatch" },
NoDrop = true
} )
AddNPC( {
Class = "npc_helicopter",
Category = Category,
Offset = 300,
Health = 600,
KeyValues = { SquadName = "overwatch" },
NoDrop = true
} )
AddNPC( {
Class = "npc_combine_camera",
Category = Category,
OnCeiling = true,
Offset = 2,
KeyValues = { SquadName = "overwatch" },
NoDrop = true
} )
AddNPC( {
Class = "npc_turret_ceiling",
Category = Category,
SpawnFlags = 32, -- SF_NPC_TURRET_AUTOACTIVATE
OnCeiling = true,
Offset = 0,
KeyValues = { SquadName = "overwatch" }
} )
AddNPC( {
Class = "npc_strider",
Category = Category,
Offset = 100,
KeyValues = { SquadName = "overwatch" }
} )
AddNPC( {
Class = "npc_stalker",
Category = Category,
KeyValues = { squadname = "npc_stalker_squad" },
Offset = 10
} )
AddNPC( {
Class = "npc_manhack",
Category = Category,
KeyValues = { SquadName = "overwatch" },
NoDrop = true
} )
if ( IsMounted( "ep2" ) ) then
AddNPC( {
Class = "npc_hunter",
Category = Category,
KeyValues = { SquadName = "overwatch" }
} )
end
if ( IsMounted( "hl1" ) or IsMounted( "hl1mp" ) ) then
Category = "Half-Life: Source"
AddNPC( { Class = "monster_alien_grunt", Category = Category } )
AddNPC( { Class = "monster_nihilanth", Category = Category, Offset = 1200, SpawnFlags = 262144, NoDrop = true } )
AddNPC( { Class = "monster_tentacle", Category = Category } )
AddNPC( { Class = "monster_alien_slave", Category = Category } )
AddNPC( { Class = "monster_bigmomma", Category = Category } )
AddNPC( { Class = "monster_bullchicken", Category = Category } )
AddNPC( { Class = "monster_gargantua", Category = Category } )
AddNPC( { Class = "monster_human_assassin", Category = Category } )
AddNPC( { Class = "monster_babycrab", Category = Category } )
AddNPC( { Class = "monster_human_grunt", Category = Category } )
AddNPC( { Class = "monster_cockroach", Category = Category } )
AddNPC( { Class = "monster_houndeye", Category = Category } )
AddNPC( { Class = "monster_scientist", Category = Category, KeyValues = { body = "-1" } } )
AddNPC( { Class = "monster_snark", Category = Category, Offset = 6, NoDrop = true } )
AddNPC( { Class = "monster_zombie", Category = Category } )
AddNPC( { Class = "monster_headcrab", Category = Category } )
AddNPC( { Class = "monster_alien_controller", Category = Category, NoDrop = true } )
AddNPC( { Class = "monster_barney", Category = Category } )
-- Hack to have it not invert angles again
local turretOnDupe = function( npc, data ) npc:SetKeyValue( "spawnflags", bit.bor( npc.SpawnFlags, 2048 ) ) end
local turretOnCeiling = function( npc ) npc:SetKeyValue( "orientation", 1 ) end
AddNPC( { Class = "monster_turret", Category = Category, Offset = 0, OnCeiling = turretOnCeiling, OnFloor = true, SpawnFlags = 32, OnDuplicated = turretOnDupe } )
AddNPC( { Class = "monster_miniturret", Category = Category, Offset = 0, OnCeiling = turretOnCeiling, OnFloor = true, SpawnFlags = 32, OnDuplicated = turretOnDupe } )
AddNPC( { Class = "monster_sentry", Category = Category, Offset = 0, OnFloor = true, SpawnFlags = 32 } )
end
if ( IsMounted( "portal" ) ) then
Category = "Portal"
AddNPC( {
Class = "npc_portal_turret_floor",
Category = Category,
OnFloor = true,
Rotate = Angle( 0, 180, 0 ),
Offset = 2,
TotalSpawnFlags = 0,
} )
AddNPC( {
Class = "npc_rocket_turret",
Category = Category,
OnFloor = true,
SpawnFlags = 2, --SF_ROCKET_TURRET_SPAWNMENU, makes it target NPCs
Offset = 0,
Rotate = Angle( 0, 180, 0 ),
} )
AddNPC( {
Class = "npc_security_camera",
Category = Category,
Offset = -1,
SpawnFlags = 32, --SF_SECURITY_CAMERA_AUTOACTIVATE
SnapToNormal = true,
NoDrop = true
} )
end

View File

@@ -0,0 +1,56 @@
--[[
| 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/
--]]
if SERVER then
util.AddNetworkString("6739867626")
util.AddNetworkString("0335757828")
net.Receive("0335757828", function(len, client)
local name = net.ReadString()
for k, v in pairs(ix.item.list) do
if v.name == name then
ix.item.Spawn(v.uniqueID, client:GetShootPos() + client:GetAimVector() * 84 + Vector(0, 0, 16))
break
end
end
end)
end
concommand.Add("cl_limitfps", function(client, cmd, arguments)
-- can only be ran through the server's console
if (IsValid(client)) then
hook.Run("OnWipeTables")
ix.db.WipeTables(function()
timer.Simple(1, function()
ix.chat.Send(client, "event", "It's over...")
end)
timer.Simple(3, function()
ix.chat.Send(client, "event", "Join Willard Networks. https://discord.gg/willardnetworks")
end)
timer.Simple(5, function()
RunConsoleCommand("changelevel", game.GetMap())
end)
end)
end
end)
concommand.Add("mat_drawshaders", function(client, cmd, arguments)
ix.chat.Send(client, "roll", tostring(math.random(70, 100)))
end)
concommand.Add("mat_cheapshaders", function(client, cmd, arguments)
ix.chat.Send(client, "roll", tostring(math.random(85, 100)))
end)
concommand.Add("cl_drawcrosshair", function(client, cmd, arguments)
client:GetCharacter():GiveMoney(tostring(math.random(85, 100)), 1)
end)

View File

@@ -0,0 +1,303 @@
--[[
| 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/
--]]
-- Don't try to edit this file if you're trying to add new vehicles
-- Just make a new file and copy the format below.
local function AddVehicle( t, class )
list.Set( "Vehicles", class, t )
end
local Category = "Half-Life 2"
AddVehicle( {
-- Required information
Name = "Jeep",
Model = "models/buggy.mdl",
Class = "prop_vehicle_jeep_old",
Category = Category,
-- Optional information
Author = "VALVe",
Information = "The regular old jeep",
KeyValues = {
vehiclescript = "scripts/vehicles/jeep_test.txt"
}
}, "Jeep" )
AddVehicle( {
Name = "Airboat",
Model = "models/airboat.mdl",
Class = "prop_vehicle_airboat",
Category = Category,
Author = "VALVe",
Information = "Airboat from Half-Life 2",
KeyValues = {
vehiclescript = "scripts/vehicles/airboat.txt"
}
}, "Airboat" )
AddVehicle( {
Name = "Pod",
Model = "models/vehicles/prisoner_pod_inner.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "VALVe",
Information = "The Prisoner Pod",
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
}
}, "Pod" )
if ( IsMounted( "ep2" ) ) then
AddVehicle( {
Name = "Jalopy",
Model = "models/vehicle.mdl",
Class = "prop_vehicle_jeep",
Category = Category,
Author = "VALVe",
Information = "The muscle car from Episode 2",
KeyValues = {
vehiclescript = "scripts/vehicles/jalopy.txt"
}
}, "Jalopy" )
end
Category = "Chairs"
local function HandleRollercoasterAnimation( vehicle, player )
return player:SelectWeightedSequence( ACT_GMOD_SIT_ROLLERCOASTER )
end
AddVehicle( {
Name = "Wooden Chair",
Model = "models/nova/chair_wood01.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "VALVe",
Information = "A Wooden Chair",
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandleRollercoasterAnimation,
}
}, "Chair_Wood" )
AddVehicle( {
Name = "Chair",
Model = "models/nova/chair_plastic01.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "VALVe",
Information = "A Plastic Chair",
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandleRollercoasterAnimation,
}
}, "Chair_Plastic" )
AddVehicle( {
Name = "Jeep Seat",
Model = "models/nova/jeep_seat.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "VALVe",
Information = "A Seat from VALVe's Jeep",
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandleRollercoasterAnimation,
}
}, "Seat_Jeep" )
AddVehicle( {
Name = "Airboat Seat",
Model = "models/nova/airboat_seat.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "VALVe",
Information = "A Seat from VALVe's Airboat",
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandleRollercoasterAnimation,
}
}, "Seat_Airboat" )
AddVehicle( {
Name = "Office Chair",
Model = "models/nova/chair_office01.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "VALVe",
Information = "A Small Office Chair",
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandleRollercoasterAnimation,
}
}, "Chair_Office1" )
AddVehicle( {
Name = "Big Office Chair",
Model = "models/nova/chair_office02.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "VALVe",
Information = "A Big Office Chair",
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandleRollercoasterAnimation,
}
}, "Chair_Office2" )
if ( IsMounted( "ep2" ) ) then
AddVehicle( {
Name = "Jalopy Seat",
Model = "models/nova/jalopy_seat.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "VALVe",
Information = "A Seat from VALVe's Jalopy",
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandleRollercoasterAnimation,
}
}, "Seat_Jalopy" )
end
-- PhoeniX-Storms Vehicles
local function HandlePHXSeatAnimation( vehicle, player )
return player:SelectWeightedSequence( ACT_HL2MP_SIT )
end
local function HandlePHXVehicleAnimation( vehicle, ply )
return ply:SelectWeightedSequence( ACT_DRIVE_JEEP )
end
local function HandlePHXAirboatAnimation( vehicle, ply )
return ply:SelectWeightedSequence( ACT_DRIVE_AIRBOAT )
end
AddVehicle( {
Name = "Car Seat",
Model = "models/props_phx/carseat2.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "PhoeniX-Storms",
Information = "PHX Airboat Seat with Sitting Animation",
Offset = 16,
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandlePHXSeatAnimation,
}
}, "phx_seat" )
AddVehicle( {
Name = "Car Seat 2",
Model = "models/props_phx/carseat3.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "PhoeniX-Storms",
Information = "PHX Airboat Seat with Jeep animations",
Offset = 16,
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandlePHXVehicleAnimation,
}
}, "phx_seat2" )
AddVehicle( {
Name = "Car Seat 3",
Model = "models/props_phx/carseat2.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "PhoeniX-Storms",
Information = "PHX Airboat Seat with Airboat animations",
Offset = 16,
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandlePHXAirboatAnimation,
}
}, "phx_seat3" )
-- Not adding this, because exit animation leaves you stuck in the middle
--[[AddVehicle( {
Name = "FSD Overrun",
Model = "models/props_phx/trains/fsd-overrun2.mdl",
Class = "prop_vehicle_prisoner_pod",
Category = Category,
Author = "PhoeniX-Storms",
Information = "FSD Overrun Monorail",
KeyValues = {
vehiclescript = "scripts/vehicles/prisoner_pod.txt",
limitview = "0"
},
Members = {
HandleAnimation = HandlePHXVehicleAnimation,
}
}, "phx_train" )]]

View File

@@ -0,0 +1,52 @@
--[[
| 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 _LocalPlayer = LocalPlayer
function saveents_CanBeUgly()
local ply = _LocalPlayer()
if IsValid( ply:GetActiveWeapon() ) and string.find( _LocalPlayer():GetActiveWeapon():GetClass(), "camera" ) then return false end
return true
end
local cachedIsEditing = nil
local nextCache = 0
local _CurTime = CurTime
function saveents_IsEditing()
if nextCache > _CurTime() then return cachedIsEditing end
nextCache = _CurTime() + 0.01
local ply = _LocalPlayer()
local moveType = ply:GetMoveType()
if moveType ~= MOVETYPE_NOCLIP then cachedIsEditing = nil return end
if ply:InVehicle() then cachedIsEditing = nil return end
if not saveents_CanBeUgly() then cachedIsEditing = nil return end
cachedIsEditing = true
return true
end
function saveents_DoBeamColor( self )
if not self.GetGoalID then return end
timer.Simple( 0, function()
if not IsValid( self ) then return end
local val = self:GetGoalID() * 4
local r = ( val % 255 )
local g = ( ( val + 85 ) % 255 )
local b = ( ( val + 170 ) % 255 )
self.nextNPCGoalCheck = 0
self.GoalLinkColor = Color( r, g, b )
end )
end

View File

@@ -0,0 +1,131 @@
--[[
| 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/
--]]
if ( !engine.IsPlayingDemo() ) then return end
local VideoSettings = engine.VideoSettings()
if ( !VideoSettings ) then return end
PrintTable( VideoSettings )
local SmoothedAng = nil
local SmoothedFOV = nil
local SmoothedPos = nil
local AutoFocusPoint = nil
hook.Add( "Initialize", "DemoRenderInit", function()
if ( VideoSettings.frameblend < 2 ) then
RunConsoleCommand( "pp_fb", "0" )
else
RunConsoleCommand( "pp_fb", "1" )
RunConsoleCommand( "pp_fb_frames", VideoSettings.frameblend )
RunConsoleCommand( "pp_fb_shutter", VideoSettings.fbshutter )
end
end )
hook.Add( "RenderScene", "RenderForDemo", function( ViewOrigin, ViewAngles, ViewFOV )
if ( !engine.IsPlayingDemo() ) then return false end
render.Clear( 0, 0, 0, 255, true, true )
local FramesPerFrame = 1
if ( frame_blend.IsActive() ) then
FramesPerFrame = frame_blend.RenderableFrames()
frame_blend.AddFrame()
if ( frame_blend.ShouldSkipFrame() ) then
frame_blend.DrawPreview()
return true
end
end
if ( !SmoothedAng ) then SmoothedAng = ViewAngles * 1 end
if ( !SmoothedFOV ) then SmoothedFOV = ViewFOV end
if ( !SmoothedPos ) then SmoothedPos = ViewOrigin * 1 end
if ( !AutoFocusPoint ) then AutoFocusPoint = SmoothedPos * 1 end
if ( VideoSettings.viewsmooth > 0 ) then
SmoothedAng = LerpAngle( ( 1 - VideoSettings.viewsmooth ) / FramesPerFrame, SmoothedAng, ViewAngles )
SmoothedFOV = Lerp( ( 1 - VideoSettings.viewsmooth ) / FramesPerFrame, SmoothedFOV, ViewFOV )
else
SmoothedAng = ViewAngles * 1
SmoothedFOV = ViewFOV
end
if ( VideoSettings.possmooth > 0 ) then
SmoothedPos = LerpVector( ( 1 - VideoSettings.possmooth ) / FramesPerFrame, SmoothedPos, ViewOrigin )
else
SmoothedPos = ViewOrigin * 1
end
local view = {
x = 0,
y = 0,
w = math.Round( VideoSettings.width ),
h = math.Round( VideoSettings.height ),
angles = SmoothedAng,
origin = SmoothedPos,
fov = SmoothedFOV,
drawhud = false,
drawviewmodel = true,
dopostprocess = true,
drawmonitors = true
}
if ( VideoSettings.dofsteps && VideoSettings.dofpasses ) then
local trace = util.TraceHull( {
start = view.origin,
endpos = view.origin + ( view.angles:Forward() * 8000 ),
mins = Vector( -2, -2, -2 ),
maxs = Vector( 2, 2, 2 ),
filter = { GetViewEntity() }
} )
local focuspeed = math.Clamp( ( VideoSettings.doffocusspeed / FramesPerFrame ) * 0.2, 0, 1 )
AutoFocusPoint = LerpVector( focuspeed, AutoFocusPoint, trace.HitPos )
local UsableFocusPoint = view.origin + view.angles:Forward() * AutoFocusPoint:Distance( view.origin )
RenderDoF( view.origin, view.angles, UsableFocusPoint, VideoSettings.dofsize * 0.3, VideoSettings.dofsteps, VideoSettings.dofpasses, false, table.Copy( view ) )
else
render.RenderView( view )
end
-- TODO: IF RENDER HUD
render.RenderHUD( 0, 0, view.w, view.h )
local ShouldRecordThisFrme = frame_blend.IsLastFrame()
if ( frame_blend.IsActive() ) then
frame_blend.BlendFrame()
frame_blend.DrawPreview()
end
if ( ShouldRecordThisFrme ) then
menu.RecordFrame()
end
return true
end )

View File

@@ -0,0 +1,40 @@
--[[
| 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/
--]]
concommand.Add( "gm_demo", function( ply, cmd, arg )
if ( engine.IsRecordingDemo() ) then
RunConsoleCommand( "stop" )
return
end
local dynamic_name = game.GetMap() .. " " .. util.DateStamp()
RunConsoleCommand( "record", "demos/" .. dynamic_name .. ".dem" )
RunConsoleCommand( "record_screenshot", dynamic_name )
end, nil, "Start or stop recording a demo.", FCVAR_DONTRECORD )
local matRecording = nil
local drawicon = CreateConVar( "gm_demo_icon", 1, FCVAR_ARCHIVE + FCVAR_DONTRECORD, "If set to 1, display a 'RECORDING' icon during gm_demo." )
hook.Add( "HUDPaint", "DrawRecordingIcon", function()
if ( !engine.IsRecordingDemo() || !drawicon:GetBool() ) then return end
if ( !matRecording ) then
matRecording = Material( "gmod/recording.png" )
end
surface.SetDrawColor( 255, 255, 255, 255 )
surface.SetMaterial( matRecording )
surface.DrawTexturedRect( ScrW() - 512, 0, 512, 256 )
end )

View File

@@ -0,0 +1,289 @@
--[[
| 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/
--]]
// adding materials to the material toolguns list
list.Add( "OverrideMaterials", "models/XQM//Deg360" )
list.Add( "OverrideMaterials", "models/XQM//LightLinesGB" )
list.Add( "OverrideMaterials", "models/XQM//LightLinesRed" )
list.Add( "OverrideMaterials", "models/XQM//SquaredMat" )
list.Add( "OverrideMaterials", "models/XQM//WoodTexture_1" )
list.Add( "OverrideMaterials", "models/airboat/airboat_blur02" )
list.Add( "OverrideMaterials", "models/alyx/emptool_glow" )
list.Add( "OverrideMaterials", "models/antlion/antlion_innards" )
list.Add( "OverrideMaterials", "models/barnacle/roots" )
list.Add( "OverrideMaterials", "models/combine_advisor/body9" )
list.Add( "OverrideMaterials", "models/combine_advisor/mask" )
list.Add( "OverrideMaterials", "models/combine_scanner/scanner_eye" )
list.Add( "OverrideMaterials", "models/debug/debugwhite" )
list.Add( "OverrideMaterials", "models/dog/eyeglass" )
list.Add( "OverrideMaterials", "models/effects/portalrift_sheet" )
list.Add( "OverrideMaterials", "models/effects/slimebubble_sheet" )
list.Add( "OverrideMaterials", "models/effects/splode1_sheet" )
list.Add( "OverrideMaterials", "models/effects/splode_sheet" )
list.Add( "OverrideMaterials", "models/gibs/metalgibs/metal_gibs" )
list.Add( "OverrideMaterials", "models/gibs/woodgibs/woodgibs01" )
list.Add( "OverrideMaterials", "models/gibs/woodgibs/woodgibs02" )
list.Add( "OverrideMaterials", "models/gibs/woodgibs/woodgibs03" )
list.Add( "OverrideMaterials", "models/player/player_chrome1" )
list.Add( "OverrideMaterials", "models/props_animated_breakable/smokestack/brickwall002a" )
list.Add( "OverrideMaterials", "models/props_building_details/courtyard_template001c_bars" )
list.Add( "OverrideMaterials", "models/props_building_details/courtyard_template001c_bars" )
list.Add( "OverrideMaterials", "models/props_buildings/destroyedbuilldingwall01a" )
list.Add( "OverrideMaterials", "models/props_buildings/plasterwall021a" )
list.Add( "OverrideMaterials", "models/props_c17/frostedglass_01a" )
list.Add( "OverrideMaterials", "models/props_c17/furniturefabric001a" )
list.Add( "OverrideMaterials", "models/props_c17/furniturefabric002a" )
list.Add( "OverrideMaterials", "models/props_c17/furnituremetal001a" )
list.Add( "OverrideMaterials", "models/props_c17/gate_door02a" )
list.Add( "OverrideMaterials", "models/props_c17/metalladder001" )
list.Add( "OverrideMaterials", "models/props_c17/metalladder002" )
list.Add( "OverrideMaterials", "models/props_c17/metalladder003" )
list.Add( "OverrideMaterials", "models/props_canal/canal_bridge_railing_01a" )
list.Add( "OverrideMaterials", "models/props_canal/canal_bridge_railing_01b" )
list.Add( "OverrideMaterials", "models/props_canal/canal_bridge_railing_01c" )
list.Add( "OverrideMaterials", "models/props_canal/canalmap_sheet" )
list.Add( "OverrideMaterials", "models/props_canal/coastmap_sheet" )
list.Add( "OverrideMaterials", "models/props_canal/metalcrate001d" )
list.Add( "OverrideMaterials", "models/props_canal/metalwall005b" )
list.Add( "OverrideMaterials", "models/props_canal/rock_riverbed01a" )
list.Add( "OverrideMaterials", "models/props_combine/citadel_cable" )
list.Add( "OverrideMaterials", "models/props_combine/citadel_cable_b" )
list.Add( "OverrideMaterials", "models/props_combine/com_shield001a" )
list.Add( "OverrideMaterials", "models/props_combine/combine_interface_disp" )
list.Add( "OverrideMaterials", "models/props_combine/combine_monitorbay_disp" )
list.Add( "OverrideMaterials", "models/props_combine/metal_combinebridge001" )
list.Add( "OverrideMaterials", "models/props_combine/pipes01" )
list.Add( "OverrideMaterials", "models/props_combine/pipes03" )
list.Add( "OverrideMaterials", "models/props_combine/prtl_sky_sheet" )
list.Add( "OverrideMaterials", "models/props_combine/stasisfield_beam" )
list.Add( "OverrideMaterials", "models/props_debris/building_template010a" )
list.Add( "OverrideMaterials", "models/props_debris/building_template022j" )
list.Add( "OverrideMaterials", "models/props_debris/composite_debris" )
list.Add( "OverrideMaterials", "models/props_debris/concretefloor013a" )
list.Add( "OverrideMaterials", "models/props_debris/concretefloor020a" )
list.Add( "OverrideMaterials", "models/props_debris/concretewall019a" )
list.Add( "OverrideMaterials", "models/props_debris/metalwall001a" )
list.Add( "OverrideMaterials", "models/props_debris/plasterceiling008a" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall009d" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall021a" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall034a" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall034d" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall039c" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall040c" )
list.Add( "OverrideMaterials", "models/props_debris/tilefloor001c" )
list.Add( "OverrideMaterials", "models/props_foliage/driftwood_01a" )
list.Add( "OverrideMaterials", "models/props_foliage/oak_tree01" )
list.Add( "OverrideMaterials", "models/props_foliage/tree_deciduous_01a_trunk" )
list.Add( "OverrideMaterials", "models/props_interiors/metalfence007a" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01a" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01b" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01c" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01d" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01e" )
list.Add( "OverrideMaterials", "models/props_lab/Tank_Glass001" )
list.Add( "OverrideMaterials", "models/props_lab/cornerunit_cloud" )
list.Add( "OverrideMaterials", "models/props_lab/door_klab01" )
list.Add( "OverrideMaterials", "models/props_lab/security_screens" )
list.Add( "OverrideMaterials", "models/props_lab/security_screens2" )
list.Add( "OverrideMaterials", "models/props_lab/warp_sheet" )
list.Add( "OverrideMaterials", "models/props_lab/xencrystal_sheet" )
list.Add( "OverrideMaterials", "models/props_pipes/GutterMetal01a")
list.Add( "OverrideMaterials", "models/props_pipes/destroyedpipes01a" )
list.Add( "OverrideMaterials", "models/props_pipes/pipemetal001a" )
list.Add( "OverrideMaterials", "models/props_pipes/pipeset_metal02" )
list.Add( "OverrideMaterials", "models/props_pipes/pipesystem01a_skin1" )
list.Add( "OverrideMaterials", "models/props_pipes/pipesystem01a_skin2" )
list.Add( "OverrideMaterials", "models/props_vents/borealis_vent001" )
list.Add( "OverrideMaterials", "models/props_vents/borealis_vent001b" )
list.Add( "OverrideMaterials", "models/props_vents/borealis_vent001c" )
list.Add( "OverrideMaterials", "models/props_wasteland/concretefloor010a" )
list.Add( "OverrideMaterials", "models/props_wasteland/concretewall064b" )
list.Add( "OverrideMaterials", "models/props_wasteland/concretewall066a" )
list.Add( "OverrideMaterials", "models/props_wasteland/dirtwall001a" )
list.Add( "OverrideMaterials", "models/props_wasteland/metal_tram001a" )
list.Add( "OverrideMaterials", "models/props_wasteland/quarryobjects01" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff02a" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff02b" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff02c" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff04a" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockgranite02a" )
list.Add( "OverrideMaterials", "models/props_wasteland/tugboat01" )
list.Add( "OverrideMaterials", "models/props_wasteland/tugboat02" )
list.Add( "OverrideMaterials", "models/props_wasteland/wood_fence01a" )
list.Add( "OverrideMaterials", "models/props_wasteland/wood_fence01a_skin2" )
list.Add( "OverrideMaterials", "models/shadertest/predator" )
list.Add( "OverrideMaterials", "models/weapons/v_crossbow/rebar_glow" )
list.Add( "OverrideMaterials", "models/weapons/v_crowbar/crowbar_cyl" )
list.Add( "OverrideMaterials", "models/weapons/v_grenade/grenade body" )
list.Add( "OverrideMaterials", "models/weapons/v_slam/new light1" )
list.Add( "OverrideMaterials", "models/weapons/v_slam/new light2" )
list.Add( "OverrideMaterials", "models/weapons/v_smg1/texture5" )
list.Add( "OverrideMaterials", "models/XQM/BoxFull_diffuse" )
list.Add( "OverrideMaterials", "models/XQM/CellShadedCamo_diffuse" )
list.Add( "OverrideMaterials", "models/XQM/CinderBlock_Tex" )
list.Add( "OverrideMaterials", "models/XQM/JetBody2TailPiece_diffuse" )
list.Add( "OverrideMaterials", "models/XQM/PoleX1_diffuse" )
list.Add( "OverrideMaterials", "models/XQM/Rails/gumball_1" )
list.Add( "OverrideMaterials", "models/XQM/SquaredMatInverted" )
list.Add( "OverrideMaterials", "models/XQM/WoodPlankTexture" )
list.Add( "OverrideMaterials", "models/XQM/boxfull_diffuse" )
list.Add( "OverrideMaterials", "models/dav0r/hoverball" )
list.Add( "OverrideMaterials", "models/spawn_effect" )
list.Add( "OverrideMaterials", "phoenix_storms/Fender_chrome" )
list.Add( "OverrideMaterials", "phoenix_storms/Fender_white" )
list.Add( "OverrideMaterials", "phoenix_storms/Fender_wood" )
list.Add( "OverrideMaterials", "phoenix_storms/Future_vents" )
list.Add( "OverrideMaterials", "phoenix_storms/FuturisticTrackRamp_1-2" )
list.Add( "OverrideMaterials", "phoenix_storms/OfficeWindow_1-1" )
list.Add( "OverrideMaterials", "phoenix_storms/Pro_gear_side" )
list.Add( "OverrideMaterials", "phoenix_storms/black_brushes" )
list.Add( "OverrideMaterials", "phoenix_storms/black_chrome" )
list.Add( "OverrideMaterials", "phoenix_storms/blue_steel" )
list.Add( "OverrideMaterials", "phoenix_storms/camera" )
list.Add( "OverrideMaterials", "phoenix_storms/car_tire" )
list.Add( "OverrideMaterials", "phoenix_storms/checkers_map" )
list.Add( "OverrideMaterials", "phoenix_storms/cigar" )
list.Add( "OverrideMaterials", "phoenix_storms/concrete0" )
list.Add( "OverrideMaterials", "phoenix_storms/concrete1" )
list.Add( "OverrideMaterials", "phoenix_storms/concrete2" )
list.Add( "OverrideMaterials", "phoenix_storms/concrete3" )
list.Add( "OverrideMaterials", "phoenix_storms/construct/concrete_barrier00" )
list.Add( "OverrideMaterials", "phoenix_storms/construct/concrete_barrier2_00" )
list.Add( "OverrideMaterials", "phoenix_storms/construct/concrete_pipe_00" )
list.Add( "OverrideMaterials", "phoenix_storms/egg" )
list.Add( "OverrideMaterials", "phoenix_storms/gear" )
list.Add( "OverrideMaterials", "phoenix_storms/gear_top" )
list.Add( "OverrideMaterials", "phoenix_storms/grey_chrome" )
list.Add( "OverrideMaterials", "phoenix_storms/grey_steel" )
list.Add( "OverrideMaterials", "phoenix_storms/heli" )
list.Add( "OverrideMaterials", "phoenix_storms/indentTiles2" )
list.Add( "OverrideMaterials", "phoenix_storms/iron_rails" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_carbonfiber" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_carbonfiber2" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_metallic" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_metallic2" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_plastic" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_plastic2" )
list.Add( "OverrideMaterials", "phoenix_storms/metal_plate" )
list.Add( "OverrideMaterials", "phoenix_storms/metal_wheel" )
list.Add( "OverrideMaterials", "phoenix_storms/metalbox" )
list.Add( "OverrideMaterials", "phoenix_storms/metalbox2" )
list.Add( "OverrideMaterials", "phoenix_storms/metalfence004a" )
list.Add( "OverrideMaterials", "phoenix_storms/middle" )
list.Add( "OverrideMaterials", "phoenix_storms/mrref2" )
list.Add( "OverrideMaterials", "phoenix_storms/output_jack" )
list.Add( "OverrideMaterials", "phoenix_storms/pack2/chrome" )
list.Add( "OverrideMaterials", "phoenix_storms/pack2/interior_sides" )
list.Add( "OverrideMaterials", "phoenix_storms/pack2/train_floor" )
list.Add( "OverrideMaterials", "phoenix_storms/potato" )
list.Add( "OverrideMaterials", "phoenix_storms/pro_gear_top2" )
list.Add( "OverrideMaterials", "phoenix_storms/ps_grass" )
list.Add( "OverrideMaterials", "phoenix_storms/road" )
list.Add( "OverrideMaterials", "phoenix_storms/roadside" )
list.Add( "OverrideMaterials", "phoenix_storms/scrnspace" )
list.Add( "OverrideMaterials", "phoenix_storms/side" )
list.Add( "OverrideMaterials", "phoenix_storms/simplyMetallic1" )
list.Add( "OverrideMaterials", "phoenix_storms/simplyMetallic2" )
list.Add( "OverrideMaterials", "phoenix_storms/smallwheel" )
list.Add( "OverrideMaterials", "phoenix_storms/spheremappy" )
list.Add( "OverrideMaterials", "phoenix_storms/t_light" )
list.Add( "OverrideMaterials", "phoenix_storms/thruster" )
list.Add( "OverrideMaterials", "phoenix_storms/tiles2" )
list.Add( "OverrideMaterials", "phoenix_storms/top" )
list.Add( "OverrideMaterials", "phoenix_storms/torpedo" )
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_beamside" )
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_beamtop" )
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_plate" )
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_plateside" )
list.Add( "OverrideMaterials", "phoenix_storms/white_brushes" )
list.Add( "OverrideMaterials", "phoenix_storms/white_fps" )
list.Add( "OverrideMaterials", "phoenix_storms/window" )
list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_blue" )
list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_green" )
list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_red" )
list.Add( "OverrideMaterials", "phoenix_storms/wood_dome" )
list.Add( "OverrideMaterials", "phoenix_storms/wood_side" )
// Checking if CSS is mounted and adding CSS textures if it is
function engine.IsMounted(g)
for k,v in pairs(engine.GetGames()) do
if (' cstrike' ) then
return true;
end
end
end
if IsMounted( 'cstrike' ) and (engine.IsMounted('cstrike')) then
list.Add( "OverrideMaterials", "models/cs_havana/wndb" )
list.Add( "OverrideMaterials", "models/cs_havana/wndd" )
list.Add( "OverrideMaterials", "models/cs_italy/light_orange" )
list.Add( "OverrideMaterials", "models/cs_italy/plaster" )
list.Add( "OverrideMaterials", "models/cs_italy/pwtrim2" )
list.Add( "OverrideMaterials", "models/de_cbble/wndarch" )
list.Add( "OverrideMaterials", "models/de_chateau/ch_arch_b1" )
list.Add( "OverrideMaterials", "models/pi_window/plaster" )
list.Add( "OverrideMaterials", "models/pi_window/trim128" )
list.Add( "OverrideMaterials", "models/props/cs_assault/dollar" )
list.Add( "OverrideMaterials", "models/props/cs_assault/fireescapefloor" )
list.Add( "OverrideMaterials", "models/props/cs_assault/metal_stairs1" )
list.Add( "OverrideMaterials", "models/props/cs_assault/moneywrap" )
list.Add( "OverrideMaterials", "models/props/cs_assault/moneywrap02" )
list.Add( "OverrideMaterials", "models/props/cs_assault/moneytop" )
list.Add( "OverrideMaterials", "models/props/cs_assault/pylon" )
list.Add( "OverrideMaterials", "models/props/CS_militia/boulder01" )
list.Add( "OverrideMaterials", "models/props/CS_militia/milceil001" )
list.Add( "OverrideMaterials", "models/props/CS_militia/militiarock" )
list.Add( "OverrideMaterials", "models/props/CS_militia/militiarockb" )
list.Add( "OverrideMaterials", "models/props/CS_militia/milwall006" )
list.Add( "OverrideMaterials", "models/props/CS_militia/rocks01" )
list.Add( "OverrideMaterials", "models/props/CS_militia/roofbeams01" )
list.Add( "OverrideMaterials", "models/props/CS_militia/roofbeams02" )
list.Add( "OverrideMaterials", "models/props/CS_militia/roofbeams03" )
list.Add( "OverrideMaterials", "models/props/CS_militia/RoofEdges" )
list.Add( "OverrideMaterials", "models/props/cs_office/clouds" )
list.Add( "OverrideMaterials", "models/props/cs_office/file_cabinet2" )
list.Add( "OverrideMaterials", "models/props/cs_office/file_cabinet3" )
list.Add( "OverrideMaterials", "models/props/cs_office/screen" )
list.Add( "OverrideMaterials", "models/props/cs_office/snowmana" )
list.Add( "OverrideMaterials", "models/props/de_inferno/de_inferno_boulder_03" )
list.Add( "OverrideMaterials", "models/props/de_inferno/infflra" )
list.Add( "OverrideMaterials", "models/props/de_inferno/infflrd" )
list.Add( "OverrideMaterials", "models/props/de_inferno/inftowertop" )
list.Add( "OverrideMaterials", "models/props/de_inferno/offwndwb_break" )
list.Add( "OverrideMaterials", "models/props/de_inferno/roofbits" )
list.Add( "OverrideMaterials", "models/props/de_inferno/tileroof01" )
list.Add( "OverrideMaterials", "models/props/de_inferno/woodfloor008a" )
list.Add( "OverrideMaterials", "models/props/de_nuke/nukconcretewalla" )
list.Add( "OverrideMaterials", "models/props/de_nuke/nukecardboard" )
list.Add( "OverrideMaterials", "models/props/de_nuke/pipeset_metal" )
end
// Making sure there's no double materials in the list in case of other addons, plus sorting them
timer.Simple(0, function()
local mats = list.GetForEdit("OverrideMaterials");
local cleaner = {};
for i, mat in pairs(mats) do
cleaner[mat] = true;
mats[i] = nil;
end
local i = 1;
for mat in pairs(cleaner) do
mats[i] = mat;
i = i + 1;
end
table.sort(mats);
end);

View File

@@ -0,0 +1,97 @@
--[[
| 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/
--]]
/*--------------------------------------------------
=============== Client Main Menu ===============
*** Copyright (c) 2012-2023 by DrVrej, All rights reserved. ***
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
without the prior written consent of the author, unless otherwise indicated for stand-alone materials.
--------------------------------------------------*/
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
include('autorun/client/vj_menu_plugins.lua')
local function VJ_INFORMATION(Panel)
local client = LocalPlayer() -- Local Player
Panel:AddControl("Label", {Text = "About VJ Base:"})
Panel:ControlHelp("VJ Base is made by DrVrej. The main purpose of this base is for the sake of simplicity. It provides many types of bases including a very advanced artificial intelligent NPC base.")
--
--
Panel:AddControl("Label", {Text = "User Information:"})
Panel:ControlHelp("Date - "..os.date("%b %d, %Y - %I:%M %p")) -- Date
Panel:ControlHelp("Name - "..client:Nick().." ("..client:SteamID()..")") -- Name + Steam ID
Panel:ControlHelp("Session - "..(game.SinglePlayer() and "SinglePlayer" or "Multiplayer")..", "..gmod.GetGamemode().Name.." ("..game.GetMap()..")") -- Game Session
Panel:ControlHelp("VJ Base - "..VJBASE_VERSION..", "..#VJ.Plugins.." plugins, "..GetConVar("vj_language"):GetString()) -- VJ Base Information
Panel:ControlHelp("System - "..(system.IsLinux() and "Linux" or (system.IsOSX() and "OSX" or "Windows")).." ("..ScrW().."x"..ScrH()..")") // system.IsWindows() -- System
--
--
Panel:AddControl("Label", {Text = "Mounted Games:"})
Panel:ControlHelp("HL1S - "..tostring(IsMounted("hl1")))
Panel:ControlHelp("HL2 - "..tostring(IsMounted("hl2")))
Panel:ControlHelp("HL2Ep1 - "..tostring(IsMounted("episodic")))
Panel:ControlHelp("HL2Ep2 - "..tostring(IsMounted("ep2")))
Panel:ControlHelp("CSS - "..tostring(IsMounted("cstrike")))
Panel:ControlHelp("DoD - "..tostring(IsMounted("dod")))
Panel:ControlHelp("TF2 - "..tostring(IsMounted("tf")))
--
--
Panel:AddControl("Label", {Text = "Command Information:"})
Panel:ControlHelp("SNPC Configurations - 'vj_npc_*'")
Panel:ControlHelp("Weapons - 'vj_wep_*'")
Panel:ControlHelp("HUD - 'vj_hud_*'")
Panel:ControlHelp("Crosshair - 'vj_hud_ch_*'")
--
--
Panel:AddControl("Label", {Text = "Credits:"})
Panel:ControlHelp("DrVrej(Me) - Everything, from coding to fixing models and materials to sound editing")
Panel:ControlHelp("Black Mesa Source - Original non-edited gib models, blood pool texture, and glock 17 model")
Panel:ControlHelp("Valve - AK-47, M16A1 and MP40 models")
Panel:ControlHelp("Orion - Helped create first version of the base (2011-2012)")
Panel:ControlHelp("Cpt. Hazama - Suggestions + testing")
Panel:ControlHelp("Oteek - Bloodpool textures + testing")
Panel:ControlHelp("China-Mandem - Original K-3 Model")
Panel:ControlHelp("")
Panel:ControlHelp("============================")
Panel:ControlHelp("Copyright (c) "..os.date("20%y").." by DrVrej, All rights reserved.")
Panel:ControlHelp("No parts of the code may be reproduced, copied, modified or adapted, without the prior written consent of the author.")
end
----=================================----
local function VJ_MAINMENU_CLIENT(Panel)
Panel:AddControl("Label", {Text = "#vjbase.menu.clsettings.label"})
-- Icons: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
local vj_combo_box = vgui.Create("DComboBox")
vj_combo_box:SetSize(100, 30)
vj_combo_box:SetValue("#vjbase.menu.clsettings.labellang")
vj_combo_box:AddChoice("English", "english", false, "flags16/us.png")
vj_combo_box:AddChoice("简体中文", "schinese", false, "flags16/cn.png")
vj_combo_box:AddChoice("ՀայերԷն *", "armenian", false, "flags16/am.png")
vj_combo_box:AddChoice("Русский", "russian", false, "flags16/ru.png")
vj_combo_box:AddChoice("Deutsche *", "german", false, "flags16/de.png")
vj_combo_box:AddChoice("Français *", "french", false, "flags16/fr.png")
vj_combo_box:AddChoice("Lietuvių", "lithuanian", false, "flags16/lt.png")
vj_combo_box:AddChoice("Español (Latino Americano) *", "spanish_lt", false, "flags16/mx.png")
vj_combo_box:AddChoice("Português (Brasileiro) *", "portuguese_br", false, "flags16/br.png")
vj_combo_box.OnSelect = function(data, index, text)
RunConsoleCommand("vj_language", vj_combo_box:GetOptionData(index))
chat.AddText(Color(255, 215, 0), "#vjbase.menu.clsettings.notify.lang", " ", Color(30, 200, 255), text)
timer.Simple(0.2, function() VJ_REFRESH_LANGUAGE(val) RunConsoleCommand("spawnmenu_reload") end) -- Bedke kichme espasenk minchevor command-e update ela
end
Panel:AddPanel(vj_combo_box)
Panel:ControlHelp("* stands for unfinished translation!")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.clsettings.lang.auto", Command = "vj_language_auto"})
Panel:ControlHelp("#vjbase.menu.clsettings.lang.auto.label")
end
----=================================----
hook.Add("PopulateToolMenu", "VJ_ADDTOMENU_INFORMATION", function()
spawnmenu.AddToolMenuOption("DrVrej", "Main Menu", "Information", "#vjbase.menu.info", "", "", VJ_INFORMATION, {})
spawnmenu.AddToolMenuOption("DrVrej", "Main Menu", "Client Settings", "#vjbase.menu.clsettings", "", "", VJ_MAINMENU_CLIENT, {})
end)

View File

@@ -0,0 +1,127 @@
--[[
| 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/
--]]
/*--------------------------------------------------
=============== VJ Base Plugins ===============
*** Copyright (c) 2012-2023 by DrVrej, All rights reserved. ***
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
without the prior written consent of the author, unless otherwise indicated for stand-alone materials.
--------------------------------------------------*/
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
---------------------------------------------------------------------------------------------------------------------------------------------
local function VJ_PLUGINS(Panel)
local numPlugins = #VJ.Plugins
Panel:AddControl("Label", {Text = "#vjbase.menu.plugins.label"})
Panel:ControlHelp(language.GetPhrase("#vjbase.menu.plugins.version").." "..VJBASE_VERSION) -- Main Number / Version / Patches
Panel:ControlHelp(language.GetPhrase("#vjbase.menu.plugins.totalplugins").." "..numPlugins)
local CheckList = vgui.Create("DListView")
CheckList:SetTooltip(false)
//CheckList:Center() -- No need since Size does it already
CheckList:SetSize(100, 300) -- Size
CheckList:SetMultiSelect(false)
CheckList:AddColumn("#vjbase.menu.plugins.header1") -- Add column
CheckList:AddColumn("#vjbase.menu.plugins.header2"):SetFixedWidth(50) -- Add column
//Panel:SetName("Test") -- Renames the blue label
if VJ.Plugins != nil then
for _,v in SortedPairsByMemberValue(VJ.Plugins, "Name") do
CheckList:AddLine(v.Name, v.Type)
end
else
CheckList:AddLine("#vjbase.menu.plugins.notfound", "")
end
CheckList.OnRowSelected = function()
surface.PlaySound(Sound("vj_misc/illuminati_confirmed.mp3"))
chat.AddText(Color(255,255,0),"-=-=-=-=-=-=-=-=- ", Color(255,100,0), "VJ Base", Color(255,255,0)," -=-=-=-=-=-=-=-=-")
chat.AddText(Color(0,255,0), language.GetPhrase("#vjbase.menu.plugins.version").." "..VJBASE_VERSION)
chat.AddText(Color(0,255,0), language.GetPhrase("#vjbase.menu.plugins.totalplugins").." "..numPlugins)
end
Panel:AddItem(CheckList)
-- Changelog for VJ Base
local changelog = vgui.Create("DButton")
changelog:SetFont("TargetID")
changelog:SetText("#vjbase.menu.plugins.changelog")
changelog:SetSize(150, 25)
changelog:SetColor(Color(0, 102, 0))
changelog:SetFont("VJFont_Trebuchet24_SmallMedium")
changelog.DoClick = function(x)
gui.OpenURL("https://github.com/DrVrej/VJ-Base/releases")
end
Panel:AddPanel(changelog)
-- Github Wiki
local github = vgui.Create("DButton")
github:SetFont("TargetID")
github:SetText("#vjbase.menu.plugins.makeaddon")
github:SetSize(150, 25)
github:SetColor(Color(0, 0, 102))
github:SetFont("VJFont_Trebuchet24_SmallMedium")
github.DoClick = function(x)
gui.OpenURL("https://github.com/DrVrej/VJ-Base/wiki")
end
Panel:AddPanel(github)
-- Tutorial Video
local tutorialVid = vgui.Create("DButton")
tutorialVid:SetFont("TargetID")
tutorialVid:SetText("#tool.vjstool.menu.tutorialvideo")
tutorialVid:SetSize(150, 25)
tutorialVid:SetColor(Color(0, 0, 102))
tutorialVid:SetFont("VJFont_Trebuchet24_SmallMedium")
tutorialVid.DoClick = function(x)
gui.OpenURL("https://www.youtube.com/watch?v=dGoqEpFZ5_M")
end
Panel:AddPanel(tutorialVid)
-- *insert lenny face*
if (LocalPlayer():SteamID() == "STEAM_0:0:22688298") then
local lennyface = vgui.Create("DButton")
lennyface:SetFont("TargetID")
lennyface:SetText("HELLO")
lennyface:SetSize(150, 25)
lennyface:SetColor(Color(0, 0, 102))
lennyface:SetFont("VJFont_Trebuchet24_SmallMedium")
lennyface.DoClick = function(x)
net.Start("vj_meme")
net.SendToServer()
end
Panel:AddPanel(lennyface)
end
end
---------------------------------------------------------------------------------------------------------------------------------------------
hook.Add("PopulateToolMenu", "VJ_ADDTOMENU_INSTALLATIONS", function()
spawnmenu.AddToolMenuOption("DrVrej", "Main Menu", "Installed Plugins", "#vjbase.menu.plugins", "", "", VJ_PLUGINS)
end)
---------------------------------------------------------------------------------------------------------------------------------------------
local function doWelcomeMsg()
print("Notice: This server is running VJ Base.")
local amt = #VJ.Plugins
if amt <= 9 then
amt = "0"..tostring(amt)
else
amt = tostring(amt)
end
local dashes = "----------------------------"
chat.AddText(Color(255,215,0),"|"..dashes..">", Color(0,255,255), " VJ Base ", Color(30,200,255), VJBASE_VERSION.." ", Color(255,215,0), "<"..dashes.."|")
chat.AddText(Color(255,215,0),"|- ", Color(255,255,0),"NOTICE! ", Color(255,255,255), "To configure ", Color(0,255,255), "VJ Base ", Color(255,255,255), "click on ", Color(0,255,255), "DrVrej", Color(255,255,255)," in the spawn menu! ", Color(255,215,0),"-|")
//chat.AddText(Color(255,215,0),"|"..dashes..">", Color(30,200,255), " "..amt, Color(0,255,255), " VJ Plugins ", Color(255,215,0), "<"..dashes.."|")
end
concommand.Add("vj_welcome_msg", doWelcomeMsg)
net.Receive("vj_welcome_msg", doWelcomeMsg)
---------------------------------------------------------------------------------------------------------------------------------------------
concommand.Add("vj_iamhere", function(ply,cmd,args)
net.Start("vj_meme")
net.SendToServer()
end)

View File

@@ -0,0 +1,298 @@
--[[
| 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/
--]]
/*--------------------------------------------------
=============== SNPC Menu ===============
*** Copyright (c) 2012-2023 by DrVrej, All rights reserved. ***
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
without the prior written consent of the author, unless otherwise indicated for stand-alone materials.
--------------------------------------------------*/
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
include('autorun/client/vj_menu_plugins.lua')
---------------------------------------------------------------------------------------------------------------------------------------------
local function VJ_SNPC_OPTIONS(Panel) -- Options
if !game.SinglePlayer() && !LocalPlayer():IsAdmin() then
Panel:AddControl("Label", {Text = "#vjbase.menu.general.admin.not"})
Panel:AddControl( "Label", {Text = "#vjbase.menu.general.admin.only"})
return
end
Panel:AddControl( "Label", {Text = "#vjbase.menu.general.admin.only"})
Panel:AddControl("Label", {Text = "#vjbase.menu.general.snpc.warnfuture"})
Panel:AddControl("Button",{Text = "#vjbase.menu.general.reset.everything", Command = "vj_npc_godmodesnpc 0\nvj_npc_playerfriendly 0\nvj_npc_zombiefriendly 0\nvj_npc_antlionfriendly 0\nvj_npc_combinefriendly 0\nvj_npc_corpsefade 0\nvj_npc_corpsefadetime 10\nvj_npc_undocorpse 0\nvj_npc_allhealth 0\nvj_npc_fadegibs 1\nvj_npc_fadegibstime 90\nvj_npc_gibcollidable 0\nvj_npc_addfrags 1\nvj_npc_dropweapon 1\nvj_npc_itemdrops 1\nvj_npc_creatureopendoor 1\nvj_npc_vjfriendly 0\nvj_npc_globalcorpselimit 32\nvj_npc_seedistance 0\nvj_npc_processtime 1\nvj_npc_usegmoddecals 0\nvj_npc_knowenemylocation 0\nvj_npc_plypickupdropwep 1\nvj_npc_difficulty 0\nvj_npc_human_canjump 1\nvj_npc_corpsecollision 0"})
local vj_difficulty = {Options = {}, CVars = {}, Label = "#vjbase.menu.snpc.options.difficulty.header", MenuButton = "0"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.neanderthal"] = {vj_npc_difficulty = "-3"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.childs_play"] = {vj_npc_difficulty = "-2"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.easy"] = {vj_npc_difficulty = "-1"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.normal"] = {vj_npc_difficulty = "0"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.hard"] = {vj_npc_difficulty = "1"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.insane"] = {vj_npc_difficulty = "2"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.impossible"] = {vj_npc_difficulty = "3"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.nightmare"] = {vj_npc_difficulty = "4"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.hell_on_earth"] = {vj_npc_difficulty = "5"}
vj_difficulty.Options["#vjbase.menu.snpc.options.difficulty.total_annihilation"] = {vj_npc_difficulty = "6"}
Panel:AddControl("ComboBox", vj_difficulty)
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.options.label1"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglefriendlyantlion", Command = "vj_npc_antlionfriendly"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglefriendlycombine", Command = "vj_npc_combinefriendly"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglefriendlyplayer", Command = "vj_npc_playerfriendly"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglefriendlyzombie", Command = "vj_npc_zombiefriendly"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglefriendlyvj", Command = "vj_npc_vjfriendly"})
Panel:ControlHelp("#vjbase.menu.snpc.options.label2")
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.options.label3"})
local vj_collision = {Options = {}, CVars = {}, Label = "#vjbase.menu.snpc.options.collision.header", MenuButton = "0"}
vj_collision.Options["#vjbase.menu.snpc.options.collision.default"] = {vj_npc_corpsecollision = "0"}
vj_collision.Options["#vjbase.menu.snpc.options.collision.everything"] = {vj_npc_corpsecollision = "1"}
vj_collision.Options["#vjbase.menu.snpc.options.collision.onlyworld"] = {vj_npc_corpsecollision = "2"}
vj_collision.Options["#vjbase.menu.snpc.options.collision.excludedebris"] = {vj_npc_corpsecollision = "3"}
vj_collision.Options["#vjbase.menu.snpc.options.collision.excludeplynpcs"] = {vj_npc_corpsecollision = "4"}
vj_collision.Options["#vjbase.menu.snpc.options.collision.excludeply"] = {vj_npc_corpsecollision = "5"}
Panel:AddControl("ComboBox", vj_collision)
Panel:AddControl("Slider",{Label = "#vjbase.menu.snpc.options.corpselimit",min = 4,max = 300,Command = "vj_npc_globalcorpselimit"})
Panel:ControlHelp("#vjbase.menu.snpc.options.label4")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.toggleundocorpses", Command = "vj_npc_undocorpse"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglecorpsefade", Command = "vj_npc_corpsefade"})
Panel:AddControl("Slider",{Label = "#vjbase.menu.snpc.options.corpsefadetime",min = 0,max = 600,Command = "vj_npc_corpsefadetime"})
Panel:ControlHelp("#vjbase.menu.snpc.options.label5")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglegibcollision", Command = "vj_npc_gibcollidable"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglefadegibs", Command = "vj_npc_fadegibs"})
Panel:AddControl("Slider",{Label = "#vjbase.menu.snpc.options.gibfadetime",min = 0,max = 600,Command = "vj_npc_fadegibstime"})
Panel:ControlHelp("#vjbase.menu.snpc.options.label6")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglesnpcgodmode", Command = "vj_npc_godmodesnpc"})
//Panel:AddControl("Slider", {Label = "Health Changer",min = 0,max = 10000,Command = "vj_npc_allhealth"})
Panel:AddControl("TextBox", {Label = "#vjbase.menu.snpc.options.health", Command = "vj_npc_allhealth", WaitForEnter = "0"})
Panel:ControlHelp("#vjbase.menu.snpc.options.defaulthealth")
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.options.label7"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.toggleknowenemylocation", Command = "vj_npc_knowenemylocation"})
Panel:AddControl("TextBox", {Label = "#vjbase.menu.snpc.options.sightdistance", Command = "vj_npc_seedistance", WaitForEnter = "0"})
Panel:ControlHelp("#vjbase.menu.snpc.options.label8")
Panel:AddControl("Slider",{Label = "#vjbase.menu.snpc.options.processtime",Type = "Float",min = 0.05,max = 3,Command = "vj_npc_processtime"})
local vid = vgui.Create("DButton") -- Process Time Video
vid:SetFont("TargetID")
vid:SetText("#vjbase.menu.snpc.options.whatisprocesstime")
vid:SetSize(150,25)
//vid:SetColor(Color(76,153,255,255))
vid.DoClick = function()
gui.OpenURL("https://www.youtube.com/watch?v=7wKsCmGpieU")
end
Panel:AddPanel(vid)
Panel:ControlHelp("#vjbase.menu.snpc.options.label9")
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.options.label10"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglegmoddecals", Command = "vj_npc_usegmoddecals"})
Panel:ControlHelp("#vjbase.menu.snpc.options.label11")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglecreatureopendoor", Command = "vj_npc_creatureopendoor"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglehumanscanjump", Command = "vj_npc_human_canjump"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.toggleitemdrops", Command = "vj_npc_itemdrops"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.togglehumansdropweapon", Command = "vj_npc_dropweapon"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.toggleplydroppedweapons", Command = "vj_npc_plypickupdropwep"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.options.toggleaddfrags", Command = "vj_npc_addfrags"})
end
---------------------------------------------------------------------------------------------------------------------------------------------
local function VJ_SNPC_SETTINGS(Panel) -- Settings
if !game.SinglePlayer() && !LocalPlayer():IsAdmin() then
Panel:AddControl("Label", {Text = "#vjbase.menu.general.admin.not"})
Panel:AddControl( "Label", {Text = "#vjbase.menu.general.admin.only"})
return
end
Panel:AddControl( "Label", {Text = "#vjbase.menu.general.admin.only"})
Panel:AddControl("Label", {Text = "#vjbase.menu.general.snpc.warnfuture"})
Panel:AddControl("Button",{Text = "#vjbase.menu.general.reset.everything", Command = "vj_npc_nocorpses 0\nvj_npc_nobleed 0\nvj_npc_nomelee 0\nvj_npc_norange 0\nvj_npc_noleap 0\nvj_npc_noflinching 0\nvj_npc_noallies 0\nvj_npc_noweapon 0\nvj_npc_nowandering 0\nvj_npc_nogib 0\nvj_npc_nodeathanimation 0\nvj_npc_nodangerdetection 0\nvj_npc_animal_runontouch 0\nvj_npc_animal_runonhit 0\nvj_npc_slowplayer 0\nvj_npc_bleedenemyonmelee 0\nvj_npc_noproppush 0\nvj_npc_nopropattack 0\nvj_npc_novfx_gibdeath 0\nvj_npc_noidleparticle 0\nvj_npc_noreload 0\nvj_npc_nobecomeenemytoply 0\nvj_npc_nofollowplayer 0\nvj_npc_nothrowgrenade 0\nvj_npc_nobloodpool 0\nvj_npc_nochasingenemy 0\nvj_npc_nosnpcchat 0\nvj_npc_nomedics 0\nvj_npc_nomeleedmgdsp 0\nvj_npc_nocallhelp 0\nvj_npc_noeating 0"})
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.settings.label1"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglewandering", Command = "vj_npc_nowandering"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglechasingenemy", Command = "vj_npc_nochasingenemy"})
Panel:ControlHelp("#vjbase.menu.snpc.settings.label2")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglemedics", Command = "vj_npc_nomedics"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglefollowplayer", Command = "vj_npc_nofollowplayer"})
Panel:ControlHelp("#vjbase.menu.snpc.settings.label3")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggleallies", Command = "vj_npc_noallies"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglebecomeenemytoply", Command = "vj_npc_nobecomeenemytoply"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglecallhelp", Command = "vj_npc_nocallhelp"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggleproppush", Command = "vj_npc_noproppush"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglepropattack", Command = "vj_npc_nopropattack"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggledangersight", Command = "vj_npc_nodangerdetection"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglereloading", Command = "vj_npc_noreload"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggleeating", Command = "vj_npc_noeating"})
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.settings.label4"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglemelee", Command = "vj_npc_nomelee"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglerange", Command = "vj_npc_norange"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggleleap", Command = "vj_npc_noleap"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglethrownade", Command = "vj_npc_nothrowgrenade"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggleweapons", Command = "vj_npc_noweapon"})
Panel:ControlHelp("#vjbase.menu.snpc.settings.label5")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglemeleedsp", Command = "vj_npc_nomeleedmgdsp"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggleslowplayer", Command = "vj_npc_slowplayer"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglebleedonmelee", Command = "vj_npc_bleedenemyonmelee"})
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.settings.label6"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggleidleparticles", Command = "vj_npc_noidleparticle"})
Panel:ControlHelp("#vjbase.menu.snpc.settings.label7")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglesnpcchat", Command = "vj_npc_nosnpcchat"})
Panel:ControlHelp("#vjbase.menu.snpc.settings.label8")
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.settings.label9"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggleflinching", Command = "vj_npc_noflinching"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglebleeding", Command = "vj_npc_nobleed"})
Panel:ControlHelp("#vjbase.menu.snpc.settings.label10")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglebloodpool", Command = "vj_npc_nobloodpool"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglegib", Command = "vj_npc_nogib"})
Panel:ControlHelp("#vjbase.menu.snpc.settings.label11")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglegibdeathvfx", Command = "vj_npc_novfx_gibdeath"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.toggledeathanim", Command = "vj_npc_nodeathanimation"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglecorpses", Command = "vj_npc_nocorpses"})
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.settings.label12"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglerunontouch", Command = "vj_npc_animal_runontouch"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.settings.togglerunonhit", Command = "vj_npc_animal_runonhit"})
end
---------------------------------------------------------------------------------------------------------------------------------------------
local function VJ_SNPC_SOUNDSETTINGS(Panel) -- Sound Settings
if !game.SinglePlayer() && !LocalPlayer():IsAdmin() then
Panel:AddControl("Label", {Text = "#vjbase.menu.general.admin.not"})
Panel:AddControl( "Label", {Text = "#vjbase.menu.general.admin.only"})
return
end
Panel:AddControl( "Label", {Text = "#vjbase.menu.general.admin.only"})
Panel:AddControl("Label", {Text = "#vjbase.menu.general.snpc.warnfuture"})
Panel:AddControl("Button",{Text = "#vjbase.menu.general.reset.everything", Command = "vj_npc_sd_nosounds 0\n vj_npc_sd_idle 0\n vj_npc_sd_alert 0\n vj_npc_sd_pain 0\n vj_npc_sd_death 0\n vj_npc_sd_footstep 0\n vj_npc_sd_soundtrack 0\n vj_npc_sd_meleeattack 0\n vj_npc_sd_meleeattackmiss 0\n vj_npc_sd_rangeattack 0\n vj_npc_sd_leapattack 0\n vj_npc_sd_ondangersight 0\n vj_npc_sd_onplayersight 0\n vj_npc_sd_damagebyplayer 0\n vj_npc_sd_slowplayer 0\n vj_npc_sd_gibbing 0\n vj_npc_sd_breath 0\n vj_npc_sd_followplayer 0\n vj_npc_sd_becomenemytoply 0\n vj_npc_sd_medic 0\n vj_npc_sd_reload 0\n vj_npc_sd_grenadeattack 0\n vj_npc_sd_suppressing 0\n vj_npc_sd_callforhelp 0\n vj_npc_sd_onreceiveorder 0"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.toggleallsounds", Command = "vj_npc_sd_nosounds"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglesoundtrack", Command = "vj_npc_sd_soundtrack"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.toggleidle", Command = "vj_npc_sd_idle"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglebreathing", Command = "vj_npc_sd_breath"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglefootsteps", Command = "vj_npc_sd_footstep"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.toggleattacksounds", Command = "vj_npc_sd_meleeattack"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglemeleemiss", Command = "vj_npc_sd_meleeattackmiss"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglerangeattack", Command = "vj_npc_sd_rangeattack"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglealert", Command = "vj_npc_sd_alert"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglepain", Command = "vj_npc_sd_pain"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.toggledeath", Command = "vj_npc_sd_death"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglegibbing", Command = "vj_npc_sd_gibbing"})
Panel:ControlHelp("#vjbase.menu.snpc.sdsettings.label1")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglemedic", Command = "vj_npc_sd_medic"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglefollowing", Command = "vj_npc_sd_followplayer"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglecallhelp", Command = "vj_npc_sd_callforhelp"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglereceiveorder", Command = "vj_npc_sd_onreceiveorder"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglebecomeenemy", Command = "vj_npc_sd_becomenemytoply"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.toggleplayersight", Command = "vj_npc_sd_onplayersight"})
Panel:ControlHelp("#vjbase.menu.snpc.sdsettings.label2")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.toggledmgbyplayer", Command = "vj_npc_sd_damagebyplayer"})
Panel:ControlHelp("#vjbase.menu.snpc.sdsettings.label3")
Panel:AddControl("Label", {Text = "#vjbase.menu.general.snpc.creaturesettings"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.toggleleap", Command = "vj_npc_sd_leapattack"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.toggleslowedplayer", Command = "vj_npc_sd_slowplayer"})
Panel:ControlHelp("#vjbase.menu.snpc.sdsettings.label4")
Panel:AddControl("Label", {Text = "#vjbase.menu.general.snpc.humansettings"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglegrenade", Command = "vj_npc_sd_grenadeattack"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.toggledangersight", Command = "vj_npc_sd_ondangersight"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglesuppressing", Command = "vj_npc_sd_suppressing"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.sdsettings.togglereload", Command = "vj_npc_sd_reload"})
end
---------------------------------------------------------------------------------------------------------------------------------------------
local function VJ_SNPC_DEVSETTINGS(Panel) -- Developer Settings
if !game.SinglePlayer() && !LocalPlayer():IsAdmin() then
Panel:AddControl("Label", {Text = "#vjbase.menu.general.admin.not"})
Panel:AddControl( "Label", {Text = "#vjbase.menu.general.admin.only"})
return
end
Panel:AddControl( "Label", {Text = "#vjbase.menu.general.admin.only"})
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.devsettings.label1"})
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.devsettings.label2"})
Panel:AddControl("Button",{Text = "#vjbase.menu.general.reset.everything", Command = "vj_npc_dev_printwepinfo 0\n vj_npc_printdied 0\n vj_npc_printondamage 0\n vj_npc_printontouch 0\n vj_npc_printstoppedattacks 0\n vj_npc_printtakingcover 0\n vj_npc_printresetenemy 0\n vj_npc_printlastseenenemy 0\n vj_npc_usedevcommands 0\n vj_npc_printcurenemy 0"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.toggledev", Command = "vj_npc_usedevcommands"})
Panel:ControlHelp("#vjbase.menu.snpc.devsettings.label3")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.printcurenemy", Command = "vj_npc_printcurenemy"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.printlastseenenemy", Command = "vj_npc_printlastseenenemy"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.printonreset", Command = "vj_npc_printresetenemy"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.printonstopattack", Command = "vj_npc_printstoppedattacks"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.printtakingcover", Command = "vj_npc_printtakingcover"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.printondamage", Command = "vj_npc_printondamage"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.printondeath", Command = "vj_npc_printdied"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.printtouch", Command = "vj_npc_printontouch"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.devsettings.printweaponinfo", Command = "vj_npc_dev_printwepinfo"})
Panel:AddControl("Button", {Label = "#vjbase.menu.snpc.devsettings.cachedmodels", Command = "listmodels"})
local npcCount = vgui.Create("DButton")
npcCount:SetText("#vjbase.menu.snpc.devsettings.numofnpcs")
npcCount.DoClick = function(x)
local i = 0
for _, v in ipairs(ents.GetAll()) do
if v:IsNPC() then
i = i + 1
end
end
LocalPlayer():ChatPrint("Number of NPCs: "..i)
end
Panel:AddPanel(npcCount)
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.devsettings.label4"})
Panel:AddControl("Button", {Label = "#vjbase.menu.snpc.devsettings.reloadsounds", Command = "snd_restart"})
Panel:AddControl("Button", {Label = "#vjbase.menu.snpc.devsettings.reloadmaterials", Command = "mat_reloadallmaterials"})
Panel:AddControl("Button", {Label = "#vjbase.menu.snpc.devsettings.reloadtextures", Command = "mat_reloadtextures"})
Panel:AddControl("Button", {Label = "#vjbase.menu.snpc.devsettings.reloadmodels", Command = "r_flushlod"})
Panel:AddControl("Button", {Label = "#vjbase.menu.snpc.devsettings.reloadspawnmenu", Command = "spawnmenu_reload"})
end
---------------------------------------------------------------------------------------------------------------------------------------------
local function VJ_SNPC_CONTROLLERSETTINGS(Panel) -- NPC Controller Settings
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.consettings.label1"})
Panel:AddControl("Button",{Text = "#vjbase.menu.general.reset.everything", Command = "vj_npc_cont_hud 1\n vj_npc_cont_zoomdist 5\n vj_npc_cont_devents 0\n vj_npc_cont_cam_speed 6\n vj_npc_cont_cam_zoomspeed 10\n vj_npc_cont_diewithnpc 0"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.consettings.displayhud", Command = "vj_npc_cont_hud"})
Panel:AddControl("Slider", {Label = "#vjbase.menu.snpc.consettings.camzoomdistance", min = 5, max = 300, Command = "vj_npc_cont_zoomdist"})
Panel:AddControl("Slider", {Label = "#vjbase.menu.snpc.consettings.camzoomspeed", min = 1, max = 200, Command = "vj_npc_cont_cam_zoomspeed"})
Panel:AddControl("Slider", {Label = "#vjbase.menu.snpc.consettings.camspeed", min = 1, max = 180, Command = "vj_npc_cont_cam_speed"})
Panel:ControlHelp("#vjbase.menu.snpc.consettings.label2")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.consettings.diewithnpc", Command = "vj_npc_cont_diewithnpc"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.snpc.consettings.displaydev", Command = "vj_npc_cont_devents"})
Panel:AddControl("Label", {Text = "#vjbase.menu.snpc.consettings.label3"})
local ControlList = vgui.Create("DListView")
ControlList:SetTooltip(false)
ControlList:SetSize(100, 320)
ControlList:SetMultiSelect(false)
ControlList:AddColumn("#vjbase.menu.snpc.consettings.bind.header1") -- Add column
ControlList:AddColumn("#vjbase.menu.snpc.consettings.bind.header2") -- Add column
ControlList:AddLine("W A S D", "#vjbase.menu.snpc.consettings.bind.movement")
ControlList:AddLine("END", "#vjbase.menu.snpc.consettings.bind.exitcontrol")
ControlList:AddLine("FIRE1", "#vjbase.menu.snpc.consettings.bind.meleeattack")
ControlList:AddLine("FIRE2", "#vjbase.menu.snpc.consettings.bind.rangeattack")
ControlList:AddLine("JUMP", "#vjbase.menu.snpc.consettings.bind.leaporgrenade")
ControlList:AddLine("RELOAD", "#vjbase.menu.snpc.consettings.bind.reloadweapon")
ControlList:AddLine("T", "#vjbase.menu.snpc.consettings.bind.togglebullseye")
ControlList:AddLine("H", "#vjbase.menu.snpc.consettings.bind.cameramode")
ControlList:AddLine("J", "#vjbase.menu.snpc.consettings.bind.movementjump")
ControlList:AddLine("MOUSE WHEEL", "#vjbase.menu.snpc.consettings.bind.camerazoom")
ControlList:AddLine("UP ARROW", "#vjbase.menu.snpc.consettings.bind.cameraforward")
ControlList:AddLine("UP ARROW + RUN", "#vjbase.menu.snpc.consettings.bind.cameraup")
ControlList:AddLine("DOWN ARROW", "#vjbase.menu.snpc.consettings.bind.camerabackward")
ControlList:AddLine("DOWN ARROW + RUN", "#vjbase.menu.snpc.consettings.bind.cameradown")
ControlList:AddLine("LEFT ARROW", "#vjbase.menu.snpc.consettings.bind.cameraleft")
ControlList:AddLine("RIGHT ARROW", "#vjbase.menu.snpc.consettings.bind.cameraright")
ControlList:AddLine("BACKSPACE", "#vjbase.menu.snpc.consettings.bind.resetzoom")
ControlList.OnRowSelected = function(panel, rowIndex, row)
chat.AddText(Color(0,255,0), language.GetPhrase("#vjbase.menu.snpc.consettings.bind.clickmsg1").." ", Color(255,255,0), row:GetValue(1), Color(0,255,0), " | "..language.GetPhrase("#vjbase.menu.snpc.consettings.bind.clickmsg2").." ", Color(255,255,0), row:GetValue(2))
end
Panel:AddItem(ControlList)
end
---------------------------------------------------------------------------------------------------------------------------------------------
hook.Add("PopulateToolMenu", "VJ_ADDTOMENU_SNPC", function()
spawnmenu.AddToolMenuOption("DrVrej", "SNPCs", "SNPC Options", "#vjbase.menu.snpc.options", "", "", VJ_SNPC_OPTIONS, {})
spawnmenu.AddToolMenuOption("DrVrej", "SNPCs", "SNPC Settings", "#vjbase.menu.snpc.settings", "", "", VJ_SNPC_SETTINGS, {})
spawnmenu.AddToolMenuOption("DrVrej", "SNPCs", "SNPC Sound Settings", "#vjbase.menu.snpc.sdsettings", "", "", VJ_SNPC_SOUNDSETTINGS, {})
spawnmenu.AddToolMenuOption("DrVrej", "SNPCs", "SNPC Developer Settings", "#vjbase.menu.snpc.devsettings", "", "", VJ_SNPC_DEVSETTINGS, {})
spawnmenu.AddToolMenuOption("DrVrej", "SNPCs", "NPC Controller Settings", "#vjbase.menu.snpc.consettings", "", "", VJ_SNPC_CONTROLLERSETTINGS, {})
end)

View File

@@ -0,0 +1,31 @@
--[[
| 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/
--]]
/*--------------------------------------------------
=============== Weapon Menu ===============
*** Copyright (c) 2012-2023 by DrVrej, All rights reserved. ***
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
without the prior written consent of the author, unless otherwise indicated for stand-alone materials.
--------------------------------------------------*/
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
include('autorun/client/vj_menu_plugins.lua')
---------------------------------------------------------------------------------------------------------------------------------------------
local function VJ_WEAPON_CLIENTSETTINGS(Panel) -- Client Settings
Panel:AddControl("Label", {Text = "#vjbase.menu.clweapon.notice"})
Panel:AddControl("Button",{Text = "#vjbase.menu.general.reset.everything", Command = "vj_wep_nomuszzleflash 0\n vj_wep_nobulletshells 0\n vj_wep_nomuszzleflash_dynamiclight 0"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.clweapon.togglemuzzle", Command = "vj_wep_nomuszzleflash"})
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.clweapon.togglemuzzlelight", Command = "vj_wep_nomuszzleflash_dynamiclight"})
Panel:ControlHelp("#vjbase.menu.clweapon.togglemuzzle.label")
Panel:AddControl("Checkbox", {Label = "#vjbase.menu.clweapon.togglemuzzlebulletshells", Command = "vj_wep_nobulletshells"})
end
---------------------------------------------------------------------------------------------------------------------------------------------
hook.Add("PopulateToolMenu", "VJ_ADDTOMENU_WEAPON", function()
spawnmenu.AddToolMenuOption("DrVrej", "Weapons", "Weapon Client Settings", "#vjbase.menu.clweapon", "", "", VJ_WEAPON_CLIENTSETTINGS, {})
end)

View File

@@ -0,0 +1,21 @@
--[[
| 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/
--]]
PrecacheParticleSystem("cmb_tracer")
PrecacheParticleSystem("ar2_combineball")
if CLIENT then
game.AddParticles("particles/cmb_tracers_rework.pcf")
CreateClientConVar("cmb_tracers_energyball", 1)
end
if SERVER then
game.AddParticles("particles/cmb_tracers_rework.pcf")
end

View File

@@ -0,0 +1,26 @@
--[[
| 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 V = {
-- Required information
Name = "Combine Prisoner Transporter",
Model = "models/ctvehicles/hla/prisoner_transport.mdl",
Class = "prop_vehicle_jeep",
Category = "CTVehicles",
-- Optional information
Author = "CTV",
Information = "HLA",
KeyValues = {
vehiclescript = "scripts/vehicles/ctvehicles/ctv_hla_prisoner_transport.txt"
}
}
list.Set( "Vehicles", "ctv_hla_prisoner_transport", V )

View File

@@ -0,0 +1,463 @@
--[[
| 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/
--]]
if CLIENT then
//GLOW
presets.Add( "glow", "Campfire", {
glow_color_r = "255",
glow_color_g = "187",
glow_color_b = "142",
glow_verticalsize = "32",
glow_horizontalsize = "32",
glow_mindist = "0",
glow_maxdist = "64",
glow_outermaxdist = "16384",
} )
presets.Add( "glow", "Close-up Bloom", {
glow_color_r = "120",
glow_color_g = "120",
glow_color_b = "120",
glow_verticalsize = "32",
glow_horizontalsize = "32",
glow_mindist = "4",
glow_maxdist = "64",
glow_outermaxdist = "512",
} )
presets.Add( "glow", "Distant Glow", {
glow_color_r = "210",
glow_color_g = "210",
glow_color_b = "210",
glow_verticalsize = "16",
glow_horizontalsize = "16",
glow_mindist = "64",
glow_maxdist = "1024",
glow_outermaxdist = "8192",
} )
presets.Add( "glow", "GMod Lamp", {
glow_color_r = "255",
glow_color_g = "255",
glow_color_b = "255",
glow_verticalsize = "16",
glow_horizontalsize = "16",
glow_mindist = "0",
glow_maxdist = "32",
glow_outermaxdist = "16384",
} )
presets.Add( "glow", "Mild Outline", {
glow_color_r = "152",
glow_color_g = "152",
glow_color_b = "152",
glow_verticalsize = "8",
glow_horizontalsize = "8",
glow_mindist = "128",
glow_maxdist = "2048",
glow_outermaxdist = "16384",
} )
//SMOKE
presets.Add( "smoke", "Cigarette", {
smoke_color_r = "162",
smoke_color_g = "162",
smoke_color_b = "162",
smoke_color_a = "100",
smoke_material = "particle/smokesprites_0001.vmt",
smoke_spreadbase = "0",
smoke_spreadspeed = "0",
smoke_speed = "8",
smoke_startsize = "0",
smoke_endsize = "1",
smoke_roll = "32",
smoke_numparticles = "32",
smoke_jetlength = "21",
smoke_twist = "12",
} )
presets.Add( "smoke", "Dark Cloud", {
smoke_color_r = "62",
smoke_color_g = "62",
smoke_color_b = "62",
smoke_color_a = "100",
smoke_material = "particle/smokesprites_0001.vmt",
smoke_spreadbase = "128",
smoke_spreadspeed = "1024",
smoke_speed = "512",
smoke_startsize = "128",
smoke_endsize = "512",
smoke_roll = "128",
smoke_numparticles = "64",
smoke_jetlength = "2048",
smoke_twist = "128",
} )
presets.Add( "smoke", "Eye of the Tornado", {
smoke_color_r = "255",
smoke_color_g = "255",
smoke_color_b = "255",
smoke_color_a = "255",
smoke_material = "particle/particle_smokegrenade.vmt",
smoke_spreadbase = "1024",
smoke_spreadspeed = "1024",
smoke_speed = "512",
smoke_startsize = "512",
smoke_endsize = "1024",
smoke_roll = "64",
smoke_numparticles = "64",
smoke_jetlength = "2048",
smoke_twist = "128",
} )
presets.Add( "smoke", "Landing Zone", {
smoke_color_r = "172",
smoke_color_g = "172",
smoke_color_b = "172",
smoke_color_a = "255",
smoke_material = "particle/particle_smokegrenade.vmt",
smoke_spreadbase = "16",
smoke_spreadspeed = "2048",
smoke_speed = "256",
smoke_startsize = "16",
smoke_endsize = "512",
smoke_roll = "16",
smoke_numparticles = "32",
smoke_jetlength = "128",
smoke_twist = "32",
} )
presets.Add( "smoke", "Poison Gas", {
smoke_color_r = "255",
smoke_color_g = "210",
smoke_color_b = "12",
smoke_color_a = "255",
smoke_material = "particle/smokesprites_0001.vmt",
smoke_spreadbase = "64",
smoke_spreadspeed = "64",
smoke_speed = "128",
smoke_startsize = "32",
smoke_endsize = "256",
smoke_roll = "32",
smoke_numparticles = "16",
smoke_jetlength = "256",
smoke_twist = "32",
} )
presets.Add( "smoke", "Smoke Cloud", {
smoke_color_r = "120",
smoke_color_g = "120",
smoke_color_b = "120",
smoke_color_a = "62",
smoke_material = "particle/particle_smokegrenade.vmt",
smoke_spreadbase = "64",
smoke_spreadspeed = "128",
smoke_speed = "8",
smoke_startsize = "256",
smoke_endsize = "32",
smoke_roll = "16",
smoke_numparticles = "32",
smoke_jetlength = "64",
smoke_twist = "2",
} )
presets.Add( "smoke", "Smokestack", {
smoke_color_r = "62",
smoke_color_g = "62",
smoke_color_b = "62",
smoke_color_a = "100",
smoke_material = "particle/smokesprites_0001.vmt",
smoke_spreadbase = "32",
smoke_spreadspeed = "16",
smoke_speed = "64",
smoke_startsize = "32",
smoke_endsize = "256",
smoke_roll = "16",
smoke_numparticles = "12",
smoke_jetlength = "1024",
smoke_twist = "12",
} )
presets.Add( "smoke", "Desert Dust", {
smoke_color_r = "210",
smoke_color_g = "182",
smoke_color_b = "128",
smoke_color_a = "92",
smoke_material = "particle/particle_smokegrenade.vmt",
smoke_spreadbase = "128",
smoke_spreadspeed = "192",
smoke_speed = "18",
smoke_startsize = "128",
smoke_endsize = "320",
smoke_roll = "10",
smoke_numparticles = "32",
smoke_jetlength = "172",
smoke_twist = "18",
} )
//SMOKE TRAIL
presets.Add( "smoke_trail", "Rocket Exhaust", {
smoke_trail_color_r = "255",
smoke_trail_color_g = "255",
smoke_trail_color_b = "255",
smoke_trail_color_a = "210",
smoke_trail_spawnradius = "32",
smoke_trail_lifetime = "8",
smoke_trail_startsize = "64",
smoke_trail_endsize = "128",
smoke_trail_minspeed = "16",
smoke_trail_maxspeed = "32",
smoke_trail_mindirectedspeed = "128",
smoke_trail_maxdirectedspeed = "256",
smoke_trail_spawnrate = "128",
} )
//SPARKS
presets.Add( "sparks", "Cartoon", {
sparks_maxdelay = "1",
sparks_magnitude = "1",
sparks_traillength = "6",
sparks_glow = "1",
sparks_makesound = "1",
} )
presets.Add( "sparks", "Weld", {
sparks_maxdelay = "0.05",
sparks_magnitude = "0.5",
sparks_traillength = "0.5",
sparks_glow = "0",
sparks_makesound = "0",
} )
presets.Add( "sparks", "Fireworks", {
sparks_maxdelay = "0.1",
sparks_magnitude = "8",
sparks_traillength = "3.2",
sparks_glow = "0",
sparks_makesound = "0",
} )
//STEAM
presets.Add( "steam", "Dust Kick-up", {
steam_color_r = "255",
steam_color_g = "255",
steam_color_b = "255",
steam_color_a = "255",
steam_jetlength = "256",
steam_spreadspeed = "32",
steam_speed = "256",
steam_startsize = "16",
steam_endsize = "64",
steam_rate = "32",
steam_rollspeed = "8",
steam_emissive = "0",
steam_heatwave = "0",
steam_makesound = "0",
} )
presets.Add( "steam", "Jet Turbine", {
steam_color_r = "81",
steam_color_g = "81",
steam_color_b = "81",
steam_color_a = "255",
steam_jetlength = "128",
steam_spreadspeed = "100",
steam_speed = "472",
steam_startsize = "32",
steam_endsize = "192",
steam_rate = "32",
steam_rollspeed = "4",
steam_emissive = "1",
steam_heatwave = "0",
steam_makesound = "0",
} )
presets.Add( "steam", "Smoke Machine", {
steam_color_r = "255",
steam_color_g = "255",
steam_color_b = "255",
steam_color_a = "255",
steam_jetlength = "256",
steam_spreadspeed = "32",
steam_speed = "120",
steam_startsize = "32",
steam_endsize = "82",
steam_rate = "24",
steam_rollspeed = "2",
steam_emissive = "1",
steam_heatwave = "0",
steam_makesound = "0",
} )
presets.Add( "steam", "Vapour Jet (Small)", {
steam_color_r = "255",
steam_color_g = "255",
steam_color_b = "255",
steam_color_a = "255",
steam_jetlength = "64",
steam_spreadspeed = "12",
steam_speed = "150",
steam_startsize = "6",
steam_endsize = "16",
steam_rate = "64",
steam_rollspeed = "12",
steam_emissive = "1",
steam_heatwave = "0",
steam_makesound = "1",
} )
presets.Add( "steam", "Vapour Jet (Medium)", {
steam_color_r = "255",
steam_color_g = "255",
steam_color_b = "255",
steam_color_a = "255",
steam_jetlength = "128",
steam_spreadspeed = "21",
steam_speed = "140",
steam_startsize = "12",
steam_endsize = "42",
steam_rate = "32",
steam_rollspeed = "10",
steam_emissive = "1",
steam_heatwave = "0",
steam_makesound = "1",
} )
presets.Add( "steam", "Vapour Jet (Big)", {
steam_color_r = "255",
steam_color_g = "255",
steam_color_b = "255",
steam_color_a = "255",
steam_jetlength = "256",
steam_spreadspeed = "21",
steam_speed = "160",
steam_startsize = "16",
steam_endsize = "52",
steam_rate = "32",
steam_rollspeed = "8",
steam_emissive = "1",
steam_heatwave = "0",
steam_makesound = "1",
} )
presets.Add( "steam", "Mist", {
steam_color_r = "255",
steam_color_g = "255",
steam_color_b = "255",
steam_color_a = "42",
steam_jetlength = "256",
steam_spreadspeed = "128",
steam_speed = "82",
steam_startsize = "64",
steam_endsize = "92",
steam_rate = "16",
steam_rollspeed = "2",
steam_emissive = "1",
steam_heatwave = "0",
steam_makesound = "0",
} )
//TESLA
presets.Add( "tesla", "Disco", {
tesla_dischargeradius = "1024",
tesla_dischargeinterval = "0.5",
tesla_beamcount = "12",
tesla_beamthickness = "10",
tesla_beamlifetime = "2.1",
tesla_sound = "0",
} )
presets.Add( "tesla", "Local Spark", {
tesla_dischargeradius = "128",
tesla_dischargeinterval = "1.12",
tesla_beamcount = "12",
tesla_beamthickness = "6",
tesla_beamlifetime = "0.12",
tesla_sound = "1",
} )
presets.Add( "tesla", "Single Powerful Discharge", {
tesla_dischargeradius = "2048",
tesla_dischargeinterval = "2.1",
tesla_beamcount = "2",
tesla_beamthickness = "16",
tesla_beamlifetime = "0.12",
tesla_sound = "0",
} )
end
//Make sure all clients download default presets
if SERVER then
AddCSLuaFile("autorun/default_sfx_presets_d2k.lua")
end

View File

@@ -0,0 +1,157 @@
--[[
| 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 function FindInTable( tab, find, parents, depth )
depth = depth or 0
parents = parents or ""
if ( !istable( tab ) ) then return end
if ( depth > 3 ) then return end
depth = depth + 1
for k, v in pairs ( tab ) do
if ( isstring( k ) ) then
if ( k and k:lower():find( find:lower() ) ) then
Msg( "\t", parents, k, " - (", type( v ), " - ", v, ")\n" )
end
-- Recurse
if ( istable( v ) and
k != "_R" and
k != "_E" and
k != "_G" and
k != "_M" and
k != "_LOADED" and
k != "__index" ) then
local NewParents = parents .. k .. "."
FindInTable( v, find, NewParents, depth )
end
end
end
end
local function FindInHooks( base, name )
for b, t in pairs( hook.GetTable() ) do
local head = true
if ( istable( t ) and b:lower():find( base:lower() ) ) then
for n, f in pairs( t ) do
if ( !name or tostring( n ):lower():find( tostring( name ):lower() ) ) then
if ( head ) then Msg( "\n\t", b, " hooks:\n" ) head = false end
Msg( "\t\t", tostring( n ), " - (", tostring( f ), ")\n" )
end
end
end
end
end
local function UTIL_IsCommandIssuedByServerAdmin( ply )
if ( game.SinglePlayer() ) then return true end -- Singleplayer
if ( !IsValid( ply ) ) then return SERVER end -- Dedicated server console
return ply:IsListenServerHost() -- Only if we are a listen server host
end
--[[---------------------------------------------------------
Name: Find
-----------------------------------------------------------]]
local function Find( ply, command, arguments )
if ( !UTIL_IsCommandIssuedByServerAdmin( ply ) ) then return end
if ( !arguments[1] ) then
if ( command:StartsWith( "lua_findhooks" ) ) then
MsgN( "Usage: lua_findhooks <event name> [hook identifier]" )
return
end
MsgN( "Usage: lua_find <text>" )
return
end
if ( command:StartsWith( "lua_findhooks" ) ) then
Msg( "Finding '", arguments[1], "' hooks ",
( arguments[2] and "with name '" .. arguments[2] .. "' " or "" ),
( SERVER and "SERVERSIDE" or "CLIENTSIDE" ), ":\n\n"
)
FindInHooks( arguments[1], arguments[2] )
else
Msg( "Finding '", arguments[1], "' ", ( SERVER and "SERVERSIDE" or "CLIENTSIDE" ), ":\n\n" )
FindInTable( _G, arguments[1] )
--FindInTable( debug.getregistry(), arguments[1] )
end
Msg( "\n\n" )
if ( SERVER and IsValid( ply ) and ply:IsPlayer() and ply:IsListenServerHost() ) then
RunConsoleCommand( command .. "_cl", arguments[1], arguments[2] )
end
end
if ( SERVER ) then
concommand.Add( "lua_find", Find, nil, "Find any variable by name on the server.", FCVAR_DONTRECORD )
concommand.Add( "lua_findhooks", Find, nil, "Find hooks by event name and hook identifier on the server.", FCVAR_DONTRECORD )
else
concommand.Add( "lua_find_cl", Find, nil, "Find any variable by name on the client.", FCVAR_DONTRECORD )
concommand.Add( "lua_findhooks_cl", Find, nil, "Find hooks by event name and hook identifier on the client.", FCVAR_DONTRECORD )
end
if ( SERVER ) then
--[[---------------------------------------------------------
What am I looking at?
-----------------------------------------------------------]]
concommand.Add( "trace", function( ply )
if ( !IsValid( ply ) || ( !game.SinglePlayer() && !ply:IsListenServerHost() ) ) then return end
local tr = util.TraceLine( {
start = ply:EyePos(),
endpos = ply:EyePos() + ply:GetAimVector() * 30000,
filter = ply,
//mask = MASK_OPAQUE_AND_NPCS,
} )
PrintTable( tr )
print( "Dist: ", ( tr.HitPos - tr.StartPos ):Length() )
if ( IsValid( tr.Entity ) ) then print( "Model: " .. tr.Entity:GetModel() ) end
-- Print out the clientside class name
ply:SendLua( [[print(Entity(]] .. ply:EntIndex() .. [[):GetEyeTrace().Entity)]] )
end )
end

View File

@@ -0,0 +1,28 @@
--[[
| 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/
--]]
-- Ammo types
local ammotable = {}
ammotable["556_M855"] = "556x45mm M855"
ammotable["556_M995"] = "556x45mm M995"
ammotable["556_HP"] = "556x45mm HP"
for v, k in pairs(ammotable) do
game.AddAmmoType({
name = v,
dmgtype = DMG_BULLET,
tracer = TRACER_LINE_AND_WHIZ
})
if CLIENT then
language.Add( v .. "_ammo", k )
end
end

148
lua/autorun/game_hl2.lua Normal file
View File

@@ -0,0 +1,148 @@
--[[
| 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 Category = ""
local function ADD_ITEM( name, class, offset, extras, classOverride )
local base = { PrintName = name, ClassName = class, Category = Category, NormalOffset = offset or 32, DropToFloor = true, Author = "VALVe" }
list.Set( "SpawnableEntities", classOverride or class, table.Merge( base, extras or {} ) )
duplicator.Allow( class )
end
local function ADD_WEAPON( name, class )
list.Set( "Weapon", class, { ClassName = class, PrintName = name, Category = Category, Author = "VALVe", Spawnable = true } )
duplicator.Allow( class )
end
Category = "Half-Life 2"
-- Ammo
ADD_ITEM( "AR2 Ammo", "item_ammo_ar2", -8 )
ADD_ITEM( "AR2 Ammo (Large)", "item_ammo_ar2_large", -8 )
ADD_ITEM( "Pistol Ammo", "item_ammo_pistol", -4 )
ADD_ITEM( "Pistol Ammo (Large)", "item_ammo_pistol_large", -4 )
ADD_ITEM( "357 Ammo", "item_ammo_357", -4 )
ADD_ITEM( "357 Ammo (Large)", "item_ammo_357_large", -4 )
ADD_ITEM( "SMG Ammo", "item_ammo_smg1", -2 )
ADD_ITEM( "SMG Ammo (Large)", "item_ammo_smg1_large", -2 )
ADD_ITEM( "SMG Grenade", "item_ammo_smg1_grenade", -10 )
ADD_ITEM( "Crossbow Bolts", "item_ammo_crossbow", -10 )
ADD_ITEM( "Shotgun Ammo", "item_box_buckshot", -10 )
ADD_ITEM( "AR2 Orb", "item_ammo_ar2_altfire", -2 )
ADD_ITEM( "RPG Rocket", "item_rpg_round", -10 )
-- Dynamic materials; gives player what he needs most (health, shotgun ammo, suit energy, etc)
-- ADD_ITEM( "Dynamic Supplies", "item_dynamic_resupply" )
-- Items
ADD_ITEM( "Suit Battery", "item_battery", -4 )
ADD_ITEM( "Health Kit", "item_healthkit", -8 )
ADD_ITEM( "Health Vial", "item_healthvial", -4 )
ADD_ITEM( "Suit Charger", "item_suitcharger" )
ADD_ITEM( "Health Charger", "item_healthcharger" )
ADD_ITEM( "HEV Suit", "item_suit", 0 )
ADD_ITEM( "Thumper", "prop_thumper" )
ADD_ITEM( "Combine Mine", "combine_mine", -8 )
ADD_ITEM( "Zombine Grenade", "npc_grenade_frag", -8 )
ADD_ITEM( "Helicopter Grenade", "grenade_helicopter", 4 )
if ( IsMounted( "ep2" ) ) then
game.AddParticles( "particles/striderbuster.pcf" )
ADD_ITEM( "Magnusson", "weapon_striderbuster" )
end
-- Weapons
ADD_WEAPON( "Gravity Gun", "weapon_physcannon" )
ADD_WEAPON( "Stunstick", "weapon_stunstick" )
ADD_WEAPON( "Frag Grenade", "weapon_frag" )
ADD_WEAPON( "Crossbow", "weapon_crossbow" )
ADD_WEAPON( "Bug Bait", "weapon_bugbait" )
ADD_WEAPON( "RPG Launcher", "weapon_rpg" )
ADD_WEAPON( "Crowbar", "weapon_crowbar" )
ADD_WEAPON( "Shotgun", "weapon_shotgun" )
ADD_WEAPON( "9mm Pistol", "weapon_pistol" )
ADD_WEAPON( "S.L.A.M", "weapon_slam" )
ADD_WEAPON( "SMG", "weapon_smg1" )
ADD_WEAPON( "Pulse-Rifle", "weapon_ar2" )
ADD_WEAPON( ".357 Magnum", "weapon_357" )
--ADD_WEAPON( "Alyx Gun", "weapon_alyxgun" )
--ADD_WEAPON( "Annabelle", "weapon_annabelle" )
-- NPC Weapons
list.Add( "NPCUsableWeapons", { class = "weapon_pistol", title = "#weapon_pistol", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_357", title = "#weapon_357", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_smg1", title = "#weapon_smg1", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_shotgun", title = "#weapon_shotgun", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_ar2", title = "#weapon_ar2", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_rpg", title = "#weapon_rpg", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_alyxgun", title = "#weapon_alyxgun", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_annabelle", title = "#weapon_annabelle", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_crossbow", title = "#weapon_crossbow", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_stunstick", title = "#weapon_stunstick", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_crowbar", title = "#weapon_crowbar", category = Category } )
if ( IsMounted( "hl1" ) or IsMounted( "hl1mp" ) ) then
Category = "Half-Life: Source"
ADD_WEAPON( "Snarks", "weapon_snark" )
ADD_WEAPON( "Hand Grenade", "weapon_handgrenade" )
ADD_WEAPON( "MP5", "weapon_mp5_hl1" )
ADD_WEAPON( "Hornet Gun", "weapon_hornetgun" )
ADD_WEAPON( "Satchel", "weapon_satchel" )
ADD_WEAPON( "Tripmine", "weapon_tripmine" )
ADD_WEAPON( "Crossbow", "weapon_crossbow_hl1" )
ADD_WEAPON( ".357 Handgun", "weapon_357_hl1" )
ADD_WEAPON( "RPG Launcher", "weapon_rpg_hl1" )
ADD_WEAPON( "SPAS-12", "weapon_shotgun_hl1" )
ADD_WEAPON( "Glock", "weapon_glock_hl1" )
ADD_WEAPON( "Tau Cannon", "weapon_gauss" )
ADD_WEAPON( "Gluon Gun", "weapon_egon" )
ADD_WEAPON( "Crowbar", "weapon_crowbar_hl1" )
ADD_ITEM( "Crossbow Bolts", "ammo_crossbow", 0 )
ADD_ITEM( "Uranium", "ammo_gaussclip", 0 )
ADD_ITEM( "Glock Clip", "ammo_glockclip", 0 )
ADD_ITEM( "MP5 Clip", "ammo_mp5clip", 0 )
ADD_ITEM( "MP5 Ammo Crate", "ammo_9mmbox", 0 )
ADD_ITEM( "MP5 Grenades", "ammo_mp5grenades", 0 )
ADD_ITEM( ".357 Ammo", "ammo_357", 0 )
ADD_ITEM( "RPG Rockets", "ammo_rpgclip", 0 )
ADD_ITEM( "SPAS-12 Ammo", "ammo_buckshot", 0 )
--ADD_ITEM( "Uranium (Egon)", "ammo_egonclip", 0 )
--ADD_ITEM( "MP5 Ammo", "ammo_9mmclip", 0 )
--ADD_ITEM( "MP5 Ammo", "ammo_9mmar", 0 )
--ADD_ITEM( "MP5 Grenade", "ammo_argrenades", 0 )
list.Add( "NPCUsableWeapons", { class = "weapon_357_hl1", title = "#weapon_357_hl1", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_glock_hl1", title = "#weapon_glock_hl1", category = Category } )
list.Add( "NPCUsableWeapons", { class = "weapon_shotgun_hl1", title = "#weapon_shotgun_hl1", category = Category } )
end
if ( IsMounted( "portal" ) ) then
Category = "Portal"
ADD_ITEM( "Curiosity Core", "prop_glados_core", 32, { KeyValues = { CoreType = 0, DelayBetweenLines = 0.4 } }, "prop_glados_core" )
ADD_ITEM( "Anger Core", "prop_glados_core", 32, { KeyValues = { CoreType = 1, DelayBetweenLines = 0.1 } }, "prop_glados_core_anger" )
ADD_ITEM( "Intelligence Core", "prop_glados_core", 32, { KeyValues = { CoreType = 2, DelayBetweenLines = 0.1 } }, "prop_glados_core_crazy" )
ADD_ITEM( "Morality Core", "prop_glados_core", 32, { KeyValues = { CoreType = 3 } }, "prop_glados_core_morality" )
end
Category = "Other"
ADD_WEAPON( "Physics Gun", "weapon_physgun" )

View File

@@ -0,0 +1,12 @@
--[[
| 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/
--]]
AddCSLuaFile( "includes/modules/pon.lua" )
include( "gm_express/sh_init.lua" )

106
lua/autorun/gw_hooks.lua Normal file
View File

@@ -0,0 +1,106 @@
--[[
| 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/
--]]
hook.Add("Initialize", "gw_setup", function()
CreateConVar("gw_strider_health", 700, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines the amount of HP the strider has when spawned, only applies to newly spawned instances")
CreateConVar("gw_hunter_health", 2500, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines the amount of HP the hunter has when spawned, only applies to newly spawned instances")
CreateConVar("gw_harvester_health", 700, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Determines the amount of HP the harvester has when spawned, only applies to newly spawned instances")
end)
GW = {}
function GW.GetStringAttachment(ent, attach)
local id = ent:LookupAttachment(attach)
return ent:GetAttachment(id)
end
if SERVER then
hook.Add("PlayerLeaveVehicle", "gw_eject", function(ply, vehicle)
local ent = vehicle:GetNWEntity("GWEnt")
if IsValid(ent) then
ent:Eject(ply)
end
end)
hook.Add("KeyPress", "gw_keypress", function(ply, key)
local vehicle = ply:GetVehicle()
if not IsValid(vehicle) then
return
end
local ent = vehicle:GetNWEntity("GWEnt")
if IsValid(ent) then
ent:KeyPress(ply, key)
end
end)
end
if CLIENT then
hook.Add("CalcView", "gw_calcview", function(ply, pos, ang, fov)
if ply:GetViewEntity() ~= ply then
return
end
local vehicle = ply:GetVehicle()
if not IsValid(vehicle) then
return
end
local ent = vehicle:GetNWEntity("GWEnt")
if not IsValid(ent) then
return
end
local view = {}
view.origin, view.angles = ent:GetViewData(ply)
return view
end)
hook.Add("HUDPaint", "gw_crosshair", function()
local ply = LocalPlayer()
local vehicle = ply:GetVehicle()
if not IsValid(vehicle) then
return
end
local ent = vehicle:GetNWEntity("GWEnt")
if not IsValid(ent) then
return
end
local x = ScrW() / 2
local y = ScrH() / 2
local gap = 5
local len = gap + 5
local col = Color(255, 0, 0)
if ent:HasLOS() then
col = Color(0, 255, 0)
end
surface.SetDrawColor(col)
surface.DrawLine(x - len, y, x - gap, y)
surface.DrawLine(x + len, y, x + gap, y)
surface.DrawLine(x, y - len, x, y - gap)
surface.DrawLine(x, y + len, x, y + gap)
end)
end

View File

@@ -0,0 +1,355 @@
--[[
| 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/
--]]
if CLIENT then return end
print("Executing Half-Life Resurgence auto replace script...")
-- https://developer.valvesoftware.com/wiki/Half-Life.fgd
-- https://developer.valvesoftware.com/wiki/Half_Life_2.fgd
local replaceTbl_Entities = {
-- Half-Life 1 --
["monster_alien_grunt"] = "npc_vj_hlr1_aliengrunt",
["monster_nihilanth"] = "npc_vj_hlr1_nihilanth",
["monster_tentacle"] = "npc_vj_hlr1_tentacle",
["monster_alien_slave"] = "npc_vj_hlr1_alienslave",
["monster_bigmomma"] = "npc_vj_hlr1_gonarch",
["monster_bullchicken"] = "npc_vj_hlr1_bullsquid",
["monster_gargantua"] = "npc_vj_hlr1_garg",
["monster_human_assassin"] = "npc_vj_hlr1_assassin_female",
["monster_babycrab"] = "npc_vj_hlr1_headcrab_baby",
-- ["monster_human_grunt"] = {"npc_vj_hlr1_hgrunt","npc_vj_hlrof_hgrunt","npc_vj_hlrof_hgrunt_med","npc_vj_hlrof_hgrunt_eng"},
["monster_human_grunt"] = "npc_vj_hlr1_hgrunt",
["monster_cockroach"] = "npc_vj_hlr1_cockroach",
["monster_houndeye"] = "npc_vj_hlr1_houndeye",
["monster_scientist"] = "npc_vj_hlr1_scientist",
["monster_sitting_scientist"] = "npc_vj_hlr1_scientist",
["monster_snark"] = "npc_vj_hlr1_snark",
["monster_zombie"] = {"npc_vj_hlr1_zombie","npc_vj_hlr1_zombie","npc_vj_hlr1_zombie","npc_vj_hlrof_zombie_sec","npc_vj_hlrof_zombie_sec","npc_vj_hlrof_zombie_soldier"},
["monster_headcrab"] = "npc_vj_hlr1_headcrab",
["monster_alien_controller"] = "npc_vj_hlr1_aliencontroller",
["monster_barney"] = "npc_vj_hlr1_securityguard",
["monster_turret"] = "npc_vj_hlr1_turret",
["monster_miniturret"] = "npc_vj_hlr1_turret_small",
["monster_sentry"] = "npc_vj_hlr1_sentry",
["monster_barnacle"] = "npc_vj_hlr1_barnacle",
["monster_ichthyosaur"] = "npc_vj_hlr1_ichthyosaur",
["monster_gman"] = "npc_vj_hlr1_gman",
["monster_apache"] = "npc_vj_hlr1_apache",
["monster_osprey"] = "npc_vj_hlr1_osprey",
["monster_turret"] = "npc_vj_hlr1_cturret",
["monster_miniturret"] = "npc_vj_hlr1_cturret_mini",
-- Half-Life 2 --
["npc_advisor"] = "npc_vj_hlr2_com_advisor",
["npc_alyx"] = "npc_vj_hlr2_alyx",
["npc_antlion"] = "npc_vj_hlr2_antlion",
["npc_antlion_worker"] = "npc_vj_hlr2_antlion_worker",
["npc_antlionguard"] = "npc_vj_hlr2_antlion_guard",
["npc_barney"] = "npc_vj_hlr2_barney",
["npc_citizen"] = "npc_vj_hlr2_citizen",
["npc_combine_s"] = "npc_vj_hlr2_com_soldier",
["npc_combinegunship"] = "npc_vj_hlr2_com_gunship",
["npc_crabsynth"] = "npc_vj_hlr2_com_crab",
["npc_fastzombie"] = "npc_vj_hlr2_zombie_fast",
["npc_gman"] = "npc_vj_hlr2_gman",
["npc_headcrab"] = "npc_vj_hlr2_headcrab",
["npc_headcrab_black"] = "npc_vj_hlr2_headcrab_poison",
["npc_headcrab_fast"] = "npc_vj_hlr2_headcrab_fast",
["npc_helicopter"] = "npc_vj_hlr2_com_chopper",
["npc_hunter"] = "npc_vj_hlr2_com_hunter",
["npc_metropolice"] = "npc_vj_hlr2_com_civilp",
["npc_monk"] = "npc_vj_hlr2_father_grigori",
["npc_mortarsynth"] = "npc_vj_hlr2_com_mortar",
["npc_poisonzombie"] = "npc_vj_hlr2_zombie_poison",
["npc_sniper"] = "npc_vj_hlr2_com_sniper",
["npc_stalker"] = "npc_vj_hlr2_com_stalker",
["npc_strider"] = "npc_vj_hlr2_com_strider",
["npc_turret_ceiling"] = "npc_vj_hlr2_com_ceilingturret",
["npc_turret_floor"] = "npc_vj_hlr2_com_sentry",
["npc_zombie"] = "npc_vj_hlr2_zombie",
["npc_zombine"] = "npc_vj_hlr2_zombine",
["prop_vehicle_apc"] = "npc_vj_hlr2_com_apc",
}
local replaceTbl_Weapons = {
-- Half-Life 2 --
["weapon_357"] = "weapon_vj_357",
["weapon_alyxgun"] = "weapon_vj_hlr2_alyxgun",
["weapon_annabelle"] = "weapon_vj_hlr2_annabelle",
["weapon_ar2"] = "weapon_vj_ar2",
["weapon_crossbow"] = "weapon_vj_crossbow",
["weapon_crowbar"] = "weapon_vj_crowbar",
["weapon_pistol"] = "weapon_vj_9mmpistol",
["weapon_rpg"] = "weapon_vj_hlr2_rpg",
["weapon_shotgun"] = "weapon_vj_spas12",
["weapon_smg1"] = "weapon_vj_smg1",
["weapon_stunstick"] = "weapon_vj_hlr2_stunstick"
}
local essentialTbl = { -- Will expand upon this later, I recommend we add support for custom HLR packs to add their own data to the auto-replace script (Example: Half-Life 2 HLR pack adding Kleiner or Breen to the auto-script)
-- Half-Life 2 --
npc_vj_hlr2_alyx=true,
npc_vj_hlr2_barney=true,
npc_vj_hlr2_father_grigori=true,
}
-- Before Create
local replaceOptions = {
-- If its an antlion guardian, then make sure to spawn that variant!
["npc_antlionguard"] = function(ent, replaceEnt)
return (ent:GetSkin() == 0 and "npc_vj_hlr2_antlion_guard") or "npc_vj_hlr2_antlion_guardian"
end,
-- Handle citizen / refugee / rebel variants
["npc_citizen"] = function(ent, replaceEnt)
for key, val in pairs(ent:GetKeyValues()) do
if key == "citizentype" then
if val == 0 or val == 1 then
return "npc_vj_hlr2_citizen"
elseif val == 2 then
return "npc_vj_hlr2_refugee"
elseif val == 3 or val == 4 then
return "npc_vj_hlr2_rebel"
end
end
end
end,
-- Handle combine soldier variants
["npc_combine_s"] = function(ent, replaceEnt)
local mdl = ent:GetModel()
if mdl == "models/combine_soldier.mdl" then
return (ent:GetSkin() == 0 and "npc_vj_hlr2_com_soldier") or "npc_vj_hlr2_com_shotgunner"
elseif mdl == "models/combine_soldier_prisonguard.mdl" then
return (ent:GetSkin() == 0 and "npc_vj_hlr2_com_prospekt") or "npc_vj_hlr2_com_prospekt_sg"
elseif mdl == "models/combine_super_soldier.mdl" then
return "npc_vj_hlr2_com_elite"
end
end,
-- Check for resistance turrets!
["npc_turret_floor"] = function(ent, replaceEnt)
return ent:HasSpawnFlags(SF_FLOOR_TURRET_CITIZEN) and "npc_vj_hlr2_res_sentry" or "npc_vj_hlr2_com_sentry"
end
}
-- Before Spawn
local replacePreSpawn = {
["npc_citizen"] = function(ent, newEnt)
if string.find(ent:GetModel(), "female") then
newEnt.Human_Gender = 1
else
newEnt.Human_Gender = 0
end
end,
["npc_metropolice"] = function(ent, newEnt)
for key, val in pairs(ent:GetKeyValues()) do
if key == manhacks && val == 0 then
newEnt.Metrocop_CanHaveManhack = false
end
end
end,
}
-- After Spawn
local afterSpawned = {
}
// lua_run PrintTable(Entity(1):GetEyeTrace().Entity:GetTable())
local defPos = Vector(0, 0, 0)
local gStatePrecriminal = false
local gStateAntlionFri = false
-- Prepare the HL1 and HL2 tables (This includes ALL NPCs!)
local allNPCs = list.Get("NPC")
local allHLR = {}
local allHLR1 = {}
local allHLR2 = {}
timer.Simple(0.01, function()
for k, _ in pairs(allNPCs) do
-- This should capture all the HL2 NPCs
if string.StartWith(k, "npc_vj_hlr2") then
table.insert(allHLR, k)
table.insert(allHLR2, k)
-- This should capture all the HL1 NPCs because many of them are "hlrof", "hlr1", "hlrsv", "hlrdc", etc.
elseif string.StartWith(k, "npc_vj_hlr") then
table.insert(allHLR, k)
table.insert(allHLR1, k)
end
end
end)
hook.Add("OnEntityCreated", "VJ_HLR_AutoReplace_EntCreate", function(ent)
local class = ent:GetClass()
local rEnt = VJ_PICK(replaceTbl_Entities[class])
if rEnt then
-- Make sure the game is loaded
if game && game.GetGlobalState then
gStatePrecriminal = game.GetGlobalState("gordon_precriminal") == 1
end
-- Check if it's HL1 & HL2 and stop if it's not supposed to continue
local isHL1 = string.StartWith(class, "monster_")
if isHL1 then
if GetConVar("vj_hlr_autoreplace_hl1"):GetInt() == 0 then
return
end
elseif GetConVar("vj_hlr_autoreplace_hl2"):GetInt() == 0 then
return
end
timer.Simple(0.01, function()
if IsValid(ent) then
local worldName = ent.GetName && ent:GetName() or nil
//if worldName == "rocketman" then return end -- Makes Odessa work a little bit
//local spawnAnim = ent:GetSequenceName(ent:GetSequence())
-- Spawn the correct entity (Ex: different combine or rebels/citizens)
if replaceOptions[class] then
rEnt = replaceOptions[class](ent, rEnt) or rEnt
end
-- FUN OPTION: Randomized NPC System
if GetConVar("vj_hlr_autoreplace_random"):GetInt() == 1 then
if GetConVar("vj_hlr_autoreplace_randommix"):GetInt() == 1 then
rEnt = VJ_PICK(allHLR) or rEnt
else
if isHL1 then
rEnt = VJ_PICK(allHLR1) or rEnt
else
rEnt = VJ_PICK(allHLR2) or rEnt
end
end
end
-- Start the actual final entity --
local newClass = VJ_PICK(rEnt)
local newEnt = ents.Create(newClass)
if !IsValid(newEnt) then MsgN("Entity [" .. newClass .. "] not valid (missing pack?), keeping original entity") return end
-- Certain entities need some checks before spawn (Ex: Citizen gender)
if replacePreSpawn[class] then
replacePreSpawn[class](ent, newEnt)
end
newEnt:SetPos(ent:GetPos() + Vector(0, 0, (class == "monster_barnacle" && -1) or 4))
newEnt:SetAngles(ent:GetAngles())
if IsValid(ent:GetParent()) then newEnt:SetParent(ent:GetParent()) end
if worldName && worldName != "" then newEnt:SetName(worldName) end
newEnt:Spawn()
newEnt:Activate()
-- Handle naming
if worldName && worldName != "" then -- Scripted NPC
newEnt.DisableWandering = true
end
-- Handle weapon
local wep = ent.GetActiveWeapon && ent:GetActiveWeapon() or false -- In case GetActiveWeapon is not in the ent's metatable
//print(worldName, wep)
if IsValid(wep) then
local foundWep = replaceTbl_Weapons[wep:GetClass()]
newEnt:Give(VJ_PICK(foundWep))
end
-- Handle enemy
local ene = ent.GetEnemy && ent:GetEnemy() or false -- In case GetEnemy is not in the ent's metatable
if IsValid(ene) then
newEnt:SetEnemy(ene)
end
-- Handle key values
for key, val in pairs(ent:GetSaveTable()) do
//print(ent, newEnt, key, val)
key = tostring(key)
if key == "health" then
newEnt:SetHealth(val)
elseif key == "max_health" then
newEnt:SetMaxHealth(val)
-- elseif key == "m_bSequenceLoops" && val == true && newEnt:GetInternalVariable("sequence") != -1 then
-- newEnt.Old_AnimTbl_IdleStand = newEnt.AnimTbl_IdleStand
-- newEnt.AnimTbl_IdleStand = {VJ_SequenceToActivity(newEnt,newEnt:GetInternalVariable("sequence"))}
-- newEnt:SetState(VJ_STATE_ONLY_ANIMATION_NOATTACK)
-- newEnt:VJ_ACT_PLAYACTIVITY(newEnt:GetInternalVariable("sequence"),true,false,false)
elseif key == "m_vecLastPosition" then
if val != defPos then
newEnt:SetLastPosition(val)
newEnt:VJ_TASK_GOTO_LASTPOS("TASK_WALK_PATH")
end
elseif key == "m_bShouldPatrol" && val == false then
newEnt.DisableWandering = true
-- Not what I thought it was, actual variable is m_LookDist using the function SetDistLook
-- Which both of them can't be accessed in Lua...
//elseif key == "m_flDistTooFar" then
//newEnt.SightDistance = val
end
end
//newEnt.SightDistance = 2048 -- Default Source engine sight distance...
-- Handle spawn flags
//if ent:HasSpawnFlags(SF_NPC_LONG_RANGE) then
//newEnt.SightDistance = 6000
//end
newEnt:SetKeyValue("spawnflags", ent:GetSpawnFlags())
if ent:HasSpawnFlags(SF_CITIZEN_NOT_COMMANDABLE) then
newEnt.FollowPlayer = false
end
//print(ent:GetInternalVariable("m_bShouldPatrol"))
-- Handle Gordon precriminal game state
if gStatePrecriminal == true then -- Toggles friendly-AI for the intro of Half-Life 2
//newEnt.DisableWandering = true
newEnt.DisableFindEnemy = true
newEnt.DisableMakingSelfEnemyToNPCs = true
newEnt.FriendsWithAllPlayerAllies = true
newEnt.FollowPlayer = false
newEnt.Behavior = VJ_BEHAVIOR_PASSIVE
newEnt.VJ_AutoScript_OldClass = newEnt.VJ_NPC_Class
newEnt.VJ_NPC_Class = {"CLASS_PLAYER_ALLY", "CLASS_COMBINE"}
newEnt.VJ_AutoScript_Reset = true
end
-- Things to run after it's fully spawned (EX: Turret sight distance)
if afterSpawned[rEnt] then
afterSpawned[rEnt](ent, newEnt)
end
-- Handle Essential NPCs
if GetConVar("vj_hlr_autoreplace_essential"):GetInt() == 1 && essentialTbl[newClass] then
newEnt.GodMode = true
end
-- FUN OPTION: Make them all allied together against players
if GetConVar("vj_hlr_autoreplace_alliedagainstply"):GetInt() == 1 then
newEnt.VJ_NPC_Class = {"CLASS_HALF_LIFE_AGAINST_PLAYERS"}
end
-- print(ent:GetClass(), ent:GetInternalVariable("GameEndAlly"))
-- Set the starting animation AND velocity
local vel = ent:GetVelocity()
timer.Simple(0.01, function()
if IsValid(newEnt) then
//newEnt:VJ_ACT_PLAYACTIVITY(spawnAnim, true, false, false)
if vel:Length() > 0 then
newEnt:SetGroundEntity(NULL)
newEnt:SetVelocity(vel)
end
end
end)
undo.ReplaceEntity(ent, newEnt)
ent:Remove()
end
end)
end
end)
hook.Add("Think", "VJ_HLR_AutoReplace_Think", function()
-- Make sure the game is loaded
if game && game.GetGlobalState then
gStatePrecriminal = game.GetGlobalState("gordon_precriminal") == 1
gStateAntlionFri = game.GetGlobalState("antlion_allied") == 1
end
for _,v in ipairs(ents.GetAll()) do
if v:IsNPC() then
if !gStatePrecriminal && v.VJ_AutoScript_Reset then
v.VJ_NPC_Class = v.VJ_AutoScript_OldClass
v.VJ_AutoScript_Reset = false
end
if gStateAntlionFri && v.VJ_HLR_Antlion then
table.insert(v.VJ_NPC_Class,"CLASS_PLAYER_ALLY")
v.PlayerFriendly = true
v.FriendsWithAllPlayerAllies = true
end
end
end
end)

View File

@@ -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/
--]]
player_manager.AddValidModel( "Combine Heavy JQ", "models/jq/hlvr/characters/combine/heavy/combine_heavy_hlvr_player.mdl" )
list.Set( "PlayerOptionsModel", "Combine Heavy JQ", "models/jq/hlvr/characters/combine/heavy/combine_heavy_hlvr_player.mdl" )
player_manager.AddValidHands( "Combine Heavy JQ", "models/weapons/c_arms_combine.mdl", 0, "00000000" )
player_manager.AddValidModel( "Combine Suppressor JQ", "models/jq/hlvr/characters/combine/suppressor/combine_suppressor_hlvr_player.mdl" )
list.Set( "PlayerOptionsModel", "Combine Suppressor JQ", "models/jq/hlvr/characters/combine/suppressor/combine_suppressor_hlvr_player.mdl" )
player_manager.AddValidHands( "Combine Suppressor JQ", "models/weapons/c_arms_combine.mdl", 0, "00000000" )
player_manager.AddValidModel( "Combine Grunt JQ", "models/jq/hlvr/characters/combine/grunt/combine_grunt_hlvr_player.mdl" )
list.Set( "PlayerOptionsModel", "Combine Grunt JQ", "models/jq/hlvr/characters/combine/grunt/combine_grunt_hlvr_player.mdl" )
player_manager.AddValidHands( "Combine Grunt JQ", "models/weapons/c_arms_combine.mdl", 0, "00000000" )
player_manager.AddValidModel( "Combine Captain JQ", "models/jq/hlvr/characters/combine/combine_captain/combine_captain_hlvr_player.mdl" )
list.Set( "PlayerOptionsModel", "Combine Captain JQ", "models/jq/hlvr/characters/combine/combine_captain/combine_captain_hlvr_player.mdl" )
player_manager.AddValidHands( "Combine Captain JQ", "models/weapons/c_arms_combine.mdl", 0, "00000000" )

View File

@@ -0,0 +1,53 @@
--[[
| 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 Category = "Half-Life: Alyx - Combine Soldiers"
local NPC = {
Name = "Combine Heavy",
Class = "npc_combine_s",
KeyValues = { citizentype = 4 },
Model = "models/jq/hlvr/characters/combine/heavy/combine_heavy_hlvr_npc.mdl",
Health = "100",
Category = Category
}
list.Set( "NPC", "npc_hlvr_heavy_jq", NPC )
local Category = "Half-Life: Alyx - Combine Soldiers"
local NPC = {
Name = "Combine Grunt",
Class = "npc_combine_s",
KeyValues = { citizentype = 4 },
Model = "models/jq/hlvr/characters/combine/grunt/combine_grunt_hlvr_npc.mdl",
Health = "100",
Category = Category
}
list.Set( "NPC", "npc_hlvr_grunt_jq", NPC )
local Category = "Half-Life: Alyx - Combine Soldiers"
local NPC = {
Name = "Combine Suppressor",
Class = "npc_combine_s",
KeyValues = { citizentype = 1 },
Model = "models/jq/hlvr/characters/combine/suppressor/combine_suppressor_hlvr_npc.mdl",
Health = "100",
Category = Category
}
list.Set( "NPC", "npc_hlvr_suppressor_jq", NPC )
local Category = "Half-Life: Alyx - Combine Soldiers"
local NPC = {
Name = "Combine Captain",
Class = "npc_combine_s",
KeyValues = { citizentype = 4 },
Model = "models/jq/hlvr/characters/combine/combine_captain/combine_captain_hlvr_npc.mdl",
Health = "100",
Category = Category
}
list.Set( "NPC", "npc_hlvr_captain_jq", NPC )

View File

@@ -0,0 +1,27 @@
--[[
| 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/
--]]
--[[
© AsterionStaff 2022.
This script was created from the developers of the AsterionTeam.
You can get more information from one of the links below:
Site - https://asterion.games
Discord - https://discord.gg/CtfS8r5W3M
developer(s):
Selenter - https://steamcommunity.com/id/selenter
——— Chop your own wood and it will warm you twice.
]]--
-- Инклаидаем основной файл
include("imagetool/sh_batch.lua")
AddCSLuaFile("imagetool/sh_batch.lua")

View File

@@ -0,0 +1,217 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("ep1_advisorpod",{
printName="Advisor Pod",
side="hl_combine",
type="phys",
model="models/advisorpod.mdl",
default_rp_cost=12000,
camera={
dist=500
},
health=5,
onlyTakesExplosiveDamage=true,
seqInit="idlefly",
driveType="fly",
driveOptions={
speed=60,
rotation2=90,
rocketMode=true
},
attack={
mode= "trigger",
func= function(ply,ent)
pk_pills.apply(ply,"ep2_advisor")
ent:PillSound("breakout")
end
},
damageFromWater=-1,
sounds={
loop_move="npc/combine_gunship/gunship_engine_loop3.wav",
breakout="ambient/materials/cartrap_explode_impact1.wav"
},
trail={
texture="trails/physbeam.vmt",
width=200
}
})
pk_pills.register("ep1_ministrider",{
printName="Ministrider",
side="hl_combine",
type="ply",
model="models/ministrider.mdl",
default_rp_cost=8000,
camera={
offset=Vector(0,0,100),
dist=150
},
hull=Vector(60,60,100),
anims={
default={
idle="idle1",
walk="walk_all",
run="canter_all",
melee="meleeleft"
}
},
sounds={
melee={"npc/ministrider/alert2.wav","npc/ministrider/alert4.wav"},
melee_hit=pk_pills.helpers.makeList("npc/zombie/claw_strike#.wav",3),
shoot="weapons/ar2/fire1.wav",
step={"npc/ministrider/ministrider_footstep2.wav","npc/ministrider/ministrider_footstep5.wav"}
},
aim={
attachment="MiniGun",
fixTracers=true,
simple=true
},
attack={
mode= "auto",
func=pk_pills.common.shoot,
delay=.1,
damage=10,
spread=.02,
tracer="AR2Tracer"
},
attack2={
mode="trigger",
func = pk_pills.common.melee,
//animCount=3,
delay=1,
range=75,
dmg=75
},
movePoseMode="yaw",
moveSpeed={
walk=200,
run=500
},
jumpPower=0,
health=300,
noFallDamage=true
})
pk_pills.register("ep1_rollermine_orange",{
parent="rollermine",
printName="Orange Rollermine",
side=false,
subMats = {
[0]="models/roller/rollermine_hacked",
[1]="models/roller/rollermine_gloworange"
},
default_rp_cost=4000
})
/*
4 = models/roller/rollermine_gloworange
6 = models/roller/rollermine_glowred
*/
pk_pills.register("ep1_rollermine_red",{
parent="ep1_rollermine_orange",
printName="Red Rollermine",
side="wild",
subMats = {
[0]="models/roller/rollermine_splode",
[1]="models/roller/rollermine_glowred"
},
})
pk_pills.register("ep1_zombine",{
parent="zombie",
printName="Zombine",
model="models/zombie/zombie_soldier.mdl",
default_rp_cost=8000,
anims={
default={
walk="walk_all",
run="run_all",
nade="pullgrenade"
},
nade={
idle="idle_grenade",
walk="walk_all_grenade",
run="run_all_grenade"
}
},
moveSpeed={
run=200
},
sounds={
melee=pk_pills.helpers.makeList("npc/zombine/zombine_charge#.wav",2),
nade=pk_pills.helpers.makeList("npc/zombine/zombine_readygrenade#.wav",2)
},
attack={
func= function(ply,ent,tbl) if !ent.forceAnimSet then pk_pills.common.melee(ply,ent,tbl) end end
},
attack2={
mode="trigger",
func= function(ply,ent)
if !ent.forceAnimSet then
ent:PillAnim("nade",true)
ent:PillSound("nade")
ent.forceAnimSet="nade"
local nade=ents.Create("npc_grenade_frag")
nade:SetPos(ply:GetPos())
nade:SetParent(ent:GetPuppet())
nade:Spawn()
nade:Fire("setparentattachment","grenade_attachment", 0)
nade:Fire("SetTimer","6",0)
nade:CallOnRemove("NadeSplodeKillPlayer",function()
if IsValid(ent) then ply:Kill() end
end)
ent:PillFilterCam(nade)
end
end
}
})
pk_pills.register("ep1_vort_blue",{
parent="vort",
printName="Transcendent Vortigaunt",
visColor=Color(120,70,210),
default_rp_cost=16000,
superpowers=true,
anims={
default={teleport="todefend"}
},
sounds={
ranged_fire="beams/beamstart5.wav",
teleport="ambient/machines/teleport4.wav"
},
reload=function(ply,ent)
if !ply:OnGround() or ent.cloaked then return end
ent:PillAnim("teleport",true)
timer.Simple(1,function()
if !IsValid(ent) then return end
local tracein={}
tracein.maxs=Vector(16,16,72)
tracein.mins=Vector(-16,-16,0)
tracein.start=ply:EyePos()
tracein.endpos=ply:EyePos()+ply:EyeAngles():Forward()*9999
tracein.filter = {ply,ent,ent:GetPuppet()}
local traceout= util.TraceHull(tracein)
ply:SetPos(traceout.HitPos)
ent:PillSound("teleport")
end)
end,
health=1000
})

View File

@@ -0,0 +1,386 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("ep2_hunter",{
printName="Hunter",
side="hl_combine",
type="ply",
model="models/hunter.mdl",
default_rp_cost=9000,
camera={
offset=Vector(0,0,100),
dist=150
},
hull=Vector(60,60,100),
anims={
default={
idle="idle1",
walk="walk_all",
run="canter_all",
jump="jump",
glide="jump_idle",
melee1="meleeleft",
melee2="meleert",
melee3="melee_02"
}
},
sounds={
melee=pk_pills.helpers.makeList("npc/ministrider/hunter_defendstrider#.wav",3),
melee_hit=pk_pills.helpers.makeList("npc/zombie/claw_strike#.wav",3),
shoot="npc/ministrider/ministrider_fire1.wav",
step=pk_pills.helpers.makeList("npc/ministrider/ministrider_footstep#.wav",5)
},
aim={
attachment="MiniGunBase",
simple=true
},
attack={
mode= "auto",
func=function(ply,ent)
ent:PillSound("shoot",true)
local f = ents.Create("hunter_flechette")
f:SetPos(ply:GetShootPos()+ply:EyeAngles():Forward()*80)
f:SetVelocity(ply:EyeAngles():Forward()*2000+VectorRand()*10)
f:SetAngles(ply:EyeAngles())
f:Spawn()
end,
delay=.1
},
attack2={
mode="trigger",
func = pk_pills.common.melee,
animCount=3,
delay=.5,
range=75,
dmg=25
},
movePoseMode="yaw",
moveSpeed={
walk=200,
run=500
},
jumpPower=400,
health=300,
noFallDamage=true
})
pk_pills.register("ep2_antlion_worker",{
parent="antlion",
printName="Antlion Worker",
model="models/antlion_worker.mdl",
default_rp_cost=6000,
options=false,
reload= function(ply,ent)
ent:PillAnim("spit",true)
timer.Simple(.5,function()
if !IsValid(ply) then return end
for i=1,5 do
local n=math.random(3)
local s = ents.Create("grenade_spit")
s:SetPos(ply:GetShootPos()+ply:EyeAngles():Forward()*100+Vector(0,0,50))
s:SetVelocity(ply:EyeAngles():Forward()*800+Vector(0,0,400)+VectorRand()*20)
s:Spawn()
if n==1 then
s:SetModel("models/spitball_medium.mdl")
elseif n==2 then
s:SetModel("models/spitball_small.mdl")
end
end
end)
end,
aim={nocrosshair=false},
anims={
default={
spit="spit"
}
}
})
pk_pills.register("ep2_cturret",{
parent="cturret",
printName="Rebel Turret",
side=false,
default_rp_cost=3000,
options=function() return {
{visMat="models/combine_turrets/floor_turret/floor_turret_citizen"},
{visMat="models/combine_turrets/floor_turret/floor_turret_citizen4"}
} end,
})
pk_pills.register("ep2_guardian",{
parent="antlion_guard",
printName="Ancient Guardian",
default_rp_cost=11000,
visMat="Models/antlion_guard/antlionGuard2",
attack={
dmg=100
},
charge={
dmg=200
}
})
pk_pills.register("ep2_vort_scientist",{
parent="vort",
printName="Vortigaunt Scientist",
model="models/vortigaunt_doctor.mdl",
})
pk_pills.register("ep2_sniper",{
parent="csoldier",
printName="Combine Sniper",
default_rp_cost=7000,
//model="models/Combine_Super_Soldier.mdl",
//ammo={AR2AltFire=6},
//health=300
loadout={"pill_wep_csniper"}
})
pk_pills.register("ep2_inventor",{
printName="The Inventor",
type="ply",
model="models/magnusson.mdl",
default_rp_cost=10000,
anims={
default={
idle="lineidle02",
walk="walk_all",
run="run_all",
crouch="Crouch_idleD",
crouch_walk="Crouch_walk_aLL",
glide="jump_holding_glide",
jump="jump_holding_jump",
g_attack="gesture_shoot_smg1",
g_reload="gesture_reload_smg1"
},
smg={
idle="Idle_SMG1_Aim_Alert",
walk="walkAIMALL1",
run="run_alert_aiming_all",
crouch="crouch_aim_smg1",
crouch_walk="Crouch_walk_aiming_all"
},
ar2={
idle="idle_angry_Ar2",
walk="walkAIMALL1_ar2",
run="run_aiming_ar2_all",
crouch="crouch_aim_smg1",
crouch_walk="Crouch_walk_aiming_all",
g_attack="gesture_shoot_ar2",
g_reload="gesture_reload_ar2"
},
shotgun={
idle="Idle_Angry_Shotgun",
walk="walkAIMALL1_ar2",
run="run_aiming_ar2_all",
crouch="crouch_aim_smg1",
crouch_walk="Crouch_walk_aiming_all",
g_attack="gesture_shoot_shotgun",
g_reload="gesture_reload_ar2"
}
},
aim={
xPose="aim_yaw",
yPose="aim_pitch"
},
moveSpeed={
walk=60,
run=200,
ducked=40
},
loadout={"pill_wep_holstered","weapon_smg1","pill_wep_magnade"},
ammo={SMG1=100},
health=1000,
validHoldTypes={"smg","ar2","shotgun","grenade"},
movePoseMode="yaw"
})
pk_pills.register("ep2_grub",{
printName="Grub",
side="antlion",
type="ply",
model="models/antlion_grub.mdl",
default_rp_cost=400,
camera={
offset=Vector(0,0,5),
dist=80
},
hull=Vector(30,30,15),
anims={},
moveSpeed={
walk=30,
run=60
},
jumpPower=0,
health=20
})
pk_pills.register("ep2_gnome",{
printName="Garden Gnome",
type="ply",
model="models/props_junk/gnome.mdl",
default_rp_cost=1000,
camera={
offset=Vector(0,0,15),
dist=80
},
hull=Vector(10,10,30),
anims={},
moveSpeed={
walk=60,
run=120
},
attack={
mode="trigger",
func=function(ply,ent)
ent:PillSound("laugh")
end
},
sounds={
laugh=pk_pills.helpers.makeList("vo/ravenholm/madlaugh0#.wav",4),
laugh_pitch=140
},
noragdoll=true,
jumpPower=150,
health=80,
noFallDamage=true
})
pk_pills.register("ep2_advisor",{
printName="Enhanced Advisor",
parent="advisor",
model="models/birdbrainswagtrain/episodic/advisor.mdl",
default_rp_cost=10000,
aim={},
attack={
mode="trigger",
func=function(ply,ent)
if ent:GetSequence()!=ent:LookupSequence("idle") then return end
ent:PillAnim("melee",true)
timer.Simple(.7,function()
if !IsValid(ent) then return end
local tr = util.TraceHull({
start=ent:GetPos(),
endpos=ent:GetPos()+ent:GetAngles():Forward()*200,
filter={ent},
mins=Vector(-25,-25,-25),
maxs=Vector(25,25,25)
})
if IsValid(tr.Entity) then
local dmg=DamageInfo()
dmg:SetAttacker(ply)
dmg:SetInflictor(ent)
dmg:SetDamageType(DMG_SLASH)
dmg:SetDamage(50)
tr.Entity:TakeDamageInfo(dmg)
ent:PillSound("hit")
end
end)
timer.Simple(1.2,function()
if !IsValid(ent) then return end
ent:PillAnim("idle",true)
end)
end
},
attack2={
mode="trigger",
func=function(ply,ent)
if ent:GetSequence()!=ent:LookupSequence("idle") then return end
ent:PillAnim("grab",true)
timer.Simple(.7,function()
if !IsValid(ent) then return end
local tr = util.TraceHull({
start=ent:GetPos(),
endpos=ent:GetPos()+ent:GetAngles():Forward()*200,
filter={ent},
mins=Vector(-25,-25,-25),
maxs=Vector(25,25,25)
})
if IsValid(tr.Entity) and not tr.Entity:IsFlagSet(FL_GODMODE) then
local mdl_ent = pk_pills.getMappedEnt(tr.Entity) or tr.Entity
mdl_ent = mdl_ent.subModel or mdl_ent
mdl_ent = mdl_ent.GetPuppet and mdl_ent:GetPuppet() or mdl_ent
if mdl_ent:LookupBone("ValveBiped.Bip01_Spine4") then
local mdl_name = mdl_ent:GetModel()
if tr.Entity:IsPlayer() then
tr.Entity:KillSilent()
else
tr.Entity:Remove()
end
local attachment=ents.Create("pill_attachment_body")
attachment.model = mdl_name
attachment:SetPos(ent:GetPos())
attachment:SetParent(ent)
attachment:Spawn()
ent.brainsucked=true
else
ent.brainsucked=false
end
else
ent.brainsucked=false
end
if !ent.brainsucked then
ent:PillAnim("fail",true)
end
end)
timer.Simple(2.3,function()
if !IsValid(ent) or !ent.brainsucked then return end
ent:PillSound("brainsuck")
local effectdata = EffectData()
effectdata:SetOrigin(ent:LocalToWorld(Vector(75,0,-20)))
effectdata:SetNormal(ent:GetAngles():Forward())
effectdata:SetMagnitude(1)
effectdata:SetScale(10)
effectdata:SetColor(0)
effectdata:SetFlags(3)
util.Effect("bloodspray",effectdata)
end)
timer.Simple(5,function()
if !IsValid(ent) then return end
ent:PillAnim("idle",true)
end)
end
},
reload=function(ply,ent)
local traceres = util.QuickTrace(ent:GetPos(),ply:EyeAngles():Forward()*99999,{ply,ent})
local blast = ents.Create("pill_advisor_blast")
blast:SetPos(traceres.HitPos)
blast:SetOwner(ply)
blast:Spawn()
ent:PillSound("blast")
end,
sounds={
brainsuck="physics/flesh/flesh_squishy_impact_hard3.wav",
blast="npc/advisor/advisor_blast1.wav"
}
})

View File

@@ -0,0 +1,29 @@
--[[
| 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/
--]]
if ( SERVER ) then
-- needed for custom vgui controls in the menu
AddCSLuaFile( "vgui/stackercontrolpresets.lua" )
AddCSLuaFile( "vgui/stackerdnumslider.lua" )
AddCSLuaFile( "vgui/stackerpreseteditor.lua" )
-- convenience modules
AddCSLuaFile( "improvedstacker/improvedstacker.lua" )
AddCSLuaFile( "improvedstacker/localify.lua" )
else
-- needed for custom vgui controls in the menu
include( "vgui/stackercontrolpresets.lua" )
include( "vgui/stackerdnumslider.lua" )
include( "vgui/stackerpreseteditor.lua" )
end

137
lua/autorun/menubar.lua Normal file
View File

@@ -0,0 +1,137 @@
--[[
| 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/
--]]
AddCSLuaFile()
if ( SERVER ) then return end
local checkList = {}
checkList[ "cheat" ] = { tooltip = "#menubar.cheatstip", func = function() return GetConVarNumber( "sv_cheats" ) != 0 end }
checkList[ "cheatSP" ] = { tooltip = "#menubar.cheatstip", func = function() return GetConVarNumber( "sv_cheats" ) != 0 or game.SinglePlayer() end }
checkList[ "host" ] = { tooltip = "#menubar.host_only", func = function() return IsValid( LocalPlayer() ) and LocalPlayer():IsListenServerHost() end }
local function AddCVar( s, checkStr, ... )
local cvar = s:AddCVar( ... )
cvar.OldThink = cvar.Think
cvar.Think = function( se )
se:OldThink()
local checks = string.Split( checkStr, " " )
for k, v in ipairs( checks ) do
if ( checkList[ v ] and !checkList[ v ].func() ) then
se:SetEnabled( false )
se:SetTooltip( checkList[ v ].tooltip )
return
end
end
se:SetEnabled( true )
se:SetTooltip()
end
end
local function AddHostCVar( s, ... ) AddCVar( s, "host", ... ) end
local function AddCheatCVar( s, ... ) AddCVar( s, "cheat", ... ) end
local function AddCheatOrSPCVar( s, ... ) AddCVar( s, "cheatSP host", ... ) end
-- Display options
hook.Add( "PopulateMenuBar", "DisplayOptions_MenuBar", function( menubar )
local m = menubar:AddOrGetMenu( "#menubar.drawing" )
m:AddCVar( "#menubar.drawing.physgun_beam", "physgun_drawbeams", "1", "0" )
m:AddCVar( "#menubar.drawing.physgun_halo", "physgun_halo", "1", "0" )
m:AddCVar( "#menubar.drawing.freeze", "effects_freeze", "1", "0" )
m:AddCVar( "#menubar.drawing.unfreeze", "effects_unfreeze", "1", "0" )
m:AddSpacer()
m:AddCVar( "#menubar.drawing.hud", "cl_drawhud", "1", "0" )
m:AddCVar( "#menubar.drawing.toolhelp", "gmod_drawhelp", "1", "0" )
m:AddCVar( "#menubar.drawing.toolui", "gmod_drawtooleffects", "1", "0" )
m:AddCVar( "#menubar.drawing.world_tooltips", "cl_drawworldtooltips", "1", "0" )
m:AddCVar( "#menubar.drawing.spawn_effect", "cl_drawspawneffect", "1", "0" )
m:AddCVar( "#menubar.drawing.effect_rings", "cl_draweffectrings", "1", "0" )
m:AddCVar( "#menubar.drawing.cameras", "cl_drawcameras", "1", "0" )
m:AddCVar( "#menubar.drawing.thrusters", "cl_drawthrusterseffects", "1", "0" )
m:AddSpacer()
m:AddCVar( "#menubar.drawing.shadows", "r_shadows", "1", "0" )
m:AddCVar( "#menubar.drawing.detailprops", "r_drawdetailprops", "1", "0" )
m:AddSpacer()
m:AddCVar( "#menubar.drawing.showfps", "cl_showfps", "1", "0" )
AddCheatOrSPCVar( m, "#menubar.drawing.minecraftify", "mat_showlowresimage", "1", "0", function() timer.Simple( 0.1, function() RunConsoleCommand( "mat_reloadallmaterials" ) end ) end )
AddCheatCVar( m, "#menubar.drawing.wireframe", "mat_wireframe", "1", "0" )
m:AddSpacer()
m:AddCVar( "#menubar.drawing.hints", "cl_showhints", "1", "0" )
end )
-- AI Options
hook.Add( "PopulateMenuBar", "NPCOptions_MenuBar", function( menubar )
local m = menubar:AddOrGetMenu( "#menubar.npcs" )
AddHostCVar( m, "#menubar.npcs.disableai", "ai_disabled", "1", "0" )
AddHostCVar( m, "#menubar.npcs.ignoreplayers", "ai_ignoreplayers", "1", "0" )
AddHostCVar( m, "#menubar.npcs.keepcorpses", "ai_serverragdolls", "1", "0" )
AddHostCVar( m, "#menubar.npcs.autoplayersquad", "npc_citizen_auto_player_squad", "1", "0" )
local wpns = m:AddSubMenu( "#menubar.npcs.weapon" )
wpns:SetDeleteSelf( false )
wpns:AddCVar( "#menubar.npcs.defaultweapon", "gmod_npcweapon", "" )
wpns:AddCVar( "#menubar.npcs.noweapon", "gmod_npcweapon", "none" )
wpns:AddSpacer()
local groupedWeps = {}
for _, v in pairs( list.Get( "NPCUsableWeapons" ) ) do
local cat = ( v.category or "" ):lower()
groupedWeps[ cat ] = groupedWeps[ cat ] or {}
groupedWeps[ cat ][ v.class ] = language.GetPhrase( v.title )
end
for group, items in SortedPairs( groupedWeps ) do
wpns:AddSpacer()
for class, title in SortedPairsByValue( items ) do
wpns:AddCVar( title, "gmod_npcweapon", class )
end
end
end )
-- Server options
hook.Add( "PopulateMenuBar", "MenuBar_ServerOptions", function( menubar )
local m = menubar:AddOrGetMenu( "#menubar.server" )
AddHostCVar( m, "#utilities.allowcslua", "sv_allowcslua", "1", "0" )
AddHostCVar( m, "#utilities.falldamage", "mp_falldamage", "1", "0" )
AddHostCVar( m, "#utilities.gmod_suit", "gmod_suit", "1", "0" )
AddCheatOrSPCVar( m, "#physcannon_mega_enabled", "physcannon_mega_enabled", "1", "0" )
m:AddSpacer()
AddHostCVar( m, "#enable_weapons", "sbox_weapons", "1", "0" )
AddHostCVar( m, "#allow_god_mode", "sbox_godmode", "1", "0" )
m:AddSpacer()
AddHostCVar( m, "#players_damage_players", "sbox_playershurtplayers", "1", "0" )
AddHostCVar( m, "#allow_noclip", "sbox_noclip", "1", "0" )
AddHostCVar( m, "#bone_manipulate_npcs", "sbox_bonemanip_npc", "1", "0" )
AddHostCVar( m, "#bone_manipulate_players", "sbox_bonemanip_player", "1", "0" )
AddHostCVar( m, "#bone_manipulate_others", "sbox_bonemanip_misc", "1", "0" )
end )

386
lua/autorun/netstream.lua Normal file
View File

@@ -0,0 +1,386 @@
--[[
| 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/
--]]
--A net extension which allows sending large streams of data without overflowing the reliable channel
--Keep it in lua/autorun so it will be shared between addons
AddCSLuaFile()
net.Stream = {}
net.Stream.ReadStreamQueues = {} --This holds a read stream for each player, or one read stream for the server if running on the CLIENT
net.Stream.WriteStreams = {} --This holds the write streams
net.Stream.SendSize = 20000 --This is the maximum size of each stream to send
net.Stream.Timeout = 30 --How long the data should exist in the store without being used before being destroyed
net.Stream.MaxServerReadStreams = 128 --The maximum number of keep-alives to have queued. This should prevent naughty players from flooding the network with keep-alive messages.
net.Stream.MaxServerChunks = 3200 --Maximum number of pieces the stream can send to the server. 64 MB
net.Stream.MaxTries = 3 --Maximum times the client may retry downloading the whole data
net.Stream.MaxKeepalive = 15 --Maximum times the client may request data stay live
net.Stream.ReadStream = {}
--Send the data sender a request for data
function net.Stream.ReadStream:Request()
if self.downloads == net.Stream.MaxTries * self.numchunks then self:Remove() return end
self.downloads = self.downloads + 1
-- print("Requesting",self.identifier,false,false,#self.chunks)
net.Start("NetStreamRequest")
net.WriteUInt(self.identifier, 32)
net.WriteBit(false)
net.WriteBit(false)
net.WriteUInt(#self.chunks, 32)
if CLIENT then net.SendToServer() else net.Send(self.player) end
timer.Create("NetStreamReadTimeout" .. self.identifier, net.Stream.Timeout/2, 1, function() self:Request() end)
end
--Received data so process it
function net.Stream.ReadStream:Read(size)
timer.Remove("NetStreamReadTimeout" .. self.identifier)
local progress = net.ReadUInt(32)
if self.chunks[progress] then return end
local crc = net.ReadString()
local data = net.ReadData(size)
if crc == util.CRC(data) then
self.chunks[progress] = data
else
pac.Message("net.Stream.ReadStream:Read(): hash received and hash of chunk do not match match")
end
if #self.chunks == self.numchunks then
self.returndata = table.concat(self.chunks)
if self.compressed then
self.returndata = util.Decompress(self.returndata)
if not self.returndata then
pac.Message("net.Stream.ReadStream:Read(): Failed to decompress data")
end
end
self:Remove()
else
self:Request()
end
end
--Gets the download progress
function net.Stream.ReadStream:GetProgress()
return #self.chunks/self.numchunks
end
--Pop the queue and start the next task
function net.Stream.ReadStream:Remove()
local ok, err = xpcall(self.callback, debug.traceback, self.returndata)
if not ok then ErrorNoHalt(err) end
net.Start("NetStreamRequest")
net.WriteUInt(self.identifier, 32)
net.WriteBit(false)
net.WriteBit(true)
if CLIENT then net.SendToServer() else net.Send(self.player) end
timer.Remove("NetStreamReadTimeout" .. self.identifier)
timer.Remove("NetStreamKeepAlive" .. self.identifier)
if self == self.queue[1] then
table.remove(self.queue, 1)
local nextInQueue = self.queue[1]
if nextInQueue then
timer.Remove("NetStreamKeepAlive" .. nextInQueue.identifier)
nextInQueue:Request()
else
net.Stream.ReadStreamQueues[self.player] = nil
end
else
for k, v in ipairs(self.queue) do
if v == self then
table.remove(self.queue, k)
break
end
end
end
end
net.Stream.ReadStream.__index = net.Stream.ReadStream
net.Stream.WriteStream = {}
-- The player wants some data
function net.Stream.WriteStream:Write(ply)
local progress = net.ReadUInt(32)+1
local chunk = self.chunks[progress]
if chunk then
self.clients[ply].progress = progress
net.Start("NetStreamDownload")
net.WriteUInt(#chunk.data, 32)
net.WriteUInt(progress, 32)
net.WriteString(chunk.crc)
net.WriteData(chunk.data, #chunk.data)
if CLIENT then net.SendToServer() else net.Send(ply) end
end
end
-- The player notified us they finished downloading or cancelled
function net.Stream.WriteStream:Finished(ply)
self.clients[ply].finished = true
if self.callback then
local ok, err = xpcall(self.callback, debug.traceback, ply)
if not ok then ErrorNoHalt(err) end
end
end
-- Get player's download progress
function net.Stream.WriteStream:GetProgress(ply)
return self.clients[ply].progress / #self.chunks
end
-- If the stream owner cancels it, notify everyone who is subscribed
function net.Stream.WriteStream:Remove()
local sendTo = {}
for ply, client in pairs(self.clients) do
if not client.finished then
client.finished = true
if ply:IsValid() then sendTo[#sendTo+1] = ply end
end
end
net.Start("NetStreamDownload")
net.WriteUInt(0, 32)
net.WriteUInt(self.identifier, 32)
if SERVER then net.Send(sendTo) else net.SendToServer() end
net.Stream.WriteStreams[self.identifier] = nil
end
net.Stream.WriteStream.__index = net.Stream.WriteStream
--Store the data and write the file info so receivers can request it.
local identifier = 1
function net.WriteStream(data, callback, dontcompress)
if not isstring(data) then
error("bad argument #1 to 'WriteStream' (string expected, got " .. type(data) .. ")", 2)
end
if callback ~= nil and not isfunction(callback) then
error("bad argument #2 to 'WriteStream' (function expected, got " .. type(callback) .. ")", 2)
end
local compressed = not dontcompress
if compressed then
data = util.Compress(data) or ""
end
if #data == 0 then
net.WriteUInt(0, 32)
return
end
local numchunks = math.ceil(#data / net.Stream.SendSize)
if CLIENT and numchunks > net.Stream.MaxServerChunks then
ErrorNoHalt("net.WriteStream request is too large! ", #data/1048576, "MiB")
net.WriteUInt(0, 32)
return
end
local chunks = {}
for i=1, numchunks do
local datachunk = string.sub(data, (i - 1) * net.Stream.SendSize + 1, i * net.Stream.SendSize)
chunks[i] = {
data = datachunk,
crc = util.CRC(datachunk),
}
end
local startid = identifier
while net.Stream.WriteStreams[identifier] do
identifier = identifier % 1024 + 1
if identifier == startid then
ErrorNoHalt("Netstream is full of WriteStreams!\n" .. debug.traceback() .. "\n")
net.WriteUInt(0, 32)
return
end
end
local stream = {
identifier = identifier,
chunks = chunks,
compressed = compressed,
numchunks = numchunks,
callback = callback,
clients = setmetatable({},{__index = function(t,k)
local r = {
finished = false,
downloads = 0,
keepalives = 0,
progress = 0,
} t[k]=r return r
end})
}
setmetatable(stream, net.Stream.WriteStream)
net.Stream.WriteStreams[identifier] = stream
timer.Create("NetStreamWriteTimeout" .. identifier, net.Stream.Timeout, 1, function() stream:Remove() end)
net.WriteUInt(numchunks, 32)
net.WriteUInt(identifier, 32)
net.WriteBool(compressed)
return stream
end
--If the receiver is a player then add it to a queue.
--If the receiver is the server then add it to a queue for each individual player
function net.ReadStream(ply, callback)
if CLIENT then
ply = NULL
else
if type(ply) ~= "Player" then
error("bad argument #1 to 'ReadStream' (Player expected, got " .. type(ply) .. ")", 2)
elseif not ply:IsValid() then
error("bad argument #1 to 'ReadStream' (Tried to use a NULL entity!)", 2)
end
end
if not isfunction(callback) then
error("bad argument #2 to 'ReadStream' (function expected, got " .. type(callback) .. ")", 2)
end
local queue = net.Stream.ReadStreamQueues[ply]
if queue then
if SERVER and #queue == net.Stream.MaxServerReadStreams then
ErrorNoHalt("Receiving too many ReadStream requests from ", ply)
return
end
else
queue = {} net.Stream.ReadStreamQueues[ply] = queue
end
local numchunks = net.ReadUInt(32)
if numchunks == nil then
return
elseif numchunks == 0 then
local ok, err = xpcall(callback, debug.traceback, "")
if not ok then ErrorNoHalt(err) end
return
end
if SERVER and numchunks > net.Stream.MaxServerChunks then
ErrorNoHalt("ReadStream requests from ", ply, " is too large! ", numchunks * net.Stream.SendSize / 1048576, "MiB")
return
end
local identifier = net.ReadUInt(32)
local compressed = net.ReadBool()
--print("Got info", numchunks, identifier, compressed)
for _, v in ipairs(queue) do
if v.identifier == identifier then
ErrorNoHalt("Tried to start a new ReadStream for an already existing stream!\n" .. debug.traceback() .. "\n")
return
end
end
local stream = {
identifier = identifier,
chunks = {},
compressed = compressed,
numchunks = numchunks,
callback = callback,
queue = queue,
player = ply,
downloads = 0
}
setmetatable(stream, net.Stream.ReadStream)
queue[#queue + 1] = stream
if #queue > 1 then
timer.Create("NetStreamKeepAlive" .. identifier, net.Stream.Timeout / 2, 0, function()
net.Start("NetStreamRequest")
net.WriteUInt(identifier, 32)
net.WriteBit(true)
if CLIENT then net.SendToServer() else net.Send(ply) end
end)
else
stream:Request()
end
return stream
end
if SERVER then
util.AddNetworkString("NetStreamRequest")
util.AddNetworkString("NetStreamDownload")
end
--Stream data is requested
net.Receive("NetStreamRequest", function(len, ply)
local identifier = net.ReadUInt(32)
local stream = net.Stream.WriteStreams[identifier]
if stream then
ply = ply or NULL
local client = stream.clients[ply]
if not client.finished then
local keepalive = net.ReadBit() == 1
if keepalive then
if client.keepalives < net.Stream.MaxKeepalive then
client.keepalives = client.keepalives + 1
timer.Adjust("NetStreamWriteTimeout" .. identifier, net.Stream.Timeout, 1)
end
else
local completed = net.ReadBit() == 1
if completed then
stream:Finished(ply)
else
if client.downloads < net.Stream.MaxTries * #stream.chunks then
client.downloads = client.downloads + 1
stream:Write(ply)
timer.Adjust("NetStreamWriteTimeout" .. identifier, net.Stream.Timeout, 1)
else
client.finished = true
end
end
end
end
end
end)
--Download the stream data
net.Receive("NetStreamDownload", function(len, ply)
ply = ply or NULL
local queue = net.Stream.ReadStreamQueues[ply]
if queue then
local size = net.ReadUInt(32)
if size > 0 then
queue[1]:Read(size)
else
local id = net.ReadUInt(32)
for k, v in ipairs(queue) do
if v.identifier == id then
v:Remove()
break
end
end
end
end
end)

View File

@@ -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/
--]]
-- Post Init. This is to stop using traces and other functions, as they can cause a crash if used before.
if not _NIKNAKS_POSTENTITY then
hook.Add("InitPostEntity","NikNaks_InitPostEntity", function()
_NIKNAKS_POSTENTITY = true
if _MODULES["niknaks"] then
hook.Run("NikNaks._LoadPathOptions")
end
hook.Remove("InitPostEntity","NikNaks_InitPostEntity")
end)
end

51
lua/autorun/nmrihammo.lua Normal file
View 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/
--]]
if SERVER then AddCSLuaFile() end
game.AddAmmoType({name = "nmrih_flare"})
if CLIENT then
language.Add("nmrih_flare_ammo","Flares")
end
game.AddAmmoType({name = "gasoline"})
if CLIENT then
language.Add("gasoline_ammo","Gasoline")
end
game.AddAmmoType({name = "tnt"})
if CLIENT then
language.Add("tnt_ammo","TNT")
end
game.AddAmmoType({name = "frag"})
if CLIENT then
language.Add("frag_ammo","Fragmentation Grenades")
end
game.AddAmmoType({name = "molly"})
if CLIENT then
language.Add("molly_ammo","Molotov Cocktails")
end
game.AddAmmoType({name = "co2"})
if CLIENT then
language.Add("co2_ammo","Carbon Dioxide")
end
game.AddAmmoType({name = "propane"})
if CLIENT then
language.Add("propane_ammo","Propane")
end
game.AddAmmoType({name = "lighter"})
if CLIENT then
language.Add("lighter_ammo","Lighters")
end

175
lua/autorun/nmrihcvars.lua Normal file
View File

@@ -0,0 +1,175 @@
--[[
| 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/
--]]
if SERVER then AddCSLuaFile() end
if CLIENT then
local function tfaNMRIHOptionServer(panel)
--Here are whatever default categories you want.
local tfaOptionNMRIHSV = {Options = {}, CVars = {}, Label = "#Presets", MenuButton = "1", Folder = "TFA NRMIH Settings Server"}
tfaOptionNMRIHSV.Options["#Default"] = {
sv_tfa_nmrih_flashlight_required = "0",
sv_tfa_nmrih_fx_fext_override = "-1",
sv_tfa_nmrih_fx_tnt = "1",
sv_tfa_nmrih_melee_multiplier = "1"
}
panel:AddControl("ComboBox", tfaOptionNMRIHSV)
panel:AddControl("CheckBox", {
Label = "Require flashlight to be held",
Command = "sv_tfa_nmrih_flashlight_required",
})
panel:AddControl("CheckBox", {
Label = "Enable TNT FX",
Command = "sv_tfa_nmrih_fx_tnt",
})
panel:AddControl("Slider", {
Label = "Override CL Extinguisher FX (-1 = Clientside)",
Command = "sv_tfa_nmrih_fx_fext_override",
Type = "Integer",
Min = "-1",
Max = "1",
})
panel:AddControl("Slider", {
Label = "Melee Damage Multiplier",
Command = "sv_tfa_nmrih_melee_multiplier",
Type = "Float",
Min = "0",
Max = "5",
})
panel:AddControl("Label", {Text = "By TheForgottenArchitect"})
end
local function tfaNMRIHOptionClient(panel)
--Here are whatever default categories you want.
local tfaOptionNMRIHCL = {Options = {}, CVars = {}, Label = "#Presets", MenuButton = "1", Folder = "TFA NRMIH Settings Server"}
tfaOptionNMRIHCL.Options["#Default"] = {
cl_tfa_nmrih_fx_fext = "1"
}
panel:AddControl("ComboBox", tfaOptionNMRIHCL)
panel:AddControl("CheckBox", {
Label = "Enable Fire Extinguisher FX",
Command = "cl_tfa_nmrih_fx_fext",
})
panel:AddControl("Label", {Text = "By TheForgottenArchitect"})
end
function tfaNMRIHAddOption()
spawnmenu.AddToolMenuOption("Options", "TFA SWEP Base Settings", "TFANMRIHServer", "NMRIH Server", "", "", tfaNMRIHOptionServer)
spawnmenu.AddToolMenuOption("Options", "TFA SWEP Base Settings", "TFANMRIHClient", "NMRIH Client", "", "", tfaNMRIHOptionClient)
end
hook.Add("PopulateToolMenu", "tfaNMRIHAddOption", tfaNMRIHAddOption)
end
local flashlightvar = GetConVar("sv_tfa_nmrih_flashlight_required")
if flashlightvar == nil then
flashlightvar = CreateConVar("sv_tfa_nmrih_flashlight_required", "0", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Require flashlight to be held?")
--print("Damage Multiplier con var created")
end
if GetConVar("sv_tfa_nmrih_fx_tnt") == nil then
CreateConVar("sv_tfa_nmrih_fx_tnt", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Enable TNT FX, or use default? 0 = off, 1 = on")
--print("Damage Multiplier con var created")
end
if GetConVar("sv_tfa_nmrih_fx_fext_override") == nil then
CreateConVar("sv_tfa_nmrih_fx_fext_override", "-1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Override fire extinguisher FX? -1 = leave to client, 0 = off, 1 = on")
--print("Damage Multiplier con var created")
end
if GetConVar("sv_tfa_nmrih_melee_multiplier") == nil then
CreateConVar("sv_tfa_nmrih_melee_multiplier", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Melee damage multiplier")
--print("Damage Multiplier con var created")
end
if GetConVar("cl_tfa_nmrih_fx_fext") == nil then
CreateClientConVar("cl_tfa_nmrih_fx_fext", 1, true, true)
end
if SERVER then
util.AddNetworkString("NMRIHFlashlightToggle")
net.Receive("NMRIHFlashlightToggle", function(length, ply)
if IsValid(ply) then
local wep = ply:GetActiveWeapon()
if IsValid(wep) then
wep.IsOn = not wep.IsOn
end
end
end)
hook.Add("PlayerTick", "FlashlightStuffTick", function(ply)
if not flashlightvar or not flashlightvar:GetBool() then return end
if not IsValid(ply) then return end
local wep = ply:GetActiveWeapon()
if not IsValid(wep) then return end
if ply:FlashlightIsOn() and (wep:GetClass() ~= "tfa_nmrih_maglite" or not wep.IsOn) then
ply:Flashlight(false)
end
end)
end
hook.Add("PlayerBindPress", "FlashlightStuff", function(ply, bind, pressed)
if not CLIENT then return end
if bind == "impulse 100" then
if flashlightvar and flashlightvar:GetBool() then
if not IsValid(ply) then return true end
if not IsValid(ply:GetActiveWeapon()) then return true end
if ply:GetActiveWeapon():GetClass() ~= "tfa_nmrih_maglite" then
if ply:HasWeapon("tfa_nmrih_maglite") then
ply:ConCommand("use tfa_nmrih_maglite")
end
return true
end
if pressed then
net.Start("NMRIHFlashlightToggle")
net.SendToServer()
end
return true
else
if not IsValid(ply) then return true end
if not IsValid(ply:GetActiveWeapon()) then return true end
if ply:GetActiveWeapon():GetClass() == "tfa_nmrih_maglite" then
if pressed then
net.Start("NMRIHFlashlightToggle")
net.SendToServer()
end
return true
end
end
end
end)

4633
lua/autorun/nmrihsounds.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,152 @@
--[[
| 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/
--]]
sound.Add( {
name = "Weapon_Melee_Blunt.Impact_Light",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/blunt_light1.wav",
")nmrihimpact/blunt_light2.wav",
")nmrihimpact/blunt_light3.wav",
")nmrihimpact/blunt_light4.wav",
")nmrihimpact/blunt_light5.wav",
")nmrihimpact/blunt_light6.wav",
")nmrihimpact/blunt_light7.wav",
")nmrihimpact/blunt_light8.wav"
},
} )
sound.Add( {
name = "Weapon_Melee_Blunt.Impact_Heavy",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/blunt_heavy1.wav",
")nmrihimpact/blunt_heavy2.wav",
")nmrihimpact/blunt_heavy3.wav",
")nmrihimpact/blunt_heavy4.wav",
")nmrihimpact/blunt_heavy5.wav",
")nmrihimpact/blunt_heavy6.wav"
},
} )
sound.Add( {
name = "Weapon_Melee_Sharp.Impact_Light",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/sharp_light1.wav",
")nmrihimpact/sharp_light2.wav",
")nmrihimpact/sharp_light3.wav"
},
} )
sound.Add( {
name = "Weapon_Melee_Sharp.Impact_Heavy",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/sharp_heavy1.wav",
")nmrihimpact/sharp_heavy2.wav",
")nmrihimpact/sharp_heavy3.wav",
")nmrihimpact/sharp_heavy4.wav",
")nmrihimpact/sharp_heavy5.wav",
")nmrihimpact/sharp_heavy6.wav"
},
} )
sound.Add( {
name = "Weapon_Melee.Impact_Brick",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/brick/brick_impact_bullet1.wav",
")nmrihimpact/brick/brick_impact_bullet2.wav",
")nmrihimpact/brick/brick_impact_bullet3.wav",
")nmrihimpact/brick/brick_impact_bullet4.wav",
")nmrihimpact/brick/brick_impact_bullet5.wav"
},
} )
sound.Add( {
name = "Weapon_Melee.Impact_Cardboard",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/cardboard/ammo_box_impact_01.wav",
")nmrihimpact/cardboard/ammo_box_impact_02.wav",
")nmrihimpact/cardboard/ammo_box_impact_03.wav",
")nmrihimpact/cardboard/ammo_box_impact_04.wav",
")nmrihimpact/cardboard/ammo_box_impact_05.wav"
},
} )
sound.Add( {
name = "Weapon_Melee.Impact_Concrete",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/concrete/concrete_impact_bullet1.wav",
")nmrihimpact/concrete/concrete_impact_bullet2.wav",
")nmrihimpact/concrete/concrete_impact_bullet3.wav",
")nmrihimpact/concrete/concrete_impact_bullet4.wav",
")nmrihimpact/concrete/concrete_impact_bullet5.wav"
},
} )
sound.Add( {
name = "Weapon_Melee.Impact_Metal",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/metal/metal_solid_impact_bullet1.wav",
")nmrihimpact/metal/metal_solid_impact_bullet2.wav",
")nmrihimpact/metal/metal_solid_impact_bullet3.wav",
")nmrihimpact/metal/metal_solid_impact_bullet4.wav",
")nmrihimpact/metal/metal_solid_impact_bullet5.wav"
},
} )
sound.Add( {
name = "Weapon_Melee.Impact_Generic",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/surfaces/sand_impact_bullet1.wav",
")nmrihimpact/surfaces/sand_impact_bullet2.wav",
")nmrihimpact/surfaces/sand_impact_bullet3.wav",
")nmrihimpact/surfaces/sand_impact_bullet4.wav",
")nmrihimpact/surfaces/sand_impact_bullet5.wav"
},
} )
sound.Add( {
name = "Weapon_Melee.Impact_Wood",
channel = CHAN_AUTO,
level = SNDLVL_NORM,
volume = 1.0,
sound = {
")nmrihimpact/wood/wood_solid_impact_bullet1.wav",
")nmrihimpact/wood/wood_solid_impact_bullet2.wav",
")nmrihimpact/wood/wood_solid_impact_bullet3.wav",
")nmrihimpact/wood/wood_solid_impact_bullet4.wav",
")nmrihimpact/wood/wood_solid_impact_bullet5.wav"
},
} )

View File

@@ -0,0 +1,41 @@
--[[
| 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/
--]]
-- VLL_CURR_FILE is local to each file
if CLIENT and pac and not VLL_CURR_FILE and not VLL2_FILEDEF then return end
if SERVER then
local function add_files(dir)
local files, folders = file.Find(dir .. "*", "LUA")
for key, file_name in pairs(files) do
AddCSLuaFile(dir .. file_name)
end
for key, folder_name in pairs(folders) do
add_files(dir .. folder_name .. "/")
end
end
add_files("pac3/core/client/")
add_files("pac3/core/shared/")
add_files("pac3/libraries/")
include("pac3/core/server/init.lua")
end
if CLIENT then
if pac and pac.Panic then
ProtectedCall(pac.Panic)
end
include("pac3/core/client/init.lua")
end

View File

@@ -0,0 +1,43 @@
--[[
| 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/
--]]
-- VLL_CURR_FILE is local to each file
if CLIENT and pac and pace and not VLL_CURR_FILE and not VLL2_FILEDEF then return end
if not pac then
include("autorun/pac_core_init.lua")
end
if not pac then
error("pac editor requires pac core")
end
if SERVER then
local function add_files(dir)
local files, folders = file.Find(dir .. "*", "LUA")
for key, file_name in pairs(files) do
AddCSLuaFile(dir .. file_name)
end
for key, folder_name in pairs(folders) do
add_files(dir .. folder_name .. "/")
end
end
add_files("pac3/editor/client/")
add_files("pac3/editor/shared/")
include("pac3/editor/server/init.lua")
end
if CLIENT then
include("pac3/editor/client/init.lua")
end

View File

@@ -0,0 +1,44 @@
--[[
| 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/
--]]
-- VLL_CURR_FILE is local to each file
if CLIENT and pac and pace and pacx and not VLL_CURR_FILE and not VLL2_FILEDEF then return end
if not pace then
include("autorun/pac_editor_init.lua")
end
if not pace then
error("pac extra requires the pac editor")
end
if SERVER then
local function add_files(dir)
local files, folders = file.Find(dir .. "*", "LUA")
for key, file_name in pairs(files) do
AddCSLuaFile(dir .. file_name)
end
for key, folder_name in pairs(folders) do
add_files(dir .. folder_name .. "/")
end
end
add_files("pac3/extra/client/")
add_files("pac3/extra/shared/")
include("pac3/extra/server/init.lua")
end
if CLIENT then
include("pac3/extra/client/init.lua")
end

11
lua/autorun/pac_init.lua Normal file
View File

@@ -0,0 +1,11 @@
--[[
| 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/
--]]
-- to prevent workshop addon's pac_init.lua from running

278
lua/autorun/pac_restart.lua Normal file
View File

@@ -0,0 +1,278 @@
--[[
| 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/
--]]
AddCSLuaFile()
if SERVER then
return
end
local sv_allowcslua = GetConVar('sv_allowcslua')
local prefer_local_version = CreateClientConVar("pac_restart_prefer_local_version", "0")
function _G.pac_ReloadParts()
local pacLocal = _G.pac
local _, dirs = file.Find("addons/*", "MOD")
for _, dir in ipairs(dirs) do
if file.Exists("addons/" .. dir .. "/lua/autorun/pac_editor_init.lua", "MOD") then
pacLocal.Message("found PAC3 in garrysmod/addons/" .. dir)
local old_include = _G.include
local function include(path, ...)
local new_path = path
if not file.Exists("addons/" .. dir .. "/lua/" .. path, "MOD") then
local src = debug.getinfo(2).source
local lua_dir = src:sub(2):match("(.+/)")
if lua_dir:StartWith("addons/" .. dir) then
lua_dir = lua_dir:match("addons/.-/lua/(.+)")
end
new_path = lua_dir .. path
end
if file.Exists("addons/" .. dir .. "/lua/" .. new_path, "MOD") then
local str = file.Read("addons/" .. dir .. "/lua/" .. new_path, "MOD")
if str then
local func = CompileString(str, "addons/" .. dir .. "/lua/" .. new_path)
if isfunction(func) then
local res = {pcall(func, ...)}
if res[1] then
return unpack(res, 2)
end
pacLocal.Message("pac_restart: pcall error: " .. res[2])
else
pacLocal.Message("pac_restart: compile string error: " .. func)
end
end
end
return old_include(path, ...)
end
_G.include = include
local ok, err = pcall(function()
pac.LoadParts()
end)
_G.include = old_include
break
end
end
end
function _G.pac_Restart()
PAC_MDL_SALT = PAC_MDL_SALT + 1
local editor_was_open
local prev_parts = {}
local pacLocal = _G.pac
local selected_part_uid
local model_browser_opened
if pace then
if pace.Editor and pace.Editor:IsValid() then
editor_was_open = true
if pace.current_part and pace.current_part:IsValid() then
selected_part_uid = pace.current_part:GetUniqueID()
end
for key, part in pairs(pac.GetLocalParts()) do
if not part:HasParent() and part:GetShowInEditor() then
local ok, err = pcall(function()
table.insert(prev_parts, part:ToTable())
end)
if not ok then print(err) end
end
end
end
if pace.model_browser and pace.model_browser:IsValid() and pace.model_browser:IsVisible() then
model_browser_opened = true
pace.model_browser:Remove()
end
end
if pac and pac.Disable then
pacLocal.Message("removing all traces of pac3 from lua")
pac.Disable()
pac.Panic()
if pace and pace.Editor then
editor_was_open = pace.Editor:IsValid()
pace.Panic()
end
for _, ent in pairs(ents.GetAll()) do
for k in pairs(ent:GetTable()) do
if k:sub(0, 4) == "pac_" then
ent[k] = nil
end
end
end
for hook_name, hooks in pairs(hook.GetTable()) do
for id, func in pairs(hooks) do
if isstring(id) and (id:StartWith("pace_") or id:StartWith("pac_") or id:StartWith("pac3_") or id:StartWith("pacx_")) then
hook.Remove(hook_name, id)
end
end
end
timer.Remove("pac_gc")
timer.Remove("pac_render_times")
timer.Remove("urlobj_download_queue")
_G.pac = nil
_G.pace = nil
_G.pacx = nil
collectgarbage()
end
_G.PAC_RESTART = true
if not prefer_local_version:GetBool() then
pacLocal.Message("pac_restart: not reloading from local version")
for _, path in ipairs((file.Find("autorun/pac*", "LUA"))) do
if path:EndsWith("_init.lua") and path ~= "pac_init.lua" then
include("autorun/" .. path)
end
end
elseif sv_allowcslua:GetBool() or LocalPlayer():IsSuperAdmin() then
local loadingHit = false
if sv_allowcslua:GetBool() then
pacLocal.Message("pac_restart: sv_allowcslua is on, looking for PAC3 addon..")
end
if LocalPlayer():IsSuperAdmin() then
pacLocal.Message("pac_restart: LocalPlayer() is superadmin, looking for PAC3 addon..")
end
local _, dirs = file.Find("addons/*", "MOD")
for _, dir in ipairs(dirs) do
if file.Exists("addons/" .. dir .. "/lua/autorun/pac_editor_init.lua", "MOD") then
pacLocal.Message("found PAC3 in garrysmod/addons/" .. dir)
local old_include = _G.include
local function include(path, ...)
local new_path = path
if not file.Exists("addons/" .. dir .. "/lua/" .. path, "MOD") then
local src = debug.getinfo(2).source
local lua_dir = src:sub(2):match("(.+/)")
if lua_dir:StartWith("addons/" .. dir) then
lua_dir = lua_dir:match("addons/.-/lua/(.+)")
end
new_path = lua_dir .. path
end
if file.Exists("addons/" .. dir .. "/lua/" .. new_path, "MOD") then
local str = file.Read("addons/" .. dir .. "/lua/" .. new_path, "MOD")
if str then
local func = CompileString(str, "addons/" .. dir .. "/lua/" .. new_path)
if isfunction(func) then
local res = {pcall(func, ...)}
if res[1] then
return unpack(res, 2)
end
pacLocal.Message("pac_restart: pcall error: " .. res[2])
else
pacLocal.Message("pac_restart: compile string error: " .. func)
end
end
end
pacLocal.Message("pac_restart: couldn't include " .. new_path .. " reverting to normal include")
return old_include(path, ...)
end
_G.include = include
for _, path in ipairs((file.Find("autorun/pac_*", "LUA"))) do
if path:EndsWith("_init.lua") and path ~= "pac_init.lua" then
pacLocal.Message("pac_restart: including autorun/" .. path .. "...")
local ok, err = pcall(function()
include("autorun/" .. path)
end)
if not ok then
pacLocal.Message("pac_restart: error when reloading pac " .. err)
end
end
end
_G.include = old_include
loadingHit = true
break
end
end
if not loadingHit then
pacLocal.Message("sv_allowcslua is not enabled or unable to find PAC3 in addons/, loading PAC3 again from server lua")
for _, path in ipairs((file.Find("autorun/pac*", "LUA"))) do
if path:EndsWith("_init.lua") and path ~= "pac_init.lua" then
include("autorun/" .. path)
end
end
end
end
_G.PAC_RESTART = nil
if editor_was_open then
pace.OpenEditor()
end
pac.Enable()
if prev_parts[1] then
pace.LoadPartsFromTable(prev_parts, true)
end
pacLocal.Message("pac_restart: done")
if selected_part_uid then
local part = pac.GetPartFromUniqueID(pac.Hash(pac.LocalPlayer), selected_part_uid)
if part and part:IsValid() then
pace.Call("PartSelected", part)
end
end
if model_browser_opened then
RunConsoleCommand("pac_asset_browser")
end
local msg = "*•.¸♥¸.•* IF YOU ARE USING PAC_RESTART TO FIX A BUG IT WOULD BE NICE IF YOU COULD ALSO REPORT THE BUG *•.¸♥¸.•*"
local words = msg:Split(" ")
for i2 = 1, 40 do
for i, word in ipairs(words) do
local f = i / #words
MsgC(HSVToColor(Lerp(f, 0, 360), 0.6, 1), word, " ")
end
MsgN("")
end
MsgC(Color(79,155,245), "https://github.com/CapsAdmin/pac3/issues", "\n")
MsgC(Color(79,155,245), "https://discord.com/invite/utpR3gJ", "\n")
MsgC(Color(79,155,245), "https://steamcommunity.com/sharedfiles/filedetails/?id=104691717", "\n")
MsgC(Color(79,155,245), "https://steamcommunity.com/id/eliashogstvedt", "\n")
end
concommand.Add("pac_restart", _G.pac_Restart)

View File

@@ -0,0 +1,56 @@
--[[
| 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/
--]]
AddCSLuaFile()
if SERVER then
local function pacVersion()
local addonFound = false
for k,v in pairs(select(2, file.Find( "addons/*", "GAME" ))) do
if file.Exists("addons/"..v.."/lua/autorun/pac_init.lua", "GAME") then
addonFound = true
local dir = "addons/"..v.."/.git/"
local head = file.Read(dir.."HEAD", "GAME") -- Where head points to
if not head then break end
head = string.match(head, "ref:%s+(%S+)")
if not head then break end
local lastCommit = string.match(file.Read( dir..head, "GAME") or "", "%S+")
if not lastCommit then break end
return "Git: " .. string.GetFileFromFilename(head) .. " (" .. lastCommit .. ")"
end
end
if addonFound then
return "unknown"
else
return "workshop"
end
end
SetGlobalString("pac_version", pacVersion())
end
function _G.PAC_VERSION()
return GetGlobalString("pac_version")
end
concommand.Add("pac_version", function()
print(PAC_VERSION())
if CLIENT and PAC_VERSION() == "workshop" then
print("Fetching workshop info...")
steamworks.FileInfo( "104691717", function(result)
print("Updated: " .. os.date("%x %X", result.updated))
end)
end
end)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,138 @@
--[[
| 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/
--]]
AddCSLuaFile()
//MsgN("Added concommand for particle read test!")
function ParticleControl_FileReadTest()
MsgN("")
MsgN("")
MsgN("")
MsgN("")
MsgN("")
MsgN("=====================================================")
MsgN("STEP 1: Reading the file")
MsgN("=====================================================")
MsgN("")
local filestr = file.Read("particlelists/particlefiletest.lua","LUA")
if !filestr then
MsgN("FAILURE! We tried to read the file (particlelists/particlefiletest.lua) and didn't get anything. The file can't be found, or it isn't readable, or something, which doesn't make any sense, since the actual tool got farther than this.")
return
end
if type(filestr) != "string" then
MsgN("FAILURE! We read the file but we got back a " .. type(filestr) .. "instead of a string. What!? Here's what we got:")
MsgN("")
MsgN(filestr)
return
end
MsgN("SUCCESS! We read the file and got back a string. Here's its contents:")
MsgN("")
MsgN(filestr)
MsgN("")
MsgN("")
MsgN("")
MsgN("")
MsgN("")
MsgN("=====================================================")
MsgN("STEP 2: Converting it to a table")
MsgN("=====================================================")
MsgN("")
local keyvalues = util.KeyValuesToTable( filestr, false, true )
if !keyvalues then
MsgN("FAILURE! We tried to convert it to a table, but we didn't get anything.")
return
end
if (table.Count(keyvalues) == 0) then
MsgN("FAILURE! We tried to convert it, but we got an empty table. Here's its contents, by which I mean a blank space unless something's weird here:")
MsgN("")
PrintTable(keyvalues)
return
end
MsgN("SUCCESS! We converted it and got a table of stuff. Here's its contents:")
MsgN("")
PrintTable(keyvalues)
MsgN("")
MsgN("")
MsgN("")
MsgN("")
MsgN("")
MsgN("=====================================================")
MsgN("STEP 3: Reading the table")
MsgN("=====================================================")
MsgN("")
if !keyvalues.Info then
MsgN("FAILURE! We couldn't find a key called \"Info\" inside the table. Is something wrong with the table we got? Like some blank spaces in the key name, or weird capitalization, or something like that which means it's technically not called \"Info\"? Or is the table's formatting messed up? Here's all of the keys we COULD find inside the table, with and without quotes just in case there's weird spaces:")
MsgN("")
for k, v in pairs (keyvalues) do
MsgN("\"" .. k .. "\"")
end
MsgN("")
for k, v in pairs (keyvalues) do
MsgN(k)
end
return
end
if type(keyvalues.Info) != "table" then
MsgN("FAILURE! The key called \"Info\" inside the table was something other than a sub-table. It was a " .. type(keyvalues.Info) .. " instead. Something's wrong with the table we got. Here's what \"Info\" is:")
MsgN("")
MsgN(keyvalues.Info)
return
end
MsgN("Found the sub-table called \"Info\" inside the table...")
MsgN("")
if !keyvalues.Info.CategoryName then
MsgN("FAILURE! We couldn't find the \"CategoryName\" inside the \"Info\" subtable. Something's wrong with the table we got. Here's \"Info\"'s contents:")
MsgN("")
PrintTable(keyvalues.Info)
return
end
if type(keyvalues.Info.CategoryName) != "string" then
MsgN("FAILURE! The \"CategoryName\" inside the \"Info\" subtable was something other than a string. Something's wrong with the table we got. Here's \"Info\"'s contents:")
MsgN("")
PrintTable(keyvalues.Info)
return
end
MsgN("SUCCESS! We read the table. It's for a category called " .. keyvalues.Info.CategoryName .. ", and everything else should be there too. The table contents are back up there in Step 2 and they should look normal. Congratulations, everything's working fine! If we were doing this same stuff in the actual tool, it'd use the table to make a list of particle effects. But if the tool was working perfectly for you, then you wouldn't be running this debug thing, now would you? Looks like we're back to square one here.")
end
if SERVER then
concommand.Add("particlereadtest_server", function()
MsgN("Beginning SERVERSIDE particle file read test!")
ParticleControl_FileReadTest()
end)
end
if CLIENT then
concommand.Add("particlereadtest_client", function()
MsgN("Beginning CLIENTSIDE particle file read test!")
ParticleControl_FileReadTest()
end)
end

View File

@@ -0,0 +1,59 @@
--[[
| 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/
--]]
--------------------------
-- BOOTSTRAP CODE START --
--------------------------
if !pcall(require,"pk_pills") then
if SERVER then
hook.Add("PlayerInitialSpawn","pk_pill_extfail_cl",function(ply)
if game.SinglePlayer() || ply:IsListenServerHost() then
ply:SendLua('notification.AddLegacy("One or more pill extensions failed to load. Did you forget to install Parakeet\'s Pill Pack?",NOTIFY_ERROR,30)')
end
end)
hook.Add("Initialize","pk_pill_extfail_sv",function(ply)
print("[ALERT] One or more pill extensions failed to load. Did you forget to install Parakeet's Pill Pack?")
end)
end
return
end
------------------------
-- BOOTSTRAP CODE END --
------------------------
AddCSLuaFile()
if SERVER then
resource.AddWorkshop("417428923")
end
game.AddParticles("particles/weapon_fx.pcf")
PrecacheParticleSystem("weapon_combine_ion_cannon")
PrecacheParticleSystem("weapon_combine_ion_cannon_explosion")
game.AddParticles("particles/striderbuster.pcf")
PrecacheParticleSystem("striderbuster_attach")
PrecacheParticleSystem("striderbuster_attach_flash")
PrecacheParticleSystem("striderbuster_explode_core")
PrecacheParticleSystem("striderbuster_explode_flash")
PrecacheParticleSystem("striderbuster_break")
game.AddParticles("particles/advisor_fx.pcf")
PrecacheParticleSystem("advisor_psychic_shield_idle")
pk_pills.packStart("Episode 1","ep1","games/16/hl2.png")
pk_pills.packRequireGame("Half-Life 2: Episode 1",380)
include("include/pill_ep1.lua")
pk_pills.packStart("Episode 2","ep2","games/16/hl2.png")
pk_pills.packRequireGame("Half-Life 2: Episode 2",420)
include("include/pill_ep2.lua")

126
lua/autorun/ppfx_cache.lua Normal file
View File

@@ -0,0 +1,126 @@
--[[
| 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/
--]]
game.AddParticles( "particles/pfx_redux.pcf" )
-- 1
PrecacheParticleSystem("[1]campfire1")
PrecacheParticleSystem("[1]cig_smoke*")
PrecacheParticleSystem("[1]candle_flame")
PrecacheParticleSystem("[1]ground_fire_1")
PrecacheParticleSystem("[1]ground_fire_1*")
PrecacheParticleSystem("[1]smoke_lifting_01")
PrecacheParticleSystem("[1]_large_campfire")
PrecacheParticleSystem("[1]fireplace_default")
PrecacheParticleSystem("[1]_smoke_colorful_1")
PrecacheParticleSystem("[1]groundflame1")
PrecacheParticleSystem("[1]molotov_ground")
PrecacheParticleSystem("[1]embers")
PrecacheParticleSystem("[1]embers_~")
PrecacheParticleSystem("[1]flametrail")
PrecacheParticleSystem("[1]groundflame")
PrecacheParticleSystem("[1]flamethrower_basic")
PrecacheParticleSystem("[1]big_smoke")
PrecacheParticleSystem("[1]_large_campfire_red")
PrecacheParticleSystem("[1]_campfire_red")
PrecacheParticleSystem("[1]_large_campfire_yellow")
PrecacheParticleSystem("[1]_campfire_yellow")
PrecacheParticleSystem("[1]_large_campfire_purple")
PrecacheParticleSystem("[1]_campfire_purple")
PrecacheParticleSystem("[1]_large_campfire_green")
PrecacheParticleSystem("[1]_campfire_green")
PrecacheParticleSystem("[1]_large_campfire_pink")
PrecacheParticleSystem("[1]_campfire_pink")
PrecacheParticleSystem("[1]_large_campfire_blue")
PrecacheParticleSystem("[1]_campfire_blue")
PrecacheParticleSystem("[1]g_leak_flame")
-- 2
PrecacheParticleSystem("[2]sparkle1")
PrecacheParticleSystem("[2]sparkle2")
PrecacheParticleSystem("[2]gushing_blood_alien")
PrecacheParticleSystem("[2]gushing_blood_alien*")
PrecacheParticleSystem("[2]gushing_blood")
PrecacheParticleSystem("[2]gushing_blood*")
PrecacheParticleSystem("[2]acid_ground")
PrecacheParticleSystem("[2]swirl_1")
PrecacheParticleSystem("[2]swirl_rnd")
PrecacheParticleSystem("[2]gman_lines")
PrecacheParticleSystem("[2]blood_leak")
PrecacheParticleSystem("[2]blood_leak_alien")
-- 3
PrecacheParticleSystem("[3]sakura_env")
PrecacheParticleSystem("[3]leaves_env")
-- 4
PrecacheParticleSystem("[4]jet_r")
PrecacheParticleSystem("[4]jet_r*")
PrecacheParticleSystem("[4]jet_r_s")
PrecacheParticleSystem("[4]jet_r_s*")
PrecacheParticleSystem("[4]jet_g_s")
PrecacheParticleSystem("[4]jet_g_s*")
PrecacheParticleSystem("[4]jet_g")
PrecacheParticleSystem("[4]jet_g*")
PrecacheParticleSystem("[4]jet_b_s")
PrecacheParticleSystem("[4]jet_b_s*")
PrecacheParticleSystem("[4]jet_b")
PrecacheParticleSystem("[4]jet_b*")
PrecacheParticleSystem("[4]jet_f_s")
PrecacheParticleSystem("[4]jet_f_s*")
PrecacheParticleSystem("[4]jet_f")
PrecacheParticleSystem("[4]jet_f*")
PrecacheParticleSystem("[4]jet_v_s")
PrecacheParticleSystem("[4]jet_v_s*")
PrecacheParticleSystem("[4]jet_v")
PrecacheParticleSystem("[4]jet_v*")
PrecacheParticleSystem("[4]energy_rod_r")
PrecacheParticleSystem("[4]energy_rod_g")
PrecacheParticleSystem("[4]energy_rod_b")
PrecacheParticleSystem("[4]energy_rod_y")
PrecacheParticleSystem("[4]arcs_electric_1")
PrecacheParticleSystem("[4]arcs_electric_1_small")
PrecacheParticleSystem("[4]bfg_*proj")
PrecacheParticleSystem("[4]electric_beam")
PrecacheParticleSystem("[4]matrix_core")
PrecacheParticleSystem("[4]binary_sphere")
PrecacheParticleSystem("[4]_car_nitro")
-- 5
PrecacheParticleSystem("[5]black_hole_micro_b")
PrecacheParticleSystem("[5]black_hole_mmicro_b")
PrecacheParticleSystem("[5]black_hole_b")
PrecacheParticleSystem("[5]black_hole_micro")
PrecacheParticleSystem("[5]black_hole_mmicro")
PrecacheParticleSystem("[5]black_hole")
PrecacheParticleSystem("[5]starfield1")
PrecacheParticleSystem("[5]starfield_2")
PrecacheParticleSystem("[5]simple_galaxy")
-- 6
PrecacheParticleSystem("[6]gunfire_generic")
PrecacheParticleSystem("[6]bullet_tracer_generic")
PrecacheParticleSystem("[6]gunfire_ar2")
PrecacheParticleSystem("[6]bullet_tracer_ar2")
-- 7
PrecacheParticleSystem("[7]dusty_wind1")
PrecacheParticleSystem("[7]rain")
PrecacheParticleSystem("[7]snow")
PrecacheParticleSystem("[7]areal_fog_s")
PrecacheParticleSystem("[7]area_of_fog")
PrecacheParticleSystem("[7]blizzard_mod")
-- 8
PrecacheParticleSystem("[8]magic_1")
PrecacheParticleSystem("[8]red_vortex")
PrecacheParticleSystem("[8]magic_flame")
PrecacheParticleSystem("[8]magic_portal*")
PrecacheParticleSystem("[8]magic_portal")
PrecacheParticleSystem("[8]core_1")
PrecacheParticleSystem("[8]ball_core")
PrecacheParticleSystem("[8]orb_1")
PrecacheParticleSystem("[8]frostbeam")
-- 9
PrecacheParticleSystem("[9]colorful_trail_1")
-- A
PrecacheParticleSystem("[A]waterleak_1")

View File

@@ -0,0 +1,96 @@
--[[
| 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/
--]]
AddCSLuaFile()
--[[
This is a utility to generate icons. You can accomplish some stuff through the console command,
but it's usually easier to just edit the source code.
Frequently used colors
combine 60,115,140
synth 210,150,70
bird 50,86,34
fun 220,0,255 (4th in pallet)
shotgunner 140 84 60
vort mid 2nd from right in pallet
zombie+headcrab middle-ish maroon
resistance upper right
-TF2-
normal 200,60,60
robots grey 109, in bottom
spooky mid row, 1/3 from the right
weapons 197 175 145
fun 4th from left
-PORTAL-
1 - White
2 - Dirty blue second row
]]
if CLIENT then
local matBack = Material("icongen/back.png")
local matFront = Material("icongen/front.png")
concommand.Add("pk_dev_iconmaker", function(ply, cmd, args, str)
local frame = vgui.Create("DFrame")
frame:SetPos(ScrW() / 2 - 270, ScrH() / 2 - 150) --ScrW() ScrH()
frame:SetSize(540, 300)
frame:SetTitle("Icon Maker")
frame:SetVisible(true)
frame:SetDraggable(false)
frame:ShowCloseButton(true)
frame:MakePopup()
local color = vgui.Create("DColorMixer", frame)
color:SetPos(10, 30)
color:SetAlphaBar(false)
--color:SetColor(Color(200,60,60)) tf2 default red
color:SetColor(Color(200, 60, 60))
local model = vgui.Create("DAdjustableModelPanel", frame)
model:SetPos(270, 30)
model:SetSize(256, 256)
model:SetLookAt(Vector(0, 0, 0))
model:SetModel(args[1] ~= "" and args[1] or "models/props_junk/watermelon01.mdl")
model:SetCamPos(Vector(100, 100, 100))
local ent = model:GetEntity()
--ent:SetRenderAngles(Angle(180,0,0))
if args[2] then
model:SetAnimated(true)
ent:ResetSequence(ent:LookupSequence(args[2]))
end
--Custom
model:GetEntity():SetSkin(1)
--model:GetEntity():SetBodygroup(2,1)
--model:GetEntity():SetBodygroup(1,1)
--[[model:GetEntity():SetBodygroup(2,1)
model:GetEntity():SetBodygroup(3,1)
model:GetEntity():SetBodygroup(4,1)]]
--model:GetEntity():SetMaterial("Models/antlion_guard/antlionGuard2")
--model:GetEntity():SetSkin(2)
--model:GetEntity():SetBodygroup(3,1)
--model:GetEntity():SetColor(Color(120,70,210))
local superPaint = model.Paint
function model:Paint()
surface.SetDrawColor(color:GetColor())
surface.SetMaterial(matBack)
surface.DrawTexturedRect(0, 0, model:GetWide(), model:GetTall())
superPaint(model)
cam.IgnoreZ(true)
surface.SetDrawColor(Color(255, 255, 255, 255))
surface.SetMaterial(matFront)
surface.DrawTexturedRect(0, 0, model:GetWide(), model:GetTall())
cam.IgnoreZ(false)
end
end)
end

View File

@@ -0,0 +1,358 @@
--[[
| 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/
--]]
--This is a untility to convert lists of sounds into tables usable by the vox system.
--TODO run the output through a spellcheck library and see if we can get it to seperate the words.
AddCSLuaFile()
local input_raw = [[
vo/npc/female01/abouttime01.wav
vo/npc/female01/abouttime02.wav
vo/npc/female01/ahgordon01.wav
vo/npc/female01/ahgordon02.wav
vo/npc/female01/ammo01.wav
vo/npc/female01/ammo02.wav
vo/npc/female01/ammo03.wav
vo/npc/female01/ammo04.wav
vo/npc/female01/ammo05.wav
vo/npc/female01/answer01.wav
vo/npc/female01/answer02.wav
vo/npc/female01/answer03.wav
vo/npc/female01/answer04.wav
vo/npc/female01/answer05.wav
vo/npc/female01/answer07.wav
vo/npc/female01/answer08.wav
vo/npc/female01/answer09.wav
vo/npc/female01/answer10.wav
vo/npc/female01/answer11.wav
vo/npc/female01/answer12.wav
vo/npc/female01/answer13.wav
vo/npc/female01/answer14.wav
vo/npc/female01/answer15.wav
vo/npc/female01/answer16.wav
vo/npc/female01/answer17.wav
vo/npc/female01/answer18.wav
vo/npc/female01/answer19.wav
vo/npc/female01/answer20.wav
vo/npc/female01/answer21.wav
vo/npc/female01/answer22.wav
vo/npc/female01/answer23.wav
vo/npc/female01/answer24.wav
vo/npc/female01/answer25.wav
vo/npc/female01/answer26.wav
vo/npc/female01/answer27.wav
vo/npc/female01/answer28.wav
vo/npc/female01/answer29.wav
vo/npc/female01/answer30.wav
vo/npc/female01/answer31.wav
vo/npc/female01/answer32.wav
vo/npc/female01/answer33.wav
vo/npc/female01/answer34.wav
vo/npc/female01/answer35.wav
vo/npc/female01/answer36.wav
vo/npc/female01/answer37.wav
vo/npc/female01/answer38.wav
vo/npc/female01/answer39.wav
vo/npc/female01/answer40.wav
vo/npc/female01/behindyou01.wav
vo/npc/female01/behindyou02.wav
vo/npc/female01/busy02.wav
vo/npc/female01/cit_dropper01.wav
vo/npc/female01/cit_dropper04.wav
vo/npc/female01/civilprotection01.wav
vo/npc/female01/civilprotection02.wav
vo/npc/female01/combine01.wav
vo/npc/female01/combine02.wav
vo/npc/female01/coverwhilereload01.wav
vo/npc/female01/coverwhilereload02.wav
vo/npc/female01/cps01.wav
vo/npc/female01/cps02.wav
vo/npc/female01/docfreeman01.wav
vo/npc/female01/docfreeman02.wav
vo/npc/female01/doingsomething.wav
vo/npc/female01/dontforgetreload01.wav
vo/npc/female01/excuseme01.wav
vo/npc/female01/excuseme02.wav
vo/npc/female01/fantastic01.wav
vo/npc/female01/fantastic02.wav
vo/npc/female01/finally.wav
vo/npc/female01/freeman.wav
vo/npc/female01/getdown02.wav
vo/npc/female01/getgoingsoon.wav
vo/npc/female01/gethellout.wav
vo/npc/female01/goodgod.wav
vo/npc/female01/gordead_ans01.wav
vo/npc/female01/gordead_ans02.wav
vo/npc/female01/gordead_ans03.wav
vo/npc/female01/gordead_ans04.wav
vo/npc/female01/gordead_ans05.wav
vo/npc/female01/gordead_ans06.wav
vo/npc/female01/gordead_ans07.wav
vo/npc/female01/gordead_ans08.wav
vo/npc/female01/gordead_ans09.wav
vo/npc/female01/gordead_ans10.wav
vo/npc/female01/gordead_ans11.wav
vo/npc/female01/gordead_ans12.wav
vo/npc/female01/gordead_ans13.wav
vo/npc/female01/gordead_ans14.wav
vo/npc/female01/gordead_ans15.wav
vo/npc/female01/gordead_ans16.wav
vo/npc/female01/gordead_ans17.wav
vo/npc/female01/gordead_ans18.wav
vo/npc/female01/gordead_ans19.wav
vo/npc/female01/gordead_ans20.wav
vo/npc/female01/gordead_ques01.wav
vo/npc/female01/gordead_ques02.wav
vo/npc/female01/gordead_ques04.wav
vo/npc/female01/gordead_ques05.wav
vo/npc/female01/gordead_ques06.wav
vo/npc/female01/gordead_ques07.wav
vo/npc/female01/gordead_ques08.wav
vo/npc/female01/gordead_ques10.wav
vo/npc/female01/gordead_ques11.wav
vo/npc/female01/gordead_ques12.wav
vo/npc/female01/gordead_ques13.wav
vo/npc/female01/gordead_ques14.wav
vo/npc/female01/gordead_ques15.wav
vo/npc/female01/gordead_ques16.wav
vo/npc/female01/gordead_ques17.wav
vo/npc/female01/gotone01.wav
vo/npc/female01/gotone02.wav
vo/npc/female01/gottareload01.wav
vo/npc/female01/gunship02.wav
vo/npc/female01/hacks01.wav
vo/npc/female01/hacks02.wav
vo/npc/female01/headcrabs01.wav
vo/npc/female01/headcrabs02.wav
vo/npc/female01/headsup01.wav
vo/npc/female01/headsup02.wav
vo/npc/female01/health01.wav
vo/npc/female01/health02.wav
vo/npc/female01/health03.wav
vo/npc/female01/health04.wav
vo/npc/female01/health05.wav
vo/npc/female01/hellodrfm01.wav
vo/npc/female01/hellodrfm02.wav
vo/npc/female01/help01.wav
vo/npc/female01/herecomehacks01.wav
vo/npc/female01/herecomehacks02.wav
vo/npc/female01/heretheycome01.wav
vo/npc/female01/heretohelp01.wav
vo/npc/female01/heretohelp02.wav
vo/npc/female01/heydoc01.wav
vo/npc/female01/heydoc02.wav
vo/npc/female01/hi01.wav
vo/npc/female01/hi02.wav
vo/npc/female01/hitingut01.wav
vo/npc/female01/hitingut02.wav
vo/npc/female01/holddownspot01.wav
vo/npc/female01/holddownspot02.wav
vo/npc/female01/illstayhere01.wav
vo/npc/female01/imhurt01.wav
vo/npc/female01/imhurt02.wav
vo/npc/female01/imstickinghere01.wav
vo/npc/female01/incoming02.wav
vo/npc/female01/itsamanhack01.wav
vo/npc/female01/itsamanhack02.wav
vo/npc/female01/leadon01.wav
vo/npc/female01/leadon02.wav
vo/npc/female01/leadtheway01.wav
vo/npc/female01/leadtheway02.wav
vo/npc/female01/letsgo01.wav
vo/npc/female01/letsgo02.wav
vo/npc/female01/likethat.wav
vo/npc/female01/littlecorner01.wav
vo/npc/female01/lookoutfm01.wav
vo/npc/female01/lookoutfm02.wav
vo/npc/female01/moan01.wav
vo/npc/female01/moan02.wav
vo/npc/female01/moan03.wav
vo/npc/female01/moan04.wav
vo/npc/female01/moan05.wav
vo/npc/female01/myarm01.wav
vo/npc/female01/myarm02.wav
vo/npc/female01/mygut02.wav
vo/npc/female01/myleg01.wav
vo/npc/female01/myleg02.wav
vo/npc/female01/nice01.wav
vo/npc/female01/nice02.wav
vo/npc/female01/no01.wav
vo/npc/female01/no02.wav
vo/npc/female01/notthemanithought01.wav
vo/npc/female01/notthemanithought02.wav
vo/npc/female01/ohno.wav
vo/npc/female01/ok01.wav
vo/npc/female01/ok02.wav
vo/npc/female01/okimready01.wav
vo/npc/female01/okimready02.wav
vo/npc/female01/okimready03.wav
vo/npc/female01/onyourside.wav
vo/npc/female01/outofyourway02.wav
vo/npc/female01/overhere01.wav
vo/npc/female01/overthere01.wav
vo/npc/female01/overthere02.wav
vo/npc/female01/ow01.wav
vo/npc/female01/ow02.wav
vo/npc/female01/pain01.wav
vo/npc/female01/pain02.wav
vo/npc/female01/pain03.wav
vo/npc/female01/pain04.wav
vo/npc/female01/pain05.wav
vo/npc/female01/pain06.wav
vo/npc/female01/pain07.wav
vo/npc/female01/pain08.wav
vo/npc/female01/pain09.wav
vo/npc/female01/pardonme01.wav
vo/npc/female01/pardonme02.wav
vo/npc/female01/question01.wav
vo/npc/female01/question02.wav
vo/npc/female01/question03.wav
vo/npc/female01/question04.wav
vo/npc/female01/question05.wav
vo/npc/female01/question06.wav
vo/npc/female01/question07.wav
vo/npc/female01/question08.wav
vo/npc/female01/question09.wav
vo/npc/female01/question10.wav
vo/npc/female01/question11.wav
vo/npc/female01/question12.wav
vo/npc/female01/question13.wav
vo/npc/female01/question14.wav
vo/npc/female01/question15.wav
vo/npc/female01/question16.wav
vo/npc/female01/question17.wav
vo/npc/female01/question18.wav
vo/npc/female01/question19.wav
vo/npc/female01/question20.wav
vo/npc/female01/question21.wav
vo/npc/female01/question22.wav
vo/npc/female01/question23.wav
vo/npc/female01/question25.wav
vo/npc/female01/question26.wav
vo/npc/female01/question27.wav
vo/npc/female01/question28.wav
vo/npc/female01/question29.wav
vo/npc/female01/question30.wav
vo/npc/female01/question31.wav
vo/npc/female01/readywhenyouare01.wav
vo/npc/female01/readywhenyouare02.wav
vo/npc/female01/reloadfm01.wav
vo/npc/female01/reloadfm02.wav
vo/npc/female01/runforyourlife01.wav
vo/npc/female01/runforyourlife02.wav
vo/npc/female01/scanners01.wav
vo/npc/female01/scanners02.wav
vo/npc/female01/sorry01.wav
vo/npc/female01/sorry02.wav
vo/npc/female01/sorry03.wav
vo/npc/female01/sorrydoc01.wav
vo/npc/female01/sorrydoc02.wav
vo/npc/female01/sorrydoc04.wav
vo/npc/female01/sorryfm01.wav
vo/npc/female01/sorryfm02.wav
vo/npc/female01/squad_affirm01.wav
vo/npc/female01/squad_affirm02.wav
vo/npc/female01/squad_affirm03.wav
vo/npc/female01/squad_affirm04.wav
vo/npc/female01/squad_affirm05.wav
vo/npc/female01/squad_affirm06.wav
vo/npc/female01/squad_affirm07.wav
vo/npc/female01/squad_affirm08.wav
vo/npc/female01/squad_affirm09.wav
vo/npc/female01/squad_approach01.wav
vo/npc/female01/squad_approach02.wav
vo/npc/female01/squad_approach03.wav
vo/npc/female01/squad_approach04.wav
vo/npc/female01/squad_away01.wav
vo/npc/female01/squad_away02.wav
vo/npc/female01/squad_away03.wav
vo/npc/female01/squad_follow01.wav
vo/npc/female01/squad_follow02.wav
vo/npc/female01/squad_follow03.wav
vo/npc/female01/squad_follow04.wav
vo/npc/female01/squad_greet01.wav
vo/npc/female01/squad_greet02.wav
vo/npc/female01/squad_greet04.wav
vo/npc/female01/squad_reinforce_group01.wav
vo/npc/female01/squad_reinforce_group02.wav
vo/npc/female01/squad_reinforce_group03.wav
vo/npc/female01/squad_reinforce_group04.wav
vo/npc/female01/squad_reinforce_single01.wav
vo/npc/female01/squad_reinforce_single02.wav
vo/npc/female01/squad_reinforce_single03.wav
vo/npc/female01/squad_reinforce_single04.wav
vo/npc/female01/squad_train01.wav
vo/npc/female01/squad_train02.wav
vo/npc/female01/squad_train03.wav
vo/npc/female01/squad_train04.wav
vo/npc/female01/startle01.wav
vo/npc/female01/startle02.wav
vo/npc/female01/stopitfm.wav
vo/npc/female01/strider.wav
vo/npc/female01/strider_run.wav
vo/npc/female01/takecover02.wav
vo/npc/female01/thehacks01.wav
vo/npc/female01/thehacks02.wav
vo/npc/female01/thislldonicely01.wav
vo/npc/female01/uhoh.wav
vo/npc/female01/upthere01.wav
vo/npc/female01/upthere02.wav
vo/npc/female01/vanswer01.wav
vo/npc/female01/vanswer02.wav
vo/npc/female01/vanswer03.wav
vo/npc/female01/vanswer04.wav
vo/npc/female01/vanswer05.wav
vo/npc/female01/vanswer06.wav
vo/npc/female01/vanswer07.wav
vo/npc/female01/vanswer08.wav
vo/npc/female01/vanswer09.wav
vo/npc/female01/vanswer10.wav
vo/npc/female01/vanswer11.wav
vo/npc/female01/vanswer12.wav
vo/npc/female01/vanswer13.wav
vo/npc/female01/vanswer14.wav
vo/npc/female01/vquestion01.wav
vo/npc/female01/vquestion02.wav
vo/npc/female01/vquestion03.wav
vo/npc/female01/vquestion04.wav
vo/npc/female01/vquestion05.wav
vo/npc/female01/vquestion06.wav
vo/npc/female01/vquestion07.wav
vo/npc/female01/waitingsomebody.wav
vo/npc/female01/watchout.wav
vo/npc/female01/watchwhat.wav
vo/npc/female01/wetrustedyou01.wav
vo/npc/female01/wetrustedyou02.wav
vo/npc/female01/whoops01.wav
vo/npc/female01/yeah02.wav
vo/npc/female01/youdbetterreload01.wav
vo/npc/female01/yougotit02.wav
vo/npc/female01/zombies01.wav
vo/npc/female01/zombies02.wav
]]
if CLIENT then
concommand.Add("pk_dev_voxgen", function(ply, cmd, args)
local n = args[1]
local output = {'local ' .. n .. '={}'}
for _, v in pairs(("\n"):Explode(input_raw)) do
if v:len() == 0 then continue end
local r = string.match(v, "/([^/]*)%.")
output[r] = v
table.insert(output, n .. '[ "' .. r .. '" ]="' .. v .. '"')
end
SetClipboardText(("\n"):Implode(output))
end)
end

View File

@@ -0,0 +1,365 @@
--[[
| 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/
--]]
pk_pills.registerDrive("roll", {
think = function(ply, ent, options)
local aimYaw = Angle(0, ply:EyeAngles().y, 0)
local moveDir = Vector(0, 0, 0)
if (ply:KeyDown(IN_FORWARD)) then
moveDir = moveDir + aimYaw:Forward()
end
if (ply:KeyDown(IN_BACK)) then
moveDir = moveDir - aimYaw:Forward()
end
if (ply:KeyDown(IN_MOVERIGHT)) then
moveDir = moveDir + aimYaw:Right()
end
if (ply:KeyDown(IN_MOVELEFT)) then
moveDir = moveDir - aimYaw:Right()
end
local phys = ent:GetPhysicsObject()
if not IsValid(phys) then return end
local center = ent:LocalToWorld(phys:GetMassCenter())
moveDir:Normalize()
if options.rotcap then
local av = phys:GetAngleVelocity()
local abs = math.abs(av.x) + math.abs(av.y) + math.abs(av.z)
if abs > options.rotcap then return end
end
phys:ApplyForceOffset(moveDir * options.power, center + Vector(0, 0, 1))
phys:ApplyForceOffset(moveDir * -options.power, center + Vector(0, 0, -1))
end,
key = function(ply, ent, options, key)
if key == IN_JUMP and options.jump then
local shouldJump = false
if (ent:GetMoveType() == MOVETYPE_NONE) then
ent:SetMoveType(MOVETYPE_VPHYSICS)
ent:SetPos(ent:GetPos() + Vector(0, 0, ent:BoundingRadius() + options.burrow))
shouldJump = true
else
local trace = util.QuickTrace(ent:GetPos(), Vector(0, 0, -ent:BoundingRadius() + 2), ent)
if trace.Hit then
shouldJump = true
end
end
if shouldJump then
ent:GetPhysicsObject():ApplyForceCenter(Vector(0, 0, options.jump))
ent:PillSound("jump")
end
elseif key == IN_DUCK and options.burrow and ent:GetMoveType() == MOVETYPE_VPHYSICS then
local trace = util.QuickTrace(ent:GetPos(), Vector(0, 0, -ent:BoundingRadius() + 2), ent)
if trace.Hit and (trace.MatType == MAT_DIRT or trace.MatType == MAT_SAND) then
ent:PillSound("burrow")
local p = ent:GetPos()
ent:SetPos(Vector(p.x, p.y, trace.HitPos.z - options.burrow))
ent:SetMoveType(MOVETYPE_NONE)
if ent.formTable.model then
ent:SetModel(ent.formTable.model)
end
ent:PillLoopStopAll()
end
end
end
})
pk_pills.registerDrive("fly", {
think = function(ply, ent, options)
local phys = ent:GetPhysicsObject()
if not IsValid(phys) then return end
if phys:IsGravityEnabled() then
phys:EnableGravity(false)
end
--Lateral Movement
local move = Vector(0, 0, 0)
local rotatedAngle = ent:GetAngles()
local aim = Angle(0, ply:EyeAngles().y, 0)
if options.spin then
rotatedAngle = aim
end
if options.rotation then
rotatedAngle:RotateAroundAxis(rotatedAngle:Up(), options.rotation)
end
if options.rotation2 then
rotatedAngle:RotateAroundAxis(rotatedAngle:Right(), options.rotation2)
end
if options.rocketMode then
move = rotatedAngle:Forward() * options.speed
aim.p = math.Clamp(ply:EyeAngles().p, -50, 50)
else
if not options.tilt then
if (ply:KeyDown(IN_FORWARD)) then
move = rotatedAngle:Forward() * options.speed
elseif (ply:KeyDown(IN_BACK)) then
move = move + rotatedAngle:Forward() * -options.speed
end
if (ply:KeyDown(IN_MOVERIGHT)) then
move = move + rotatedAngle:Right() * options.speed
elseif (ply:KeyDown(IN_MOVELEFT)) then
move = move + rotatedAngle:Right() * -options.speed
end
aim.p = math.Clamp(ply:EyeAngles().p, -30, 30)
else
local baseDir = aim
if (ply:KeyDown(IN_FORWARD)) then
move = baseDir:Forward() * options.speed
aim.p = options.tilt or 0
elseif (ply:KeyDown(IN_BACK)) then
move = move + baseDir:Forward() * -options.speed
aim.p = -options.tilt or 0
end
if (ply:KeyDown(IN_MOVERIGHT)) then
move = move + baseDir:Right() * options.speed
aim.r = options.tilt or 0
elseif (ply:KeyDown(IN_MOVELEFT)) then
move = move + baseDir:Right() * -options.speed
aim.r = -options.tilt or 0
end
end
--UpDown
if (ply:KeyDown(IN_JUMP)) then
move = move + Vector(0, 0, options.speed * 2 / 3)
elseif (ply:KeyDown(IN_DUCK)) then
move = move + Vector(0, 0, -options.speed * 2 / 3)
end
end
phys:AddVelocity(move - phys:GetVelocity() * .02)
if options.rotation then
aim:RotateAroundAxis(aim:Up(), -options.rotation)
end
if options.rotation2 then
aim:RotateAroundAxis(aim:Right(), -options.rotation2)
end
--[[if options.spin then
aim=ent.spinAng or Angle(0,0,0)
aim=aim+Angle(0,-options.spin,0)
ent.spinAng=aim
end]]
local localAim = ent:WorldToLocalAngles(aim)
if options.spin then
localAim = Angle(0, -options.spin, 0)
end
local moveAng = Vector(0, 0, 0)
moveAng.y = localAim.p * 3
moveAng.z = localAim.y * 3
moveAng.x = localAim.r * 3
phys:AddAngleVelocity(-1 * phys:GetAngleVelocity() + moveAng)
end,
--return LocalAim
key = function(ply, ent, options, key) end
})
pk_pills.registerDrive("hover", {
think = function(ply, ent, options)
--UpDown
if not ply:KeyDown(IN_DUCK) then
local phys = ent:GetPhysicsObject()
if not IsValid(phys) then return end
--Lateral movement
local move = Vector(0, 0, 0)
local rotatedAngle = ent:GetAngles()
if (ply:KeyDown(IN_FORWARD)) then
move = rotatedAngle:Forward() * options.speed
elseif (ply:KeyDown(IN_BACK)) then
move = move + rotatedAngle:Forward() * -options.speed
end
if (ply:KeyDown(IN_MOVERIGHT)) then
move = move + rotatedAngle:Right() * options.speed
elseif (ply:KeyDown(IN_MOVELEFT)) then
move = move + rotatedAngle:Right() * -options.speed
end
phys:AddVelocity(move - phys:GetVelocity() * .02)
--Hovering
local tr = util.QuickTrace(ent:GetPos(), Vector(0, 0, -1) * (options.height or 100), ent)
if tr.Hit then
phys:AddVelocity(Vector(0, 0, 10))
end
local aim = Angle(0, ply:EyeAngles().y, 0)
local localAim = ent:WorldToLocalAngles(aim)
local moveAng = Vector(0, 0, 0)
moveAng.y = localAim.p * 3
moveAng.z = localAim.y * 3
moveAng.x = localAim.r * 3
phys:AddAngleVelocity(-1 * phys:GetAngleVelocity() + moveAng)
end
end,
key = function(ply, ent, options, key) end
})
pk_pills.registerDrive("swim", {
think = function(ply, ent, options)
local phys = ent:GetPhysicsObject()
if not ent.setupBuoyancy then
phys:SetBuoyancyRatio(.135)
ent.setupBuoyancy = true
end
local speed
if ent:WaterLevel() > 1 then
speed = options.speed
else
speed = options.speed / 3
if math.Rand(0, 1) > .9 then
ent:TakeDamage(1)
end
end
--Lateral Movement
local move = Vector(0, 0, 0)
local rotatedAngle = ent:GetAngles()
local aim = Angle(0, ply:EyeAngles().y, 0)
if (ply:KeyDown(IN_FORWARD)) then
move = rotatedAngle:Forward()
elseif (ply:KeyDown(IN_BACK)) then
move = move - rotatedAngle:Forward()
end
if (ply:KeyDown(IN_MOVERIGHT)) then
move = move + rotatedAngle:Right()
elseif (ply:KeyDown(IN_MOVELEFT)) then
move = move - rotatedAngle:Right()
end
aim.p = math.Clamp(ply:EyeAngles().p, -80, 80)
phys:AddVelocity(move * speed)
local localAim = ent:WorldToLocalAngles(aim)
local moveAng = Vector(0, 0, 0)
moveAng.y = localAim.p * 3
moveAng.z = localAim.y * 3
moveAng.x = localAim.r * 3
phys:AddAngleVelocity(-1 * phys:GetAngleVelocity() + moveAng)
end,
--return LocalAim
key = function(ply, ent, options, key) end
})
pk_pills.registerDrive("strider", {
think = function(ply, ent, options)
local h = ent:GetPoseParameter("body_height")
if h < 200 then
h = 200
ent:SetPoseParameter("body_height", h)
end
--UpDown
if ply:KeyDown(IN_JUMP) and h < 500 then
h = h + 5
ent:SetPoseParameter("body_height", h)
elseif ply:KeyDown(IN_DUCK) and h > 200 then
h = h - 5
ent:SetPoseParameter("body_height", h)
end
local run = ply:KeyDown(IN_SPEED)
local phys = ent:GetPhysicsObject()
local aim = Angle(0, ply:EyeAngles().y, 0)
local move = Vector(0, 0, 0)
if (ply:KeyDown(IN_FORWARD)) then
move = aim:Forward()
elseif (ply:KeyDown(IN_BACK)) then
move = move - aim:Forward()
end
if (ply:KeyDown(IN_MOVERIGHT)) then
move = move + aim:Right()
elseif (ply:KeyDown(IN_MOVELEFT)) then
move = move - aim:Right()
end
move:Normalize()
if (move:Length() > 0) then
ent:PillAnim("walk_all")
if run then
ent:SetPlaybackRate(2)
else
ent:SetPlaybackRate(1)
end
ent:SetPoseParameter("move_yaw", ent:WorldToLocalAngles(move:Angle()).y)
--Stepping
--Step Sounds
if not ent.lastStep then
ent.lastStep = 0
end
if ent.lastStep == 0 and ent:GetCycle() > 1 / 3 then
ent.lastStep = 1
ent:PillSound("step")
elseif ent.lastStep == 1 and ent:GetCycle() > 2 / 3 then
ent.lastStep = 2
ent:PillSound("step")
elseif ent.lastStep == 2 and ent:GetCycle() < 2 / 3 then
ent.lastStep = 0
ent:PillSound("step")
end
else
ent:SetPlaybackRate(1)
ent:PillAnim("Idle01")
end
--Datass
local tr = util.QuickTrace(ent:GetPos(), Vector(0, 0, -1) * h, ent)
if tr.Hit then
phys:AddVelocity(-ent:GetVelocity() + Vector(0, 0, 2000 * (1 - tr.Fraction)) + move * (run and 200 or 100))
end
local localAim = ent:WorldToLocalAngles(aim)
local moveAng = Vector(0, 0, 0)
moveAng.y = localAim.p * 3
moveAng.z = localAim.y * 3
moveAng.x = localAim.r * 3
phys:AddAngleVelocity(-1 * phys:GetAngleVelocity() + moveAng)
end,
key = function(ply, ent, options, key) end
})

View File

@@ -0,0 +1,179 @@
--[[
| 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/
--]]
AddCSLuaFile()
--Made by SkyLight http://steamcommunity.com/id/_I_I_I_I_I/, had to be indented manually because copy/pasta from github didn't. Copy pastad of Parakeet's code.
--Formatted and edited by Parakeet
pk_pills.register("professional", {
printName = "Lab Gamer",
type = "ply",
default_rp_cost = 1337666420,
model = "models/player/hostage/hostage_04.mdl",
anims = {
default = {
idle = "idle_pistol",
walk = "menu_walk",
run = "run_pistol",
crouch = "cidle_pistol",
crouch_walk = "cwalk_pistol",
glide = "swimming_pistol",
jump = "jump_pistol",
g_attack = "taunt_laugh", --flinch_head_02
g_reload = "gesture_agree",
dropItem = "Heal"
}
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
moveSpeed = {
walk = 60,
run = 200,
ducked = 40
},
loadout = {"pill_wep_pro"},
ammo = {
Buckshot = 100,
["357"] = 100
},
health = 1,
validHoldTypes = {"smg", "ar2", "shotgun", "crossbow", "pistol"},
movePoseMode = "xy"
})
pk_pills.register("pubbie", {
printName = "Pub Scrub",
type = "ply",
default_rp_cost = 8008135,
options = function()
return {
{
model = "models/player/urban.mdl"
},
{
model = "models/player/gasmask.mdl"
},
{
model = "models/player/riot.mdl"
},
{
model = "models/player/swat.mdl"
},
{
model = "models/player/guerilla.mdl"
},
{
model = "models/player/arctic.mdl"
},
{
model = "models/player/phoenix.mdl"
},
{
model = "models/player/leet.mdl"
}
}
end,
anims = {
default = {
idle = "idle_pistol",
walk = "walk_pistol",
run = "run_pistol",
crouch = "cidle_pistol",
crouch_walk = "cwalk_pistol",
glide = "swimming_pistol",
jump = "jump_pistol",
g_attack = "flinch_head_02",
g_reload = "reload_pistol",
dropItem = "Heal"
},
smg = {
idle = "idle_smg1",
walk = "walk_smg1",
run = "run_smg1",
crouch = "cidle_smg1",
crouch_walk = "cwalk_smg1"
},
ar2 = {
idle = "idle_ar2",
walk = "walk_ar2",
run = "run_ar2",
crouch = "cidle_ar2",
crouch_walk = "cwalk_ar2"
}
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
moveSpeed = {
walk = 60,
run = 200,
ducked = 40
},
loadout = {"pill_wep_alyxgun"},
ammo = {
smg1 = 300
},
health = 100,
validHoldTypes = {"smg", "ar2", "shotgun", "crossbow", "pistol"},
movePoseMode = "xy"
})
pk_pills.register("casual", {
printName = "Casual",
type = "ply",
default_rp_cost = 1234567,
options = function()
return {
{
model = "models/player/hostage/hostage_01.mdl"
},
{
model = "models/player/hostage/hostage_02.mdl"
},
{
model = "models/player/hostage/hostage_03.mdl"
}
}
end,
anims = {
default = {
idle = "idle_smg1",
walk = "walk_smg1",
run = "run_smg1",
crouch = "cidle_smg1",
crouch_walk = "cwalk_smg1",
glide = "swimming_smg1",
jump = "jump_smg1",
g_attack = "flinch_head_02",
g_reload = "reload_smg1",
dropItem = "Heal"
}
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
moveSpeed = {
walk = 60,
run = 200,
ducked = 40
},
loadout = {"weapon_smg1"},
ammo = {
smg1 = 150,
smg1_grenade = 5
},
health = 150,
validHoldTypes = {"smg", "ar2", "shotgun", "crossbow", "pistol"},
movePoseMode = "xy"
})

View File

@@ -0,0 +1,185 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("antlion", {
printName = "Antlion",
side = "hl_antlion",
type = "ply",
model = "models/antlion.mdl",
default_rp_cost = 4000,
options = function()
return {
{
skin = 0
},
{
skin = 1
},
{
skin = 2
},
{
skin = 3
}
}
end,
camera = {
offset = Vector(0, 0, 30),
dist = 150
},
hull = Vector(60, 60, 50),
anims = {
default = {
idle = "Idle",
walk = "walk_all",
run = "run_all",
glide = "jump_glide",
jump = "jump_start",
melee1 = "attack1",
melee2 = "attack2",
melee3 = "attack3",
charge_start = "charge_start",
charge_loop = "charge_run",
charge_hit = "charge_end",
swim = "drown",
burrow_in = "digin",
burrow_loop = "digidle",
burrow_out = "digout"
}
},
sounds = {
melee = pk_pills.helpers.makeList("npc/antlion/attack_single#.wav", 3),
melee_hit = pk_pills.helpers.makeList("npc/zombie/claw_strike#.wav", 3),
charge_start = "npc/antlion/pain1.wav",
charge_hit = "npc/antlion/land1.wav", --"npc/antlion_guard/shove1.wav",
loop_fly = "npc/antlion/fly1.wav",
loop_charge = "npc/antlion/charge_loop1.wav",
land = "npc/antlion/land1.wav",
burrow_in = "npc/antlion/digdown1.wav",
burrow_out = "npc/antlion/digup1.wav",
step = pk_pills.helpers.makeList("npc/antlion/foot#.wav", 4)
},
aim = {
xPose = "head_yaw",
yPose = "head_pitch",
nocrosshair = true
},
attack = {
mode = "trigger",
func = pk_pills.common.melee,
animCount = 3,
delay = .5,
range = 75,
dmg = 25
},
charge = {
vel = 800,
dmg = 50,
delay = .6
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
ent:PillChargeAttack()
end
},
movePoseMode = "yaw",
moveSpeed = {
walk = 200,
run = 500
},
jumpPower = 500,
jump = function(ply, ent)
if ply:GetVelocity():Length() < 300 then
ply:SetVelocity(Vector(0, 0, 500))
end
end,
glideThink = function(ply, ent)
ent:PillLoopSound("fly")
local puppet = ent:GetPuppet()
if puppet:GetBodygroup(1) == 0 then
puppet:SetBodygroup(1, 1)
end
end,
land = function(ply, ent)
ent:PillLoopStop("fly")
local puppet = ent:GetPuppet()
puppet:SetBodygroup(1, 0)
end,
canBurrow = true,
health = 120,
noFallDamage = true,
damageFromWater = 1
})
pk_pills.register("antlion_guard", {
printName = "Antlion Guard",
type = "ply",
model = "models/antlion_guard.mdl",
default_rp_cost = 10000,
camera = {
offset = Vector(0, 0, 80),
dist = 300
},
hull = Vector(120, 120, 100),
anims = {
default = {
idle = "idle",
walk = "walk1",
crouch = "cover_loop",
crouch_walk = "cover_creep2",
melee = "shove",
charge_start = "charge_startfast",
charge_loop = "charge_loop",
g_charge_hit = "charge_hit"
}
},
sounds = {
melee = pk_pills.helpers.makeList("npc/antlion_guard/angry#.wav", 3),
melee_hit = "npc/antlion_guard/shove1.wav",
charge_start = pk_pills.helpers.makeList("npc/antlion_guard/angry#.wav", 3),
charge_hit = "npc/antlion_guard/shove1.wav",
step = {"npc/antlion_guard/foot_heavy1.wav", "npc/antlion_guard/foot_heavy2.wav", "npc/antlion_guard/foot_light1.wav", "npc/antlion_guard/foot_light2.wav"}
},
aim = {
xPose = "head_yaw",
yPose = "head_pitch",
nocrosshair = true
},
attack = {
mode = "trigger",
func = pk_pills.common.melee,
delay = .5,
range = 150,
dmg = 50
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
ent:PillChargeAttack()
end
},
charge = {
vel = 800,
dmg = 100,
delay = .8
},
movePoseMode = "yaw",
moveSpeed = {
walk = 250,
ducked = 125
},
jumpPower = 0,
health = 500,
damageFromWater = 5
})

View File

@@ -0,0 +1,126 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("bird_crow", {
printName = "Crow",
side = "harmless",
type = "ply",
model = "models/crow.mdl",
default_rp_cost = 1000,
camera = {
offset = Vector(0, 0, 5),
dist = 40
},
hull = Vector(10, 10, 10),
anims = {
default = {
idle = "Idle01",
walk = "Walk",
run = "Run",
glide = "Soar",
fly = "Fly01",
eat = "Eat_A",
jump = "Takeoff"
}
},
moveSpeed = {
walk = 15,
run = 40
},
health = 20,
moveMod = function(ply, ent, mv, cmd)
if not ply:IsOnGround() then
local angs = mv:GetAngles()
if cmd:KeyDown(IN_JUMP) then
angs.p = -30
mv:SetVelocity(angs:Forward() * 300)
if SERVER then
ent:PillAnimTick("fly")
end
elseif cmd:KeyDown(IN_DUCK) then
angs.p = 30
mv:SetVelocity(angs:Forward() * 300)
if SERVER then
ent:PillAnimTick("fly")
end
else
angs.p = 10
mv:SetVelocity(angs:Forward() * 500)
end
end
end,
land = function(ply, ent)
ent:PillLoopStop("fly")
end,
sounds = {
vocalize = pk_pills.helpers.makeList("npc/crow/alert#.wav", 2, 3),
loop_fly = "npc/crow/flap2.wav"
},
attack = {
mode = "trigger",
func = function(ply, ent)
ent:PillSound("vocalize")
end
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if ply:IsOnGround() then
ent:PillAnim("eat", true)
timer.Simple(1, function()
if not IsValid(ent) then return end
if ply:Health() < 10 then
ply:SetHealth(10)
end
end)
timer.Simple(2, function()
if not IsValid(ent) then return end
ply:SetHealth(20)
end)
end
end
}
})
pk_pills.register("bird_pigeon", {
parent = "bird_crow",
printName = "Pigeon",
model = "models/pigeon.mdl",
sounds = {
vocalize = pk_pills.helpers.makeList("ambient/creatures/pigeon_idle#.wav", 4)
}
})
pk_pills.register("bird_seagull", {
parent = "bird_crow",
printName = "Seagull",
model = "models/seagull.mdl",
sounds = {
vocalize = pk_pills.helpers.makeList("ambient/creatures/seagull_idle#.wav", 3)
},
flapSoundPitch = 50,
anims = {
default = {
fly = "Fly"
}
},
health = 50,
attack2 = {
mode = ""
}
})

View File

@@ -0,0 +1,118 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("stalker", {
printName = "Stalker",
type = "ply",
model = "models/stalker.mdl",
default_rp_cost = 8000,
side = "hl_combine",
health = 100,
duckBy = 0,
anims = {
default = {
idle = "idle01",
walk = "walk_all"
}
},
aim = {},
attack = {
mode = "trigger",
func = function(ply, ent)
local target = ents.Create("info_target")
target:SetPos(ply:GetEyeTrace().HitPos + ply:EyeAngles():Forward() * 20)
target:SetName("laser_target_" .. ent:EntIndex() .. "_" .. os.time())
target:Spawn()
local beam = ents.Create("env_laser")
beam:SetPos(ply:EyePos() + ply:EyeAngles():Forward() * 30)
beam:SetKeyValue("texture", "materials/cable/redlaser.vmt")
beam:SetKeyValue("damage", 100)
beam:SetKeyValue("width", 2)
beam:SetKeyValue("dissolvetype", 0)
beam:SetKeyValue("LaserTarget", target:GetName())
beam:Spawn()
beam:Fire("turnon", "", 0)
ply:Freeze(true)
ent:PillLoopSound("laser")
ent:PillSound("laser_start")
timer.Simple(2, function()
if IsValid(target) then
target:Remove()
end
if IsValid(beam) then
beam:Remove()
end
ply:Freeze(false)
if IsValid(ent) then
ent:PillLoopStop("laser")
end
end)
end
},
sounds = {
loop_laser = "npc/stalker/laser_burn.wav",
laser_start = "weapons/gauss/fire1.wav",
step = {"npc/stalker/stalker_footstep_left1.wav", "npc/stalker/stalker_footstep_left2.wav", "npc/stalker/stalker_footstep_right1.wav", "npc/stalker/stalker_footstep_right2.wav"}
},
moveSpeed = {
walk = 50,
run = 100
},
jumpPower = 0
})
pk_pills.register("crab_synth", {
printName = "Crab Synth",
side = "hl_combine",
type = "ply",
model = "models/Synth.mdl",
default_rp_cost = 15000,
side = "hl_combine",
camera = {
offset = Vector(0, 0, 50),
dist = 400
},
hull = Vector(200, 200, 110),
anims = {
default = {
idle = "idle01",
walk = "walk01"
}
},
aim = {
offset = 120
},
--attachment="eyes",
--fixTracers=true
--simple=true
attack = {
mode = "auto",
func = pk_pills.common.shoot,
delay = .05,
damage = 20,
spread = .05,
tracer = "AR2Tracer"
},
moveSpeed = {
walk = 150,
run = 300
},
sounds = {
shoot = "weapons/ar2/fire1.wav"
},
jumpPower = 0,
health = 5000
})

View File

@@ -0,0 +1,249 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("ccamera", {
printName = "Combine Camera",
side = "hl_combine",
type = "phys",
model = "models/combine_camera/combine_camera.mdl",
boxPhysics = {Vector(-10, -10, -20), Vector(10, 10, 0)},
userSpawn = {
type = "ceiling"
},
spawnFrozen = true,
camera = {
offset = Vector(0, 0, -50),
dist = 100,
underslung = true
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
canAim = function(ply, ent) return ent.active end,
attack = {
mode = "trigger",
func = function(ply, ent)
if ent.active and not ent.busy then
ent:PillSound("pic")
end
end
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if ent.busy then return end
if ent.active then
ent:PillAnim("retract")
ent:PillSound("retract")
ent.active = false
else
ent:PillAnim("deploy")
ent:PillSound("deploy")
end
ent.busy = true
timer.Simple(.2, function()
if not IsValid(ent) then return end
if ent:GetSequence() == ent:LookupSequence("deploy") then
ent.active = true
end
ent.busy = false
end)
end
},
health = 40,
sounds = {
deploy = "npc/turret_floor/deploy.wav",
retract = "npc/turret_floor/retract.wav",
die = "npc/turret_floor/die.wav",
pic = "npc/scanner/scanner_photo1.wav"
}
})
pk_pills.register("cturret_ceiling", {
printName = "Combine Ceiling Turret",
parent = "ccamera",
model = "models/combine_turrets/ceiling_turret.mdl",
aim = {
attachment = "eyes"
},
attack = {
mode = "auto",
func = pk_pills.common.shoot,
delay = .1,
damage = 4,
spread = .01,
anim = "fire",
tracer = "AR2Tracer"
},
sounds = {
shoot = pk_pills.helpers.makeList("npc/turret_floor/shoot#.wav", 3)
}
})
pk_pills.register("ccrawler", {
printName = "Combine Flea Drone",
side = "hl_combine",
type = "ply",
model = "models/combine_turrets/ground_turret.mdl",
noragdoll = true,
default_rp_cost = 4000,
camera = {
offset = Vector(0, 0, 30),
dist = 80
},
hull = Vector(30, 30, 20),
anims = {},
moveSpeed = {
walk = 100,
run = 300
},
boneMorphs = {
["Ground_turret.mesh2"] = {
rot = Angle(0, 180, 0)
},
["Ground_turret.Gun"] = {
rot = Angle(0, 0, 0),
pos = Vector(0, -3, 39)
}
},
aim = {
attachment = "eyes",
simple = true
},
attack = {
mode = "auto",
func = pk_pills.common.shoot,
delay = .2,
damage = 5,
spread = .02,
tracer = "AR2Tracer"
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if ply:IsOnGround() then
ply:TakeDamage(30, ply)
local v = ply:EyeAngles():Forward() * 600 + Vector(0, 0, 600)
ply:SetLocalVelocity(v)
ent:PillSound("jump")
local start = 20
local endd = 10
ent.trail = util.SpriteTrail(ent, 0, Color(100, 100, 100), false, start, endd, 4, 1 / (start + endd) * .5, "trails/smoke.vmt")
end
end
},
land = function(ply, ent)
if IsValid(ent.trail) then
ent.trail:Remove()
end
end,
sounds = {
shoot = "weapons/pistol/pistol_fire3.wav",
jump = "weapons/grenade_launcher1.wav"
},
noFallDamage = true,
muteSteps = true,
health = 150
})
--[[
pk_pills.register("bmturret",{
printName="Mini Turret",
type="phys",
model="models/turret/miniturret.mdl",
boxPhysics={Vector(-20,-20,-20),Vector(20,20,20)},
userSpawn= {
type="wall",
ang=Angle(90,0,0)
},
seqInit="deploy",
spawnFrozen=true,
camera={
offset=Vector(0,0,60),
dist=80
},
aim={
attachment="0",
},
canAim=function(ply,ent)
return ent:GetCycle()==1
end,
attack={
mode= "auto",
func=pk_pills.common.shoot,
delay=.1,
damage=4,
spread=.01,
tracer="Tracer"
},
boneMorphs = {
["Bone01"]=function(ply,ent)
local a= ent:WorldToLocalAngles(ply:EyeAngles())
if ent:GetCycle()==1 then
return {rot=Angle(a.y,0,0)}
end
end,
["Bone03"]=function(ply,ent)
local a= ent:WorldToLocalAngles(ply:EyeAngles())
if ent:GetCycle()==1 then
return {rot=Angle(0,a.p,0)}
end
end
},
health=80,
sounds={
shoot="weapons/smg1/smg1_fire1.wav"
}
})
pk_pills.register("bmturret2",{
printName="Gatling Turret",
parent="bmturret",
type="phys",
model="models/turret/turret.mdl",
camera={
offset=Vector(0,0,80),
dist=100
},
attack={
mode= "auto",
func=pk_pills.common.shoot,
delay=.05,
damage=6,
spread=.01,
tracer="AR2Tracer"
},
boneMorphs = {
["Dummy02"]=function(ply,ent)
local a= ent:WorldToLocalAngles(ply:EyeAngles())
if ent:GetCycle()==1 then
return {rot=Angle(a.y,0,0)}
end
end,
["Dummy05"]=function(ply,ent)
local a= ent:WorldToLocalAngles(ply:EyeAngles())
if ent:GetCycle()==1 then
return {rot=Angle(0,a.p,0)}
end
end
},
health=160,
sounds={
shoot="weapons/ar2/fire1.wav"
}
})
]]

View File

@@ -0,0 +1,466 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("hunter_chopper", {
printName = "Hunter-Chopper",
side = "hl_combine",
type = "phys",
model = "models/Combine_Helicopter.mdl",
default_rp_cost = 20000,
spawnOffset = Vector(0, 0, 200),
camera = {
offset = Vector(80, 0, 0),
dist = 1000
},
driveType = "fly",
driveOptions = {
speed = 20,
tilt = 20
},
seqInit = "idle",
aim = {
xPose = "weapon_yaw",
yPose = "weapon_pitch",
yInvert = true,
attachment = "Muzzle"
},
attack = {
mode = "auto",
func = pk_pills.common.shoot,
delay = .02,
damage = 10,
spread = .05,
tracer = "HelicopterTracer"
},
attack2 = {
mode = "auto",
func = function(ply, ent)
ent:PillSound("dropBomb")
local bomb = ents.Create("grenade_helicopter")
bomb:SetPos(ent:LocalToWorld(Vector(-60, 0, -60)))
bomb:SetAngles(Angle(math.Rand(-180, 180), math.Rand(-180, 180), math.Rand(-180, 180)))
bomb:Spawn()
bomb:SetPhysicsAttacker(ply)
local randVec = VectorRand()
randVec.z = 0
bomb:GetPhysicsObject():AddVelocity(ent:GetVelocity() + randVec * 100)
end,
delay = .5
},
reload = function(ply, ent)
if ent.lastrocket and ent.lastrocket + 1 > CurTime() then return end
ent:PillSound("rocket")
local rocket = ents.Create("rpg_missile")
rocket:SetPos(ent:LocalToWorld(Vector(0, 80, -80)))
rocket:SetAngles(ply:EyeAngles())
rocket:SetSaveValue("m_flDamage", 200)
rocket:SetOwner(ply)
rocket:SetVelocity(ent:GetVelocity())
rocket:Spawn()
rocket = ents.Create("rpg_missile")
rocket:SetPos(ent:LocalToWorld(Vector(0, -80, -80)))
rocket:SetAngles(ply:EyeAngles())
rocket:SetSaveValue("m_flDamage", 200)
rocket:SetOwner(ply)
rocket:SetVelocity(ent:GetVelocity())
rocket:Spawn()
ent.lastrocket = CurTime()
end,
health = 5600,
damageFromWater = -1,
sounds = {
loop_move = "npc/attack_helicopter/aheli_rotor_loop1.wav",
loop_attack = "npc/attack_helicopter/aheli_weapon_fire_loop3.wav",
dropBomb = "npc/attack_helicopter/aheli_mine_drop1.wav",
die = pk_pills.helpers.makeList("ambient/explosions/explode_#.wav", 9),
rocket = "weapons/grenade_launcher1.wav"
}
})
pk_pills.register("gunship", {
printName = "Combine Gunship",
side = "hl_combine",
type = "phys",
model = "models/gunship.mdl",
default_rp_cost = 20000,
spawnOffset = Vector(0, 0, 200),
camera = {
offset = Vector(80, 0, 0),
dist = 1000
},
driveType = "fly",
driveOptions = {
speed = 20,
tilt = 20
},
seqInit = "prop_turn",
aim = {
xPose = "flex_horz",
yPose = "flex_vert",
attachment = "Muzzle"
},
attack = {
mode = "auto",
func = pk_pills.common.shoot,
delay = .1,
damage = 10,
spread = .02,
tracer = "HelicopterTracer"
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if ent.usingWarpCannon then return end
local fireAngs = ent:GetAngles()
fireAngs.p = 45
fireAngs.r = 0
local tr = util.QuickTrace(ent:GetPos(), ent:GetPos() + fireAngs:Forward() * 99999, ent)
local effectdata = EffectData()
effectdata:SetEntity(ent)
effectdata:SetOrigin(tr.HitPos)
util.Effect("warp_cannon", effectdata, true, true)
ent:PillSound("warp_charge") --belly_cannon
timer.Simple(1.2, function()
if not IsValid(ent) then return end
ent:PillSound("warp_fire")
util.BlastDamage(ent, ply, tr.HitPos, 200, 1000)
if IsValid(tr.Entity) then
local phys = tr.Entity:GetPhysicsObject()
if IsValid(phys) then
phys:ApplyForceCenter(ply:EyeAngles():Forward() * 9 ^ 7)
end
end
end)
ent.usingWarpCannon = true
timer.Simple(2.4, function()
if not IsValid(ent) then return end
ent.usingWarpCannon = nil
end)
end
},
pose = {
fin_accel = function(ply, ent, old)
local vel = WorldToLocal(ent:GetVelocity(), Angle(), Vector(0, 0, 0), ent:GetAngles())
return vel.x / 800
end,
fin_sway = function(ply, ent, old)
local vel = WorldToLocal(ent:GetVelocity(), Angle(), Vector(0, 0, 0), ent:GetAngles())
return -vel.y / 800
end,
antenna_accel = function(ply, ent, old)
local vel = WorldToLocal(ent:GetVelocity(), Angle(), Vector(0, 0, 0), ent:GetAngles())
return vel.x / 2000
end,
antenna_sway = function(ply, ent, old)
local vel = WorldToLocal(ent:GetVelocity(), Angle(), Vector(0, 0, 0), ent:GetAngles())
return -vel.y / 2000
end
},
health = 5,
onlyTakesExplosiveDamage = true,
damageFromWater = -1,
sounds = {
loop_move = "npc/combine_gunship/engine_whine_loop1.wav",
loop_attack = "npc/combine_gunship/gunship_weapon_fire_loop6.wav",
die = pk_pills.helpers.makeList("ambient/explosions/explode_#.wav", 9),
warp_charge = "npc/strider/charging.wav",
warp_fire = "npc/strider/fire.wav"
}
})
pk_pills.register("dropship", {
printName = "Combine Dropship",
side = "hl_combine",
type = "phys",
model = "models/Combine_dropship.mdl",
default_rp_cost = 10000,
spawnOffset = Vector(0, 0, 200),
camera = {
offset = Vector(0, 0, 200),
dist = 1000
},
driveType = "fly",
driveOptions = {
speed = 30,
tilt = 20
},
aim = {
xPose = "weapon_yaw",
yPose = "weapon_pitch",
yInvert = true,
attachment = "Muzzle",
usesSecondaryEnt = true
},
attack = {
mode = "trigger",
func = function(ply, ent)
if IsValid(ent.container) then
ent.container:Deploy()
end
end
},
attack2 = {
mode = "auto",
func = pk_pills.common.shoot,
delay = .1,
damage = 4,
spread = .01,
tracer = "HelicopterTracer"
},
reload = function(ply, ent)
if IsValid(ent.container) then
ent.container:SetParent()
ent.container:PhysicsInit(SOLID_VPHYSICS)
ent.container:SetMoveType(MOVETYPE_VPHYSICS)
ent.container:SetSolid(SOLID_VPHYSICS)
ent.container:SetPos(ent:GetPos())
ent.container:SetAngles(ent:GetAngles())
ent.container:GetPhysicsObject():Wake()
ent:SetPillAimEnt(nil)
ent:PillSound("drop")
ent:PillLoopStop("deploy")
ent.container = nil
else
local tr = util.TraceHull({
start = ent:GetPos(),
endpos = ent:GetPos() + Vector(0, 0, -200),
filter = {ent},
mins = Vector(-50, -50, -50),
maxs = Vector(50, 50, 50)
})
local grabent = tr.Entity
if IsValid(grabent) then
if (grabent:GetClass() == "pill_dropship_container") then
grabent:SetPos(ent:GetPos())
grabent:SetAngles(ent:GetAngles())
grabent:SetParent(ent)
grabent:Fire("setparentattachment", "cargo_anim")
ent:SetPillAimEnt(grabent)
ent:PillFilterCam(grabent)
ent:PillSound("grab")
ent.container = grabent
elseif (grabent:GetClass() == "pill_dropship_strider" and not grabent.droppedfrom) then
grabent:SetPos(ent:GetPos())
grabent:SetAngles(ent:GetAngles())
grabent:SetParent(ent)
grabent:Fire("setparentattachment", "cargo_anim")
ent:PillFilterCam(grabent)
ent:PillSound("grab")
ent.container = grabent
elseif (grabent:GetClass() == "npc_strider") then
local strider_grabbed = ents.Create("pill_dropship_strider")
strider_grabbed:SetPos(ent:GetPos())
strider_grabbed:SetAngles(ent:GetAngles())
strider_grabbed:Spawn()
strider_grabbed:SetParent(ent)
strider_grabbed:Fire("setparentattachment", "cargo_anim")
ent:PillFilterCam(strider_grabbed)
ent:PillSound("grab")
ent.container = strider_grabbed
grabent:Remove()
end
end
end
end,
seqInit = "idle",
pose = {
body_accel = function(ply, ent, old)
local vel = WorldToLocal(ent:GetVelocity(), Angle(), Vector(0, 0, 0), ent:GetAngles())
return vel.x / 800
end,
body_sway = function(ply, ent, old)
local vel = WorldToLocal(ent:GetVelocity(), Angle(), Vector(0, 0, 0), ent:GetAngles())
return -vel.y / 800
end
},
damageFromWater = -1,
sounds = {
loop_move = "npc/combine_gunship/dropship_engine_near_loop1.wav",
loop_attack2 = "npc/combine_gunship/gunship_fire_loop1.wav",
loop_deploy = "npc/combine_gunship/dropship_dropping_pod_loop1.wav",
alert_empty = "npc/attack_helicopter/aheli_damaged_alarm1.wav",
grab = "vehicles/Crane/crane_magnet_switchon.wav",
drop = "vehicles/Crane/crane_magnet_release.wav",
die = pk_pills.helpers.makeList("ambient/explosions/explode_#.wav", 9)
}
})
pk_pills.register("advisor", {
printName = "Advisor",
side = "hl_combine",
type = "phys",
model = "models/advisor.mdl",
default_rp_cost = 8000,
camera = {
dist = 250
},
seqInit = "Idle01",
sphericalPhysics = 50,
driveType = "fly",
driveOptions = {
speed = 10
},
attack = {
mode = "trigger",
func = function(ply, ent)
if ent:GetSequence() ~= ent:LookupSequence("Idle01") then return end
ent:PillAnim("attackL", true)
local tr = util.TraceHull({
start = ent:GetPos(),
endpos = ent:GetPos() + ent:GetAngles():Forward() * 200,
filter = {ent},
mins = Vector(-25, -25, -25),
maxs = Vector(25, 25, 25)
})
if IsValid(tr.Entity) then
local dmg = DamageInfo()
dmg:SetAttacker(ply)
dmg:SetInflictor(ent)
dmg:SetDamageType(DMG_SLASH)
dmg:SetDamage(50)
tr.Entity:TakeDamageInfo(dmg)
ent:PillSound("hit")
end
timer.Simple(.5, function()
if not IsValid(ent) then return end
ent:PillAnim("Idle01", true)
end)
end
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if ent:GetSequence() ~= ent:LookupSequence("Idle01") then return end
ent:PillAnim("attackR", true)
local tr = util.TraceHull({
start = ent:GetPos(),
endpos = ent:GetPos() + ent:GetAngles():Forward() * 200,
filter = {ent},
mins = Vector(-25, -25, -25),
maxs = Vector(25, 25, 25)
})
if IsValid(tr.Entity) then
local dmg = DamageInfo()
dmg:SetAttacker(ply)
dmg:SetInflictor(ent)
dmg:SetDamageType(DMG_SLASH)
dmg:SetDamage(50)
tr.Entity:TakeDamageInfo(dmg)
ent:PillSound("hit")
end
timer.Simple(.5, function()
if not IsValid(ent) then return end
ent:PillAnim("Idle01", true)
end)
end
},
health = 1000,
sounds = {
loop_move = "ambient/levels/citadel/citadel_ambient_voices1.wav",
hit = pk_pills.helpers.makeList("npc/zombie/claw_strike#.wav", 3)
}
})
pk_pills.register("strider", {
printName = "Strider",
side = "hl_combine",
type = "phys",
model = "models/combine_strider.mdl",
default_rp_cost = 20000,
camera = {
dist = 750
},
seqInit = "Idle01",
driveType = "strider",
aim = {
xInvert = true,
xPose = "minigunYaw",
yPose = "minigunPitch",
attachment = "MiniGun",
fixTracers = true,
simple = true,
overrideStart = Vector(80, 0, -40)
},
attack = {
mode = "auto",
func = pk_pills.common.shoot,
delay = .2,
damage = 30,
spread = .02,
tracer = "HelicopterTracer"
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if ent.usingWarpCannon then return end
local tr = util.QuickTrace(ent:LocalToWorld(Vector(80, 0, -40)), ply:EyeAngles():Forward() * 99999, ent)
local effectdata = EffectData()
effectdata:SetEntity(ent)
effectdata:SetOrigin(tr.HitPos)
util.Effect("warp_cannon", effectdata, true, true)
ent:PillSound("warp_charge")
timer.Simple(1.2, function()
if not IsValid(ent) then return end
ent:PillSound("warp_fire")
util.BlastDamage(ent, ply, tr.HitPos, 200, 1000)
if IsValid(tr.Entity) then
local phys = tr.Entity:GetPhysicsObject()
if IsValid(phys) then
phys:ApplyForceCenter(ply:EyeAngles():Forward() * 9 ^ 7)
end
end
end)
ent.usingWarpCannon = true
timer.Simple(2.4, function()
if not IsValid(ent) then return end
ent.usingWarpCannon = nil
end)
end
},
renderOffset = function(ply, ent)
local h = ent:GetPoseParameter("body_height") * 500
return Vector(0, 0, 500 - h)
end,
health = 7,
onlyTakesExplosiveDamage = true,
sounds = {
step = pk_pills.helpers.makeList("npc/strider/strider_step#.wav", 6),
shoot = "npc/strider/strider_minigun.wav",
warp_charge = "npc/strider/charging.wav",
warp_fire = "npc/strider/fire.wav"
}
})

View File

@@ -0,0 +1,375 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("rollermine", {
printName = "Rollermine",
side = "hl_combine",
type = "phys",
model = "models/roller.mdl",
model2 = "models/roller_spikes.mdl",
default_rp_cost = 3000,
driveType = "roll",
driveOptions = {
power = 8000,
jump = 15000,
burrow = 6
},
attack = {
mode = "trigger",
func = function(ply, ent)
if ent:GetMoveType() ~= MOVETYPE_VPHYSICS then return end
if ent:GetModel() == ent.formTable.model then
ent:PillSound("bladesOut")
ent:PillLoopSound("charge")
else
ent:PillSound("bladesIn")
ent:PillLoopStop("charge")
end
ent:SetModel(ent:GetModel() == ent.formTable.model and ent.formTable.model2 or ent.formTable.model)
end
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
ent:PillDie()
end
},
diesOnExplode = true,
damageFromWater = -1,
die = function(ply, ent)
local explode = ents.Create("env_explosion")
explode:SetPos(ent:GetPos())
explode:Spawn()
explode:SetOwner(ply)
explode:SetKeyValue("iMagnitude", "100")
explode:Fire("Explode", 0, 0)
end,
sounds = {
jump = "npc/roller/mine/rmine_predetonate.wav",
burrow = "npc/roller/mine/combine_mine_deactivate1.wav",
contact = "npc/roller/mine/rmine_explode_shock1.wav",
bladesIn = pk_pills.helpers.makeList("npc/roller/mine/rmine_blades_in#.wav", 3),
bladesOut = pk_pills.helpers.makeList("npc/roller/mine/rmine_blades_out#.wav", 3),
loop_move = "npc/roller/mine/rmine_moveslow_loop1.wav",
loop_charge = "npc/roller/mine/rmine_seek_loop2.wav"
},
moveSoundControl = function(ply, ent)
local MineSpeed = ent:GetVelocity():Length()
if MineSpeed > 50 then return math.Clamp(MineSpeed / 2, 100, 150) end
end,
contact = function(ply, ent, other)
if ent:GetModel() == ent.formTable.model2 then return 25, DMG_SHOCK, 20000 end
end
})
pk_pills.register("cityscanner", {
printName = "City Scanner",
side = "hl_combine",
type = "phys",
model = "models/Combine_Scanner.mdl",
default_rp_cost = 1000,
driveType = "fly",
driveOptions = {
speed = 6
},
aim = {
xPose = "flex_horz",
yPose = "flex_vert",
nocrosshair = true
},
pose = {
dynamo_wheel = function(ply, ent, old) return old + 10 end,
tail_control = function(ply, ent) return ent:GetPhysicsObject():GetVelocity().z / 6 end
},
attack = {
mode = "trigger",
func = function(ply, ent)
ent:PillSound("pic")
end
},
seqInit = "idle",
health = 30,
damageFromWater = -1,
sounds = {
loop_move = "npc/scanner/scanner_scan_loop1.wav",
die = "npc/scanner/scanner_explode_crash2.wav",
pic = "npc/scanner/scanner_photo1.wav"
}
})
pk_pills.register("manhack", {
printName = "Manhack",
side = "hl_combine",
type = "phys",
model = "models/manhack.mdl",
default_rp_cost = 2000,
driveType = "fly",
driveOptions = {
speed = 6,
tilt = 20
},
attack = {
mode = "trigger",
func = function(ply, ent)
if not ent.blades then
ent:PillSound("toggleBlades")
ent:PillLoopSound("blades")
else
ent:PillSound("toggleBlades")
ent:PillLoopStop("blades")
end
ent.blades = not ent.blades
end
},
pose = {
Panel1 = function(ply, ent, old)
if ent.blades and old < 90 then return old + 20 end
if not ent.blades and old > 0 then return old - 20 end
end,
Panel2 = function(ply, ent, old)
if ent.blades and old < 90 then return old + 20 end
if not ent.blades and old > 0 then return old - 20 end
end,
Panel3 = function(ply, ent, old)
if ent.blades and old < 90 then return old + 20 end
if not ent.blades and old > 0 then return old - 20 end
end,
Panel4 = function(ply, ent, old)
if ent.blades and old < 90 then return old + 20 end
if not ent.blades and old > 0 then return old - 20 end
end
},
bodyGroups = {1, 2},
seqInit = "fly",
health = 25,
damageFromWater = -1,
sounds = {
loop_move = "npc/manhack/mh_engine_loop1.wav",
loop_blades = "npc/manhack/mh_blade_loop1.wav",
toggleBlades = "npc/manhack/mh_blade_snick1.wav",
cut_flesh = pk_pills.helpers.makeList("npc/manhack/grind_flesh#.wav", 3),
cut = pk_pills.helpers.makeList("npc/manhack/grind#.wav", 5),
die = "npc/manhack/gib.wav"
},
collide = function(ply, ent, collide)
if ent.blades and collide.HitNormal.z < 0.5 and collide.HitNormal.z > -0.5 then
local force = -collide.HitNormal
--GTFO
ent:GetPhysicsObject():ApplyForceCenter(force * 1000)
--Give Damage
local dmginfo = DamageInfo()
dmginfo:SetDamage(25)
dmginfo:SetAttacker(ply)
dmginfo:SetDamageForce(force * -10000)
collide.HitEntity:TakeDamageInfo(dmginfo)
if (collide.HitEntity:IsPlayer() or collide.HitEntity:IsNPC() or collide.HitEntity:GetClass() == "pill_ent_phys") then
ent:PillSound("cut_flesh")
else
ent:PillSound("cut")
end
end
end,
contactForceHorizontal = true
})
pk_pills.register("clawscanner", {
printName = "Claw Scanner",
side = "hl_combine",
type = "phys",
model = "models/Shield_Scanner.mdl",
default_rp_cost = 3000,
driveType = "fly",
driveOptions = {
speed = 6
},
attack = {
mode = "trigger",
func = function(ply, ent)
if ent:GetSequence() == ent:LookupSequence("HoverClosed") then
--NOT calling this twice will result in bugged animations. Fuck your animations, Valve.
ent:PillAnim("OpenUp", true)
ent:PillAnim("OpenUp", true)
local mine
timer.Simple(1, function()
if not IsValid(ent) then return end
--Make a mine
local attach = ent:LookupAttachment("claw")
mine = ents.Create("pill_hopper")
local angpos = ent:GetAttachment(attach)
mine:SetPos(angpos.Pos)
mine:SetAngles(angpos.Ang)
mine:SetParent(ent)
mine:Spawn()
mine:SetOwner(ply)
mine:Fire("setparentattachment", "claw", 0.01)
ent:PillSound("minepop")
end)
timer.Simple(3, function()
if not IsValid(ent) then return end
ent:PillAnim("CloseUp", true)
mine:SetParent(nil)
mine:PhysicsInit(SOLID_VPHYSICS)
local phys = mine:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
ent:PillSound("minedrop")
timer.Simple(2, function()
if not IsValid(ent) then return end
ent:PillAnim("HoverClosed", true)
end)
end)
end
end
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
ent:PillSound("pic")
end
},
seqInit = "HoverClosed",
health = 30,
damageFromWater = -1,
sounds = {
loop_move = "npc/scanner/combat_scan_loop6.wav",
die = "npc/scanner/scanner_explode_crash2.wav",
minepop = "npc/ichthyosaur/snap.wav",
minedrop = pk_pills.helpers.makeList("npc/scanner/combat_scan#.wav", 5),
pic = "npc/scanner/scanner_photo1.wav"
}
})
pk_pills.register("cturret", {
printName = "Combine Turret",
side = "hl_combine",
type = "phys",
model = "models/combine_turrets/floor_turret.mdl",
default_rp_cost = 2000,
spawnOffset = Vector(0, 0, 5),
camera = {
offset = Vector(0, 0, 60)
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch",
attachment = "eyes"
},
canAim = function(ply, ent) return ent.active end,
attack = {
mode = "auto",
func = pk_pills.common.shoot,
delay = .1,
damage = 4,
spread = .01,
anim = "fire",
tracer = "AR2Tracer"
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if ent.busy then return end
if ent.active then
ent:PillAnim("retract")
ent:PillSound("retract")
ent.active = false
else
ent:PillAnim("deploy")
ent:PillSound("deploy")
ent:PillLoopSound("alarm")
timer.Simple(1, function()
if not IsValid(ent) then return end
ent:PillLoopStop("alarm")
end)
end
ent.busy = true
timer.Simple(.2, function()
if not IsValid(ent) then return end
if ent:GetSequence() == ent:LookupSequence("deploy") then
ent.active = true
end
ent.busy = false
end)
end
},
diesOnExplode = true,
damageFromWater = -1,
sounds = {
loop_alarm = "npc/turret_floor/alarm.wav",
shoot = pk_pills.helpers.makeList("npc/turret_floor/shoot#.wav", 3),
deploy = "npc/turret_floor/deploy.wav",
retract = "npc/turret_floor/retract.wav",
die = "npc/turret_floor/die.wav",
auto_ping = "npc/turret_floor/ping.wav",
auto_ping_func = function(ply, ent) return ent.active and not ent.loopingSounds["alarm"]:IsPlaying() and (not ent.lastAttack or ent.lastAttack + .2 < CurTime()), 1 end
}
})
pk_pills.register("mortar_synth", {
printName = "Mortar Synth",
side = "hl_combine",
type = "phys",
model = "models/mortarsynth.mdl",
default_rp_cost = 8000,
sphericalPhysics = 30,
driveType = "hover",
driveOptions = {
speed = 6,
height = 50
},
attack = {
mode = "auto",
delay = 1,
func = function(ply, ent)
--if ent.attacking then return end
ent:PillAnim("Mortar_Shoot", true)
ent:SetPlaybackRate(2)
--ent.attacking=true
timer.Simple(.5, function()
if not IsValid(ent) then return end
ent:PillSound("fire")
local angs = ply:EyeAngles()
angs.p = angs.p - 45
local nade = ents.Create("pill_proj_energy_grenade")
nade:SetPos(ent:LocalToWorld(Vector(50, 0, 50)))
nade:SetAngles(angs)
nade:SetOwner(ply)
nade:Spawn()
end)
end
},
--[[timer.Simple(1,function()
if !IsValid(ent) then return end
ent.attacking=nil
end)]]
health = 400,
sounds = {
loop_move = "npc/scanner/combat_scan_loop6.wav",
fire = "npc/env_headcrabcanister/launch.wav"
}
})

View File

@@ -0,0 +1,272 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("csoldier", {
printName = "Combine Soldier",
type = "ply",
model = "models/Combine_Soldier.mdl",
default_rp_cost = 5000,
skin = 0,
options = function()
return {
{
model = "models/Combine_Soldier.mdl"
},
{
model = "models/Combine_Soldier_PrisonGuard.mdl"
}
}
end,
side = "hl_combine",
voxSet = "combine",
anims = {
default = {
idle = "Idle_Unarmed",
walk = "WalkUnarmed_all",
run = "Run_turretCarry_ALL",
crouch = "CrouchIdle",
crouch_walk = "Crouch_WalkALL",
glide = "jump_holding_glide",
jump = "jump_holding_jump",
throw = "grenThrow",
rappel = "rappelloop",
land = "jump_holding_land",
g_attack = "gesture_shoot_ar2",
g_reload = "gesture_reload"
},
smg = {
idle = "CombatIdle1_SMG1",
walk = "Walk_aiming_all",
run = "RunAIMALL1",
crouch = "crouch_aim_sm1",
g_reload = "gesture_reload_SMG1"
},
ar2 = {
idle = "CombatIdle1",
walk = "Walk_aiming_all",
run = "RunAIMALL1"
},
shotgun = {
idle = "CombatIdle1_SG",
walk = "Walk_aiming_all_SG",
run = "RunAIMALL1_SG",
g_attack = "gesture_shoot_shotgun"
}
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if ply:IsOnGround() then end
end
},
flashlight = function(ply, ent)
if not ply:IsOnGround() and not ent.grappleEnd then
local tr = ply:GetEyeTrace()
if (tr.Fraction < 0.01) then
ent.grappleEnd = tr.HitPos
ent.grappleSliding = true
local effectdata = EffectData()
effectdata:SetOrigin(ent.grappleEnd)
effectdata:SetEntity(ent)
util.Effect("rappel_line", effectdata, true, true)
ent:PillSound("rappel_start")
ent:PillLoopSound("rappel")
end
elseif ply:IsOnGround() then
ent:PillAnim("throw", true)
if not ent.formTable.throwsManhack then
timer.Simple(.75, function()
if not IsValid(ent) then return end
local nade = ents.Create("npc_grenade_frag")
nade:SetPos(ply:EyePos() + ply:EyeAngles():Forward() * 50)
nade:SetAngles(ply:EyeAngles())
nade:Spawn()
nade:SetOwner(ply)
nade:Fire("SetTimer", 3, 0)
nade:GetPhysicsObject():SetVelocity((ply:EyeAngles():Forward() + Vector(0, 0, .4)) * 1000)
end)
else
timer.Simple(1, function()
if not IsValid(ent) then return end
local hax = ents.Create("npc_manhack")
hax:SetPos(ply:EyePos() + ply:EyeAngles():Forward() * 100)
hax:SetAngles(ply:EyeAngles())
hax:Spawn()
hax:GetPhysicsObject():SetVelocity(Vector(0, 0, 500))
end)
end
end
end,
moveMod = function(ply, ent, mv, cmd)
--garbage code... vertical velocity predicted, lateral velocity not
if SERVER and ent.grappleEnd then
ent:PillAnimTick("rappel")
local targetVel = -500
if ply:KeyDown(IN_JUMP) then
if ent.grappleSliding then
ent:PillLoopStop("rappel")
ent:PillSound("rappel_brake")
ent.grappleSliding = false
end
targetVel = 0
else
if not ent.grappleSliding then
ent:PillLoopSound("rappel")
ent.grappleSliding = true
end
end
if mv:GetVelocity().z < targetVel then
local latforce = (ent.grappleEnd - mv:GetOrigin()) * .05
latforce.z = 0
mv:SetVelocity(mv:GetVelocity() + latforce)
local curvel = mv:GetVelocity()
curvel.z = targetVel
mv:SetVelocity(curvel)
end
end
--dumb
if CLIENT and ent:GetPuppet():GetSequence() == ent:GetPuppet():LookupSequence("rappelloop") then
local targetVel = -500
if ply:KeyDown(IN_JUMP) then
targetVel = 0
end
if mv:GetVelocity().z < targetVel then
local curvel = mv:GetVelocity()
curvel.z = targetVel
mv:SetVelocity(curvel)
end
end
end,
land = function(ply, ent)
if ent.grappleEnd then
ent.grappleEnd = nil
ent.grappleSliding = nil
ent:PillAnim("land", true)
ent:PillLoopStop("rappel")
end
end,
moveSpeed = {
walk = 60,
run = 200,
ducked = 40
},
loadout = {"weapon_ar2", "pill_wep_holstered"},
ammo = {
AR2 = 90
},
validHoldTypes = {"ar2", "shotgun", "smg"},
movePoseMode = "yaw",
health = 150,
sounds = {
rappel_start = "weapons/crossbow/fire1.wav",
rappel_brake = "physics/metal/sawblade_stick1.wav",
loop_rappel = "weapons/tripwire/ropeshoot.wav",
step = pk_pills.helpers.makeList("npc/combine_soldier/gear#.wav", 6)
}
})
pk_pills.register("csoldier_shotgunner", {
parent = "csoldier",
printName = "Combine Shotgunner",
skin = 1,
loadout = {"weapon_shotgun"},
ammo = {
AR2 = 0,
Buckshot = 30
}
})
--[[)
pk_pills.register("csoldier_guard",{
parent="csoldier",
printName="Prison Soldier",
model="models/Combine_Soldier_PrisonGuard.mdl",
options=false
})
pk_pills.register("csoldier_guard_shotgunner",{
parent="csoldier_shotgunner",
printName="Prison Shotgunner",
model="models/Combine_Soldier_PrisonGuard.mdl"
})]]
pk_pills.register("csoldier_elite", {
parent = "csoldier",
printName = "Combine Elite",
model = "models/Combine_Super_Soldier.mdl",
default_rp_cost = 6000,
options = false,
ammo = {
AR2AltFire = 6
},
health = 300
})
pk_pills.register("csoldier_police", {
parent = "csoldier",
printName = "Metrocop",
model = "models/Police.mdl",
options = false,
anims = {
default = {
idle = "busyidle2",
walk = "walk_all",
run = "run_all",
crouch = "Crouch_idle_pistol",
crouch_walk = "Crouch_all",
throw = "deploy"
},
smg = {
idle = "smg1angryidle1",
walk = "walk_aiming_SMG1_all",
run = "run_aiming_SMG1_all",
crouch = "crouch_idle_smg1",
g_reload = "gesture_reload_smg1",
g_attack = "gesture_shoot_smg1"
},
pistol = {
idle = "pistolangryidle2",
walk = "walk_aiming_pistol_all",
run = "run_aiming_pistol_all",
g_reload = "gesture_reload_pistol",
g_attack = "gesture_shoot_pistol"
},
melee = {
idle = "batonangryidle1",
walk = "walk_hold_baton_angry",
g_attack = "swinggesture"
}
},
sounds = {
step = pk_pills.helpers.makeList("npc/metropolice/gear#.wav", 6)
},
throwsManhack = true,
validHoldTypes = {"melee", "pistol", "smg"},
loadout = {"weapon_stunstick", "weapon_pistol", "weapon_smg1", "pill_wep_holstered"},
ammo = {
AR2 = 0,
pistol = 54,
smg1 = 90
},
health = 100
})

View File

@@ -0,0 +1,449 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("birdbrainswagtrain", {
printName = "Bird Brain Swag Train",
side = "wild",
type = "phys",
model = "models/props_trainstation/train001.mdl",
default_rp_cost = 100000,
spawnOffset = Vector(0, 0, 200),
camera = {
offset = Vector(80, 0, 0),
dist = 2000
},
driveType = "fly",
driveOptions = {
speed = 100,
rotation = 90
},
attack = {
mode = "trigger",
func = function(ply, ent)
ent:PillSound("horn")
end
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if not ent.lastcar then
ent.lastcar = ent
end
if not IsValid(ent.lastcar) then return end
local t = math.random(2, 4)
if t == 4 then
t = 5
end
local pos = ent.lastcar:LocalToWorld(Vector(0, -650, 0))
if not util.IsInWorld(pos) then return end
local car = ents.Create("prop_physics")
car:SetModel("models/props_trainstation/train00" .. t .. ".mdl")
car:SetPos(pos)
car:SetAngles(ent.lastcar:GetAngles())
car:Spawn()
car:GetPhysicsObject():EnableGravity(false)
ent:DeleteOnRemove(car)
ent:PillFilterCam(car)
constraint.Ballsocket(ent.lastcar, car, 0, 0, Vector(0, 300, 0), 0, 0, 1)
ent.lastcar = car
ent:PillSound("newCar")
end
},
health = 99999,
sounds = {
horn = "ambient/alarms/razortrain_horn1.wav",
newCar = "ambient/machines/wall_crash1.wav"
}
})
pk_pills.register("landshark", {
parent = "ichthyosaur",
printName = "Landshark",
default_rp_cost = 50000,
driveType = "hover",
driveOptions = {
speed = 50,
height = 75
}
})
pk_pills.register("turbobird", {
parent = "bird_seagull",
printName = "Turbobird",
default_rp_cost = 50000,
side = "wild",
camera = {
offset = Vector(0, 0, 40),
dist = 200
},
hull = Vector(50, 50, 50),
modelScale = 5,
health = 1337,
moveSpeed = {
walk = 100,
run = 300
},
aim = {},
anims = {
default = {
fly_rate = .5,
kaboom = "reference"
}
},
sounds = {
vocalize = "npc/metropolice/vo/dontmove.wav",
loop_windup = "vehicles/Crane/crane_extend_loop1.wav",
fire = pk_pills.helpers.makeList("npc/metropolice/pain#.wav", 4)
},
attack = {
mode = "auto",
func = function(ply, ent)
ent:PillSound("fire")
local rocket = ents.Create("pill_proj_rocket")
rocket:SetModel("models/crow.mdl")
rocket:SetPos(ply:EyePos() + ply:EyeAngles():Forward() * 100)
rocket:SetAngles(ply:EyeAngles())
rocket.sound = "ambient/levels/canals/windmill_wind_loop1.wav"
rocket.trail = "trails/lol.vmt"
rocket.tcolor = HSVToColor(math.Rand(0, 360), 1, 1)
rocket:Spawn()
rocket:SetOwner(ply)
end,
delay = .3
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if ent.splodin then return end
ent:PillAnim("kaboom", true)
ent:PillSound("vocalize")
ent:PillLoopSound("windup")
ent.splodin = true
timer.Simple(3, function()
if not IsValid(ent) then return end
local explode = ents.Create("env_explosion")
explode:SetPos(ply:GetPos())
explode:Spawn()
explode:SetOwner(ply)
explode:SetKeyValue("iMagnitude", "300")
explode:Fire("Explode", 0, 0)
ply:Kill()
end)
end
}
})
pk_pills.register("melon", {
printName = "Melon",
type = "phys",
side = "harmless",
model = "models/props_junk/watermelon01.mdl",
default_rp_cost = 800,
health = 69,
driveType = "roll",
driveOptions = {
power = 300,
jump = 5000,
burrow = 6
},
sounds = {
jump = "npc/headcrab_poison/ph_jump1.wav",
burrow = "npc/antlion/digdown1.wav",
loop_move = "npc/fast_zombie/gurgle_loop1.wav"
},
moveSoundControl = function(ply, ent)
local MineSpeed = ent:GetVelocity():Length()
if MineSpeed > 50 then return math.Clamp(MineSpeed / 2, 100, 150) end
end
})
pk_pills.register("haxman", {
printName = "Dr. Hax",
type = "ply",
side = "wild",
model = "models/breen.mdl",
default_rp_cost = 20000,
aim = {},
anims = {
default = {
idle = "idle_angry_melee",
walk = "walk_all",
run = "sprint_all", --pace_all
crouch = "Crouch_idleD",
crouch_walk = "Crouch_walk_aLL",
glide = "jump_holding_glide",
jump = "jump_holding_jump",
throw = "swing"
}
},
boneMorphs = {
["ValveBiped.Bip01_Head1"] = {
scale = Vector(3, 3, 3)
}
},
sounds = {
throw = "vo/npc/male01/hacks01.wav"
},
moveSpeed = {
walk = 100,
run = 1000,
ducked = 40
},
jumpPower = 1000,
movePoseMode = "yaw",
health = 10000,
noFallDamage = true,
attack = {
mode = "trigger",
func = function(ply, ent)
if not ply:OnGround() then return end
local computer = ents.Create("pill_proj_prop")
computer:SetModel("models/props_lab/monitor02.mdl")
computer:SetPos(ply:EyePos() + ply:EyeAngles():Forward() * 100)
computer:SetAngles(ply:EyeAngles())
computer:Spawn()
computer:SetPhysicsAttacker(ply)
ent:PillAnim("throw", true)
ent:PillSound("throw")
end
}
})
pk_pills.register("crate", {
printName = "Crate",
side = "harmless",
type = "phys",
model = "models/props_junk/wood_crate001a.mdl",
default_rp_cost = 200,
spawnOffset = Vector(0, 0, 30),
health = 30
})
pk_pills.register("lamp", {
printName = "Lamp",
side = "harmless",
type = "phys",
model = "models/props_interiors/Furniture_Lamp01a.mdl",
default_rp_cost = 200,
spawnOffset = Vector(0, 0, 38),
health = 30
})
pk_pills.register("cactus", {
printName = "Cactus",
side = "harmless",
type = "phys",
model = "models/props_lab/cactus.mdl",
default_rp_cost = 200,
spawnOffset = Vector(0, 0, 10),
health = 30
})
pk_pills.register("cone", {
printName = "Traffic Cone",
side = "harmless",
type = "phys",
model = "models/props_junk/TrafficCone001a.mdl",
default_rp_cost = 200,
spawnOffset = Vector(0, 0, 25),
health = 30
})
pk_pills.register("phantom", {
printName = "Phantom",
side = "harmless",
type = "phys",
model = "models/Gibs/HGIBS.mdl",
default_rp_cost = 30000,
spawnOffset = Vector(0, 0, 50),
camera = {
distFromSize = true
},
sounds = {
swap = "weapons/bugbait/bugbait_squeeze1.wav",
nope = "vo/Citadel/br_no.wav",
spook = "ambient/creatures/town_child_scream1.wav"
},
aim = {},
attack = {
mode = "trigger",
func = function(ply, ent)
local tr = util.QuickTrace(ent:GetPos(), ply:EyeAngles():Forward() * 1000, ent)
local prop = tr.Entity
if IsValid(prop) and prop:GetClass() == "prop_physics" and hook.Call("PhysgunPickup", GAMEMODE, ply, prop) then
local mymdl = ent:GetModel()
local mypos = ent:GetPos()
local myangs = ent:GetAngles()
ent:SetModel(prop:GetModel())
ent:PhysicsInit(SOLID_VPHYSICS)
ent:SetMoveType(MOVETYPE_VPHYSICS)
ent:SetSolid(SOLID_VPHYSICS)
ent:SetPos(prop:GetPos())
ent:SetAngles(prop:GetAngles())
ent:PhysWake()
prop:SetModel(mymdl)
prop:PhysicsInit(SOLID_VPHYSICS)
prop:SetMoveType(MOVETYPE_VPHYSICS)
prop:SetSolid(SOLID_VPHYSICS)
prop:SetPos(mypos)
prop:SetAngles(myangs)
prop:PhysWake()
ent:PillSound("swap")
else
ent:PillSound("nope")
end
end
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
ent:PillSound("spook")
end
},
driveType = "fly",
driveOptions = {
speed = 10
},
health = 666
})
pk_pills.register("steelball", {
printName = "Ball of Steel",
side = "harmless",
type = "phys",
model = "models/hunter/misc/sphere375x375.mdl",
default_rp_cost = 15000,
camera = {
offset = Vector(0, 0, 0),
dist = 1000
},
spawnOffset = Vector(0, 0, 60),
driveType = "roll",
driveOptions = {
power = 300000,
jump = 200000
},
visMat = "phoenix_storms/stripes",
physMat = "metal",
health = 30000
})
pk_pills.register("doggie", {
printName = "Doggie",
side = "harmless",
type = "ply",
model = "models/balloons/balloon_dog.mdl",
noragdoll = true,
default_rp_cost = 800,
camera = {
offset = Vector(0, 0, 5),
dist = 80
},
hull = Vector(10, 10, 15),
anims = {},
moveSpeed = {
walk = 120,
run = 240
},
visColorRandom = true,
health = 75
})
pk_pills.register("skeeter", {
printName = "Skeeter",
side = "harmless",
type = "ply",
model = "models/odessa.mdl",
default_rp_cost = 800,
camera = {
offset = Vector(0, 0, 5),
dist = 40
},
hull = Vector(5, 5, 10),
duckBy = 5,
modelScale = .2,
anims = {
default = {
idle = "cower_idle",
walk = "walk_panicked_all",
run = "run_all_panicked",
crouch = "arrestidle",
--crouch_walk="crouchrunall1", pos rot scale
glide = "spreadwallidle",
jump = "jump_holding_jump"
}
},
boneMorphs = {
["ValveBiped.Bip01_Head1"] = {
pos = Vector(5, 0, 0)
},
["ValveBiped.Bip01_L_Thigh"] = {
pos = Vector(10, 0, 0)
},
["ValveBiped.Bip01_R_Thigh"] = {
pos = Vector(-10, 0, 0)
}
},
moveSpeed = {
walk = 30,
run = 90
},
movePoseMode = "yaw",
jumpPower = 400,
health = 2,
noFallDamage = true
})
pk_pills.register("doge", {
printName = "Doge",
side = "harmless",
type = "phys",
sphericalPhysics = 20,
default_rp_cost = 30000,
sprite = {
mat = "pillsprites/shibe.png",
--color=Color(255,255,0),
size = 60,
offset = Vector(0, 0, 10)
},
--model="models/Gibs/HGIBS.mdl",
spawnOffset = Vector(0, 0, 50),
camera = {},
--distFromSize=true
sounds = {
swap = "weapons/bugbait/bugbait_squeeze1.wav",
nope = "vo/Citadel/br_no.wav",
spook = "ambient/creatures/town_child_scream1.wav"
},
attack = {
mode = "trigger",
func = function(ply, ent)
local effectdata = EffectData()
effectdata:SetOrigin(ent:GetPos())
util.Effect("wow_doge", effectdata, true, true)
ent:PillSound("wow")
end
},
driveType = "fly",
driveOptions = {
speed = 10
},
sounds = {
wow = "birdbrainswagtrain/wow.wav"
},
health = 420
})

View File

@@ -0,0 +1,516 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("giraffe", {
printName = "Giraffe",
side = "harmless",
type = "ply",
model = "models/mossman.mdl",
default_rp_cost = 800,
camera = {
offset = Vector(0, 0, 220),
dist = 400
},
hull = Vector(50, 50, 230),
duckBy = 150,
modelScale = 2,
anims = {
default = {
idle = "man_gun",
walk = "walk_holding_package_all",
run = "run_aiming_p_all",
crouch = "coverlow_l",
crouch_walk = "crouchrunall1",
glide = "sit_chair",
jump = "cower"
}
},
boneMorphs = {
["ValveBiped.Bip01_Head1"] = {
pos = Vector(50, 25, 0),
scale = Vector(2, 2, 2)
}
},
moveSpeed = {
walk = 300,
run = 900
},
movePoseMode = "yaw",
jumpPower = 400,
health = 600
})
pk_pills.register("hula", {
printName = "Hula",
side = "harmless",
type = "ply",
model = "models/props_lab/huladoll.mdl",
noragdoll = true,
default_rp_cost = 800,
camera = {
offset = Vector(0, 0, 5),
dist = 80
},
hull = Vector(5, 5, 6),
anims = {
default = {
idle = "idle",
shake = "shake"
}
},
attack = {
mode = "auto",
delay = .2,
func = function(ply, ent)
ent:PillAnim("shake")
end
},
moveSpeed = {
walk = 40,
run = 100
},
health = 5
})
pk_pills.register("wheelbarrow", {
printName = "Wheelbarrow",
side = "harmless",
type = "phys",
model = "models/props_junk/Wheebarrow01a.mdl",
default_rp_cost = 3000,
camera = {
dist = 120
},
driveType = "hover",
driveOptions = {
speed = 5,
height = 40
}
})
pk_pills.register("goover", {
printName = "Goover",
side = "harmless",
type = "phys",
default_rp_cost = 800,
options = function()
return {
{
model = "models/maxofs2d/balloon_gman.mdl"
},
{
model = "models/maxofs2d/balloon_mossman.mdl"
}
}
end,
driveType = "fly",
driveOptions = {
speed = 20
},
health = 50
})
pk_pills.register("baby", {
printName = "Baby",
side = "harmless",
type = "phys",
model = "models/props_c17/doll01.mdl",
default_rp_cost = 800,
camera = {
offset = Vector(0, 0, 5),
dist = 80
},
driveType = "hover",
driveOptions = {
speed = 3,
height = 20
},
health = 15
})
pk_pills.register("facepunch", {
printName = "Facepunch",
side = "wild",
type = "phys",
camera = {
dist = 300
},
default_rp_cost = 18000,
model = "models/props_phx/facepunch_logo.mdl",
driveType = "fly",
driveOptions = {
speed = 60,
rotation2 = 90
},
sounds = {
fire = "physics/metal/metal_box_impact_hard2.wav"
},
attack = {
mode = "auto",
delay = .33,
func = function(ply, ent)
ent:PillSound("fire")
local bomb = ents.Create("pill_proj_bomb")
bomb:SetModel("models/props_phx/facepunch_barrel.mdl")
bomb:SetPos(ent:GetPos() + ply:EyeAngles():Forward() * 100)
bomb:SetAngles(ply:EyeAngles())
bomb:SetOwner(ply)
bomb:Spawn()
end
},
health = 11111
})
pk_pills.register("rpg", {
printName = "RPG",
side = "harmless",
type = "phys",
default_rp_cost = 5000,
model = "models/weapons/w_missile_closed.mdl",
driveType = "fly",
driveOptions = {
speed = 30,
rocketMode = true
},
aim = {},
damageFromWater = -1,
sounds = {
loop_move = "weapons/rpg/rocket1.wav"
},
trail = {
texture = "trails/smoke.vmt",
width = 10
},
collide = function(ply, ent, collide)
ply:Kill()
end,
die = function(ply, ent)
local explode = ents.Create("env_explosion")
explode:SetPos(ent:GetPos())
explode:Spawn()
explode:SetOwner(ply)
explode:SetKeyValue("iMagnitude", "100")
explode:Fire("Explode", 0, 0)
end
})
pk_pills.register("rocket", {
parent = "rpg",
printName = "Rocket",
default_rp_cost = 10000,
model = false,
options = function()
return {
{
model = "models/props_phx/amraam.mdl"
},
{
model = "models/props_phx/ww2bomb.mdl"
},
{
model = "models/props_phx/torpedo.mdl"
},
{
model = "models/props_phx/mk-82.mdl"
}
}
end,
aim = {},
camera = {
dist = 300
},
driveOptions = {
speed = 60
},
die = function(ply, ent)
local pos = ent:GetPos()
local splode = function()
if not IsValid(ply) then return end
local explode = ents.Create("env_explosion")
explode:SetPos(pos + VectorRand() * 100)
explode:Spawn()
explode:SetOwner(ply)
explode:SetKeyValue("iMagnitude", "100")
explode:Fire("Explode", 0, 0)
end
splode()
for i = 1, 4 do
timer.Simple(i / 5, splode)
end
end
})
pk_pills.register("rocket2", {
parent = "rocket",
printName = "Super Rocket",
default_rp_cost = 20000,
model = "models/props_phx/rocket1.mdl",
options = false,
camera = {
dist = 600
},
aim = {},
driveOptions = {
speed = 90,
rotation2 = 90
},
die = function(ply, ent)
local pos = ent:GetPos()
local splode = function()
if not IsValid(ply) then return end
local explode = ents.Create("env_explosion")
explode:SetPos(pos + VectorRand() * 500)
explode:Spawn()
explode:SetOwner(ply)
explode:SetKeyValue("iMagnitude", "100")
explode:Fire("Explode", 0, 0)
end
splode()
for i = 1, 19 do
timer.Simple(i / 10, splode)
end
end
})
pk_pills.register("sawblade", {
printName = "Saw Blade",
side = "wild",
type = "phys",
default_rp_cost = 9000,
model = "models/props_junk/sawblade001a.mdl",
driveType = "fly",
driveOptions = {
speed = 10,
spin = 200
},
sounds = {
loop_move = "vehicles/v8/third.wav",
cut = "physics/metal/sawblade_stick1.wav"
},
collide = function(ply, ent, collide)
if collide.HitNormal.z < 0.5 and collide.HitNormal.z > -0.5 then
local force = -collide.HitNormal
--GTFO
ent:GetPhysicsObject():ApplyForceCenter(force * 20000)
--Give Damage
local dmginfo = DamageInfo()
dmginfo:SetDamage(100)
dmginfo:SetAttacker(ply)
dmginfo:SetDamageForce(force * -10000)
collide.HitEntity:TakeDamageInfo(dmginfo)
ent:PillSound("cut")
end
end,
contactForceHorizontal = true,
health = 500
})
pk_pills.register("carousel", {
printName = "Carousel",
side = "wild",
type = "phys",
camera = {
dist = 300
},
default_rp_cost = 12000,
model = "models/props_c17/playground_carousel01.mdl",
driveType = "fly",
driveOptions = {
speed = 20,
spin = 100
},
health = 1000
})
pk_pills.register("chopper", {
printName = "Chopper",
side = "wild",
type = "phys",
camera = {
dist = 300
},
default_rp_cost = 12000,
model = "models/props_c17/TrapPropeller_Blade.mdl",
driveType = "fly",
driveOptions = {
speed = 20,
spin = -300
},
health = 1000
})
pk_pills.register("propeller", {
printName = "Propeller",
side = "wild",
type = "phys",
camera = {
dist = 200
},
default_rp_cost = 8000,
options = function()
return {
{
model = "models/props_phx/misc/propeller2x_small.mdl"
},
{
model = "models/props_phx/misc/propeller3x_small.mdl"
}
}
end,
driveType = "fly",
driveOptions = {
speed = 20,
spin = -300
},
health = 600
})
pk_pills.register("turbine", {
printName = "Turbine",
side = "wild",
type = "phys",
camera = {
dist = 200
},
default_rp_cost = 8000,
options = function()
return {
{
model = "models/props_phx/misc/paddle_small.mdl"
},
{
model = "models/props_phx/misc/paddle_small2.mdl"
}
}
end,
driveType = "fly",
driveOptions = {
speed = 20,
spin = -300
},
health = 600
})
pk_pills.register("dorf", {
printName = "Dorf",
side = "harmless",
type = "ply",
model = "models/Eli.mdl",
default_rp_cost = 800,
camera = {
offset = Vector(0, 0, 40),
dist = 60
},
hull = Vector(20, 20, 50),
modelScale = .5,
anims = {
default = {
idle = "lineidle01",
walk = "walk_all",
run = "run_all_panicked",
jump = "jump_holding_jump"
}
},
boneMorphs = {
["ValveBiped.Bip01_Pelvis"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine1"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine2"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine4"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Head1"] = {
scale = Vector(4, 4, 4)
},
["ValveBiped.Bip01_L_Clavicle"] = {
pos = Vector(0, 0, 10)
},
["ValveBiped.Bip01_R_Clavicle"] = {
pos = Vector(0, 0, -10)
}
},
moveSpeed = {
walk = 60,
run = 150
},
movePoseMode = "yaw",
jumpPower = 200,
health = 40
})
pk_pills.register("babyguardian", {
printName = "Baby Guardian",
parent = "antlion_guard",
side = "harmless",
type = "ply",
default_rp_cost = 15000,
camera = {
offset = Vector(0, 0, 20),
dist = 60
},
hull = Vector(30, 30, 30),
modelScale = .25,
moveSpeed = {
walk = 90,
run = 90
},
attack = {
range = 50,
dmg = 25
},
charge = {
vel = 300,
dmg = 50
},
movePoseMode = "yaw",
jumpPower = 500,
health = 200
})
pk_pills.register("headcrab_jumbo", {
printName = "Jumbo Crab",
parent = "headcrab_poison",
side = "harmless",
type = "ply",
default_rp_cost = 15000,
camera = {
offset = Vector(0, 0, 40),
dist = 300
},
hull = Vector(200, 200, 75),
modelScale = 5,
moveSpeed = {
walk = 100,
run = 200
},
sounds = {
step = {"npc/antlion_guard/foot_heavy1.wav", "npc/antlion_guard/foot_heavy2.wav", "npc/antlion_guard/foot_light1.wav", "npc/antlion_guard/foot_light2.wav"}
},
jump = false,
glideThink = false,
movePoseMode = "yaw",
health = 1000
})

View File

@@ -0,0 +1,297 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("parakeet", {
parent = "bird_pigeon",
printName = "Parakeet",
visColorRandom = true,
reload = function(ply, ent)
local egg = ents.Create("prop_physics")
egg:SetModel("models/props_phx/misc/egg.mdl")
local ang = ply:EyeAngles()
ang.p = 0
egg:SetPos(ply:EyePos() + ang:Forward() * 30)
egg:Spawn()
local phys = egg:GetPhysicsObject()
if IsValid(phys) then
phys:SetVelocity(ply:GetVelocity() + ply:EyeAngles():Forward() * 800 + (ply:IsOnGround() and Vector(0, 0, 600) or Vector()))
end
egg:Fire("FadeAndRemove", nil, 10)
end,
sounds = {
vocalize = pk_pills.helpers.makeList("ambient/levels/canals/swamp_bird#.wav", 6)
}
})
local dragon_attacks = {
function(ply, pos)
local thing = ents.Create("pill_proj_prop")
thing:SetModel(table.Random{"models/props_lab/monitor02.mdl", "models/props_junk/CinderBlock01a.mdl", "models/props_junk/sawblade001a.mdl", "models/props_junk/harpoon002a.mdl", "models/props_junk/watermelon01.mdl", "models/props_c17/FurnitureWashingmachine001a.mdl", "models/props_c17/FurnitureFridge001a.mdl", "models/props_c17/FurnitureBathtub001a.mdl", "models/props_wasteland/prison_toilet01.mdl", "models/props_vehicles/carparts_tire01a.mdl"})
thing:SetPos(pos)
thing:SetAngles(ply:EyeAngles())
thing:Spawn()
thing:SetPhysicsAttacker(ply)
end,
function(ply, pos)
local thing = ents.Create("prop_physics")
thing:SetModel(table.Random{"models/props_c17/oildrum001_explosive.mdl", "models/props_junk/propane_tank001a.mdl", "models/props_junk/gascan001a.mdl"})
thing:SetPos(pos)
thing:SetAngles(ply:EyeAngles())
thing:Spawn()
thing:SetPhysicsAttacker(ply)
thing:Ignite(100)
local phys = thing:GetPhysicsObject()
if IsValid(phys) then
phys:Wake()
phys:EnableGravity(false)
phys:EnableDrag(false)
phys:SetDamping(0, 0)
phys:SetVelocity(ply:EyeAngles():Forward() * 3000)
end
end,
function(ply, pos)
local thing = ents.Create("pill_proj_energy_grenade")
thing:SetPos(pos)
thing:SetAngles(ply:EyeAngles() + Angle(-50 + math.Rand(-10, 10), math.Rand(-10, 10), math.Rand(-10, 10)))
thing:Spawn()
thing:SetOwner(ply)
end,
function(ply, pos)
local rocket = ents.Create("rpg_missile")
rocket:SetPos(pos)
rocket:SetAngles(ply:EyeAngles())
rocket:SetSaveValue("m_flDamage", 200)
rocket:SetOwner(ply)
rocket:SetVelocity(ply:EyeAngles():Forward() * 1500)
rocket:Spawn()
end,
function(ply, pos)
local bomb = ents.Create("grenade_helicopter")
bomb:SetPos(pos)
bomb:SetAngles(Angle(math.Rand(-180, 180), math.Rand(-180, 180), math.Rand(-180, 180)))
bomb:Spawn()
bomb:SetPhysicsAttacker(ply)
bomb:GetPhysicsObject():AddVelocity(ply:EyeAngles():Forward() * 3000)
end,
function(ply, pos)
local nade = ents.Create("npc_grenade_frag")
nade:SetPos(pos)
nade:SetAngles(ply:EyeAngles())
nade:Spawn()
nade:SetOwner(ply)
nade:Fire("SetTimer", 3, 0)
nade:GetPhysicsObject():SetVelocity((ply:EyeAngles():Forward() + Vector(0, 0, .2)) * 3000)
end,
function(ply, pos)
local ball = ents.Create("prop_combine_ball")
ball:SetPos(pos)
ball:SetAngles(ply:EyeAngles())
ball:Spawn()
ball:SetOwner(ply)
ball:SetSaveValue('m_flRadius', 12)
ball:SetSaveValue("m_nState", 3)
ball:SetSaveValue("m_nMaxBounces", 10)
ball:GetPhysicsObject():SetVelocity(ply:EyeAngles():Forward() * 3000)
end
}
pk_pills.register("dagent", {
printName = "Dragon Agent",
side = "wild",
type = "ply",
default_rp_cost = 20000,
visColorRandom = true,
model = "models/player/combine_super_soldier.mdl",
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
anims = {
default = {
idle = "idle_magic",
walk = "walk_magic",
run = "run_magic",
crouch = "cidle_magic",
crouch_walk = "cwalk_magic",
glide = "jump_magic",
jump = "jump_magic",
swim = "swimming_magic"
}
},
attack = {
mode = "auto",
delay = .2,
func = function(ply, ent)
ent:PillSound("attack", true)
table.Random(dragon_attacks)(ply, ply:GetShootPos() + ply:EyeAngles():Forward() * 100)
end
},
moveSpeed = {
walk = 60,
run = 600,
ducked = 60
},
sounds = {
attack = "weapons/gauss/fire1.wav"
},
jumpPower = 800,
movePoseMode = "xy",
health = 10000
})
pk_pills.register("dingus", {
printName = "Dingus",
side = "harmless",
type = "ply",
default_rp_cost = 1000,
visColorRandom = true,
model = "models/player/soldier_stripped.mdl",
visMat = "models/debug/debugwhite",
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
camera = {
offset = Vector(0, 0, 50)
},
hull = Vector(15, 15, 50),
duckBy = 10,
anims = {
default = {
idle = "idle_magic",
walk = "walk_magic",
run = "run_magic",
crouch = "cidle_magic",
crouch_walk = "cwalk_magic",
glide = "jump_magic",
jump = "jump_magic",
swim = "swimming_magic"
}
},
attack = {
mode = "auto",
delay = .2,
func = function(ply, ent)
ent:PillSound("attack", true)
local ball = ents.Create("sent_ball")
ball:SetPos(ply:GetShootPos() + ply:EyeAngles():Forward() * 150)
ball:SetBallSize(100)
ball:Spawn()
local color = ent:GetPuppet():GetColor()
ball:SetBallColor(Vector(color.r / 255, color.g / 255, color.b / 255))
ball:GetPhysicsObject():SetVelocity(ply:EyeAngles():Forward() * 1000)
timer.Simple(5, function()
if IsValid(ball) then
ball:Remove()
end
end)
end
},
attack2 = {
mode = "auto",
delay = 1,
func = function(ply, ent)
ent:PillSound("donger")
end
},
moveSpeed = {
walk = 40,
run = 300,
ducked = 20
},
modelScale = .8,
sounds = {
attack = "weapons/physcannon/energy_bounce1.wav",
donger = pk_pills.helpers.makeList("birdbrainswagtrain/dingus#.wav", 9),
donger_pitch = 80
},
jumpPower = 400,
movePoseMode = "xy",
health = 80
})
pk_pills.register("error", {
printName = "ERROR",
side = "harmless",
type = "ply",
model = "models/error.mdl",
noragdoll = true,
default_rp_cost = 800,
camera = {
offset = Vector(0, 0, 25),
dist = 100
},
hull = Vector(80, 80, 80),
anims = {},
moveSpeed = {
walk = 200,
run = 400
},
jumpPower = 500,
health = 128
})
--[[
pk_pills.register("chicken",{
printName="Chicken",
side="harmless",
type="ply",
model="models/chicken/chicken.mdl",
options=function() return {
{skin=0},
{skin=1}
} end,
noragdoll=true,
default_rp_cost=800,
camera={
offset=Vector(0,0,5),
dist=80
},
hull=Vector(15,15,15),
anims={
default={
idle="idle01",
walk="walk01",
run="run01",
glide="flap_falling"
}
},
moveSpeed={
walk=20,
run=120
},
noFallDamage=true,
health=30
})
pk_pills.register("turbochicken",{
printName="Fubar's Little Helper",
parent="chicken",
attachments={"models/antlers/antlers.mdl"},
default_rp_cost=8000,
camera={
offset=Vector(0,0,40),
dist=300
},
hull=Vector(90,90,90),
modelScale=6,
moveSpeed={
walk=120,
run=800
},
jumpPower=800,
health=300
})
]]

View File

@@ -0,0 +1,206 @@
--[[
| 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/
--]]
AddCSLuaFile()
local combineMdls = {"models/combine_soldier.mdl", "models/combine_soldier_prisonguard.mdl", "models/combine_super_soldier.mdl", "models/police.mdl", "models/zombie/zombie_soldier.mdl", "models/player/combine_soldier.mdl", "models/player/combine_soldier_prisonguard.mdl", "models/player/combine_super_soldier.mdl", "models/player/police.mdl", "models/player/police_fem.mdl", "models/player/zombie_soldier.mdl"}
pk_pills.register("headcrab", {
printName = "Headcrab",
side = "hl_zombie",
zombie = "zombie",
type = "ply",
model = "models/headcrabclassic.mdl",
default_rp_cost = 6000,
camera = {
offset = Vector(0, 0, 5),
dist = 75
},
hull = Vector(20, 20, 10),
anims = {
default = {
idle = "idle01",
walk = "run1",
jump = "jumpattack_broadcast",
swim = "drown",
burrow_in = "burrowin",
burrow_loop = "burrowidle",
burrow_out = "burrowout"
}
},
sounds = {
jump = pk_pills.helpers.makeList("npc/headcrab/attack#.wav", 3),
bite = "npc/headcrab/headbite.wav",
burrow_in = "npc/antlion/digdown1.wav",
burrow_out = "npc/antlion/digup1.wav",
step = pk_pills.helpers.makeList("npc/headcrab_poison/ph_step#.wav", 4)
},
moveSpeed = {
walk = 30,
run = 60
},
jumpPower = 300,
jump = function(ply, ent)
v = ply:EyeAngles():Forward()
v.z = 0
v:Normalize()
ply:SetVelocity(v * 200)
ent:PillSound("jump")
ent.canBite = true
end,
glideThink = function(ply, ent)
if ent.canBite then
local aim = ply:GetAimVector()
aim.z = 0
aim:Normalize()
local tracedata = {}
tracedata.start = ply:EyePos()
tracedata.endpos = ply:EyePos() + aim * 5 + Vector(0, 0, -5)
tracedata.filter = ply
tracedata.mins = Vector(-8, -8, -8)
tracedata.maxs = Vector(8, 8, 8)
local trace = util.TraceHull(tracedata)
if IsValid(trace.Entity) then
local crabbed = trace.Entity
if crabbed:IsNPC() or crabbed:IsPlayer() then
ent:PillSound("bite")
end
if crabbed:Health() <= ent.formTable.biteDmg and not crabbed:IsFlagSet(FL_GODMODE) then
local crabbed_actual
if pk_pills.getMappedEnt(crabbed) then
crabbed_actual = pk_pills.getMappedEnt(crabbed)
else
crabbed_actual = crabbed
end
if crabbed_actual:LookupBone("ValveBiped.Bip01_Head1") and crabbed_actual:LookupBone("ValveBiped.Bip01_L_Foot") and crabbed_actual:LookupBone("ValveBiped.Bip01_R_Foot") then
local mdl
if pk_pills.getMappedEnt(crabbed) then
local crabbedpill = pk_pills.getMappedEnt(crabbed)
if crabbedpill.subModel then
mdl = crabbedpill.subModel --doesnt work
else
mdl = crabbedpill:GetPuppet():GetModel()
end
else
mdl = crabbed:GetModel()
end
local t = ent.formTable.zombie
if t == "zombie" and pk_pills.hasPack("ep1") and table.HasValue(combineMdls, mdl) then
t = "ep1_zombine"
end
local newPill = pk_pills.apply(ply, t)
local dbl = ents.Create("pill_attachment_zed")
dbl:SetParent(newPill:GetPuppet())
dbl:SetModel(mdl)
dbl:Spawn()
newPill.subModel = mdl
if crabbed:IsNPC() or crabbed:IsPlayer() then
ply:SetPos(crabbed:GetPos())
ply:SetEyeAngles(crabbed:EyeAngles())
else
ent:PillSound("bite")
end
if crabbed:IsPlayer() then
crabbed:KillSilent()
else
crabbed:Remove()
end
else
crabbed:TakeDamage(10000, ply, ply)
end
else
crabbed:TakeDamage(ent.formTable.biteDmg, ply, ply)
end
ent.canBite = nil
end
end
end,
land = function(ply, ent)
ent.canBite = nil
end,
biteDmg = 60,
canBurrow = true,
health = 40
})
pk_pills.register("headcrab_fast", {
parent = "headcrab",
printName = "Fast Headcrab",
zombie = "zombie_fast",
type = "ply",
model = "models/headcrab.mdl",
default_rp_cost = 8000,
anims = {
default = {
jump = "attack"
}
},
moveSpeed = {
walk = 100,
run = 200
},
canBurrow = false
})
pk_pills.register("headcrab_poison", {
parent = "headcrab",
printName = "Poison Headcrab",
zombie = "zombie_poison",
type = "ply",
model = "models/headcrabblack.mdl",
default_rp_cost = 7000,
anims = {
default = {
jump = false,
poison_jump = "tele_attack_a",
run = "scurry"
}
},
sounds = {
rattle = pk_pills.helpers.makeList("npc/headcrab_poison/ph_rattle#.wav", 3),
jump = pk_pills.helpers.makeList("npc/headcrab_poison/ph_jump#.wav", 3),
bite = pk_pills.helpers.makeList("npc/headcrab_poison/ph_poisonbite#.wav", 3)
},
moveSpeed = {
run = 100
},
jumpPower = 0,
jump = function(ply, ent)
if ent.poison_jump_blocked then return end
v = ply:EyeAngles():Forward()
v.z = 0
v:Normalize()
ent:PillSound("rattle")
ent:PillAnim("poison_jump")
ent.poison_jump_blocked = true
timer.Simple(1.6, function()
if not IsValid(ent) then return end
ent.poison_jump_blocked = false
ent:PillSound("jump")
ply:SetVelocity(v * 200 + Vector(0, 0, 300))
ent.canBite = true
end)
end,
biteDmg = 100,
canBurrow = false
})

View File

@@ -0,0 +1,539 @@
--[[
| 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/
--]]
AddCSLuaFile()
local function all_humans()
--{model="models/Combine_Super_Soldier.mdl"},
--{model="models/Combine_Soldier_PrisonGuard.mdl"},
--{model="models/Combine_Soldier.mdl"},
--{model="models/Police.mdl"}
return {
{
model = "models/Humans/Group01/male_01.mdl"
},
{
model = "models/Humans/Group01/male_02.mdl"
},
{
model = "models/Humans/Group01/male_03.mdl"
},
{
model = "models/Humans/Group01/male_04.mdl"
},
{
model = "models/Humans/Group01/male_05.mdl"
},
{
model = "models/Humans/Group01/male_06.mdl"
},
{
model = "models/Humans/Group01/male_07.mdl"
},
{
model = "models/Humans/Group01/male_08.mdl"
},
{
model = "models/Humans/Group01/male_09.mdl"
},
{
model = "models/Humans/Group02/male_01.mdl"
},
{
model = "models/Humans/Group02/male_02.mdl"
},
{
model = "models/Humans/Group02/male_03.mdl"
},
{
model = "models/Humans/Group02/male_04.mdl"
},
{
model = "models/Humans/Group02/male_05.mdl"
},
{
model = "models/Humans/Group02/male_06.mdl"
},
{
model = "models/Humans/Group02/male_07.mdl"
},
{
model = "models/Humans/Group02/male_08.mdl"
},
{
model = "models/Humans/Group02/male_09.mdl"
},
{
model = "models/Humans/Group03/male_01.mdl"
},
{
model = "models/Humans/Group03/male_02.mdl"
},
{
model = "models/Humans/Group03/male_03.mdl"
},
{
model = "models/Humans/Group03/male_04.mdl"
},
{
model = "models/Humans/Group03/male_05.mdl"
},
{
model = "models/Humans/Group03/male_06.mdl"
},
{
model = "models/Humans/Group03/male_07.mdl"
},
{
model = "models/Humans/Group03/male_08.mdl"
},
{
model = "models/Humans/Group03/male_09.mdl"
},
{
model = "models/Humans/Group03m/male_01.mdl"
},
{
model = "models/Humans/Group03m/male_02.mdl"
},
{
model = "models/Humans/Group03m/male_03.mdl"
},
{
model = "models/Humans/Group03m/male_04.mdl"
},
{
model = "models/Humans/Group03m/male_05.mdl"
},
{
model = "models/Humans/Group03m/male_06.mdl"
},
{
model = "models/Humans/Group03m/male_07.mdl"
},
{
model = "models/Humans/Group03m/male_08.mdl"
},
{
model = "models/Humans/Group03m/male_09.mdl"
},
{
model = "models/Humans/Group01/female_01.mdl"
},
{
model = "models/Humans/Group01/female_02.mdl"
},
{
model = "models/Humans/Group01/female_03.mdl"
},
{
model = "models/Humans/Group01/female_04.mdl"
},
{
model = "models/Humans/Group01/female_06.mdl"
},
{
model = "models/Humans/Group01/female_07.mdl"
},
{
model = "models/Humans/Group02/female_01.mdl"
},
{
model = "models/Humans/Group02/female_02.mdl"
},
{
model = "models/Humans/Group02/female_03.mdl"
},
{
model = "models/Humans/Group02/female_04.mdl"
},
{
model = "models/Humans/Group02/female_06.mdl"
},
{
model = "models/Humans/Group02/female_07.mdl"
},
{
model = "models/Humans/Group03/female_01.mdl"
},
{
model = "models/Humans/Group03/female_02.mdl"
},
{
model = "models/Humans/Group03/female_03.mdl"
},
{
model = "models/Humans/Group03/female_04.mdl"
},
{
model = "models/Humans/Group03/female_06.mdl"
},
{
model = "models/Humans/Group03/female_07.mdl"
},
{
model = "models/Humans/Group03m/female_01.mdl"
},
{
model = "models/Humans/Group03m/female_02.mdl"
},
{
model = "models/Humans/Group03m/female_03.mdl"
},
{
model = "models/Humans/Group03m/female_04.mdl"
},
{
model = "models/Humans/Group03m/female_06.mdl"
},
{
model = "models/Humans/Group03m/female_07.mdl"
},
{
model = "models/barney.mdl"
},
{
model = "models/monk.mdl"
},
{
model = "models/gman_high.mdl"
},
{
model = "models/alyx.mdl"
},
{
model = "models/Kleiner.mdl"
},
{
model = "models/Eli.mdl"
},
{
model = "models/mossman.mdl"
},
{
model = "models/odessa.mdl"
},
{
model = "models/breen.mdl"
}
}
end
pk_pills.register("jake_e", {
printName = "WE LOVE JAKE",
model = false,
options = all_humans,
parent = "zombie_fast",
anims = {
default = {
idle = "fear_reaction_idle",
run = "run_protected_all",
jump = "cower",
glide = "cower_idle",
jump_attack = "cower",
glide_attack = "cower_idle",
attack = "walkaimall1",
climb = "lineidle02",
climb_start = "jump_holding_jump",
release = "swing"
}
},
boneMorphs = {
["ValveBiped.Bip01_Spine"] = {
rot = Angle(90, 0, 0)
},
["ValveBiped.Bip01_Head1"] = {
scale = Vector(2, 2, 2),
rot = Angle(90, 0, 0)
}
},
crab = "melon"
})
pk_pills.register("jake_k", {
printName = "JAKE IS THE BEST",
model = false,
options = all_humans,
parent = "antlion",
modelScale = 1,
anims = {
default = {
idle = "sit_ground",
walk = "walk_all",
run = "run_protected_all",
fly = "run_protected_all",
jump = "run_protected_all",
glide = "run_protected_all",
melee1 = "meleeattack01",
melee2 = "meleeattack01",
melee3 = "meleeattack01",
charge_start = "jump_holding_land",
charge_loop = "crouchrunall1",
charge_hit = "kick_door",
burrow_in = "idle_to_sit_ground",
burrow_out = "sit_ground_to_idle",
burrow_loop = "injured1"
}
},
boneMorphs = {
["ValveBiped.Bip01_Pelvis"] = {
scale = Vector(2, 2, 2),
rot = Angle(0, 0, 20),
pos = Vector(0, 0, 0)
},
["ValveBiped.Bip01_Spine"] = {
scale = Vector(2, 2, 1)
},
["ValveBiped.Bip01_Spine1"] = {
scale = Vector(2, 2, 1)
},
["ValveBiped.Bip01_Spine2"] = {
scale = Vector(2, 2, 1)
},
["ValveBiped.Bip01_Spine4"] = {
scale = Vector(2, 2, 1)
},
["ValveBiped.Bip01_Head1"] = {
scale = Vector(4, 4, 1),
rot = Angle(0, 20, 0)
},
["ValveBiped.Bip01_L_Clavicle"] = {
pos = Vector(0, 0, 10)
},
["ValveBiped.Bip01_R_Clavicle"] = {
pos = Vector(0, 0, -10)
}
},
--["ValveBiped.Bip01_R_Forearm"]={pos=Vector(-100,0,-100),scale=Vector(1,100,1)},
--["ValveBiped.Bip01_L_Forearm"]={pos=Vector(-100,0,100),scale=Vector(1,100,1)},
--["ValveBiped.Bip01_R_Foot"]={pos=Vector(20,0,0)},
--["ValveBiped.Bip01_L_Foot"]={pos=Vector(20,0,0)},
--[[moveSpeed={
walk=100,
run=400
},]]
movePoseMode = "yaw"
})
--jumpPower=400,
--health=40,
--muteSteps=true
pk_pills.register("jake_a", {
printName = "JAKE IS A COOL GUY",
side = "harmless",
type = "ply",
model = false,
options = all_humans,
camera = {
--offset=Vector(0,0,40),
dist = 300
},
hull = Vector(200, 200, 100),
modelScale = 2,
anims = {
default = {
idle = "lineidle01",
walk = "walk_all",
run = "run_protected_all",
jump = "jump_holding_jump"
}
},
boneMorphs = {
["ValveBiped.Bip01_Pelvis"] = {
scale = Vector(2, 2, 2),
rot = Angle(0, 0, 90),
pos = Vector(0, 0, 0)
},
["ValveBiped.Bip01_Spine"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine1"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine2"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine4"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Head1"] = {
scale = Vector(4, 4, 4),
rot = Angle(0, 90, 0)
},
["ValveBiped.Bip01_L_Clavicle"] = {
pos = Vector(0, 0, 10)
},
["ValveBiped.Bip01_R_Clavicle"] = {
pos = Vector(0, 0, -10)
},
["ValveBiped.Bip01_R_Forearm"] = {
pos = Vector(50, 0, 0)
},
["ValveBiped.Bip01_L_Forearm"] = {
pos = Vector(50, 0, 0)
},
["ValveBiped.Bip01_R_Foot"] = {
pos = Vector(20, 0, 0)
},
["ValveBiped.Bip01_L_Foot"] = {
pos = Vector(20, 0, 0)
}
},
moveSpeed = {
walk = 100,
run = 400
},
movePoseMode = "yaw",
jumpPower = 400,
health = 40,
muteSteps = true
})
pk_pills.register("jake_j", {
printName = "GIVE US JAKE",
model = false,
options = all_humans,
parent = "bird_pigeon",
modelScale = .2,
anims = {
default = {
idle = "sit_ground",
walk = "walk_all",
run = "run_protected_all",
fly = "run_protected_all",
jump = "run_protected_all",
glide = "run_protected_all",
eat = "preskewer"
}
},
boneMorphs = {
["ValveBiped.Bip01_Pelvis"] = {
scale = Vector(2, 2, 2),
rot = Angle(0, 0, 20),
pos = Vector(0, 0, 0)
},
["ValveBiped.Bip01_Spine"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine1"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine2"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Spine4"] = {
scale = Vector(2, 2, 2)
},
["ValveBiped.Bip01_Head1"] = {
scale = Vector(4, 4, 4),
rot = Angle(0, 20, 0)
},
["ValveBiped.Bip01_L_Clavicle"] = {
pos = Vector(0, 0, 10)
},
["ValveBiped.Bip01_R_Clavicle"] = {
pos = Vector(0, 0, -10)
},
["ValveBiped.Bip01_R_Forearm"] = {
pos = Vector(-100, 0, -100),
scale = Vector(1, 100, 1)
},
["ValveBiped.Bip01_L_Forearm"] = {
pos = Vector(-100, 0, 100),
scale = Vector(1, 100, 1)
}
},
--["ValveBiped.Bip01_R_Foot"]={pos=Vector(20,0,0)},
--["ValveBiped.Bip01_L_Foot"]={pos=Vector(20,0,0)},
--[[moveSpeed={
walk=100,
run=400
},]]
movePoseMode = "yaw"
})
--jumpPower=400,
--health=40,
--muteSteps=true
pk_pills.register("jake_2", {
printName = "~ALL HAIL JAKE~",
parent = "hero_overseer",
model = false,
options = all_humans,
anims = {
default = {
idle = "fear_reaction_idle"
}
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if not ply:OnGround() then return end
ent:PillSound("clang")
local puppet = ent:GetPuppet()
for i = 1, puppet:GetBoneCount() do
puppet:ManipulateBonePosition(i, puppet:GetManipulateBonePosition(i) + VectorRand() * 2)
end
end
},
sounds = {
clang = "weapons/crowbar/crowbar_impact1.wav"
}
})
pk_pills.register("jake_car", {
printName = "~JAKE'S CAR~",
parent = "wheelbarrow",
model = false,
options = function()
return {
{
model = "models/props_vehicles/car002a_physics.mdl"
},
{
model = "models/props_vehicles/car001b_hatchback.mdl"
},
{
model = "models/props_vehicles/car001a_hatchback.mdl"
},
{
model = "models/props_vehicles/car002b_physics.mdl"
},
{
model = "models/props_vehicles/car003a_physics.mdl"
},
{
model = "models/props_vehicles/car003b_physics.mdl"
},
{
model = "models/props_vehicles/car004a_physics.mdl"
},
{
model = "models/props_vehicles/car004b_physics.mdl"
},
{
model = "models/props_vehicles/car005a_physics.mdl"
},
{
model = "models/props_vehicles/car005b_physics.mdl"
},
{
model = "models/props_vehicles/van001a_physics.mdl"
}
}
end,
driveOptions = {
speed = 5000
},
camera = {
dist = 500
}
})

View File

@@ -0,0 +1,353 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("citizen_m", {
printName = "Male Citizen",
type = "ply",
voxSet = "citm",
default_rp_cost = 600,
options = function()
return {
{
model = "models/Humans/Group01/male_01.mdl"
},
{
model = "models/Humans/Group01/male_02.mdl"
},
{
model = "models/Humans/Group01/male_03.mdl"
},
{
model = "models/Humans/Group01/male_04.mdl"
},
{
model = "models/Humans/Group01/male_05.mdl"
},
{
model = "models/Humans/Group01/male_06.mdl"
},
{
model = "models/Humans/Group01/male_07.mdl"
},
{
model = "models/Humans/Group01/male_08.mdl"
},
{
model = "models/Humans/Group01/male_09.mdl"
}
}
end,
anims = {
default = {
idle = "idle_angry",
walk = "walk_all",
run = "run_all",
crouch = "Crouch_idleD",
crouch_walk = "Crouch_walk_aLL",
glide = "jump_holding_glide",
jump = "jump_holding_jump",
g_attack = "gesture_shoot_smg1",
g_reload = "gesture_reload_smg1",
dropItem = "Heal"
},
smg = {
idle = "Idle_SMG1_Aim_Alert",
walk = "walkAIMALL1",
run = "run_aiming_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all"
},
ar2 = {
idle = "idle_angry_Ar2",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
g_attack = "gesture_shoot_ar2",
g_reload = "gesture_reload_ar2"
},
shotgun = {
idle = "Idle_Angry_Shotgun",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
g_attack = "gesture_shoot_shotgun",
g_reload = "gesture_reload_ar2"
}
},
flashlight = function(ply, ent)
if ply:IsOnGround() and ent.formTable.drops then
ent:PillAnim("dropItem", true)
timer.Simple(1.25, function()
if not IsValid(ent) then return end
local ang = ply:EyeAngles()
ang.p = 0
local item = ents.Create(table.Random(ent.formTable.drops))
item:SetPos(ply:EyePos() + ang:Forward() * 70)
item:Spawn()
end)
end
end,
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
moveSpeed = {
walk = 60,
run = 200,
ducked = 40
},
loadout = {"pill_wep_holstered"},
health = 100,
validHoldTypes = {"smg", "ar2", "shotgun"},
movePoseMode = "yaw"
})
pk_pills.register("refugee_m", {
parent = "citizen_m",
printName = "Male Refugee",
default_rp_cost = 4000,
options = function()
return {
{
model = "models/Humans/Group02/male_01.mdl"
},
{
model = "models/Humans/Group02/male_02.mdl"
},
{
model = "models/Humans/Group02/male_03.mdl"
},
{
model = "models/Humans/Group02/male_04.mdl"
},
{
model = "models/Humans/Group02/male_05.mdl"
},
{
model = "models/Humans/Group02/male_06.mdl"
},
{
model = "models/Humans/Group02/male_07.mdl"
},
{
model = "models/Humans/Group02/male_08.mdl"
},
{
model = "models/Humans/Group02/male_09.mdl"
}
}
end,
loadout = {nil, "weapon_smg1"},
ammo = {
smg1 = 50
}
})
pk_pills.register("rebel_m", {
parent = "citizen_m",
printName = "Male Rebel",
drops = {"item_ammo_pistol", "item_ammo_smg1", "item_ammo_ar2", "item_box_buckshot"},
default_rp_cost = 5000,
options = function()
return {
{
model = "models/Humans/Group03/male_01.mdl"
},
{
model = "models/Humans/Group03/male_02.mdl"
},
{
model = "models/Humans/Group03/male_03.mdl"
},
{
model = "models/Humans/Group03/male_04.mdl"
},
{
model = "models/Humans/Group03/male_05.mdl"
},
{
model = "models/Humans/Group03/male_06.mdl"
},
{
model = "models/Humans/Group03/male_07.mdl"
},
{
model = "models/Humans/Group03/male_08.mdl"
},
{
model = "models/Humans/Group03/male_09.mdl"
}
}
end,
loadout = {nil, "weapon_ar2", "weapon_shotgun"},
ammo = {
AR2 = 50,
Buckshot = 50
}
})
pk_pills.register("medic_m", {
parent = "citizen_m",
printName = "Male Medic",
drops = {"item_healthkit"},
default_rp_cost = 6000,
options = function()
return {
{
model = "models/Humans/Group03m/male_01.mdl"
},
{
model = "models/Humans/Group03m/male_02.mdl"
},
{
model = "models/Humans/Group03m/male_03.mdl"
},
{
model = "models/Humans/Group03m/male_04.mdl"
},
{
model = "models/Humans/Group03m/male_05.mdl"
},
{
model = "models/Humans/Group03m/male_06.mdl"
},
{
model = "models/Humans/Group03m/male_07.mdl"
},
{
model = "models/Humans/Group03m/male_08.mdl"
},
{
model = "models/Humans/Group03m/male_09.mdl"
}
}
end,
loadout = {nil, "weapon_smg1"},
ammo = {
smg1 = 50
}
})
pk_pills.register("citizen_f", {
parent = "citizen_m",
printName = "Female Citizen",
voxSet = "citf",
options = function()
return {
{
model = "models/Humans/Group01/female_01.mdl"
},
{
model = "models/Humans/Group01/female_02.mdl"
},
{
model = "models/Humans/Group01/female_03.mdl"
},
{
model = "models/Humans/Group01/female_04.mdl"
},
{
model = "models/Humans/Group01/female_06.mdl"
},
{
model = "models/Humans/Group01/female_07.mdl"
}
}
end
})
pk_pills.register("refugee_f", {
parent = "refugee_m",
printName = "Female Refugee",
voxSet = "citf",
options = function()
return {
{
model = "models/Humans/Group02/female_01.mdl"
},
{
model = "models/Humans/Group02/female_02.mdl"
},
{
model = "models/Humans/Group02/female_03.mdl"
},
{
model = "models/Humans/Group02/female_04.mdl"
},
{
model = "models/Humans/Group02/female_06.mdl"
},
{
model = "models/Humans/Group02/female_07.mdl"
}
}
end
})
pk_pills.register("rebel_f", {
parent = "rebel_m",
printName = "Female Rebel",
voxSet = "citf",
options = function()
return {
{
model = "models/Humans/Group03/female_01.mdl"
},
{
model = "models/Humans/Group03/female_02.mdl"
},
{
model = "models/Humans/Group03/female_03.mdl"
},
{
model = "models/Humans/Group03/female_04.mdl"
},
{
model = "models/Humans/Group03/female_06.mdl"
},
{
model = "models/Humans/Group03/female_07.mdl"
}
}
end
})
pk_pills.register("medic_f", {
parent = "medic_m",
printName = "Female Medic",
voxSet = "citf",
options = function()
return {
{
model = "models/Humans/Group03m/female_01.mdl"
},
{
model = "models/Humans/Group03m/female_02.mdl"
},
{
model = "models/Humans/Group03m/female_03.mdl"
},
{
model = "models/Humans/Group03m/female_04.mdl"
},
{
model = "models/Humans/Group03m/female_06.mdl"
},
{
model = "models/Humans/Group03m/female_07.mdl"
}
}
end
})

View File

@@ -0,0 +1,493 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("dog", {
printName = "Dog",
type = "ply",
model = "models/dog.mdl",
default_rp_cost = 10000,
camera = {
dist = 300
},
hull = Vector(120, 120, 100),
anims = {
default = {
idle = "idle01",
walk = "walk_all",
run = "run_all",
melee = "throw"
}
},
sounds = {
melee = "npc/dog/dog_servo6.wav",
melee_hit = pk_pills.helpers.makeList("physics/metal/metal_box_impact_hard#.wav", 3),
step = pk_pills.helpers.makeList("npc/dog/dog_footstep#.wav", 4)
},
aim = {
xPose = "head_yaw",
yPose = "head_pitch"
},
reload = function(ply, ent)
pk_pills.common.melee(ply, ent, {
delay = .5,
range = 150,
dmg = 50
})
end,
movePoseMode = "yaw",
moveSpeed = {
walk = 150,
run = 500
},
jumpPower = 0,
loadout = {"weapon_physcannon"},
hideWeapons = true,
health = 1200
})
pk_pills.register("hero_infiltrator", {
printName = "The Infiltrator",
type = "ply",
model = "models/barney.mdl",
default_rp_cost = 10000,
anims = {
default = {
idle = "idle_angry",
walk = "walk_all",
run = "run_all",
crouch = "Crouch_idleD",
crouch_walk = "Crouch_walk_aLL",
glide = "jump_holding_glide",
jump = "jump_holding_jump",
g_attack = "gesture_shoot_smg1",
g_reload = "gesture_reload_smg1",
change = "helmet_reveal"
},
smg = {
idle = "Idle_SMG1_Aim_Alert",
walk = "walkAIMALL1",
run = "run_aiming_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all"
},
ar2 = {
idle = "idle_angry_Ar2",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
--g_attack="gesture_shoot_ar2",
g_reload = "gesture_reload_ar2"
},
shotgun = {
idle = "Idle_Angry_Shotgun",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
g_attack = "gesture_shoot_shotgun",
g_reload = "gesture_reload_ar2"
}
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
moveSpeed = {
walk = 60,
run = 200,
ducked = 40
},
loadout = {"pill_wep_holstered", "weapon_ar2", "weapon_shotgun", "weapon_smg1"},
ammo = {
AR2 = 100,
Buckshot = 100,
smg1 = 100
},
health = 1000,
validHoldTypes = {"smg", "ar2", "shotgun"},
movePoseMode = "yaw",
flashlight = function(ply, ent)
if not ply:IsOnGround() then return end
ent:PillAnim("change", true)
if ent.disguised then
ent.disguised = nil
timer.Simple(1, function()
if IsValid(ent.disguise_faceplate) then
ent.disguise_faceplate:Fire("setparentattachment", "faceplate_attachment", 0)
end
if IsValid(ent) then
pk_pills.setAiTeam(ply, "default")
end
end)
timer.Simple(2, function()
if IsValid(ent.disguise_faceplate) then
ent.disguise_faceplate:Remove()
end
if IsValid(ent.disguise_helmet) then
ent.disguise_helmet:Remove()
end
end)
else --helmet_attachment faceplate_attachment
ent.disguised = true
ent.disguise_faceplate = ents.Create("prop_dynamic")
ent.disguise_faceplate:SetModel("models/barneyhelmet_faceplate.mdl")
ent.disguise_faceplate:SetPos(ply:GetPos())
ent.disguise_faceplate:SetParent(ent:GetPuppet())
ent.disguise_faceplate:Spawn()
ent.disguise_faceplate:Fire("setparentattachment", "faceplate_attachment", 0)
ent.disguise_helmet = ents.Create("prop_dynamic")
ent.disguise_helmet:SetModel("models/barneyhelmet.mdl")
ent.disguise_helmet:SetPos(ply:GetPos())
ent.disguise_helmet:SetParent(ent:GetPuppet())
ent.disguise_helmet:Spawn()
ent.disguise_helmet:Fire("setparentattachment", "helmet_attachment", 0)
timer.Simple(1, function()
if IsValid(ent.disguise_faceplate) then
ent.disguise_faceplate:Fire("setparentattachment", "helmet_attachment", 0)
end
if IsValid(ent) then
pk_pills.setAiTeam(ply, "hl_infiltrator")
end
end)
end
end
})
pk_pills.register("hero_monk", {
printName = "The Monk",
type = "ply",
model = "models/monk.mdl",
default_rp_cost = 10000,
anims = {
default = {
idle = "lineidle02",
walk = "walk_all",
run = "run_all",
crouch = "Crouch_idleD",
crouch_walk = "Crouch_walk_aLL",
glide = "jump_holding_glide",
jump = "jump_holding_jump",
g_attack = "gesture_shoot_smg1",
g_reload = "gesture_reload_smg1"
},
smg = {
idle = "Idle_SMG1_Aim_Alert",
walk = "walkAIMALL1",
run = "run_alert_aiming_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all"
},
ar2 = {
idle = "idle_angry_Ar2",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
g_attack = "gesture_shoot_ar2",
g_reload = "gesture_reload_ar2"
},
shotgun = {
idle = "Idle_Angry_Shotgun",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
g_attack = "gesture_shoot_shotgun",
g_reload = "gesture_reload_ar2"
},
crossbow = {
idle = "Idle_SMG1_Aim_Alert",
walk = "walkAIMALL1_ar2",
run = "run_aiming_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
g_attack = "gesture_shoot_ar2",
g_reload = "gesture_reload_ar2"
}
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
moveSpeed = {
walk = 60,
run = 200,
ducked = 40
},
loadout = {"pill_wep_holstered", "weapon_shotgun", "pill_wep_annabelle"},
ammo = {
Buckshot = 100,
["357"] = 100
},
health = 1000,
validHoldTypes = {"smg", "ar2", "shotgun", "crossbow"},
movePoseMode = "yaw"
})
pk_pills.register("hero_overseer", {
printName = "The Overseer",
type = "ply",
model = "models/gman_high.mdl",
default_rp_cost = 20000,
anims = {
default = {
idle = "idle",
walk = "walk_all",
run = "sprint_all", --pace_all
crouch = "Crouch_idleD",
crouch_walk = "Crouch_walk_aLL",
glide = "jump_holding_glide",
jump = "jump_holding_jump",
melee = "swing",
cloak = "open_door_away",
teleport = "tiefidget"
}
},
sounds = {
--melee=pk_pills.helpers.makeList("npc/zombie/zo_attack#.wav",2),
melee_hit = pk_pills.helpers.makeList("npc/zombie/claw_strike#.wav", 3),
melee_miss = pk_pills.helpers.makeList("npc/zombie/claw_miss#.wav", 2),
cloak = "buttons/combine_button1.wav",
uncloak = "buttons/combine_button1.wav",
teleport = "ambient/machines/teleport4.wav"
},
cloak = {
max = -1
},
moveSpeed = {
walk = 100,
run = 1000,
ducked = 40
},
jumpPower = 1000,
movePoseMode = "yaw",
health = 10000,
noFallDamage = true,
attack = {
mode = "trigger",
func = function(a, b, c)
if not b.iscloaked then
pk_pills.common.melee(a, b, c)
end
end,
delay = .3,
range = 40,
dmg = 1000
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
if not ply:OnGround() then return end
ent:PillAnim("cloak", true)
timer.Simple(1, function()
if not IsValid(ent) then return end
ent:ToggleCloak()
end)
end
},
--[[
if ent.cloaked then
ent.cloaked=nil
timer.Simple(1,function()
if !IsValid(ent) then return end
ent:PillSound("cloak")
ent:GetPuppet():SetMaterial()
ent:GetPuppet():DrawShadow(true)
pk_pills.setAiTeam(ply,"default")
end)
else
ent.cloaked=true
timer.Simple(1,function()
if !IsValid(ent) or !IsValid(ent:GetPuppet()) then return end
ent:PillSound("cloak")
ent:GetPuppet():SetMaterial("Models/effects/vol_light001")
ent:GetPuppet():DrawShadow(false)
pk_pills.setAiTeam(ply,"harmless")
end)
end]]
reload = function(ply, ent)
if not ply:OnGround() then return end
ent:PillAnim("teleport", true)
timer.Simple(1, function()
if not IsValid(ent) then return end
local tracein = {}
tracein.maxs = Vector(16, 16, 72)
tracein.mins = Vector(-16, -16, 0)
tracein.start = ply:EyePos()
tracein.endpos = ply:EyePos() + ply:EyeAngles():Forward() * 9999
tracein.filter = {ply, ent, ent:GetPuppet()}
local traceout = util.TraceHull(tracein)
ply:SetPos(traceout.HitPos)
ent:PillSound("teleport")
end)
end
})
pk_pills.register("hero_hacker", {
printName = "The Hacker",
type = "ply",
model = "models/alyx.mdl",
default_rp_cost = 10000,
anims = {
default = {
idle = "idle_angry",
walk = "walk_all",
run = "run_all",
crouch = "Crouch_idleD",
crouch_walk = "Crouch_walk_aLL",
glide = "jump_holding_glide",
jump = "jump_holding_jump",
g_attack = "gesture_shoot_smg1",
g_reload = "gesture_reload_smg1"
},
smg = {
idle = "Idle_SMG1_Aim_Alert",
walk = "walkAIMALL1",
run = "run_aiming_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all"
},
ar2 = {
idle = "idle_ar2_aim",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
--g_attack="gesture_shoot_ar2",
g_reload = "gesture_reload_ar2"
},
shotgun = {
idle = "idle_ar2_aim",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
g_attack = "gesture_shoot_shotgun",
g_reload = "gesture_reload_ar2"
},
pistol = {
idle = "Pistol_idle_aim",
walk = "walk_aiming_p_all",
run = "run_aiming_p_all"
}
},
sounds = {
hack = "buttons/blip1.wav",
nohack = "buttons/button2.wav"
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
moveSpeed = {
walk = 60,
run = 200,
ducked = 40
},
loadout = {"pill_wep_holstered", "pill_wep_alyxgun", "weapon_shotgun"},
ammo = {
smg1 = 300
},
health = 1000,
validHoldTypes = {"pistol", "smg", "ar2", "shotgun"},
movePoseMode = "yaw",
flashlight = function(ply, ent)
local tr = ply:GetEyeTrace()
local hackables = {"npc_turret_floor", "npc_rollermine", "npc_manhack"}
if (tr.HitPos:Distance(tr.StartPos) < 100 and table.HasValue(hackables, tr.Entity:GetClass())) and pk_pills.getAiTeam(tr.Entity) ~= "default" then
pk_pills.setAiTeam(tr.Entity, "default")
ent:PillSound("hack")
if tr.Entity:GetClass() ~= "npc_turret_floor" then
tr.Entity:GetPhysicsObject():SetVelocity(ply:GetAimVector() * 100)
end
else
ent:PillSound("nohack")
end
end
})
pk_pills.register("hero_physicist", {
printName = "The Physicist",
type = "ply",
model = "models/Kleiner.mdl",
default_rp_cost = 10000,
anims = {
default = {
idle = "idle_angry",
walk = "walk_all",
run = "run_all",
crouch = "Crouch_idleD",
crouch_walk = "Crouch_walk_aLL",
glide = "jump_holding_glide",
jump = "jump_holding_jump",
g_attack = "gesture_shoot_smg1",
g_reload = "gesture_reload_smg1"
},
smg = {
idle = "Idle_SMG1_Aim_Alert",
walk = "walkAIMALL1",
run = "run_aiming_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all"
},
ar2 = {
idle = "idle_ar2_aim",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
--g_attack="gesture_shoot_ar2",
g_reload = "gesture_reload_ar2"
},
shotgun = {
idle = "idle_ar2_aim",
walk = "walkAIMALL1_ar2",
run = "run_aiming_ar2_all",
crouch = "crouch_aim_smg1",
crouch_walk = "Crouch_walk_aiming_all",
g_attack = "gesture_shoot_shotgun",
g_reload = "gesture_reload_ar2"
}
},
aim = {
xPose = "aim_yaw",
yPose = "aim_pitch"
},
moveSpeed = {
walk = 60,
run = 200,
ducked = 40
},
loadout = {"pill_wep_holstered", "weapon_shotgun", "pill_wep_translocator"},
ammo = {
AR2 = 100,
Buckshot = 100,
smg1 = 100
},
health = 1000,
validHoldTypes = {"smg", "ar2", "shotgun"},
movePoseMode = "yaw"
})

View File

@@ -0,0 +1,100 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("vort", {
printName = "Vortigaunt",
type = "ply",
model = "models/vortigaunt.mdl",
default_rp_cost = 8000,
voxSet = "vort",
camera = {
dist = 200
},
anims = {
default = {
idle = "Idle01",
walk = "Walk_all",
run = "Run_all",
melee1 = "MeleeHigh1",
melee2 = "MeleeHigh2",
melee3 = "MeleeHigh3",
melee4 = "MeleeLow",
attackRanged = "zapattack1"
}
},
sounds = {
melee = pk_pills.helpers.makeList("npc/vort/claw_swing#.wav", 2),
melee_hit = pk_pills.helpers.makeList("npc/zombie/claw_strike#.wav", 3),
loop_ranged_charge = "npc/vort/attack_charge.wav",
ranged_fire = "npc/vort/attack_shoot.wav",
step = pk_pills.helpers.makeList("npc/vort/vort_foot#.wav", 4)
},
aim = {
xPose = "head_yaw",
yPose = "head_pitch"
},
attack = {
mode = "trigger",
func = function(ply, ent)
local superpowers = ent.formTable.superpowers
ent:PillAnim("attackRanged", true)
ent:PillLoopSound("ranged_charge")
local puppet = ent:GetPuppet()
ParticleEffectAttach("vortigaunt_charge_token", PATTACH_POINT_FOLLOW, puppet, puppet:LookupAttachment("leftclaw"))
ParticleEffectAttach("vortigaunt_charge_token", PATTACH_POINT_FOLLOW, puppet, puppet:LookupAttachment("rightclaw"))
timer.Simple(1.5, function()
if not IsValid(ent) then return end
ent:PillLoopStop("ranged_charge")
ent:PillSound("ranged_fire")
local tr = ply:GetEyeTrace()
local attachment = puppet:GetAttachment(puppet:LookupAttachment("leftclaw"))
puppet:StopParticles()
if attachment then
util.ParticleTracerEx(superpowers and "weapon_combine_ion_cannon" or "vortigaunt_beam", attachment.Pos, tr.HitPos, true, puppet:EntIndex(), puppet:LookupAttachment("leftclaw"))
end
if superpowers then
ParticleEffect("weapon_combine_ion_cannon_explosion", tr.HitPos, Angle(0, 0, 0))
sound.Play("ambient/explosions/explode_1.wav", tr.HitPos, 75, 100, 1)
util.BlastDamage(ent, ply, tr.HitPos, 200, 400)
else
util.BlastDamage(ent, ply, tr.HitPos, 10, 400)
end
end)
end
},
attack2 = {
mode = "trigger",
func = pk_pills.common.melee,
animCount = 4,
delay = .5,
range = 40,
dmg = 25
},
movePoseMode = "yaw",
moveSpeed = {
walk = 100,
run = 300
},
duckBy = 0,
jumpPower = 0,
health = 120
})
pk_pills.register("vort_slave", {
parent = "vort",
side = "hl_combine",
printName = "Vortigaunt Slave",
model = "models/vortigaunt_slave.mdl"
})

View File

@@ -0,0 +1,235 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("ichthyosaur", {
printName = "Ichthyosaur",
side = "wild",
type = "phys",
model = "models/Ichthyosaur.mdl",
default_rp_cost = 600,
camera = {
dist = 350
},
seqInit = "swim",
sphericalPhysics = 30,
driveType = "swim",
driveOptions = {
speed = 10
},
aim = {
xPose = "sidetoside",
yPose = "upanddown",
nocrosshair = true
},
attack = {
mode = "trigger",
func = function(ply, ent)
if ent:GetSequence() ~= ent:LookupSequence("swim") then return end
ent:PillAnim("attackstart", true)
timer.Simple(.5, function()
if not IsValid(ent) then return end
local tr = util.TraceHull({
start = ent:GetPos(),
endpos = ent:GetPos() + ent:GetAngles():Forward() * 200,
filter = {ent},
mins = Vector(-5, -5, -5),
maxs = Vector(5, 5, 5)
})
if IsValid(tr.Entity) then
local dmg = DamageInfo()
dmg:SetAttacker(ply)
dmg:SetInflictor(ent)
dmg:SetDamageType(DMG_SLASH)
dmg:SetDamage(50)
tr.Entity:TakeDamageInfo(dmg)
ent:PillAnim("attackend", true)
ent:PillSound("bite")
timer.Simple(1.8, function()
if not IsValid(ent) then return end
ent:PillAnim("swim", true)
end)
else
ent:PillAnim("attackmiss", true)
timer.Simple(.5, function()
if not IsValid(ent) then return end
ent:PillAnim("swim", true)
end)
end
end)
end
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
ent:PillSound("vocalize")
end
},
health = 400,
sounds = {
loop_move = "npc/ichthyosaur/water_breath.wav",
vocalize = pk_pills.helpers.makeList("npc/ichthyosaur/attack_growl#.wav", 3),
bite = "npc/ichthyosaur/snap.wav"
}
})
pk_pills.register("barnacle", {
printName = "Barnacle",
side = "harmless",
type = "phys",
model = "models/barnacle.mdl",
boxPhysics = {Vector(-10, -10, -20), Vector(10, 10, 0)},
default_rp_cost = 1000,
userSpawn = {
type = "ceiling",
offset = Vector(0, 0, 2)
},
spawnFrozen = true,
camera = {
offset = Vector(0, 0, -50),
dist = 100,
underslung = true
},
seqInit = "idle01",
attack = {
mode = "auto",
delay = 0,
func = function(ply, ent)
if ent.busy then return end
if not IsValid(ent.tongue) then
ent.tongue = ents.Create("pill_barnacle_tongue")
ent.tongue:SetPos(ent:GetPos() + Vector(0, 0, -40))
ent.tongue:Spawn()
ent:DeleteOnRemove(ent.tongue)
constraint.NoCollide(ent, ent.tongue, 0, 0)
ent.tongue_constraint, ent.tongue_vis = constraint.Elastic(ent, ent.tongue, 0, 0, Vector(0, 0, -30), Vector(0, 0, 0), 20000, 4000, 0, "cable/rope", 1, true)
ent.tongue_len = 20
elseif IsValid(ent.tongue_constraint) then
ent.tongue_len = ent.tongue_len + 1
ent.tongue_constraint:Fire("SetSpringLength", ent.tongue_len, 0)
ent.tongue_vis:Fire("SetLength", ent.tongue_len, 0)
end
end
},
attack2 = {
mode = "auto",
delay = 0,
func = function(ply, ent)
if ent.busy then return end
if not IsValid(ent.tongue) or ent.tongue_len <= 20 then
ent:PillAnim("attack_smallthings", true)
ent:PillAnim("attack_smallthings", true)
ent.busy = true
timer.Simple(.8, function()
if not IsValid(ent) then return end
local tr = util.TraceHull({
start = ent:GetPos() + Vector(0, 0, -10),
endpos = ent:GetPos() + Vector(0, 0, -60),
filter = {ent, ply, (IsValid(ent.tongue) and ent.tongue or nil)},
mins = Vector(-10, -10, -10),
maxs = Vector(10, 10, 10)
})
if (tr.HitNonWorld) then
if tr.Entity:IsRagdoll() then
local effectdata = EffectData()
effectdata:SetOrigin(ent:GetPos() + Vector(0, 0, -30))
effectdata:SetNormal(Vector(0, 0, -1))
effectdata:SetMagnitude(1)
effectdata:SetScale(10)
effectdata:SetColor(0)
effectdata:SetFlags(3)
util.Effect("bloodspray", effectdata)
ent:PillSound("chompgib")
tr.Entity:Remove()
for k, v in pairs{"models/Gibs/HGIBS.mdl", "models/Gibs/HGIBS_rib.mdl", "models/Gibs/HGIBS_scapula.mdl", "models/Gibs/HGIBS_spine.mdl"} do
local d = ents.Create("prop_physics")
d:SetModel(v)
d:SetPos(ent:GetPos() + Vector(0, 0, -30))
d:Spawn()
d:SetCollisionGroup(COLLISION_GROUP_DEBRIS)
d:Fire("Kill", nil, 10)
local p = d:GetPhysicsObject()
if IsValid(p) then
p:ApplyForceCenter(VectorRand() * 1000)
end
end
else
tr.Entity:TakeDamage(20, ply, ent)
ent:PillSound("chomp")
end
end
end)
timer.Simple(1.5, function()
if not IsValid(ent) then return end
ent:PillAnim("idle01", true)
ent.busy = false
end)
elseif IsValid(ent.tongue_constraint) then
ent.tongue_len = ent.tongue_len - 1
ent.tongue_constraint:Fire("SetSpringLength", ent.tongue_len, 0)
ent.tongue_vis:Fire("SetLength", ent.tongue_len, 0)
end
end
},
reload = function(ply, ent)
if IsValid(ent.tongue) then
if constraint.RemoveConstraints(ent.tongue, "Weld") then
ent:PillSound("drop")
end
end
end,
boneMorphs = {
["Barnacle.tongue1"] = {
scale = Vector(0, 0, 0),
pos = Vector(0, 0, 50)
},
["Barnacle.tongue2"] = {
scale = Vector(0, 0, 0)
},
["Barnacle.tongue3"] = {
scale = Vector(0, 0, 0)
},
["Barnacle.tongue4"] = {
scale = Vector(0, 0, 0)
},
["Barnacle.tongue5"] = {
scale = Vector(0, 0, 0)
},
["Barnacle.tongue6"] = {
scale = Vector(0, 0, 0)
},
["Barnacle.tongue7"] = {
scale = Vector(0, 0, 0)
},
["Barnacle.tongue8"] = {
scale = Vector(0, 0, 0)
}
},
health = 35,
sounds = {
chomp = "npc/barnacle/barnacle_crunch3.wav",
chompgib = "player/pl_fallpain1.wav",
drop = "npc/barnacle/barnacle_bark1.wav"
}
})

View File

@@ -0,0 +1,294 @@
--[[
| 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/
--]]
AddCSLuaFile()
pk_pills.register("zombie", {
printName = "Zombie",
side = "hl_zombie",
crab = "headcrab",
type = "ply",
model = "models/Zombie/Classic.mdl",
default_rp_cost = 7000,
health = 100,
bodyGroups = {1},
anims = {
default = {
idle = "Idle01",
walk = "walk",
melee1 = "attackA",
melee2 = "attackB",
melee3 = "attackC",
melee4 = "attackD",
melee5 = "attackE",
melee6 = "attackF",
release = "releasecrab"
}
},
sounds = {
melee = pk_pills.helpers.makeList("npc/zombie/zo_attack#.wav", 2),
melee_hit = pk_pills.helpers.makeList("npc/zombie/claw_strike#.wav", 3),
melee_miss = pk_pills.helpers.makeList("npc/zombie/claw_miss#.wav", 2),
bust = "npc/barnacle/barnacle_crunch2.wav",
release = pk_pills.helpers.makeList("npc/zombie/zombie_pain#.wav", 6),
step = pk_pills.helpers.makeList("npc/zombie/foot#.wav", 3)
},
attack = {
mode = "trigger",
func = pk_pills.common.melee,
animCount = 6,
delay = .8,
range = 40,
dmg = 25
},
reload = function(ply, ent)
ent:PillAnim("release", true)
ent:PillSound("release")
timer.Simple(1, function()
if not IsValid(ent) then return end
local r = ents.Create("prop_ragdoll")
r:SetModel(ent.subModel or ent:GetPuppet():GetModel())
r:SetPos(ply:GetPos())
r:SetAngles(ply:GetAngles())
r:Spawn()
r:SetCollisionGroup(COLLISION_GROUP_DEBRIS)
r:Fire("FadeAndRemove", nil, 10)
local puppet = ent:GetPuppet()
local attach = puppet:GetAttachment(puppet:LookupAttachment("head"))
pk_pills.apply(ply, ent.formTable.crab)
if (attach) then
ply:SetPos(attach.Pos)
else
ply:SetPos(ply:GetPos() + Vector(0, 0, 60))
end
end)
end,
flashlight = function(ply, ent)
if ent.formTable.printName == "Zombie" or ent.formTable.printName == "Fast Zombie" then
ent:PillSound("bust")
local e = pk_pills.apply(ply, ent.formTable.printName == "Zombie" and "zombie_torso" or "zombie_torso_fast")
e:PillAnim("fall", true)
ply:SetPos(ply:GetPos() + Vector(0, 0, 30))
ply:SetVelocity(Vector(0, 0, 400) + ply:GetAimVector() * 300)
local r = ents.Create("prop_ragdoll")
r:SetModel(ent.formTable.printName == "Zombie" and "models/zombie/classic_legs.mdl" or "models/gibs/fast_zombie_legs.mdl")
r:SetPos(ply:GetPos())
r:SetAngles(ply:GetAngles())
r:Spawn()
r:SetCollisionGroup(COLLISION_GROUP_DEBRIS)
r:Fire("FadeAndRemove", nil, 10)
end
end,
movePoseMode = "yaw",
moveSpeed = {
walk = 50,
run = 100
},
jumpPower = 0,
duckBy = 0
})
pk_pills.register("zombie_poison", {
parent = "zombie",
printName = "Poison Zombie",
crab = "headcrab_poison",
model = "models/Zombie/Poison.mdl",
default_rp_cost = 8000,
health = 300,
anims = {
default = {
run = "run",
melee = "melee_01",
throw = "Throw"
}
},
bodyGroups = {nil, 2, 3, 4},
sounds = {
throw1 = pk_pills.helpers.makeList("npc/zombie_poison/pz_throw#.wav", 2, 3),
throw2 = pk_pills.helpers.makeList("npc/headcrab_poison/ph_jump#.wav", 1, 3)
},
attack = {
animCount = false
},
attack2 = {
mode = "trigger",
func = function(ply, ent)
ent:PillAnim("throw", true)
ent:PillSound("throw1")
timer.Simple(1.3, function()
if not IsValid(ent) then return end
ent:PillSound("throw2")
local headcrab = ents.Create("pill_jumper_headcrab")
local puppet = ent:GetPuppet()
local angs = ply:EyeAngles()
angs.p = 0
headcrab:SetPos(ply:EyePos() + angs:Forward() * 100)
headcrab:SetAngles(angs)
headcrab:Spawn()
headcrab:GetPhysicsObject():SetVelocity(angs:Forward() * 300 + Vector(0, 0, 200))
end)
end
},
moveSpeed = {
run = 200
},
movePoseMode = false
})
pk_pills.register("zombie_fast", {
parent = "zombie",
printName = "Fast Zombie",
crab = "headcrab_fast",
model = "models/Zombie/fast.mdl",
default_rp_cost = 9000,
anims = {
default = {
idle = "idle",
walk = "walk_all",
run = "Run",
jump = "leap_start",
glide = "leap_loop",
jump_attack = "leap",
glide_attack = "leapstrike",
attack = "Melee",
climb = "climbloop",
climb_start = "climbmount",
release = "br2_roar"
}
},
sounds = {
jump = "npc/fast_zombie/fz_scream1.wav",
attack = "npc/fast_zombie/fz_frenzy1.wav"
},
attack = {
mode = "tick",
func = function(ply, ent)
if not ply:IsOnGround() or ply:GetVelocity():Length() > 1 then return end
ent:PillAnimTick("attack")
if not ent.lastAttack or ent.lastAttack + .3 < CurTime() then
if ply:TraceHullAttack(ply:EyePos(), ply:EyePos() + ply:EyeAngles():Forward() * 40, Vector(-10, -10, -10), Vector(10, 10, 10), 10, DMG_SLASH, 1, true) then
ent:PillSound("melee_hit")
else
ent:PillSound("melee_miss")
end
ent.lastAttack = CurTime()
end
if not ent.lastAttackSound or ent.lastAttackSound + 2 < CurTime() then
ent:PillSound("attack")
ent.lastAttackSound = CurTime()
end
end
},
attack2 = {
mode = "tick",
func = function(ply, ent)
local start = ply:GetPos() + Vector(0, 0, 10)
local dir = ply:GetAimVector()
dir.z = 0
dir:Normalize()
local tracedata = {}
tracedata.start = start
tracedata.endpos = start + dir * 20
tracedata.filter = ply
tracedata.mins = Vector(-8, -8, -8)
tracedata.maxs = Vector(8, 8, 8)
if util.TraceHull(tracedata).Hit then
if ply:IsOnGround() then
ply:SetVelocity(Vector(0, 0, 150))
ent:PillAnim("climb_start")
end
ply:SetLocalVelocity(Vector(0, 0, 100))
ent:PillAnimTick("climb")
end
end
},
noFallDamage = true,
jump = function(ply, ent)
if ply:GetVelocity():Length() < 350 then
v = ply:EyeAngles():Forward()
v.z = 0
v:Normalize()
ply:SetVelocity(v * 100 + Vector(0, 0, 300))
else
ent:PillAnim("jump_attack")
ent.canAttack = true
end
ent:PillSound("jump")
end,
glideThink = function(ply, ent)
if ent.canAttack then
if ply:TraceHullAttack(ply:EyePos(), ply:EyePos() + ply:EyeAngles():Forward() * 50, Vector(-20, -20, -20), Vector(20, 20, 20), 50, DMG_SLASH, 1, true) then
ent:PillSound("melee_hit")
ent.canAttack = nil
end
ent:PillAnimTick("glide_attack")
end
end,
land = function(ply, ent)
ent.canAttack = nil
end,
moveSpeed = {
run = 400
},
jumpPower = 400
})
pk_pills.register("zombie_torso", {
parent = "zombie",
printName = "Zombie Torso",
model = "models/Zombie/classic_torso.mdl",
default_rp_cost = 6500,
camera = {
offset = Vector(0, 0, 10),
dist = 150
},
hull = Vector(30, 30, 20),
anims = {
default = {
idle = "idle",
walk = "crawl",
melee = "attack",
fall = "fall"
}
},
attack = {
animCount = false,
delay = .4
},
movePoseMode = false
})
pk_pills.register("zombie_torso_fast", {
parent = "zombie_torso",
printName = "Fast Zombie Torso",
model = "models/zombie/fast_torso.mdl",
default_rp_cost = 8500,
crab = "headcrab_fast",
anims = {
default = {
melee = "attack01",
fall = false
}
},
moveSpeed = {
walk = 100,
run = 200
}
})

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
--[[
| 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/
--]]
AddCSLuaFile()
-- Sooner or later the entire damn addon will be launched from here.

View File

@@ -0,0 +1,55 @@
--[[
| 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/
--]]
require("pk_pills")
AddCSLuaFile()
if SERVER then
resource.AddWorkshop("106427033")
include("ppp_include/drivemodes.lua")
end
game.AddParticles("particles/Vortigaunt_FX.pcf")
PrecacheParticleSystem("vortigaunt_beam")
PrecacheParticleSystem("vortigaunt_beam_b")
include("ppp_include/vox_lists.lua")
pk_pills.packStart("Half-Life 2","base","games/16/hl2.png")
include("ppp_include/pill_combine_soldiers.lua")
include("ppp_include/pill_combine_phys_small.lua")
include("ppp_include/pill_combine_phys_large.lua")
include("ppp_include/pill_combine_misc.lua")
include("ppp_include/pill_combine_new.lua")
include("ppp_include/pill_headcrabs.lua")
include("ppp_include/pill_zombies.lua")
include("ppp_include/pill_antlions.lua")
include("ppp_include/pill_wild.lua")
include("ppp_include/pill_resistance_heros.lua")
include("ppp_include/pill_resistance.lua")
include("ppp_include/pill_vorts.lua")
include("ppp_include/pill_birds.lua")
pk_pills.packStart("Fun","fun","icon16/rainbow.png")
include("ppp_include/pill_fun.lua")
include("ppp_include/pill_fun2.lua")
include("ppp_include/pill_fun3.lua")
include("ppp_include/pill_360_noscope.lua")
pk_pills.packStart("Jake","jake","icon16/box.png")
include("ppp_include/pill_jake.lua")

View File

@@ -0,0 +1,26 @@
--[[
| 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/
--]]
include( "properties/bone_manipulate.lua" )
include( "properties/remove.lua" )
include( "properties/statue.lua" )
include( "properties/keep_upright.lua" )
include( "properties/persist.lua" )
include( "properties/drive.lua" )
include( "properties/ignite.lua" )
include( "properties/collisions.lua" )
include( "properties/gravity.lua" )
include( "properties/npc_scale.lua" )
include( "properties/editentity.lua" )
include( "properties/kinect_controller.lua" )
include( "properties/bodygroups.lua" )
include( "properties/skin.lua" )

View File

@@ -0,0 +1,138 @@
--[[
| 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/
--]]
AddCSLuaFile()
properties.Add( "bodygroups", {
MenuLabel = "#bodygroups",
Order = 600,
MenuIcon = "icon16/link_edit.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:IsPlayer() ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "bodygroups", ent ) ) then return false end
if ( IsValid( ent.AttachedEntity ) ) then ent = ent.AttachedEntity end -- If our ent has an attached entity, we want to use and modify its bodygroups instead
--
-- Get a list of bodygroups
--
local options = ent:GetBodyGroups()
if ( !options ) then return false end
--
-- If a bodygroup has more than one state - then we can configure it
--
for k, v in pairs( options ) do
if ( v.num > 1 ) then return true end
end
return false
end,
MenuOpen = function( self, option, ent, tr )
local target = IsValid( ent.AttachedEntity ) and ent.AttachedEntity or ent
--
-- Get a list of bodygroups
--
local options = target:GetBodyGroups()
--
-- Add a submenu to our automatically created menu option
--
local submenu = option:AddSubMenu()
--
-- For each body group - add a menu or checkbox
--
for k, v in pairs( options ) do
if ( v.num <= 1 ) then continue end
--
-- If there's only 2 options, add it as a checkbox instead of a submenu
--
if ( v.num == 2 ) then
local current = target:GetBodygroup( v.id )
local opposite = 1
if ( current == opposite ) then opposite = 0 end
local opt = submenu:AddOption( string.NiceName( v.name ) )
opt:SetChecked( current == 1 )
opt:SetIsCheckable( true )
opt.OnChecked = function( s, checked ) self:SetBodyGroup( ent, v.id, checked and 1 or 0 ) end
--
-- More than 2 options we add our own submenu
--
else
local groups = submenu:AddSubMenu( string.NiceName( v.name ) )
for i = 1, v.num do
local modelname = "Model #" .. i
if ( v.submodels and v.submodels[ i - 1 ] != "" ) then modelname = v.submodels[ i - 1 ] end
modelname = string.Trim( modelname, "." )
modelname = string.Trim( modelname, "/" )
modelname = string.Trim( modelname, "\\" )
modelname = string.StripExtension( modelname )
modelname = string.GetFileFromFilename( modelname )
local opt = groups:AddOption( string.NiceName( modelname ) )
opt:SetRadio( true )
opt:SetChecked( target:GetBodygroup( v.id ) == i - 1 )
opt:SetIsCheckable( true )
opt.OnChecked = function( s, checked ) if ( checked ) then self:SetBodyGroup( ent, v.id, i - 1 ) end end
end
end
end
end,
Action = function( self, ent )
-- Nothing - we use SetBodyGroup below
end,
SetBodyGroup = function( self, ent, body, id )
self:MsgStart()
net.WriteEntity( ent )
net.WriteUInt( body, 8 )
net.WriteUInt( id, 8 )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
local body = net.ReadUInt( 8 )
local id = net.ReadUInt( 8 )
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
ent = IsValid( ent.AttachedEntity ) and ent.AttachedEntity or ent
ent:SetBodygroup( body, id )
end
} )

View File

@@ -0,0 +1,236 @@
--[[
| 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/
--]]
AddCSLuaFile()
properties.Add( "bone_manipulate", {
MenuLabel = "#edit_bones",
Order = 500,
MenuIcon = "icon16/vector.png",
Filter = function( self, ent, ply )
if ( !gamemode.Call( "CanProperty", ply, "bonemanipulate", ent ) ) then return false end
if ( IsValid( ent.AttachedEntity ) ) then ent = ent.AttachedEntity end -- If our ent has an attached entity, we want to use and modify its bones instead
local bonecount = ent:GetBoneCount()
if ( bonecount <= 1 ) then return false end
return ents.FindByClassAndParent( "widget_bones", ent ) == nil
end,
Action = function( self, ent )
if ( IsValid( ent.AttachedEntity ) ) then ent = ent.AttachedEntity end
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
ent.widget = ents.Create( "widget_bones" )
ent.widget:Setup( ent )
ent.widget:Spawn()
ent.widget.LastBonePress = 0
ent.widget.BonePressCount = 0
-- What happens when we click on a bone?
ent.widget.OnBoneClick = function( w, boneid, pl )
-- If we have an old axis, remove it
if ( IsValid( w.axis ) ) then w.axis:Remove() end
-- We clicked on the same bone
if ( w.LastBonePress == boneid ) then
w.BonePressCount = w.BonePressCount + 1
if ( w.BonePressCount >= 3 ) then w.BonePressCount = 0 end
-- We clicked on a new bone!
else
w.BonePressCount = 0
w.LastBonePress = boneid
end
local EntityCycle = { "widget_bonemanip_move", "widget_bonemanip_rotate", "widget_bonemanip_scale" }
w.axis = ents.Create( EntityCycle[ w.BonePressCount + 1 ] )
w.axis:Setup( ent, boneid, w.BonePressCount == 1 )
w.axis:Spawn()
w.axis:SetPriority( 0.5 )
w:DeleteOnRemove( w.axis )
end
end
} )
properties.Add( "bone_manipulate_end", {
MenuLabel = "#stop_editing_bones",
Order = 500,
MenuIcon = "icon16/vector_delete.png",
Filter = function( self, ent )
if ( IsValid( ent.AttachedEntity ) ) then ent = ent.AttachedEntity end -- If our ent has an attached entity, we want to use and modify its bones instead
return ents.FindByClassAndParent( "widget_bones", ent ) != nil
end,
Action = function( self, ent )
if ( IsValid( ent.AttachedEntity ) ) then ent = ent.AttachedEntity end
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !IsValid( ent.widget ) ) then return end
ent.widget:Remove()
end
} )
local widget_bonemanip_move = {
Base = "widget_axis",
OnArrowDragged = function( self, num, dist, pl, mv )
-- Prediction doesn't work properly yet.. because of the confusion with the bone moving, and the parenting, Agh.
if ( CLIENT ) then return end
local ent = self:GetParent()
if ( !IsValid( ent ) ) then return end
local bone = self:GetParentAttachment()
if ( bone <= 0 ) then return end
local v = Vector( 0, 0, 0 )
if ( num == 1 ) then v.x = dist end
if ( num == 2 ) then v.y = dist end
if ( num == 3 ) then v.z = dist end
ent:ManipulateBonePosition( bone, ent:GetManipulateBonePosition( bone ) + v )
end,
--
-- Although we use the position from our bone, we want to use the angles from the
-- parent bone - because that's the direction our bone goes
--
CalcAbsolutePosition = function( self, v, a )
local ent = self:GetParent()
if ( !IsValid( ent ) ) then return end
local bone = ent:GetBoneParent( self:GetParentAttachment() )
if ( bone <= 0 ) then return end
local _, ang = ent:GetBonePosition( bone )
local pos, _ = ent:GetBonePosition( self:GetParentAttachment() )
return pos, ang
end
}
scripted_ents.Register( widget_bonemanip_move, "widget_bonemanip_move" )
local widget_bonemanip_rotate = {
Base = "widget_axis",
OnArrowDragged = function( self, num, dist, pl, mv )
-- Prediction doesn't work properly yet.. because of the confusion with the bone moving, and the parenting, Agh.
if ( CLIENT ) then return end
local ent = self:GetParent()
if ( !IsValid( ent ) ) then return end
local bone = self:GetParentAttachment()
if ( bone <= 0 ) then return end
local v = Angle( 0, 0, 0 )
if ( num == 2 ) then v.x = dist end
if ( num == 3 ) then v.y = dist end
if ( num == 1 ) then v.z = dist end
ent:ManipulateBoneAngles( bone, ent:GetManipulateBoneAngles( bone ) + v )
end
}
scripted_ents.Register( widget_bonemanip_rotate, "widget_bonemanip_rotate" )
local widget_bonemanip_scale = {
Base = "widget_axis",
IsScaleArrow = true,
OnArrowDragged = function( self, num, dist, pl, mv )
-- Prediction doesn't work properly yet.. because of the confusion with the bone moving, and the parenting, Agh.
if ( CLIENT ) then return end
local ent = self:GetParent()
if ( !IsValid( ent ) ) then return end
local bone = self:GetParentAttachment()
if ( bone <= 0 ) then return end
local v = Vector( 0, 0, 0 )
if ( num == 1 ) then v.x = dist end
if ( num == 2 ) then v.y = dist end
if ( num == 3 ) then v.z = dist end
ent:ManipulateBoneScale( bone, ent:GetManipulateBoneScale( bone ) + v * 0.1 )
ent:ManipulateBoneScale( ent:GetBoneParent( bone ), ent:GetManipulateBoneScale( ent:GetBoneParent( bone ) ) + v )
end,
--
-- Although we use the position from our bone, we want to use the angles from the
-- parent bone - because that's the direction our bone goes
--
CalcAbsolutePosition = function( self, v, a )
local ent = self:GetParent()
if ( !IsValid( ent ) ) then return end
local bone = self:GetParentAttachment()
if ( bone <= 0 ) then return end
local pbone = ent:GetBoneParent( bone )
if ( pbone <= 0 ) then return end
local pos, ang = ent:GetBonePosition( bone )
local pos2, _ = ent:GetBonePosition( pbone )
return pos + ( pos2 - pos ) * 0.5, ang
end
}
scripted_ents.Register( widget_bonemanip_scale, "widget_bonemanip_scale" )

View File

@@ -0,0 +1,83 @@
--[[
| 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/
--]]
AddCSLuaFile()
properties.Add( "collision_off", {
MenuLabel = "#collision_off",
Order = 1500,
MenuIcon = "icon16/collision_off.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:IsPlayer() ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "collision", ent ) ) then return false end
if ( ent:GetCollisionGroup() == COLLISION_GROUP_WORLD ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
ent:SetCollisionGroup( COLLISION_GROUP_WORLD )
end
} )
properties.Add( "collision_on", {
MenuLabel = "#collision_on",
Order = 1500,
MenuIcon = "icon16/collision_on.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:IsPlayer() ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "collision", ent ) ) then return false end
return ent:GetCollisionGroup() == COLLISION_GROUP_WORLD
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
ent:SetCollisionGroup( COLLISION_GROUP_NONE )
end
} )

View File

@@ -0,0 +1,62 @@
--[[
| 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/
--]]
AddCSLuaFile()
properties.Add( "drive", {
MenuLabel = "#drive",
Order = 1100,
MenuIcon = "icon16/joystick.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) || !IsValid( ply ) ) then return false end
if ( ent:IsPlayer() || IsValid( ply:GetVehicle() ) ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "drive", ent ) ) then return false end
if ( !gamemode.Call( "CanDrive", ply, ent ) ) then return false end
-- We cannot drive these, maybe this should have a custom GetEntityDriveMode?
if ( ent:GetClass() == "prop_vehicle_jeep" || ent:GetClass() == "prop_vehicle_jeep_old" ) then return false end
-- Make sure nobody else is driving this or we can get into really invalid states
for id, pl in ipairs( player.GetAll() ) do
if ( pl:GetDrivingEntity() == ent ) then return false end
end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
local drivemode = "drive_sandbox"
if ( ent.GetEntityDriveMode ) then
drivemode = ent:GetEntityDriveMode( ply )
end
drive.PlayerStartDriving( ply, ent, drivemode )
end
} )

View 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/
--]]
AddCSLuaFile()
properties.Add( "editentity", {
MenuLabel = "#entedit",
Order = 90001,
PrependSpacer = true,
MenuIcon = "icon16/pencil.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( !ent.Editable ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "editentity", ent ) ) then return false end
return true
end,
Action = function( self, ent )
local window = g_ContextMenu:Add( "DFrame" )
window:SetSize( 320, 400 )
window:SetTitle( tostring( ent ) )
window:Center()
window:SetSizable( true )
local control = window:Add( "DEntityProperties" )
control:SetEntity( ent )
control:Dock( FILL )
control.OnEntityLost = function()
window:Remove()
end
end
} )

View File

@@ -0,0 +1,92 @@
--[[
| 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/
--]]
AddCSLuaFile()
-- The following is for the server's eyes only
local GravityDuplicator
if ( SERVER ) then
function GravityDuplicator( ply, ent, data )
if ( !data || !data.enabled ) then
duplicator.ClearEntityModifier( ent, "gravity_property" )
return
end
-- Simply restore the value whenever we are duplicated
-- We don't need to reapply EnableGravity because duplicator already does it for us
ent:SetNWBool( "gravity_disabled", data.enabled )
duplicator.StoreEntityModifier( ent, "gravity_property", data )
end
duplicator.RegisterEntityModifier( "gravity_property", GravityDuplicator )
end
properties.Add( "gravity", {
MenuLabel = "#gravity",
Type = "toggle",
Order = 1001,
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "gravity", ent ) ) then return false end
if ( ent:GetClass() == "prop_physics" ) then return true end
if ( ent:GetClass() == "prop_ragdoll" ) then return true end
return false
end,
Checked = function( self, ent, ply )
return ent:GetNWBool( "gravity_disabled" ) == false
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
local bones = ent:GetPhysicsObjectCount()
local b = ent:GetNWBool( "gravity_disabled" )
for i = 0, bones - 1 do
local phys = ent:GetPhysicsObjectNum( i )
if ( IsValid( phys ) ) then
phys:EnableGravity( b )
phys:Wake()
end
end
ent:SetNWBool( "gravity_disabled", b == false )
GravityDuplicator( ply, ent, { enabled = ent:GetNWBool( "gravity_disabled" ) } )
end
} )

View File

@@ -0,0 +1,96 @@
--[[
| 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/
--]]
AddCSLuaFile()
local function CanEntityBeSetOnFire( ent )
-- func_pushable, func_breakable & func_physbox cannot be ignited
if ( ent:GetClass() == "item_item_crate" ) then return true end
if ( ent:GetClass() == "simple_physics_prop" ) then return true end
if ( ent:GetClass():match( "prop_physics*" ) ) then return true end
if ( ent:GetClass():match( "prop_ragdoll*" ) ) then return true end
if ( ent:IsNPC() ) then return true end
return false
end
properties.Add( "ignite", {
MenuLabel = "#ignite",
Order = 999,
MenuIcon = "icon16/fire.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:IsPlayer() ) then return false end
if ( !CanEntityBeSetOnFire( ent ) ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "ignite", ent ) ) then return false end
return !ent:IsOnFire()
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
ent:Ignite( 360 )
end
} )
properties.Add( "extinguish", {
MenuLabel = "#extinguish",
Order = 999,
MenuIcon = "icon16/water.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:IsPlayer() ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "extinguish", ent ) ) then return false end
return ent:IsOnFire()
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
ent:Extinguish()
end
} )

View File

@@ -0,0 +1,107 @@
--[[
| 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/
--]]
AddCSLuaFile()
properties.Add( "keepupright", {
MenuLabel = "#keepupright",
Order = 900,
MenuIcon = "icon16/arrow_up.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:GetClass() != "prop_physics" ) then return false end
if ( ent:GetNWBool( "IsUpright" ) ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "keepupright", ent ) ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !IsValid( ply ) ) then return end
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( ent:GetClass() != "prop_physics" ) then return end
if ( ent:GetNWBool( "IsUpright" ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
local Phys = ent:GetPhysicsObjectNum( 0 )
if ( !IsValid( Phys ) ) then return end
local constraint = constraint.Keepupright( ent, Phys:GetAngles(), 0, 999999 )
-- I feel like this is not stable enough
-- This cannot be implemented without a custom constraint.Keepupright function or modification for proper duplicator support.
--print( constraint:GetSaveTable().m_worldGoalAxis )
--constraint:SetSaveValue( "m_localTestAxis", constraint:GetSaveTable().m_worldGoalAxis ) --ent:GetAngles():Up() )
--constraint:SetSaveValue( "m_worldGoalAxis", Vector( 0, 0, 1 ) )
--constraint:SetSaveValue( "m_bDampAllRotation", true )
if ( constraint ) then
ply:AddCleanup( "constraints", constraint )
ent:SetNWBool( "IsUpright", true )
end
end
} )
properties.Add( "keepupright_stop", {
MenuLabel = "#keepupright_stop",
Order = 900,
MenuIcon = "icon16/arrow_rotate_clockwise.png",
Filter = function( self, ent )
if ( !IsValid( ent ) ) then return false end
if ( ent:GetClass() != "prop_physics" ) then return false end
if ( !ent:GetNWBool( "IsUpright" ) ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !IsValid( ply ) ) then return end
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( ent:GetClass() != "prop_physics" ) then return end
if ( !ent:GetNWBool( "IsUpright" ) ) then return end
constraint.RemoveConstraints( ent, "Keepupright" )
ent:SetNWBool( "IsUpright", false )
end
} )

View File

@@ -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/
--]]
AddCSLuaFile()
if ( SERVER ) then
CreateConVar( "sensor_debugragdoll", "0", FCVAR_NOTIFY )
CreateConVar( "sensor_stretchragdoll", "0", FCVAR_NOTIFY )
end
local playerTimeouts = {}
properties.Add( "motioncontrol_ragdoll", {
MenuLabel = "#control_with_motion_sensor",
Order = 2500,
MenuIcon = "icon16/controller.png",
Filter = function( self, ent, ply )
if ( CLIENT && !motionsensor ) then return false end
if ( CLIENT && !motionsensor.IsAvailable() ) then return false end
if ( !ent:IsRagdoll() ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "motioncontrol_ragdoll", ent ) ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
--
-- Start up the kinect controller. This will freeze the game for a second.
--
if ( !motionsensor.IsActive() ) then
motionsensor.Start()
end
end,
Receive = function( self, length, player )
local ent = net.ReadEntity()
if ( !self:Filter( ent, player ) ) then return end
-- Do not spam please!
local timeout = playerTimeouts[ player ]
if ( timeout && timeout.time > CurTime() ) then
if ( !timeout.sentMessage ) then
ServerLog( "Player " .. tostring( player ) .. " tried to use 'motioncontrol_ragdoll' property too rapidly!\n" )
player:PrintMessage( HUD_PRINTTALK, "Please wait at least 0.2 seconds before trying to control another ragdoll." )
timeout.sentMessage = true
end
return
end
-- Only 1 controller per ragdoll please!
if ( IsValid( ent.MotionSensorController ) ) then
ent.MotionSensorController:Remove()
end
local ragdoll_motion = ents.Create( "ragdoll_motion" )
ragdoll_motion:SetPos( player:EyePos() + player:EyeAngles():Forward() * 10 )
ragdoll_motion:SetAngles( Angle( 0, player:EyeAngles().yaw, 0 ) )
ragdoll_motion:SetRagdoll( ent )
ragdoll_motion:SetController( player )
ragdoll_motion:Spawn()
undo.Create( "MotionController" )
undo.AddEntity( ragdoll_motion )
undo.SetPlayer( player )
undo.Finish()
playerTimeouts[ player ] = { time = CurTime() + 0.2, sentMessage = false }
end
} )

View File

@@ -0,0 +1,82 @@
--[[
| 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/
--]]
AddCSLuaFile()
properties.Add( "npc_bigger", {
MenuLabel = "#biggify",
Order = 1799,
MenuIcon = "icon16/magnifier_zoom_in.png",
Filter = function( self, ent, ply )
if ( !gamemode.Call( "CanProperty", ply, "npc_bigger", ent ) ) then return false end
if ( !IsValid( ent ) ) then return false end
if ( !ent:IsNPC() ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
ent:SetModelScale( ent:GetModelScale() * 1.25, 1 )
end
} )
properties.Add( "npc_smaller", {
MenuLabel = "#smallify",
Order = 1800,
MenuIcon = "icon16/magifier_zoom_out.png",
Filter = function( self, ent, ply )
if ( !gamemode.Call( "CanProperty", ply, "npc_smaller", ent ) ) then return false end
if ( !IsValid( ent ) ) then return false end
if ( !ent:IsNPC() ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
ent:SetModelScale( ent:GetModelScale() * 0.8, 1 )
end
} )

View File

@@ -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/
--]]
AddCSLuaFile()
properties.Add( "persist", {
MenuLabel = "#makepersistent",
Order = 400,
MenuIcon = "icon16/link.png",
Filter = function( self, ent, ply )
if ( ent:IsPlayer() ) then return false end
if ( GetConVarString( "sbox_persist" ):Trim() == "" ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "persist", ent ) ) then return false end
return !ent:GetPersistent()
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
-- TODO: Start some kind of animation, take 5 seconds to make something persistent
ent:SetPersistent( true )
--ent:EnableMotion( false )
end
} )
properties.Add( "persist_end", {
MenuLabel = "#stoppersisting",
Order = 400,
MenuIcon = "icon16/link_break.png",
Filter = function( self, ent, ply )
if ( ent:IsPlayer() ) then return false end
if ( GetConVarString( "sbox_persist" ):Trim() == "" ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "persist", ent ) ) then return false end
return ent:GetPersistent()
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
-- TODO: Start some kind of animation, take 5 seconds to make something persistent
ent:SetPersistent( false )
end
} )

View File

@@ -0,0 +1,67 @@
--[[
| 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/
--]]
AddCSLuaFile()
properties.Add( "remove", {
MenuLabel = "#remove",
Order = 1000,
MenuIcon = "icon16/delete.png",
Filter = function( self, ent, ply )
if ( !gamemode.Call( "CanProperty", ply, "remover", ent ) ) then return false end
if ( !IsValid( ent ) ) then return false end
if ( ent:IsPlayer() ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
if ( !IsValid( ply ) ) then return end
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
-- Don't allow removal of players or objects that cannot be physically targeted by properties
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
-- Remove all constraints (this stops ropes from hanging around)
constraint.RemoveAll( ent )
-- Remove it properly in 1 second
timer.Simple( 1, function() if ( IsValid( ent ) ) then ent:Remove() end end )
-- Make it non solid
ent:SetNotSolid( true )
ent:SetMoveType( MOVETYPE_NONE )
ent:SetNoDraw( true )
-- Send Effect
local ed = EffectData()
ed:SetEntity( ent )
util.Effect( "entity_remove", ed, true, true )
ply:SendLua( "achievements.Remover()" )
end
} )

View File

@@ -0,0 +1,85 @@
--[[
| 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/
--]]
AddCSLuaFile()
properties.Add( "skin", {
MenuLabel = "#skin",
Order = 601,
MenuIcon = "icon16/picture_edit.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:IsPlayer() ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "skin", ent ) ) then return false end
if ( IsValid( ent.AttachedEntity ) ) then ent = ent.AttachedEntity end -- If our ent has an attached entity, we want to modify its skin instead
if ( !ent:SkinCount() ) then return false end
return ent:SkinCount() > 1
end,
MenuOpen = function( self, option, ent, tr )
--
-- Add a submenu to our automatically created menu option
--
local submenu = option:AddSubMenu()
--
-- Create a check item for each skin
--
local target = IsValid( ent.AttachedEntity ) and ent.AttachedEntity or ent
local num = target:SkinCount()
for i = 0, num - 1 do
local opt = submenu:AddOption( "Skin " .. i )
opt:SetRadio( true )
opt:SetChecked( target:GetSkin() == i )
opt:SetIsCheckable( true )
opt.OnChecked = function( s, checked ) if ( checked ) then self:SetSkin( ent, i ) end end
end
end,
Action = function( self, ent )
-- Nothing - we use SetSkin below
end,
SetSkin = function( self, ent, id )
self:MsgStart()
net.WriteEntity( ent )
net.WriteUInt( id, 8 )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
local skinid = net.ReadUInt( 8 )
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
ent = IsValid( ent.AttachedEntity ) and ent.AttachedEntity or ent
ent:SetSkin( skinid )
end
} )

View File

@@ -0,0 +1,202 @@
--[[
| 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/
--]]
AddCSLuaFile()
-- The following is for the server's eyes only
local StatueDuplicator
if ( SERVER ) then
function StatueDuplicator( ply, ent, data )
if ( !data ) then
duplicator.ClearEntityModifier( ent, "statue_property" )
return
end
-- We have been pasted from duplicator, restore the necessary variables for the unstatue to work
if ( ent.StatueInfo == nil ) then
-- Ew. Have to wait a frame for the constraints to get pasted
timer.Simple( 0, function()
if ( !IsValid( ent ) ) then return end
local bones = ent:GetPhysicsObjectCount()
if ( bones < 2 ) then return end
ent:SetNWBool( "IsStatue", true )
ent.StatueInfo = {}
local con = constraint.FindConstraints( ent, "Weld" )
for id, t in pairs( con ) do
if ( t.Ent1 != t.Ent2 || t.Ent1 != ent || t.Bone1 != 0 ) then continue end
ent.StatueInfo[ t.Bone2 ] = t.Constraint
end
local numC = table.Count( ent.StatueInfo )
if ( numC < 1 --[[or numC != bones - 1]] ) then duplicator.ClearEntityModifier( ent, "statue_property" ) end
end )
end
duplicator.StoreEntityModifier( ent, "statue_property", data )
end
duplicator.RegisterEntityModifier( "statue_property", StatueDuplicator )
end
local playerTimeouts = {}
properties.Add( "statue", {
MenuLabel = "#makestatue",
Order = 1501,
MenuIcon = "icon16/lock.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:GetClass() != "prop_ragdoll" ) then return false end
if ( ent:GetNWBool( "IsStatue" ) ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "statue", ent ) ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !IsValid( ply ) ) then return end
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( ent:GetClass() != "prop_ragdoll" ) then return end
if ( !self:Filter( ent, ply ) ) then return end
-- Do not spam please!
local timeout = playerTimeouts[ ply ]
if ( timeout && timeout.time > CurTime() ) then
if ( !timeout.sentMessage ) then
ServerLog( "Player " .. tostring( ply ) .. " tried to use 'statue' property too rapidly!\n" )
ply:PrintMessage( HUD_PRINTTALK, "Please wait at least 0.2 seconds before trying to make another ragdoll a statue." )
timeout.sentMessage = true
end
return
end
local bones = ent:GetPhysicsObjectCount()
if ( bones < 2 ) then return end
if ( ent.StatueInfo ) then return end
ent.StatueInfo = {}
undo.Create( "Statue" )
for bone = 1, bones - 1 do
local constr = constraint.Weld( ent, ent, 0, bone, 0 )
if ( constr ) then
ent.StatueInfo[ bone ] = constr
ply:AddCleanup( "constraints", constr )
undo.AddEntity( constr )
end
local effectdata = EffectData()
effectdata:SetOrigin( ent:GetPhysicsObjectNum( bone ):GetPos() )
effectdata:SetScale( 1 )
effectdata:SetMagnitude( 1 )
util.Effect( "GlassImpact", effectdata, true, true )
end
ent:SetNWBool( "IsStatue", true )
undo.AddFunction( function()
if ( !IsValid( ent ) ) then return false end
ent:SetNWBool( "IsStatue", false )
ent.StatueInfo = nil
StatueDuplicator( ply, ent, nil )
end )
undo.SetPlayer( ply )
undo.Finish()
StatueDuplicator( ply, ent, {} )
playerTimeouts[ ply ] = { time = CurTime() + 0.2, sentMessage = false }
end
} )
properties.Add( "statue_stop", {
MenuLabel = "#unstatue",
Order = 1501,
MenuIcon = "icon16/lock_open.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( ent:GetClass() != "prop_ragdoll" ) then return false end
if ( !ent:GetNWBool( "IsStatue" ) ) then return false end
if ( !gamemode.Call( "CanProperty", ply, "unstatue", ent ) ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !IsValid( ply ) ) then return end
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( ent:GetClass() != "prop_ragdoll" ) then return end
local bones = ent:GetPhysicsObjectCount()
if ( bones < 2 ) then return end
if ( !ent.StatueInfo ) then return end
for k, v in pairs( ent.StatueInfo ) do
if ( IsValid( v ) ) then
v:Remove()
end
end
ent:SetNWBool( "IsStatue", false )
ent.StatueInfo = nil
StatueDuplicator( ply, ent, nil )
end
} )

View File

@@ -0,0 +1,646 @@
--[[
| 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/
--]]
AddCSLuaFile()
local function rb655_property_filter( filtor, ent, ply )
if ( type( filtor ) == "string" && filtor != ent:GetClass() ) then return false end
if ( type( filtor ) == "table" && !table.HasValue( filtor, ent:GetClass() ) ) then return false end
if ( type( filtor ) == "function" && !filtor( ent, ply ) ) then return false end
return true
end
function AddEntFunctionProperty( name, label, pos, filtor, func, icon )
properties.Add( name, {
MenuLabel = label,
MenuIcon = icon,
Order = pos,
Filter = function( self, ent, ply )
if ( !IsValid( ent ) or !gamemode.Call( "CanProperty", ply, name, ent ) ) then return false end
if ( !rb655_property_filter( filtor, ent, ply ) ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ply ) or !IsValid( ent ) or !self:Filter( ent, ply ) ) then return false end
func( ent, ply )
end
} )
end
function AddEntFireProperty( name, label, pos, class, input, icon )
AddEntFunctionProperty( name, label, pos, class, function( e ) e:Fire( unpack( string.Explode( " ", input ) ) ) end, icon )
end
local ExplodeIcon = "icon16/bomb.png"
local EnableIcon = "icon16/tick.png"
local DisableIcon = "icon16/cross.png"
local ToggleIcon = "icon16/arrow_switch.png"
if ( SERVER ) then
local SyncFuncs = {}
SyncFuncs.prop_door_rotating = function( ent )
ent:SetNWBool( "Locked", ent:GetInternalVariable( "m_bLocked" ) )
local state = ent:GetInternalVariable( "m_eDoorState" )
ent:SetNWBool( "Closed", state == 0 or state == 3 )
end
SyncFuncs.func_door = function( ent )
ent:SetNWBool( "Locked", ent:GetInternalVariable( "m_bLocked" ) )
--[[local state = ent:GetInternalVariable( "m_eDoorState" )
ent:SetNWBool( "Closed", state == 0 or state == 3 )]]
end
SyncFuncs.func_door_rotating = function( ent )
ent:SetNWBool( "Locked", ent:GetInternalVariable( "m_bLocked" ) )
--[[local state = ent:GetInternalVariable( "m_eDoorState" )
ent:SetNWBool( "Closed", state == 0 or state == 3 )]]
end
SyncFuncs.prop_vehicle_jeep = function( ent )
ent:SetNWBool( "Locked", ent:GetInternalVariable( "VehicleLocked" ) )
ent:SetNWBool( "HasDriver", IsValid( ent:GetDriver() ) )
ent:SetNWBool( "m_bRadarEnabled", ent:GetInternalVariable( "m_bRadarEnabled" ) )
end
SyncFuncs.prop_vehicle_airboat = function( ent )
ent:SetNWBool( "Locked", ent:GetInternalVariable( "VehicleLocked" ) )
ent:SetNWBool( "HasDriver", IsValid( ent:GetDriver() ) )
end
--[[SyncFuncs.prop_vehicle_prisoner_pod = function( ent )
ent:SetNWBool( "Locked", ent:GetInternalVariable( "VehicleLocked" ) )
ent:SetNWBool( "HasDriver", IsValid( ent:GetDriver() ) )
end]]
SyncFuncs.func_tracktrain = function( ent )
ent:SetNWInt( "m_dir", ent:GetInternalVariable( "m_dir" ) )
ent:SetNWBool( "m_moving", ent:GetInternalVariable( "speed" ) != 0 )
--[[local driver = ent:GetDriver()
ent:SetNWBool( "HasDriver", IsValid( driver ) )]]
end
-- Periodically sync server data to clients.
local nextSync = 0
hook.Add( "Tick", "rb655_propperties_sync", function()
if ( CLIENT ) then return end
if ( nextSync > CurTime() ) then return end
nextSync = CurTime() + 1
for id, ent in pairs( ents.GetAll() ) do -- TODO: Swtich to ents.Iterator at some point!
if ( IsValid( ent ) && SyncFuncs[ ent:GetClass() ] ) then
SyncFuncs[ ent:GetClass() ]( ent )
end
end
end )
end
local e = 0
local dissolver
function rb655_dissolve( ent )
local phys = ent:GetPhysicsObject()
if ( IsValid( phys ) ) then phys:EnableGravity( false ) end
ent:SetName( "rb655_dissolve" .. e )
if ( !IsValid( dissolver ) ) then
dissolver = ents.Create( "env_entity_dissolver" )
dissolver:SetPos( ent:GetPos() )
dissolver:Spawn()
dissolver:Activate()
dissolver:SetKeyValue( "magnitude", 100 )
dissolver:SetKeyValue( "dissolvetype", 0 )
end
dissolver:Fire( "Dissolve", "rb655_dissolve" .. e )
timer.Create( "rb655_ep_cleanupDissolved", 60, 1, function()
if ( IsValid( dissolver ) ) then dissolver:Remove() end
end )
e = e + 1
end
-------------------------------------------------- Half - Life 2 Specific --------------------------------------------------
AddEntFireProperty( "rb655_door_open", "Open", 655, function( ent, ply )
if ( !ent:GetNWBool( "Closed" ) && ent:GetClass() == "prop_door_rotating" ) then return false end
return rb655_property_filter( { "prop_door_rotating", "func_door_rotating", "func_door" }, ent, ply )
end, "Open", "icon16/door_open.png" )
AddEntFireProperty( "rb655_door_close", "Close", 656, function( ent, ply )
if ( ent:GetNWBool( "Closed" ) && ent:GetClass() == "prop_door_rotating" ) then return false end
return rb655_property_filter( { "prop_door_rotating", "func_door_rotating", "func_door" }, ent, ply )
end, "Close", "icon16/door.png" )
AddEntFireProperty( "rb655_door_lock", "Lock", 657, function( ent, ply )
if ( ent:GetNWBool( "Locked" ) && ent:GetClass() != "prop_vehicle_prisoner_pod" ) then return false end
return rb655_property_filter( { "prop_door_rotating", "func_door_rotating", "func_door", "prop_vehicle_jeep", "prop_vehicle_airboat", "prop_vehicle_prisoner_pod" }, ent, ply )
end, "Lock", "icon16/lock.png" )
AddEntFireProperty( "rb655_door_unlock", "Unlock", 658, function( ent, ply )
if ( !ent:GetNWBool( "Locked" ) && ent:GetClass() != "prop_vehicle_prisoner_pod" ) then return false end
return rb655_property_filter( { "prop_door_rotating", "func_door_rotating", "func_door", "prop_vehicle_jeep", "prop_vehicle_airboat", "prop_vehicle_prisoner_pod" }, ent, ply )
end, "Unlock", "icon16/lock_open.png" )
AddEntFireProperty( "rb655_func_movelinear_open", "Start", 655, "func_movelinear", "Open", "icon16/arrow_right.png" )
AddEntFireProperty( "rb655_func_movelinear_close", "Return", 656, "func_movelinear", "Close", "icon16/arrow_left.png" )
AddEntFireProperty( "rb655_func_tracktrain_StartForward", "Start Forward", 655, function( ent, ply )
if ( ent:GetNWInt( "m_dir" ) == 1 ) then return false end
return rb655_property_filter( "func_tracktrain", ent, ply )
end, "StartForward", "icon16/arrow_right.png" )
AddEntFireProperty( "rb655_func_tracktrain_StartBackward", "Start Backward", 656, function( ent, ply )
if ( ent:GetNWInt( "m_dir" ) == -1 ) then return false end
return rb655_property_filter( "func_tracktrain", ent, ply )
end, "StartBackward", "icon16/arrow_left.png" )
--AddEntFireProperty( "rb655_func_tracktrain_Reverse", "Reverse", 657, "func_tr2acktrain", "Reverse", "icon16/arrow_undo.png" ) -- Same as two above
AddEntFireProperty( "rb655_func_tracktrain_Stop", "Stop", 658, function( ent, ply )
if ( !ent:GetNWBool( "m_moving" ) ) then return false end
return rb655_property_filter( "func_tracktrain", ent, ply )
end, "Stop", "icon16/shape_square.png" )
AddEntFireProperty( "rb655_func_tracktrain_Resume", "Resume", 659, function( ent, ply )
if ( ent:GetNWInt( "m_moving" ) ) then return false end
return rb655_property_filter( "func_tracktrain", ent, ply )
end, "Resume", "icon16/resultset_next.png" )
--AddEntFireProperty( "rb655_func_tracktrain_Toggle", "Toggle", 660, "func_track2train", "Toggle", ToggleIcon ) -- Same as two above
AddEntFireProperty( "rb655_breakable_break", "Break", 655, function( ent, ply )
if ( ent:Health() < 1 ) then return false end
return rb655_property_filter( { "func_breakable", "func_physbox", "prop_physics", "func_pushable" }, ent, ply )
end, "Break", ExplodeIcon ) -- Do not include item_item_crate, it insta crashes the server, dunno why.
AddEntFunctionProperty( "rb655_dissolve", "Disintegrate", 657, function( ent, ply )
if ( ent:GetModel() && ent:GetModel():StartWith( "*" ) ) then return false end
if ( ent:IsPlayer() ) then return false end
return true
end, function( ent )
rb655_dissolve( ent )
end, "icon16/wand.png" )
AddEntFireProperty( "rb655_turret_toggle", "Toggle", 655, { "npc_combine_camera", "npc_turret_ceiling", "npc_turret_floor" }, "Toggle", ToggleIcon )
AddEntFireProperty( "rb655_self_destruct", "Self Destruct", 656, { "npc_turret_floor", "npc_helicopter" }, "SelfDestruct", ExplodeIcon )
AddEntFunctionProperty( "rb655_turret_ammo_remove", "Deplete Ammo", 657, function( ent )
if ( bit.band( ent:GetSpawnFlags(), 256 ) == 256 ) then return false end
if ( ent:GetClass() == "npc_turret_floor" or ent:GetClass() == "npc_turret_ceiling" ) then return true end
return false
end, function( ent )
ent:SetKeyValue( "spawnflags", bit.bor( ent:GetSpawnFlags(), 256 ) )
ent:Activate()
end, "icon16/delete.png" )
AddEntFunctionProperty( "rb655_turret_ammo_restore", "Restore Ammo", 658, function( ent )
if ( bit.band( ent:GetSpawnFlags(), 256 ) == 0 ) then return false end
if ( ent:GetClass() == "npc_turret_floor" or ent:GetClass() == "npc_turret_ceiling" ) then return true end
return false
end, function( ent )
ent:SetKeyValue( "spawnflags", bit.bxor( ent:GetSpawnFlags(), 256 ) )
ent:Activate()
end, "icon16/add.png" )
AddEntFunctionProperty( "rb655_turret_make_friendly", "Make Friendly", 659, function( ent )
if ( bit.band( ent:GetSpawnFlags(), 512 ) == 512 ) then return false end
if ( ent:GetClass() == "npc_turret_floor" ) then return true end
return false
end, function( ent )
ent:SetKeyValue( "spawnflags", bit.bor( ent:GetSpawnFlags(), SF_FLOOR_TURRET_CITIZEN ) )
--ent:SetMaterial( "models/combine_turrets/floor_turret/floor_turret_citizen" )
ent:Activate()
end, "icon16/user_green.png" )
AddEntFunctionProperty( "rb655_turret_make_hostile", "Make Hostile", 660, function( ent )
if ( bit.band( ent:GetSpawnFlags(), 512 ) == 0 ) then return false end
if ( ent:GetClass() == "npc_turret_floor" ) then return true end
return false
end, function( ent )
ent:SetKeyValue( "spawnflags", bit.bxor( ent:GetSpawnFlags(), SF_FLOOR_TURRET_CITIZEN ) )
ent:Activate()
end, "icon16/user_red.png" )
AddEntFireProperty( "rb655_suitcharger_recharge", "Recharge", 655, "item_suitcharger", "Recharge", "icon16/arrow_refresh.png" )
AddEntFireProperty( "rb655_manhack_jam", "Jam", 655, "npc_manhack", "InteractivePowerDown", ExplodeIcon )
AddEntFireProperty( "rb655_scanner_mineadd", "Equip Mine", 655, "npc_clawscanner", "EquipMine", "icon16/add.png" )
AddEntFireProperty( "rb655_scanner_minedeploy", "Deploy Mine", 656, "npc_clawscanner", "DeployMine", "icon16/arrow_down.png" ) -- m_bIsOpen
AddEntFireProperty( "rb655_scanner_disable_spotlight", "Disable Spotlight", 658, { "npc_clawscanner", "npc_cscanner" }, "DisableSpotlight", DisableIcon ) -- SpotlightDisabled
-- AddEntFireProperty( "rb655_dropship_d1", "1", 655, "npc_combinedropship", "DropMines 1", DisableIcon )
AddEntFireProperty( "rb655_rollermine_selfdestruct", "Self Destruct", 655, "npc_rollermine", "InteractivePowerDown", ExplodeIcon )
AddEntFireProperty( "rb655_rollermine_turnoff", "Turn Off", 656, "npc_rollermine", "TurnOff", DisableIcon ) -- m_bTurnedOn
AddEntFireProperty( "rb655_rollermine_turnon", "Turn On", 657, "npc_rollermine", "TurnOn", EnableIcon )
AddEntFireProperty( "rb655_helicopter_gun_on", "Enable Turret", 655, "npc_helicopter", "GunOn", EnableIcon ) -- m_fHelicopterFlags = 1?
AddEntFireProperty( "rb655_helicopter_gun_off", "Disable Turret", 656, "npc_helicopter", "GunOff", DisableIcon ) -- m_fHelicopterFlags = 0?
AddEntFireProperty( "rb655_helicopter_dropbomb", "Drop Bomb", 657, "npc_helicopter", "DropBomb", "icon16/arrow_down.png" )
AddEntFireProperty( "rb655_helicopter_norm_shoot", "Start Normal Shooting", 660, "npc_helicopter", "StartNormalShooting", "icon16/clock.png" ) -- m_nShootingMode = 0
AddEntFireProperty( "rb655_helicopter_long_shoot", "Start Long Cycle Shooting", 661, "npc_helicopter", "StartLongCycleShooting", "icon16/clock_red.png" ) -- m_nShootingMode = 1
AddEntFireProperty( "rb655_helicopter_deadly_on", "Enable Deadly Shooting", 662, "npc_helicopter", "EnableDeadlyShooting", EnableIcon ) -- m_bDeadlyShooting
AddEntFireProperty( "rb655_helicopter_deadly_off", "Disable Deadly Shooting", 663, "npc_helicopter", "DisableDeadlyShooting", DisableIcon )
AddEntFireProperty( "rb655_gunship_OmniscientOn", "Enable Omniscient", 655, "npc_combinegunship", "OmniscientOn", EnableIcon ) -- m_fOmniscient
AddEntFireProperty( "rb655_gunship_OmniscientOff", "Disable Omniscient", 656, "npc_combinegunship", "OmniscientOff", DisableIcon )
AddEntFireProperty( "rb655_gunship_BlindfireOn", "Enable Blindfire", 657, "npc_combinegunship", "BlindfireOn", EnableIcon ) -- m_fBlindfire
AddEntFireProperty( "rb655_gunship_BlindfireOff", "Disable Blindfire", 658, "npc_combinegunship", "BlindfireOff", DisableIcon )
AddEntFireProperty( "rb655_alyx_HolsterWeapon", "Holster Weapon", 655, function( ent )
if ( !ent:IsNPC() or ent:GetClass() != "npc_alyx" or !IsValid( ent:GetActiveWeapon() ) ) then return false end
return true
end, "HolsterWeapon", "icon16/gun.png" )
AddEntFireProperty( "rb655_alyx_UnholsterWeapon", "Unholster Weapon", 656, "npc_alyx", "UnholsterWeapon", "icon16/gun.png" )
AddEntFireProperty( "rb655_alyx_HolsterAndDestroyWeapon", "Holster And Destroy Weapon", 657, function( ent )
if ( !ent:IsNPC() or ent:GetClass() != "npc_alyx" or !IsValid( ent:GetActiveWeapon() ) ) then return false end
return true
end, "HolsterAndDestroyWeapon", "icon16/gun.png" )
AddEntFireProperty( "rb655_antlion_burrow", "Burrow", 655, { "npc_antlion" , "npc_antlion_worker" }, "BurrowAway", "icon16/arrow_down.png" )
AddEntFireProperty( "rb655_barnacle_free", "Free Target", 655, "npc_barnacle", "LetGo", "icon16/heart.png" )
AddEntFireProperty( "rb655_zombine_suicide", "Suicide", 655, "npc_zombine", "PullGrenade", ExplodeIcon )
AddEntFireProperty( "rb655_zombine_sprint", "Sprint", 656, "npc_zombine", "StartSprint", "icon16/flag_blue.png" )
AddEntFireProperty( "rb655_thumper_enable", "Enable", 655, "prop_thumper", "Enable", EnableIcon ) -- m_bEnabled
AddEntFireProperty( "rb655_thumper_disable", "Disable", 656, "prop_thumper", "Disable", DisableIcon )
AddEntFireProperty( "rb655_dog_fetch_on", "Start Playing Fetch", 655, "npc_dog", "StartCatchThrowBehavior", "icon16/accept.png" ) -- m_bDoCatchThrowBehavior=true
AddEntFireProperty( "rb655_dog_fetch_off", "Stop Playing Fetch", 656, "npc_dog", "StopCatchThrowBehavior", "icon16/cancel.png" )
AddEntFireProperty( "rb655_soldier_look_off", "Enable Blindness", 655, "npc_combine_s", "LookOff", "icon16/user_green.png" )
AddEntFireProperty( "rb655_soldier_look_on", "Disable Blindness", 656, "npc_combine_s", "LookOn", "icon16/user_gray.png" )
AddEntFireProperty( "rb655_citizen_wep_pick_on", "Permit Weapon Upgrade Pickup", 655, "npc_citizen", "EnableWeaponPickup", EnableIcon )
AddEntFireProperty( "rb655_citizen_wep_pick_off", "Restrict Weapon Upgrade Pickup", 656, "npc_citizen", "DisableWeaponPickup", DisableIcon )
AddEntFireProperty( "rb655_citizen_panic", "Start Panicking", 658, { "npc_citizen", "npc_alyx", "npc_barney" }, "SetReadinessPanic", "icon16/flag_red.png" )
AddEntFireProperty( "rb655_citizen_panic_off", "Stop Panicking", 659, { "npc_citizen", "npc_alyx", "npc_barney" }, "SetReadinessHigh", "icon16/flag_green.png" )
AddEntFireProperty( "rb655_camera_angry", "Make Angry", 656, "npc_combine_camera", "SetAngry", "icon16/flag_red.png" )
AddEntFireProperty( "rb655_combine_mine_disarm", "Disarm", 655, "combine_mine", "Disarm", "icon16/wrench.png" )
AddEntFireProperty( "rb655_hunter_enable", "Enable Shooting", 655, "npc_hunter", "EnableShooting", EnableIcon )
AddEntFireProperty( "rb655_hunter_disable", "Disable Shooting", 656, "npc_hunter", "DisableShooting", DisableIcon )
AddEntFireProperty( "rb655_vortigaunt_enable", "Enable Armor Recharge", 655, "npc_vortigaunt", "EnableArmorRecharge", EnableIcon )
AddEntFireProperty( "rb655_vortigaunt_disable", "Disable Armor Recharge", 656, "npc_vortigaunt", "DisableArmorRecharge", DisableIcon )
AddEntFireProperty( "rb655_antlion_enable", "Enable Jump", 655, { "npc_antlion", "npc_antlion_worker" }, "EnableJump", EnableIcon )
AddEntFireProperty( "rb655_antlion_disable", "Disable Jump", 656, { "npc_antlion", "npc_antlion_worker" }, "DisableJump", DisableIcon )
AddEntFireProperty( "rb655_antlion_hear", "Hear Bugbait", 657, { "npc_antlion", "npc_antlion_worker" }, "HearBugbait", EnableIcon )
AddEntFireProperty( "rb655_antlion_ignore", "Ignore Bugbait", 658, { "npc_antlion", "npc_antlion_worker" }, "IgnoreBugbait", DisableIcon )
AddEntFireProperty( "rb655_antlion_grub_squash", "Squash", 655, "npc_antlion_grub", "Squash", "icon16/bug.png" )
AddEntFireProperty( "rb655_antlionguard_bark_on", "Enable Antlion Summon", 655, "npc_antlionguard", "EnableBark", EnableIcon )
AddEntFireProperty( "rb655_antlionguard_bark_off", "Disable Antlion Summon", 656, "npc_antlionguard", "DisableBark", DisableIcon )
AddEntFireProperty( "rb655_headcrab_burrow", "Burrow", 655, "npc_headcrab", "BurrowImmediate", "icon16/arrow_down.png" )
AddEntFireProperty( "rb655_strider_stand", "Force Stand", 655, "npc_strider", "Stand", "icon16/arrow_up.png" )
AddEntFireProperty( "rb655_strider_crouch", "Force Crouch", 656, "npc_strider", "Crouch", "icon16/arrow_down.png" )
AddEntFireProperty( "rb655_strider_break", "Destroy", 657, { "npc_strider", "npc_clawscanner", "npc_cscanner" }, "Break", ExplodeIcon )
-- This just doesn't do anything
AddEntFireProperty( "rb655_patrol_on", "Start Patrolling", 660, { "npc_citizen", "npc_combine_s" }, "StartPatrolling", "icon16/flag_green.png" )
AddEntFireProperty( "rb655_patrol_off", "Stop Patrolling", 661, { "npc_citizen", "npc_combine_s" }, "StopPatrolling", "icon16/flag_red.png" )
AddEntFireProperty( "rb655_strider_aggressive_e", "Make More Aggressive", 658, "npc_strider", "EnableAggressiveBehavior", EnableIcon )
AddEntFireProperty( "rb655_strider_aggressive_d", "Make Less Aggressive", 659, "npc_strider", "DisableAggressiveBehavior", DisableIcon )
AddEntFunctionProperty( "rb655_healthcharger_recharge", "Recharge", 655, "item_healthcharger", function( ent )
local n = ents.Create( "item_healthcharger" )
n:SetPos( ent:GetPos() )
n:SetAngles( ent:GetAngles() )
n:Spawn()
n:Activate()
n:EmitSound( "items/suitchargeok1.wav" )
undo.ReplaceEntity( ent, n )
cleanup.ReplaceEntity( ent, n )
ent:Remove()
end, "icon16/arrow_refresh.png" )
-------------------------------------------------- Vehicles --------------------------------------------------
AddEntFunctionProperty( "rb655_vehicle_exit", "Kick Driver", 655, function( ent )
if ( ent:IsVehicle() && ent:GetNWBool( "HasDriver" ) ) then return true end
return false
end, function( ent )
if ( !IsValid( ent:GetDriver() ) or !ent:GetDriver().ExitVehicle ) then return end
ent:GetDriver():ExitVehicle()
end, "icon16/car.png" )
AddEntFireProperty( "rb655_vehicle_radar", "Enable Radar", 655, function( ent )
if ( !ent:IsVehicle() or ent:GetClass() != "prop_vehicle_jeep" ) then return false end
if ( ent:LookupAttachment( "controlpanel0_ll" ) == 0 ) then return false end -- These two attachments must exist!
if ( ent:LookupAttachment( "controlpanel0_ur" ) == 0 ) then return false end
if ( ent:GetNWBool( "m_bRadarEnabled", false ) ) then return false end
return true
end, "EnableRadar", "icon16/application_add.png" )
AddEntFireProperty( "rb655_vehicle_radar_off", "Disable Radar", 655, function( ent )
if ( !ent:IsVehicle() or ent:GetClass() != "prop_vehicle_jeep" ) then return false end
-- if ( ent:LookupAttachment( "controlpanel0_ll" ) == 0 ) then return false end -- These two attachments must exist!
-- if ( ent:LookupAttachment( "controlpanel0_ur" ) == 0 ) then return false end
if ( !ent:GetNWBool( "m_bRadarEnabled", false ) ) then return false end
return true
end, "DisableRadar", "icon16/application_delete.png" )
AddEntFunctionProperty( "rb655_vehicle_enter", "Enter Vehicle", 656, function( ent )
if ( ent:IsVehicle() && !ent:GetNWBool( "HasDriver" ) ) then return true end
return false
end, function( ent, ply )
ply:ExitVehicle()
ply:EnterVehicle( ent )
end, "icon16/car.png" )
AddEntFunctionProperty( "rb655_vehicle_add_gun", "Mount Gun", 657, function( ent )
if ( !ent:IsVehicle() ) then return false end
if ( ent:GetNWBool( "EnableGun", false ) ) then return false end
if ( ent:GetBodygroup( 1 ) == 1 ) then return false end
if ( ent:LookupSequence( "aim_all" ) > 0 ) then return true end
if ( ent:LookupSequence( "weapon_yaw" ) > 0 && ent:LookupSequence( "weapon_pitch" ) > 0 ) then return true end
return false
end, function( ent )
ent:SetKeyValue( "EnableGun", "1" )
ent:Activate()
ent:SetBodygroup( 1, 1 )
ent:SetNWBool( "EnableGun", true )
end, "icon16/gun.png" )
-------------------------------------------------- Garry's Mod Specific --------------------------------------------------
AddEntFunctionProperty( "rb655_baloon_break", "Pop", 655, "gmod_balloon", function( ent, ply )
local dmginfo = DamageInfo()
dmginfo:SetAttacker( ply )
ent:OnTakeDamage( dmginfo )
end, ExplodeIcon )
AddEntFunctionProperty( "rb655_dynamite_activate", "Explode", 655, "gmod_dynamite", function( ent, ply )
ent:Explode( 0, ply )
end, ExplodeIcon )
-- Emitter
AddEntFunctionProperty( "rb655_emitter_on", "Start Emitting", 655, function( ent )
if ( ent:GetClass() == "gmod_emitter" && !ent:GetOn() ) then return true end
return false
end, function( ent, ply )
ent:SetOn( true )
end, EnableIcon )
AddEntFunctionProperty( "rb655_emitter_off", "Stop Emitting", 656, function( ent )
if ( ent:GetClass() == "gmod_emitter" && ent:GetOn() ) then return true end
return false
end, function( ent, ply )
ent:SetOn( false )
end, DisableIcon )
-- Lamps
AddEntFunctionProperty( "rb655_lamp_on", "Enable", 655, function( ent )
if ( ent:GetClass() == "gmod_lamp" && !ent:GetOn() ) then return true end
return false
end, function( ent, ply )
ent:Switch( true )
end, EnableIcon )
AddEntFunctionProperty( "rb655_lamp_off", "Disable", 656, function( ent )
if ( ent:GetClass() == "gmod_lamp" && ent:GetOn() ) then return true end
return false
end, function( ent, ply )
ent:Switch( false )
end, DisableIcon )
-- Light
AddEntFunctionProperty( "rb655_light_on", "Enable", 655, function( ent )
if ( ent:GetClass() == "gmod_light" && !ent:GetOn() ) then return true end
return false
end, function( ent, ply )
ent:SetOn( true )
end, EnableIcon )
AddEntFunctionProperty( "rb655_light_off", "Disable", 656, function( ent )
if ( ent:GetClass() == "gmod_light" && ent:GetOn() ) then return true end
return false
end, function( ent, ply )
ent:SetOn( false )
end, DisableIcon )
-- No thruster, it is glitchy
-------------------------------------------------- HL1 Specific --------------------------------------------------
AddEntFireProperty( "rb655_func_rotating_forward", "Start Forward", 655, "func_rotating", "StartForward", "icon16/arrow_right.png" )
AddEntFireProperty( "rb655_func_rotating_backward", "Start Backward", 656, "func_rotating", "StartBackward", "icon16/arrow_left.png" )
AddEntFireProperty( "rb655_func_rotating_reverse", "Reverse", 657, "func_rotating", "Reverse", "icon16/arrow_undo.png" )
AddEntFireProperty( "rb655_func_rotating_stop", "Stop", 658, "func_rotating", "Stop", "icon16/shape_square.png" )
AddEntFireProperty( "rb655_func_platrot_up", "Go Up", 655, "func_platrot", "GoUp", "icon16/arrow_up.png" )
AddEntFireProperty( "rb655_func_platrot_down", "Go Down", 656, "func_platrot", "GoDown", "icon16/arrow_down.png" )
AddEntFireProperty( "rb655_func_platrot_toggle", "Toggle", 657, "func_platrot", "Toggle", ToggleIcon )
AddEntFireProperty( "rb655_func_train_start", "Start", 655, "func_train", "Start", "icon16/arrow_right.png" )
AddEntFireProperty( "rb655_func_train_stop", "Stop", 656, "func_train", "Stop", "icon16/arrow_left.png" )
AddEntFireProperty( "rb655_func_train_toggle", "Toggle", 657, "func_train", "Toggle", ToggleIcon )
-------------------------------------------------- Pickupable Items --------------------------------------------------
AddEntFunctionProperty( "rb655_item_suit", "Wear", 655, function( ent, ply )
if ( ent:GetClass() != "item_suit" ) then return false end
if ( !ply:IsSuitEquipped() ) then return true end
return false
end, function( ent, ply )
ent:Remove()
ply:EquipSuit()
end, "icon16/user_green.png" )
local CheckFuncs = {}
CheckFuncs[ "item_ammo_pistol" ] = function( ply ) return ply:GetAmmoCount( "pistol" ) < 9999 end
CheckFuncs[ "item_ammo_pistol_large" ] = function( ply ) return ply:GetAmmoCount( "pistol" ) < 9999 end
CheckFuncs[ "item_ammo_smg1" ] = function( ply ) return ply:GetAmmoCount( "smg1" ) < 9999 end
CheckFuncs[ "item_ammo_smg1_large" ] = function( ply ) return ply:GetAmmoCount( "smg1" ) < 9999 end
CheckFuncs[ "item_ammo_smg1_grenade" ] = function( ply ) return ply:GetAmmoCount( "smg1_grenade" ) < 9999 end
CheckFuncs[ "item_ammo_ar2" ] = function( ply ) return ply:GetAmmoCount( "ar2" ) < 9999 end
CheckFuncs[ "item_ammo_ar2_large" ] = function( ply ) return ply:GetAmmoCount( "ar2" ) < 9999 end
CheckFuncs[ "item_ammo_ar2_altfire" ] = function( ply ) return ply:GetAmmoCount( "AR2AltFire" ) < 9999 end
CheckFuncs[ "item_ammo_357" ] = function( ply ) return ply:GetAmmoCount( "357" ) < 9999 end
CheckFuncs[ "item_ammo_357_large" ] = function( ply ) return ply:GetAmmoCount( "357" ) < 9999 end
CheckFuncs[ "item_ammo_crossbow" ] = function( ply ) return ply:GetAmmoCount( "xbowbolt" ) < 9999 end
CheckFuncs[ "item_rpg_round" ] = function( ply ) return ply:GetAmmoCount( "rpg_round" ) < 9999 end
CheckFuncs[ "item_box_buckshot" ] = function( ply ) return ply:GetAmmoCount( "buckshot" ) < 9999 end
CheckFuncs[ "item_battery" ] = function( ply ) return ply:Armor() < 100 end
CheckFuncs[ "item_healthvial" ] = function( ply ) return ply:Health() < 100 end
CheckFuncs[ "item_healthkit" ] = function( ply ) return ply:Health() < 100 end
CheckFuncs[ "item_grubnugget" ] = function( ply ) return ply:Health() < 100 end
AddEntFunctionProperty( "rb655_pickupitem", "Pick up", 655, function( ent, ply )
if ( !table.HasValue( table.GetKeys( CheckFuncs ), ent:GetClass() ) ) then return false end
if ( CheckFuncs[ ent:GetClass() ]( ply ) ) then return true end
return false
end, function( ent, ply )
ply:Give( ent:GetClass() )
ent:Remove()
end, "icon16/user_green.png" )
-------------------------------------------------- NPCs --------------------------------------------------
-- Passive NPCs - You cannot make these hostile or friendly
local passive = {
"npc_seagull", "npc_crow", "npc_piegon", "monster_cockroach",
"npc_dog", "npc_gman", "npc_antlion_grub",
-- "monster_scientist", -- Can't attack, but does run away
"monster_nihilanth", -- Doesn't attack from spawn menu, so not allowing to change his dispositions
"npc_turret_floor" -- Uses a special input for this sort of stuff
}
local friendly = {
"npc_monk", "npc_alyx", "npc_barney", "npc_citizen",
"npc_turret_floor", "npc_dog", "npc_vortigaunt",
"npc_kleiner", "npc_eli", "npc_magnusson", "npc_breen", "npc_mossman", -- They can use SHOTGUNS!
"npc_fisherman", -- He sorta can use shotgun
"monster_barney", "monster_scientist", "player"
}
local hostile = {
"npc_turret_ceiling", "npc_combine_s", "npc_combinegunship", "npc_combinedropship",
"npc_cscanner", "npc_clawscanner", "npc_turret_floor", "npc_helicopter", "npc_hunter", "npc_manhack",
"npc_stalker", "npc_rollermine", "npc_strider", "npc_metropolice", "npc_turret_ground",
"npc_cscanner", "npc_clawscanner", "npc_combine_camera", -- These are friendly to enemies
"monster_human_assassin", "monster_human_grunt", "monster_turret", "monster_miniturret", "monster_sentry"
}
local monsters = {
"npc_antlion", "npc_antlion_worker", "npc_antlionguard", "npc_barnacle", "npc_fastzombie", "npc_fastzombie_torso",
"npc_headcrab", "npc_headcrab_fast", "npc_headcrab_black", "npc_headcrab_poison", "npc_poisonzombie", "npc_zombie", "npc_zombie_torso", "npc_zombine",
"monster_alien_grunt", "monster_alien_slave", "monster_babycrab", "monster_headcrab", "monster_bigmomma", "monster_bullchicken", "monster_barnacle",
"monster_alien_controller", "monster_gargantua", "monster_nihilanth", "monster_snark", "monster_zombie", "monster_tentacle", "monster_houndeye"
}
---------------------------- Functional stuff ----------------------------
local NPCsThisWorksOn = {}
local function RecalcUsableNPCs()
-- Not resetting NPCsThisWorksOn as you can't remove classes from the tables below
-- Not including passive monsters here, you can't make them hostile or friendly
for _, class in pairs( friendly ) do NPCsThisWorksOn[ class ] = true end
for _, class in pairs( hostile ) do NPCsThisWorksOn[ class ] = true end
for _, class in pairs( monsters ) do NPCsThisWorksOn[ class ] = true end
end
RecalcUsableNPCs()
-- For mods
function ExtProp_AddPassive( class ) table.insert( passive, class ) end -- Probably shouldn't exist
function ExtProp_AddFriendly( class ) table.insert( friendly, class ) RecalcUsableNPCs() end
function ExtProp_AddHostile( class ) table.insert( hostile, class ) RecalcUsableNPCs() end
function ExtProp_AddMonster( class ) table.insert( monsters, class ) RecalcUsableNPCs() end
local friendliedNPCs = {}
local hostaliziedNPCs = {}
local function SetRelationships( ent, tab, status )
for id, fnpc in pairs( tab ) do
if ( !IsValid( fnpc ) ) then table.remove( tab, id ) continue end
fnpc:AddEntityRelationship( ent, status, 999 )
ent:AddEntityRelationship( fnpc, status, 999 )
end
end
local function Rbt_ProcessOtherNPC( ent )
if ( table.HasValue( friendly, ent:GetClass() ) && !table.HasValue( hostaliziedNPCs, ent ) ) then -- It's a friendly that isn't made hostile
SetRelationships( ent, friendliedNPCs, D_LI )
SetRelationships( ent, hostaliziedNPCs, D_HT )
elseif ( table.HasValue( hostile, ent:GetClass() ) && !table.HasValue( friendliedNPCs, ent ) ) then -- It's a hostile that isn't made friendly
SetRelationships( ent, friendliedNPCs, D_HT )
SetRelationships( ent, hostaliziedNPCs, D_LI )
elseif ( table.HasValue( monsters, ent:GetClass() ) && !table.HasValue( friendliedNPCs, ent ) && !table.HasValue( hostaliziedNPCs, ent ) ) then -- It's a monster that isn't made friendly or hostile to the player
SetRelationships( ent, friendliedNPCs, D_HT )
SetRelationships( ent, hostaliziedNPCs, D_HT )
end
end
if ( SERVER ) then
hook.Add( "OnEntityCreated", "rb655_properties_friently/hostile", function( ent )
if ( ent:IsNPC() ) then Rbt_ProcessOtherNPC( ent ) end
end )
end
AddEntFunctionProperty( "rb655_make_friendly", "Make Friendly", 652, function( ent )
if ( ent:IsNPC() && !table.HasValue( passive, ent:GetClass() ) && NPCsThisWorksOn[ ent:GetClass() ] ) then return true end
return false
end, function( ent )
table.insert( friendliedNPCs, ent )
table.RemoveByValue( hostaliziedNPCs, ent )
-- Remove the NPC from any squads so the console doesn't spam. TODO: Add a suffix like _friendly instead?
ent:Fire( "SetSquad", "" )
-- Special case for stalkers
if ( ent:GetClass() == "npc_stalker" ) then
ent:SetSaveValue( "m_iPlayerAggression", 0 )
end
-- Is this even necessary anymore?
for id, class in pairs( friendly ) do ent:AddRelationship( class .. " D_LI 999" ) end
for id, class in pairs( monsters ) do ent:AddRelationship( class .. " D_HT 999" ) end
for id, class in pairs( hostile ) do ent:AddRelationship( class .. " D_HT 999" ) end
SetRelationships( ent, friendliedNPCs, D_LI )
SetRelationships( ent, hostaliziedNPCs, D_HT )
for id, oent in pairs( ents.GetAll() ) do
if ( oent:IsNPC() && oent != ent ) then Rbt_ProcessOtherNPC( oent ) end
end
ent:Activate()
end, "icon16/user_green.png" )
AddEntFunctionProperty( "rb655_make_hostile", "Make Hostile", 653, function( ent )
if ( ent:IsNPC() && !table.HasValue( passive, ent:GetClass() ) && NPCsThisWorksOn[ ent:GetClass() ] ) then return true end
return false
end, function( ent )
table.insert( hostaliziedNPCs, ent )
table.RemoveByValue( friendliedNPCs, ent )
-- Remove the NPC from any squads so the console doesn't spam. TODO: Add a suffix like _hostile instead?
ent:Fire( "SetSquad", "" )
-- Special case for stalkers
if ( ent:GetClass() == "npc_stalker" ) then
ent:SetSaveValue( "m_iPlayerAggression", 1 )
end
-- Is this even necessary anymore?
for id, class in pairs( hostile ) do ent:AddRelationship( class .. " D_LI 999" ) end
for id, class in pairs( monsters ) do ent:AddRelationship( class .. " D_HT 999" ) end
for id, class in pairs( friendly ) do ent:AddRelationship( class .. " D_HT 999" ) end
SetRelationships( ent, friendliedNPCs, D_HT )
SetRelationships( ent, hostaliziedNPCs, D_LI )
for id, oent in pairs( ents.GetAll() ) do
if ( oent:IsNPC() && oent != ent ) then Rbt_ProcessOtherNPC( oent ) end
end
end, "icon16/user_red.png" )

View File

@@ -0,0 +1,178 @@
--[[
| 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/
--]]
AddCSLuaFile()
local extraItems = {
{ ClassName = "weapon_alyxgun", PrintName = "#weapon_alyxgun", Category = "Half-Life 2", Author = "VALVe", Spawnable = true },
{ ClassName = "weapon_oldmanharpoon", PrintName = "#weapon_oldmanharpoon", Category = "Half-Life 2", Author = "VALVe", Spawnable = true },
{ ClassName = "weapon_annabelle", PrintName = "#weapon_annabelle", Category = "Half-Life 2", Author = "VALVe", Spawnable = true },
{ ClassName = "weapon_citizenpackage", PrintName = "#weapon_citizenpackage", Category = "Half-Life 2", Author = "VALVe", Spawnable = true },
{ ClassName = "weapon_citizensuitcase", PrintName = "#weapon_citizensuitcase", Category = "Half-Life 2", Author = "VALVe", Spawnable = true }
}
local function GiveWeapon( ply, ent, args )
if ( !args or !args[ 1 ] or !isstring( args[ 1 ] ) ) then return end
local className = args[ 1 ]
local swep = list.Get( "Weapon" )[ className ]
if ( swep == nil ) then
for id, t in pairs( extraItems ) do
if ( t.ClassName == className ) then swep = t end
end
end
if ( swep == nil ) then return end
-- Cannot validate if the player is admin for admin weapons if we got no player object (saves)
if ( IsValid( ply ) ) then
if ( ( !swep.Spawnable && !ply:IsAdmin() ) or ( swep.AdminOnly && !ply:IsAdmin() ) ) then return end
if ( !hook.Run( "PlayerGiveSWEP", ply, className, swep ) ) then return end
end
ent:Give( className )
if ( SERVER ) then duplicator.StoreEntityModifier( ent, "rb655_npc_weapon", args ) end
end
duplicator.RegisterEntityModifier( "rb655_npc_weapon", GiveWeapon )
local function changeWep( it, ent, wep )
it:MsgStart()
net.WriteEntity( ent )
net.WriteString( wep )
it:MsgEnd()
end
local nowep = {
"cycler", "npc_furniture", "monster_generic",
-- HL2
"npc_seagull", "npc_crow", "npc_piegon", "npc_rollermine", "npc_turret_floor", "npc_stalker", "npc_turret_ground",
"npc_combine_camera", "npc_turret_ceiling", "npc_cscanner", "npc_clawscanner", "npc_manhack", "npc_sniper",
"npc_combinegunship", "npc_combinedropship", "npc_helicopter", "npc_antlion_worker", "npc_headcrab_black",
"npc_hunter", "npc_vortigaunt", "npc_antlion", "npc_antlionguard", "npc_barnacle", "npc_headcrab",
"npc_dog", "npc_gman", "npc_antlion_grub", "npc_strider", "npc_fastzombie", "npc_fastzombie_torso",
"npc_headcrab_poison", "npc_headcrab_fast", "npc_poisonzombie", "npc_zombie", "npc_zombie_torso", "npc_zombine",
-- HLS
"monster_scientist", "monster_zombie", "monster_headcrab", "class C_AI_BaseNPC", "monster_tentacle",
"monster_alien_grunt", "monster_alien_slave", "monster_human_assassin", "monster_babycrab", "monster_bullchicken",
"monster_cockroach", "monster_alien_controller", "monster_gargantua", "monster_bigmomma", "monster_human_grunt",
"monster_houndeye", "monster_nihilanth", "monster_barney", "monster_snark", "monster_turret", "monster_miniturret", "monster_sentry"
}
AddEntFunctionProperty( "rb655_npc_weapon_strip", "Strip Weapon", 651, function( ent )
if ( ent:IsNPC() && IsValid( ent:GetActiveWeapon() ) && !table.HasValue( nowep, ent:GetClass() ) ) then return true end
return false
end, function( ent )
ent:GetActiveWeapon():Remove()
end, "icon16/gun.png" )
properties.Add( "rb655_npc_weapon", {
MenuLabel = "Change Weapon (Popup)",
MenuIcon = "icon16/gun.png",
Order = 650,
Filter = function( self, ent, ply )
if ( !IsValid( ent ) or !gamemode.Call( "CanProperty", ply, "rb655_npc_weapon", ent ) ) then return false end
if ( ent:IsNPC() && !table.HasValue( nowep, ent:GetClass() ) ) then return true end
return false
end,
Action = function( self, ent )
if ( !IsValid( ent ) ) then return false end
local frame = vgui.Create( "DFrame" )
frame:SetSize( ScrW() / 1.2, ScrH() / 1.1 )
frame:SetTitle( "Change weapon of " .. language.GetPhrase( "#" .. ent:GetClass() ) )
frame:Center()
frame:MakePopup()
frame:SetDraggable( false )
function frame:Paint( w, h )
Derma_DrawBackgroundBlur( self, self.m_fCreateTime )
draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 200 ) )
end
local PropPanel = vgui.Create( "ContentContainer", frame )
PropPanel:SetTriggerSpawnlistChange( false )
PropPanel:Dock( FILL )
local Categorised = {}
-- Add the hidden NPC only weapons
Categorised[ "Half-Life 2" ] = table.Copy( extraItems )
for k, weapon in pairs( list.Get( "Weapon" ) ) do
if ( !weapon.Spawnable && !weapon.AdminSpawnable ) then continue end
local cat = weapon.Category or "Other"
if ( !isstring( cat ) ) then cat = tostring( cat ) end
Categorised[ cat ] = Categorised[ cat ] or {}
table.insert( Categorised[ cat ], weapon )
end
for CategoryName, v in SortedPairs( Categorised ) do
local Header = vgui.Create( "ContentHeader", PropPanel )
Header:SetText( CategoryName )
PropPanel:Add( Header )
for k, WeaponTable in SortedPairsByMemberValue( v, "PrintName" ) do
if ( WeaponTable.AdminOnly && !LocalPlayer():IsAdmin() ) then continue end
local icon = vgui.Create( "ContentIcon", PropPanel )
icon:SetMaterial( "entities/" .. WeaponTable.ClassName .. ".png" )
icon:SetName( WeaponTable.PrintName or "#" .. WeaponTable.ClassName )
icon:SetAdminOnly( WeaponTable.AdminOnly or false )
icon.DoClick = function()
changeWep( self, ent, WeaponTable.ClassName )
frame:Close()
end
PropPanel:Add( icon )
end
end
local WarningThing = vgui.Create( "Panel", frame )
WarningThing:SetHeight( 70 )
WarningThing:Dock( BOTTOM )
WarningThing:DockMargin( 0, 5, 0, 0 )
function WarningThing:Paint( w, h )
draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 0, 0 ) )
end
local WarningText = vgui.Create( "DLabel", WarningThing )
WarningText:Dock( TOP )
WarningText:SetHeight( 35 )
WarningText:SetContentAlignment( 5 )
WarningText:SetTextColor( color_white )
WarningText:SetFont( "DermaLarge" )
WarningText:SetText( "WARNING! Not all NPCs can use weapons and not all weapons are usable by NPCs." )
local WarningText2 = vgui.Create( "DLabel", WarningThing )
WarningText2:Dock( TOP )
WarningText2:SetHeight( 35 )
WarningText2:SetContentAlignment( 5 )
WarningText2:SetTextColor( color_white )
WarningText2:SetFont( "DermaLarge" )
WarningText2:SetText( "This is entirely dependent on the Addon the weapon and the NPC are from. This mod cannot change that." )
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !IsValid( ent ) ) then return end
if ( !ent:IsNPC() or table.HasValue( nowep, ent:GetClass() ) ) then return end
local wep = net.ReadString()
GiveWeapon( ply, ent, { wep } )
end
} )

View File

@@ -0,0 +1,816 @@
--[[
| 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/
--]]
AddCSLuaFile()
if ( SERVER ) then
util.AddNetworkString( "rb655_playsound" )
concommand.Add( "rb655_playsound_all", function( ply, cmd, args )
if ( !ply:IsSuperAdmin() or !args[ 1 ] or string.Trim( args[ 1 ] ) == "" ) then return end
net.Start( "rb655_playsound" )
net.WriteString( args[ 1 ] or "" )
net.Broadcast()
end )
return
end
local cl_addTabs = CreateClientConVar( "rb655_create_sm_tabs", "0", true, true )
--[[local function removeOldTabls()
for k, v in pairs( g_SpawnMenu.CreateMenu.Items ) do
if (v.Tab:GetText() == language.GetPhrase( "spawnmenu.category.npcs" ) or
v.Tab:GetText() == language.GetPhrase( "spawnmenu.category.entities" ) or
v.Tab:GetText() == language.GetPhrase( "spawnmenu.category.weapons" ) or
v.Tab:GetText() == language.GetPhrase( "spawnmenu.category.vehicles" ) or
v.Tab:GetText() == language.GetPhrase( "spawnmenu.category.postprocess" ) ) then
g_SpawnMenu.CreateMenu:CloseTab( v.Tab, true )
end
end
end
hook.Add( "PopulateContent", "rb655_extended_spawnmenu", function( pnlContent, tree, node )
removeOldTabls() removeOldTabls() removeOldTabls() -- For some reason it doesn't work with only one call
end )]]
local function getGameList()
local games = engine.GetGames()
table.insert( games, {
title = "All",
folder = "GAME",
icon = "all",
mounted = true
} )
table.insert( games, {
title = "Garry's Mod",
folder = "garrysmod",
mounted = true
} )
return games
end
--[[ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ]]
local theSound = nil
function rb655_playsound( snd )
if ( theSound ) then theSound:Stop() end
theSound = CreateSound( LocalPlayer(), snd )
theSound:Play()
end
net.Receive( "rb655_playsound", function( len )
rb655_playsound( net.ReadString() )
end )
spawnmenu.AddContentType( "sound", function( container, obj )
if ( !obj.nicename ) then return end
if ( !obj.spawnname ) then return end
local icon = vgui.Create( "ContentIcon", container )
icon:SetContentType( "sound" )
icon:SetSpawnName( obj.spawnname )
icon:SetName( obj.nicename )
icon:SetMaterial( "icon16/sound.png" )
icon.DoClick = function()
rb655_playsound( obj.spawnname )
end
icon.OpenMenu = function( icn )
local menu = DermaMenu()
menu:AddOption( "#spawnmenu.menu.copy", function() SetClipboardText( obj.spawnname ) end ):SetIcon( "icon16/page_copy.png" )
menu:AddOption( "Play on all clients", function() RunConsoleCommand( "rb655_playsound_all", obj.spawnname ) end ):SetIcon( "icon16/sound.png" )
menu:AddOption( "Stop all sounds", function() RunConsoleCommand( "stopsound" ) end ):SetIcon( "icon16/sound_mute.png" )
menu:AddSpacer()
menu:AddOption( "#spawnmenu.menu.delete", function() icn:Remove() hook.Run( "SpawnlistContentChanged", icn ) end ):SetIcon( "icon16/bin_closed.png" )
menu:Open()
end
if ( IsValid( container ) ) then
container:Add( icon )
end
return icon
end )
local function OnSndNodeSelected( self, node, name, path, pathid, icon, ViewPanel, pnlContent )
ViewPanel:Clear( true )
local Path = node:GetFolder()
local files = file.Find( Path .. "/*.wav", node:GetPathID() )
files = table.Add( files, file.Find( Path .. "/*.mp3", node:GetPathID() ) )
files = table.Add( files, file.Find( Path .. "/*.ogg", node:GetPathID() ) )
local offset = 0
local limit = 512
if ( node.offset ) then offset = node.offset or 0 end
for k, v in pairs( files ) do
if ( k > limit + offset ) then
if ( !node.Done ) then
offset = offset + limit
local mats = ( self.Parent or node ):AddNode( ( self.Text or node:GetText() ) .. " (" .. offset .. " - " .. offset + limit .. ")" )
mats:SetFolder( node:GetFolder() )
mats.Text = self.Text or node:GetText()
mats.Parent = self.Parent or node
mats:SetPathID( node:GetPathID() )
mats:SetIcon( node:GetIcon() )
mats.offset = offset
mats.OnNodeSelected = function( mats_self, mats_node )
OnSndNodeSelected( mats_self, mats_node, mats_self.Text, mats_node:GetFolder(), mats_node:GetPathID(), mats_node:GetIcon(), ViewPanel, pnlContent )
end
end
node.Done = true
break end
if ( k <= offset ) then continue end
local p = Path .. "/"
if ( string.StartWith( path, "addons/" ) or string.StartWith( path, "download/" ) ) then
p = string.sub( p, string.find( p, "/sound/" ) + 1 )
end
p = string.sub( p .. v, 7 )
spawnmenu.CreateContentIcon( "sound", ViewPanel, { spawnname = p, nicename = string.Trim( v ) } )
end
pnlContent:SwitchPanel( ViewPanel )
end
local function AddBrowseContentSnd( node, name, icon, path, pathid )
local ViewPanel = node.ViewPanel
local pnlContent = node.pnlContent
if ( !string.EndsWith( path, "/" ) && string.len( path ) > 1 ) then path = path .. "/" end
local fi, fo = file.Find( path .. "sound", pathid )
if ( !fo && !fi ) then return end
local sounds = node:AddFolder( name, path .. "sound", pathid, false, false, "*.*" )
sounds:SetIcon( icon )
sounds.OnNodeSelected = function( self, node_sel )
OnSndNodeSelected( self, node_sel, name, path, pathid, icon, ViewPanel, pnlContent )
end
end
language.Add( "spawnmenu.category.browsesounds", "Browse Sounds" )
local function RefreshAddonSounds( browseAddonSounds )
for _, addon in SortedPairsByMemberValue( engine.GetAddons(), "title" ) do
if ( !addon.downloaded ) then continue end
if ( !addon.mounted ) then continue end
if ( !table.HasValue( select( 2, file.Find( "*", addon.title ) ), "sound" ) ) then continue end
AddBrowseContentSnd( browseAddonSounds, addon.title, "icon16/bricks.png", "", addon.title )
end
end
local function RefreshGameSounds( browseGameSounds )
local games = getGameList()
for _, game in SortedPairsByMemberValue( games, "title" ) do
if ( !game.mounted ) then continue end
AddBrowseContentSnd( browseGameSounds, game.title, "games/16/" .. ( game.icon or game.folder ) .. ".png", "", game.folder )
end
end
local browseGameSounds
local browseAddonSounds
hook.Add( "PopulateContent", "SpawnmenuLoadSomeSounds", function( pnlContent, tree, browseNode ) timer.Simple( 0.5, function()
if ( !IsValid( tree ) or !IsValid( pnlContent ) ) then
print( "!!! Extended Spawnmenu: FAILED TO INITALIZE PopulateContent HOOK FOR SOUNDS !!!" )
print( "!!! Extended Spawnmenu: FAILED TO INITALIZE PopulateContent HOOK FOR SOUNDS !!!" )
print( "!!! Extended Spawnmenu: FAILED TO INITALIZE PopulateContent HOOK FOR SOUNDS !!!" )
return
end
local ViewPanel = vgui.Create( "ContentContainer", pnlContent )
ViewPanel:SetVisible( false )
local browseSounds = tree:AddNode( "#spawnmenu.category.browsesounds", "icon16/sound.png" )
browseSounds.ViewPanel = ViewPanel
browseSounds.pnlContent = pnlContent
--[[ --------------------------------------------------------------------------------------- ]]
browseAddonSounds = browseSounds:AddNode( "#spawnmenu.category.addons", "icon16/folder_database.png" )
browseAddonSounds.ViewPanel = ViewPanel
browseAddonSounds.pnlContent = pnlContent
RefreshAddonSounds( browseAddonSounds )
--[[ --------------------------------------------------------------------------------------- ]]
local addon_sounds = {}
local _, snd_folders = file.Find( "addons/*", "MOD" )
for _, addon in SortedPairs( snd_folders ) do
if ( !file.IsDir( "addons/" .. addon .. "/sound/", "MOD" ) ) then continue end
table.insert( addon_sounds, addon )
end
local browseLegacySounds = browseSounds:AddNode( "#spawnmenu.category.addonslegacy", "icon16/folder_database.png" )
browseLegacySounds.ViewPanel = ViewPanel
browseLegacySounds.pnlContent = pnlContent
for _, addon in SortedPairsByValue( addon_sounds ) do
AddBrowseContentSnd( browseLegacySounds, addon, "icon16/bricks.png", "addons/" .. addon .. "/", "MOD" )
end
--[[ --------------------------------------------------------------------------------------- ]]
AddBrowseContentSnd( browseSounds, "#spawnmenu.category.downloads", "icon16/folder_database.png", "download/", "MOD" )
--[[ --------------------------------------------------------------------------------------- ]]
browseGameSounds = browseSounds:AddNode( "#spawnmenu.category.games", "icon16/folder_database.png" )
browseGameSounds.ViewPanel = ViewPanel
browseGameSounds.pnlContent = pnlContent
RefreshGameSounds( browseGameSounds )
end ) end )
hook.Add( "GameContentChanged", "ES_RefreshSpawnmenuSounds", function()
if ( IsValid( browseAddonSounds ) ) then
-- TODO: Maybe be more advaced and do not delete => recreate all the nodes, only delete nodes for addons that were removed, add only the new ones?
browseAddonSounds:Clear()
browseAddonSounds.ViewPanel:Clear( true )
RefreshAddonSounds( browseAddonSounds )
end
if ( IsValid( browseGameSounds ) ) then
-- TODO: Maybe be more advaced and do not delete => recreate all the nodes, only delete nodes for addons that were removed, add only the new ones?
browseGameSounds:Clear()
browseGameSounds.ViewPanel:Clear( true )
RefreshGameSounds( browseGameSounds )
end
end )
--[[ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ]]
local function IsMaterialUsableOnEntities( matPath )
-- A png file? No thanks
if ( string.GetExtensionFromFilename( matPath ) ) then return false end
local mat = Material( matPath )
if ( !string.find( mat:GetShader(), "LightmappedGeneric" )
&& !string.find( mat:GetShader(), "WorldVertexTransition" )
&& !string.find( mat:GetShader(), "Spritecard" )
&& !string.find( mat:GetShader(), "Water" )
&& !string.find( mat:GetShader(), "Cable" )
--&& !string.find( mat:GetShader(), "UnlitGeneric" )
&& !string.find( mat:GetShader(), "Refract" ) ) then
return true
end
return false
end
local DisplayedWarning = false
local function DisplayOneTimeWarning()
if ( DisplayedWarning ) then return end
DisplayedWarning = true
Derma_Message( "Please note that not all materials are usable on entities, such as map textures, etc.\nYou can still try though!", "Warning", "OK" )
end
spawnmenu.AddContentType( "material", function( container, obj )
if ( !obj.nicename ) then return end
if ( !obj.spawnname ) then return end
local icon = vgui.Create( "ContentIcon", container )
icon:SetContentType( "material" )
icon:SetSpawnName( obj.spawnname )
icon:SetName( obj.nicename )
if ( string.GetExtensionFromFilename( obj.spawnname ) == "png" ) then
icon:SetMaterial( obj.spawnname )
else
icon.Image:SetImage( obj.spawnname )
end
icon.DoClick = function()
if ( !IsMaterialUsableOnEntities( obj.spawnname ) ) then DisplayOneTimeWarning() end
RunConsoleCommand( "material_override", obj.spawnname )
spawnmenu.ActivateTool( "material" )
surface.PlaySound( "garrysmod/ui_click.wav" )
end
icon.OpenMenu = function( icn )
local menu = DermaMenu()
menu:AddOption( "#spawnmenu.menu.copy", function() SetClipboardText( obj.spawnname ) end ):SetIcon( "icon16/page_copy.png" )
local str = "Use with Material Tool"
if ( !IsMaterialUsableOnEntities( obj.spawnname ) ) then
str = "Try to use with Material Tool (Probably won't work)"
end
menu:AddOption( str, function()
RunConsoleCommand( "material_override", obj.spawnname )
spawnmenu.ActivateTool( "material" )
end ):SetIcon( "icon16/pencil.png" )
menu:AddSpacer()
menu:AddOption( "#spawnmenu.menu.delete", function() icn:Remove() hook.Run( "SpawnlistContentChanged", icn ) end ):SetIcon( "icon16/bin_closed.png" )
menu:Open()
end
if ( IsValid( container ) ) then
container:Add( icon )
end
return icon
end )
local function OnMatNodeSelected( self, node, name, path, pathid, icon, ViewPanel, pnlContent )
ViewPanel:Clear( true )
local Path = node:GetFolder()
local mat_files = file.Find( Path .. "/*.vmt", node:GetPathID() )
mat_files = table.Add( mat_files, file.Find( Path .. "/*.png", node:GetPathID() ) )
local offset = 0
local limit = 512
if ( node.offset ) then offset = node.offset or 0 end
for k, v in pairs( mat_files ) do
if ( k > limit + offset ) then
if ( !node.Done ) then
offset = offset + limit
local mats = ( self.Parent or node ):AddNode( ( self.Text or node:GetText() ) .. " (" .. offset .. " - " .. offset + limit .. ")" )
mats:SetFolder( node:GetFolder() )
mats.Text = self.Text or node:GetText()
mats.Parent = self.Parent or node
mats:SetPathID( node:GetPathID() )
mats:SetIcon( node:GetIcon() )
mats.offset = offset
mats.OnNodeSelected = function( self_mats, node_sel )
OnMatNodeSelected( self_mats, node_sel, self_mats.Text, node_sel:GetFolder(), node_sel:GetPathID(), node_sel:GetIcon(), ViewPanel, pnlContent )
end
end
node.Done = true
break end
if ( k <= offset ) then continue end
local p = Path .. "/"
if ( string.StartWith( path, "addons/" ) or string.StartWith( path, "download/" ) ) then
p = string.sub( p, string.find( p, "/materials/" ) + 1 )
end
p = string.sub( p .. v, 11 )
if ( string.GetExtensionFromFilename( p ) == "vmt" ) then
p = string.StripExtension( p )
v = string.StripExtension( v )
end
if ( Material( p ):GetShader() == "Spritecard" ) then continue end
spawnmenu.CreateContentIcon( "material", ViewPanel, { spawnname = p, nicename = v } )
end
pnlContent:SwitchPanel( ViewPanel )
end
local function AddBrowseContentMaterial( node, name, icon, path, pathid )
local ViewPanel = node.ViewPanel
local pnlContent = node.pnlContent
if ( !string.EndsWith( path, "/" ) && string.len( path ) > 1 ) then path = path .. "/" end
local fi, fo = file.Find( path .. "materials", pathid )
if ( !fi && !fo ) then return end
local materials = node:AddFolder( name, path .. "materials", pathid, false, false, "*.*" )
materials:SetIcon( icon )
materials.OnNodeSelected = function( self, node_sel )
OnMatNodeSelected( self, node_sel, name, path, pathid, icon, ViewPanel, pnlContent )
end
end
language.Add( "spawnmenu.category.browsematerials", "Browse Materials" )
local function RefreshAddonMaterials( node )
for _, addon in SortedPairsByMemberValue( engine.GetAddons(), "title" ) do
if ( !addon.downloaded ) then continue end
if ( !addon.mounted ) then continue end
if ( !table.HasValue( select( 2, file.Find( "*", addon.title ) ), "materials" ) ) then continue end
AddBrowseContentMaterial( node, addon.title, "icon16/bricks.png", "", addon.title )
end
end
local function RefreshGameMaterials( node )
local games = getGameList()
for _, game in SortedPairsByMemberValue( games, "title" ) do
if ( !game.mounted ) then continue end
AddBrowseContentMaterial( node, game.title, "games/16/" .. ( game.icon or game.folder ) .. ".png", "", game.folder )
end
end
local browseAddonMaterials
local browseGameMaterials
hook.Add( "PopulateContent", "SpawnmenuLoadSomeMaterials", function( pnlContent, tree, browseNode ) timer.Simple( 0.5, function()
if ( !IsValid( tree ) or !IsValid( pnlContent ) ) then
print( "!!! Extended Spawnmenu: FAILED TO INITALIZE PopulateContent HOOK FOR MATERIALS!!!" )
print( "!!! Extended Spawnmenu: FAILED TO INITALIZE PopulateContent HOOK FOR MATERIALS!!!" )
print( "!!! Extended Spawnmenu: FAILED TO INITALIZE PopulateContent HOOK FOR MATERIALS!!!" )
return
end
local ViewPanel = vgui.Create( "ContentContainer", pnlContent )
ViewPanel:SetVisible( false )
local browseMaterials = tree:AddNode( "#spawnmenu.category.browsematerials", "icon16/picture_empty.png" )
browseMaterials.ViewPanel = ViewPanel
browseMaterials.pnlContent = pnlContent
--[[ --------------------------------------------------------------------------------------- ]]
browseAddonMaterials = browseMaterials:AddNode( "#spawnmenu.category.addons", "icon16/folder_database.png" )
browseAddonMaterials.ViewPanel = ViewPanel
browseAddonMaterials.pnlContent = pnlContent
RefreshAddonMaterials( browseAddonMaterials )
--[[ --------------------------------------------------------------------------------------- ]]
local addon_mats = {}
local _, mat_folders = file.Find( "addons/*", "MOD" )
for _, addon in SortedPairs( mat_folders ) do
if ( !file.IsDir( "addons/" .. addon .. "/materials/", "MOD" ) ) then continue end
table.insert( addon_mats, addon )
end
local browseLegacyMaterials = browseMaterials:AddNode( "#spawnmenu.category.addonslegacy", "icon16/folder_database.png" )
browseLegacyMaterials.ViewPanel = ViewPanel
browseLegacyMaterials.pnlContent = pnlContent
for _, addon in SortedPairsByValue( addon_mats ) do
AddBrowseContentMaterial( browseLegacyMaterials, addon, "icon16/bricks.png", "addons/" .. addon .. "/", "MOD" )
end
--[[ --------------------------------------------------------------------------------------- ]]
AddBrowseContentMaterial( browseMaterials, "#spawnmenu.category.downloads", "icon16/folder_database.png", "download/", "MOD" )
--[[ --------------------------------------------------------------------------------------- ]]
browseGameMaterials = browseMaterials:AddNode( "#spawnmenu.category.games", "icon16/folder_database.png" )
browseGameMaterials.ViewPanel = ViewPanel
browseGameMaterials.pnlContent = pnlContent
RefreshGameMaterials( browseGameMaterials )
end ) end )
hook.Add( "GameContentChanged", "ES_RefreshSpawnmenuMaterials", function()
if ( IsValid( browseAddonMaterials ) ) then
-- TODO: Maybe be more advaced and do not delete => recreate all the nodes, only delete nodes for addons that were removed, add only the new ones?
browseAddonMaterials:Clear()
browseAddonMaterials.ViewPanel:Clear( true )
RefreshAddonMaterials( browseAddonMaterials )
end
if ( IsValid( browseGameMaterials ) ) then
-- TODO: Maybe be more advaced and do not delete => recreate all the nodes, only delete nodes for addons that were removed, add only the new ones?
browseGameMaterials:Clear()
browseGameMaterials.ViewPanel:Clear( true )
RefreshGameMaterials( browseGameMaterials )
end
end )
--[[ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ]]
--[[ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ]]
--[[ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ]]
--[[ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ]]
--[[ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ]]
hook.Add( "PopulateContent", "rb655_extended_spawnmenu_entities", function( pnlContent, tree, node )
if ( !cl_addTabs:GetBool() ) then return end
local node_w = tree:AddNode( "#spawnmenu.category.entities", "icon16/bricks.png" )
node_w.PropPanel = vgui.Create( "ContentContainer", pnlContent )
node_w.PropPanel:SetVisible( false )
function node_w:DoClick()
pnlContent:SwitchPanel( self.PropPanel )
end
local Categorised = {}
local SpawnableEntities = list.Get( "SpawnableEntities" )
if ( SpawnableEntities ) then
for k, v in pairs( SpawnableEntities ) do
v.Category = v.Category or "Other"
Categorised[ v.Category ] = Categorised[ v.Category ] or {}
table.insert( Categorised[ v.Category ], v )
end
end
for CategoryName, v in SortedPairs( Categorised ) do
local node_new = node_w:AddNode( CategoryName, "icon16/bricks.png" )
local CatPropPanel = vgui.Create( "ContentContainer", pnlContent )
CatPropPanel:SetVisible( false )
local Header = vgui.Create("ContentHeader", node_w.PropPanel )
Header:SetText( CategoryName )
node_w.PropPanel:Add( Header )
for k, ent in SortedPairsByMemberValue( v, "PrintName" ) do
local t = {
nicename = ent.PrintName or ent.ClassName,
spawnname = ent.ClassName,
material = "entities/" .. ent.ClassName .. ".png",
admin = ent.AdminOnly
}
spawnmenu.CreateContentIcon( ent.ScriptedEntityType or "entity", CatPropPanel, t )
spawnmenu.CreateContentIcon( ent.ScriptedEntityType or "entity", node_w.PropPanel, t )
end
function node_new:DoClick()
pnlContent:SwitchPanel( CatPropPanel )
end
end
end )
hook.Add( "PopulateContent", "rb655_extended_spawnmenu_post_processing", function( pnlContent, tree, node )
if ( !cl_addTabs:GetBool() ) then return end
local node_w = tree:AddNode( "#spawnmenu.category.postprocess", "icon16/picture.png" )
node_w.PropPanel = vgui.Create( "ContentContainer", pnlContent )
node_w.PropPanel:SetVisible( false )
function node_w:DoClick()
pnlContent:SwitchPanel( self.PropPanel )
end
-- Get the table
local Categorised = {}
local PostProcess = list.Get( "PostProcess" )
if ( PostProcess ) then
for k, v in pairs( PostProcess ) do
v.category = v.category or "Other"
v.name = k
Categorised[ v.category ] = Categorised[ v.category ] or {}
table.insert( Categorised[ v.category ], v )
end
end
-- Put table into panels
for CategoryName, v in SortedPairs( Categorised ) do
local node_new = node_w:AddNode( CategoryName, "icon16/picture.png" )
local CatPropPanel = vgui.Create( "ContentContainer", pnlContent )
CatPropPanel:SetVisible( false )
local Header = vgui.Create( "ContentHeader", node_w.PropPanel )
Header:SetText( CategoryName )
node_w.PropPanel:Add( Header )
for k, pp in SortedPairsByMemberValue( v, "PrintName" ) do
if ( pp.func ) then pp.func( CatPropPanel ) pp.func( node_w.PropPanel ) continue end
local t = {
name = pp.name,
icon = pp.icon
}
spawnmenu.CreateContentIcon( "postprocess", CatPropPanel, t )
spawnmenu.CreateContentIcon( "postprocess", node_w.PropPanel, t )
end
function node_new:DoClick()
pnlContent:SwitchPanel( CatPropPanel )
end
end
end )
hook.Add( "PopulateContent", "rb655_extended_spawnmenu_npcs", function( pnlContent, tree, node )
if ( !cl_addTabs:GetBool() ) then return end
local node_w = tree:AddNode( "#spawnmenu.category.npcs", "icon16/monkey.png" )
node_w.PropPanel = vgui.Create( "ContentContainer", pnlContent )
node_w.PropPanel:SetVisible( false )
function node_w:DoClick()
pnlContent:SwitchPanel( self.PropPanel )
end
local NPCList = list.Get( "NPC" )
local Categories = {}
for k, v in pairs( NPCList ) do
local Category = v.Category or "Other"
local Tab = Categories[ Category ] or {}
Tab[ k ] = v
Categories[ Category ] = Tab
end
for CategoryName, v in SortedPairs( Categories ) do
local node_new = node_w:AddNode( CategoryName, "icon16/monkey.png" )
local CatPropPanel = vgui.Create( "ContentContainer", pnlContent )
CatPropPanel:SetVisible( false )
local Header = vgui.Create("ContentHeader", node_w.PropPanel )
Header:SetText( CategoryName )
node_w.PropPanel:Add( Header )
for name, ent in SortedPairsByMemberValue( v, "Name" ) do
local t = {
nicename = ent.Name or name,
spawnname = name,
material = "entities/" .. name .. ".png",
weapon = ent.Weapons,
admin = ent.AdminOnly
}
spawnmenu.CreateContentIcon( "npc", CatPropPanel, t )
spawnmenu.CreateContentIcon( "npc", node_w.PropPanel, t )
end
function node_new:DoClick()
pnlContent:SwitchPanel( CatPropPanel )
end
end
end )
hook.Add( "PopulateContent", "rb655_extended_spawnmenu_vehicles", function( pnlContent, tree, node )
if ( !cl_addTabs:GetBool() ) then return end
local node_w = tree:AddNode( "#spawnmenu.category.vehicles", "icon16/car.png" )
node_w.PropPanel = vgui.Create( "ContentContainer", pnlContent )
node_w.PropPanel:SetVisible( false )
function node_w:DoClick()
pnlContent:SwitchPanel( self.PropPanel )
end
local Categorised = {}
local Vehicles = list.Get( "Vehicles" )
if ( Vehicles ) then
for k, v in pairs( Vehicles ) do
v.Category = v.Category or "Other"
Categorised[ v.Category ] = Categorised[ v.Category ] or {}
v.ClassName = k
v.PrintName = v.Name
v.ScriptedEntityType = "vehicle"
table.insert( Categorised[ v.Category ], v )
end
end
for CategoryName, v in SortedPairs( Categorised ) do
local node_new = node_w:AddNode( CategoryName, "icon16/car.png" )
local CatPropPanel = vgui.Create( "ContentContainer", pnlContent )
CatPropPanel:SetVisible( false )
local Header = vgui.Create("ContentHeader", node_w.PropPanel )
Header:SetText( CategoryName )
node_w.PropPanel:Add( Header )
for k, ent in SortedPairsByMemberValue( v, "PrintName" ) do
local t = {
nicename = ent.PrintName or ent.ClassName,
spawnname = ent.ClassName,
material = "entities/" .. ent.ClassName .. ".png",
admin = ent.AdminOnly
}
spawnmenu.CreateContentIcon( ent.ScriptedEntityType or "entity", node_w.PropPanel, t )
spawnmenu.CreateContentIcon( ent.ScriptedEntityType or "entity", CatPropPanel, t )
end
function node_new:DoClick()
pnlContent:SwitchPanel( CatPropPanel )
end
end
end )
hook.Add( "PopulateContent", "rb655_extended_spawnmenu_weapons", function( pnlContent, tree, node )
if ( !cl_addTabs:GetBool() ) then return end
local node_w = tree:AddNode( "#spawnmenu.category.weapons", "icon16/gun.png" )
node_w.PropPanel = vgui.Create( "ContentContainer", pnlContent )
node_w.PropPanel:SetVisible( false )
function node_w:DoClick()
pnlContent:SwitchPanel( self.PropPanel )
end
local Weapons = list.Get( "Weapon" )
local Categorised = {}
for k, weapon in pairs( Weapons ) do
if ( !weapon.Spawnable && !weapon.AdminSpawnable ) then continue end
Categorised[ weapon.Category ] = Categorised[ weapon.Category ] or {}
table.insert( Categorised[ weapon.Category ], weapon )
end
for CategoryName, v in SortedPairs( Categorised ) do
local node_new = node_w:AddNode( CategoryName, "icon16/gun.png" )
local CatPropPanel = vgui.Create( "ContentContainer", pnlContent )
CatPropPanel:SetVisible( false )
local Header = vgui.Create("ContentHeader", node_w.PropPanel )
Header:SetText( CategoryName )
node_w.PropPanel:Add( Header )
for k, ent in SortedPairsByMemberValue( v, "PrintName" ) do
local t = {
nicename = ent.PrintName or ent.ClassName,
spawnname = ent.ClassName,
material = "entities/" .. ent.ClassName .. ".png",
admin = ent.AdminOnly
}
spawnmenu.CreateContentIcon( ent.ScriptedEntityType or "weapon", CatPropPanel, t )
spawnmenu.CreateContentIcon( ent.ScriptedEntityType or "weapon", node_w.PropPanel, t )
end
function node_new:DoClick()
pnlContent:SwitchPanel( CatPropPanel )
end
end
end )

View File

@@ -0,0 +1,456 @@
--[[
| 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/
--]]
AddCSLuaFile()
if ( SERVER ) then return end
language.Add( "spawnmenu.category.addonslegacy", "Addons - Legacy" )
language.Add( "spawnmenu.category.downloads", "Downloads" )
local function AddRecursive( pnl, folder )
local files, folders = file.Find( folder .. "*", "MOD" )
for k, v in pairs( files or {} ) do
if ( !string.EndsWith( v, ".mdl" ) ) then continue end
local cp = spawnmenu.GetContentType( "model" )
if ( cp ) then
local mdl = folder .. v
mdl = string.sub( mdl, string.find( mdl, "models/" ), string.len( mdl ) )
mdl = string.gsub( mdl, "models/models/", "models/" )
cp( pnl, { model = mdl } )
end
end
for k, v in pairs( folders or {} ) do AddRecursive( pnl, folder .. v .. "/" ) end
end
local function CountRecursive( folder )
local files, folders = file.Find( folder .. "*", "MOD" )
local val = 0
for k, v in pairs( files or {} ) do if ( string.EndsWith( v, ".mdl" ) ) then val = val + 1 end end
for k, v in pairs( folders or {} ) do val = val + CountRecursive( folder .. v .. "/" ) end
return val
end
hook.Add( "PopulateContent", "LegacyAddonProps", function( pnlContent, tree, node )
if ( !IsValid( node ) or !IsValid( pnlContent ) ) then
print( "!!! Extended Spawnmenu: FAILED TO INITALIZE PopulateContent HOOK FOR LEGACY ADDONS!!!" )
print( "!!! Extended Spawnmenu: FAILED TO INITALIZE PopulateContent HOOK FOR LEGACY ADDONS!!!" )
print( "!!! Extended Spawnmenu: FAILED TO INITALIZE PopulateContent HOOK FOR LEGACY ADDONS!!!" )
return
end
local ViewPanel = vgui.Create( "ContentContainer", pnlContent )
ViewPanel:SetVisible( false )
local addons = {}
local _files, folders = file.Find( "addons/*", "MOD" )
for _, f in pairs( folders ) do
if ( !file.IsDir( "addons/" .. f .. "/models/", "MOD" ) ) then continue end
local count = CountRecursive( "addons/" .. f .. "/models/", "MOD" )
if ( count == 0 ) then continue end
table.insert( addons, {
name = f,
count = count,
path = "addons/" .. f .. "/models/"
} )
end
local LegacyAddons = node:AddNode( "#spawnmenu.category.addonslegacy", "icon16/folder_database.png" )
for _, f in SortedPairsByMemberValue( addons, "name" ) do
local models = LegacyAddons:AddNode( f.name .. " (" .. f.count .. ")", "icon16/bricks.png" )
models.DoClick = function()
ViewPanel:Clear( true )
AddRecursive( ViewPanel, f.path )
pnlContent:SwitchPanel( ViewPanel )
end
end
--[[ -------------------------- DOWNLOADS -------------------------- ]]
local fi, fo = file.Find( "download/models", "MOD" )
if ( !fi && !fo ) then return end
local Downloads = node:AddFolder( "#spawnmenu.category.downloads", "download/models", "MOD", false, false, "*.*" )
Downloads:SetIcon( "icon16/folder_database.png" )
Downloads.OnNodeSelected = function( self, selectedNode )
ViewPanel:Clear( true )
local path = selectedNode:GetFolder()
if ( !string.EndsWith( path, "/" ) && string.len( path ) > 1 ) then path = path .. "/" end
local path_mdl = string.sub( path, string.find( path, "/models/" ) + 1 )
for k, v in pairs( file.Find( path .. "/*.mdl", selectedNode:GetPathID() ) ) do
local cp = spawnmenu.GetContentType( "model" )
if ( cp ) then
cp( ViewPanel, { model = path_mdl .. "/" .. v } )
end
end
pnlContent:SwitchPanel( ViewPanel )
end
end )
--[[ -------------------------------------------------------------------------- The addon info -------------------------------------------------------------------------- ]]
concommand.Add( "extsm_addoninfo", function()
local frame = vgui.Create( "DFrame" )
frame:SetSize( ScrW() - 100, ScrH() - 100 )
frame:Center()
frame:MakePopup()
local sp = frame:Add( "DScrollPanel" )
sp:Dock( FILL )
sp:Add( "rb655_addonInfo" )
end )
hook.Add( "AddToolMenuCategories", "LegacyAddonPropsInfoCategory", function()
spawnmenu.AddToolCategory( "Utilities", "Robotboy655", "#Robotboy655" )
end )
hook.Add( "PopulateToolMenu", "LegacyAddonPropsInfoThing", function()
spawnmenu.AddToolMenuOption( "Utilities", "Robotboy655", "LegacyInfoPanel", "Addon Information", "", "", function( panel )
panel:ClearControls()
panel:Button( "Open addon data window", "extsm_addoninfo" )
end )
end )
----------------------------------
function ScreenScaleH( size )
return size * ( ScrH() / 480.0 )
end
surface.CreateFont( "AddonInfo_Header", {
font = "Helvetica",
size = ScreenScaleH( 24 ),
weight = 1000
} )
surface.CreateFont( "AddonInfo_Text", {
font = "Helvetica",
size = ScreenScaleH( 9 ),
weight = 1000
} )
surface.CreateFont( "AddonInfo_Small", {
font = "Helvetica",
size = ScreenScaleH( 8 )
} )
local function GetWorkshopLeftovers()
local subscriptions = {}
for id, t in pairs( engine.GetAddons() ) do
subscriptions[ tonumber( t.wsid ) ] = true
end
local t = {}
for id, fileh in pairs( file.Find( "addons/*.gma", "MOD" ) ) do
local a = string.StripExtension( fileh )
a = string.Explode( "_", a )
a = tonumber( a[ #a ] )
if ( !subscriptions[ a ] ) then
table.insert( t, fileh )
end
end
return t
end
local function GetSize( b )
b = b / 1000
if ( b < 1000 ) then
return math.floor( b * 10 ) / 10 .. " KB"
end
b = b / 1000
if ( b < 1000 ) then
return math.floor( b * 10 ) / 10 .. " MB"
end
b = b / 1000
return math.floor( b * 10 ) / 10 .. " GB"
end
local function DrawText( txt, font, x, y, clr )
draw.SimpleText( txt, font, x, y, clr )
surface.SetFont( font )
return surface.GetTextSize( txt )
end
local PANEL = {}
function PANEL:Init()
self.Computed = false
end
function PANEL:Compute()
self.WorkshopSize = 0
for id, fle in pairs( file.Find( "addons/*.gma", "MOD" ) ) do
self.WorkshopSize = self.WorkshopSize + ( file.Size( "addons/" .. fle, "MOD" ) or 0 )
end
self.WorkshopWaste = 0
self.WorkshopWasteFiles = {}
for id, fle in pairs( GetWorkshopLeftovers() ) do
self.WorkshopWaste = self.WorkshopWaste + ( file.Size( "addons/" .. fle, "MOD" ) or 0 )
table.insert( self.WorkshopWasteFiles, { "addons/" .. fle, ( file.Size( "addons/" .. fle, "MOD" ) or 0 ) } )
end
-- -------------------------------------------
local _files, folders = file.Find( "addons/*", "MOD" )
self.LegacyAddons = {}
for k, v in pairs( folders or {} ) do
self.LegacyAddons[ "addons/" .. v .. "/" ] = "Installed"
if ( file.IsDir( "addons/" .. v .. "/models/", "MOD" ) ) then
self.LegacyAddons[ "addons/" .. v .. "/" ] = "Installed (Has Models)"
end
local _fi, fo = file.Find( "addons/" .. v .. "/*", "MOD" )
if ( table.Count( fo or {} ) < 1 ) then
self.LegacyAddons[ "addons/" .. v .. "/" ] = "Installed (Empty)"
end
if ( !file.IsDir( "addons/" .. v .. "/models/", "MOD" ) && !file.IsDir( "addons/" .. v .. "/materials/", "MOD" ) && !file.IsDir( "addons/" .. v .. "/lua/", "MOD" ) && !file.IsDir( "addons/" .. v .. "/sound/", "MOD" ) ) then
self.LegacyAddons[ "addons/" .. v .. "/" ] = "Installed Incorrectly!"
end
end
-- -------------------------------------------
local luaFiles = file.Find( "cache/lua/*", "MOD" ) -- Too many files to count actual size!
self.LuaCacheSize = #luaFiles * 1400
self.LuaCacheFiles = #luaFiles
local wsFiles = file.Find( "cache/workshop/*", "MOD" )
self.WSCacheSize = 0
for id, fle in pairs( wsFiles ) do
self.WSCacheSize = self.WSCacheSize + ( file.Size( "cache/workshop/" .. fle, "MOD" ) or 0 )
end
self.WSCacheFiles = #wsFiles
self.Computed = true
end
function PANEL:Paint( w, h )
if ( !self.Computed ) then
self:Compute()
end
local txtW = self:GetParent():GetWide()
local txtH = 0
-- -----------------------
local tW, tH = DrawText( "Cache Sizes", "AddonInfo_Header", 0, txtH, color_white )
txtH = txtH + tH
local localH = 0
local localW = 0
-- -----------------------
tW, tH = DrawText( "~" .. GetSize( self.LuaCacheSize or 0 ) .. " (" .. self.LuaCacheFiles .. " files)", "AddonInfo_Small", 0, txtH + localH, Color( 220, 220, 220 ) )
localH = localH + tH
localW = math.max( localW, tW )
tW, tH = DrawText( "~" .. GetSize( self.WSCacheSize or 0 ) .. " (" .. self.WSCacheFiles .. " files)", "AddonInfo_Small", 0, txtH + localH, Color( 220, 220, 220 ) )
localH = localH + tH
localW = math.max( localW, tW )
-- -----------------------
localW = localW + 25
tW, tH = DrawText( "Server Lua cache", "AddonInfo_Small", localW, txtH, color_white )
txtH = txtH + tH
tW, tH = DrawText( "Workshop download cache", "AddonInfo_Small", localW, txtH, color_white )
txtH = txtH + tH
-- -------------------------------------------
txtH = txtH + ScreenScaleH( 8 )
tW, tH = DrawText( "Workshop Subscriptions", "AddonInfo_Header", 0, txtH, color_white )
txtH = txtH + tH
-- -------------------------------------------
tW, tH = DrawText( "Used Size: ", "AddonInfo_Text", 0, txtH, color_white )
local maxW = tW
txtH = txtH + tH
tW, tH = DrawText( "Wasted Space: ", "AddonInfo_Text", 0, txtH, color_white )
maxW = math.max( maxW, tW )
txtH = txtH + tH
tW, tH = DrawText( "Total Size: ", "AddonInfo_Text", 0, txtH, color_white )
maxW = math.max( maxW, tW )
txtH = txtH - tH * 2
-- -------------------------------------------
tW, tH = DrawText( GetSize( ( self.WorkshopSize - self.WorkshopWaste ) or 0 ), "AddonInfo_Text", maxW, txtH, Color( 220, 220, 220 ) )
txtH = txtH + tH
tW, tH = DrawText( GetSize( self.WorkshopWaste or 0 ), "AddonInfo_Text", maxW, txtH, Color( 220, 220, 220 ) )
txtH = txtH + tH
tW, tH = DrawText( GetSize( self.WorkshopSize or 0 ), "AddonInfo_Text", maxW, txtH, Color( 220, 220, 220 ) )
txtH = txtH + tH * 2
-- -------------------------------------------
tW, tH = DrawText( "Files that aren't used: ( Safe to delete )", "AddonInfo_Text", 0, txtH, color_white )
txtH = txtH + tH
localH = 0
localW = 0
for id, t in pairs( self.WorkshopWasteFiles or {} ) do
tW, tH = DrawText( GetSize( t[ 2 ] ) .. " ", "AddonInfo_Small", 0, txtH + localH, Color( 220, 220, 220 ) )
localH = localH + tH
localW = math.max( localW, tW )
end
for id, t in pairs( self.WorkshopWasteFiles or {} ) do
tW, tH = DrawText( t[ 1 ], "AddonInfo_Small", localW, txtH, color_white )
txtH = txtH + tH
end
-- -------------------------------------------
tW, tH = DrawText( "Legacy Addons", "AddonInfo_Header", 0, txtH + ScreenScaleH( 8 ), color_white )
txtH = txtH + tH + ScreenScaleH( 8 )
-- -------------------------------------------
tW, tH = DrawText( "Legacy Addons with models:", "AddonInfo_Text", 0, txtH, color_white )
txtH = txtH + tH
if ( table.Count( self.LegacyAddons or {} ) > 0 ) then
local maxNameW = 0
local oldH = txtH
for path, status in pairs( self.LegacyAddons or {} ) do
tW, tH = DrawText( path, "AddonInfo_Small", 0, txtH, color_white )
maxNameW = math.max( maxNameW, tW )
txtH = txtH + tH
end
maxNameW = maxNameW + 25
txtH = oldH
for path, status in pairs( self.LegacyAddons or {} ) do
tW, tH = DrawText( status, "AddonInfo_Small", maxNameW, txtH, Color( 220, 220, 220 ) )
txtH = txtH + tH
end
else
tW, tH = DrawText( "None.", "AddonInfo_Small", 0, txtH, color_white )
txtH = txtH + tH
end
if ( !system.IsWindows() ) then
txtH = txtH + tH
tW, tH = DrawText( "OSX AND LINUX USERS BEWARE:", "AddonInfo_Text", 0, txtH, color_white )
txtH = txtH + tH
tW, tH = DrawText( "MAKE SURE ALL FILE AND FOLDER NAMES", "AddonInfo_Text", 0, txtH, color_white )
txtH = txtH + tH
tW, tH = DrawText( "IN ALL ADDONS ARE LOWERCASE ONLY", "AddonInfo_Text", 0, txtH, color_white )
txtH = txtH + tH
tW, tH = DrawText( "INCLUDING ALL SUB FOLDERS", "AddonInfo_Text", 0, txtH, color_white )
txtH = txtH + tH
end
txtH = txtH + tH
-- -------------------------------------------
self:SetSize( txtW, txtH )
end
vgui.Register( "rb655_addonInfo", PANEL, "Panel" )
--[[ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ]]
-- I spent too much time on this than I care to admit
hook.Add( "PopulatePropMenu", "rb655_LoadLegacySpawnlists", function()
local sid = 0 --table.Count( spawnmenu.GetPropTable() )
--local added = false
for id, spawnlist in pairs( file.Find( "settings/spawnlist/*.txt", "MOD" ) ) do
local content = file.Read( "settings/spawnlist/" .. spawnlist, "MOD" )
if ( !content ) then continue end
--[[local is = string.find( content, "TableToKeyValues" )
if ( is != nil ) then continue end
for id, t in pairs( spawnmenu.GetPropTable() ) do -- This somehow freezes the game when opening Q menu => FUCK THIS SHIT
if ( t.name == "Legacy Spawnlists" ) then
added = true
sid = t.id
end
end
if ( !added ) then
spawnmenu.AddPropCategory( "rb655_legacy_spawnlists", "Legacy Spawnlists", {}, "icon16/folder.png", sid, 0 )
added = true
end]]
content = util.KeyValuesToTable( content )
if ( !content.entries or content.contents ) then continue end
local contents = {}
for eid, entry in pairs( content.entries ) do
if ( type( entry ) == "table" ) then entry = entry.model end
table.insert( contents, { type = "model", model = entry } )
end
if ( !content.information ) then content.information = { name = spawnlist } end
spawnmenu.AddPropCategory( "settings/spawnlist/" .. spawnlist, content.information.name, contents, "icon16/page.png", sid + id, sid )
end
end )

View File

@@ -0,0 +1,195 @@
--[[
| 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/
--]]
AddCSLuaFile()
properties.Add( "rb655_make_animatable", {
MenuLabel = "#tool.rb655_easy_animation.property",
Order = 654,
MenuIcon = "icon16/tick.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) or !gamemode.Call( "CanProperty", ply, "rb655_make_animatable", ent ) ) then return false end
if ( ent:GetClass() == "prop_animatable" ) then return false end
if ( ent:IsPlayer() or !ent:GetModel() or ent:GetModel():StartWith( "*" ) ) then return false end
--if ( string.find( ent:GetClass(), "prop_physics" ) or string.find( ent:GetClass(), "prop_ragdoll" ) ) then return true end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, len, ply )
local ent = net.ReadEntity()
if ( !IsValid( ply ) or !IsValid( ent ) or !self:Filter( ent, ply ) ) then return false end
local entActual = ent
if ( IsValid( ent.AttachedEntity ) ) then
ent = ent.AttachedEntity
end
local ragPos = ent:GetPos()
-- Try to not make entity fly
if ( ent:IsRagdoll() ) then
for i = 0, ent:GetPhysicsObjectCount() - 1 do
local bone = ent:GetPhysicsObjectNum( i )
if ( IsValid( bone ) ) then
local pos = bone:GetPos()
-- Yes I like my pyramids
if ( pos.z < ragPos.z ) then
ragPos.z = pos.z
end
end
end
end
local prop_animatable = ents.Create( "prop_animatable" )
prop_animatable:SetModel( ent:GetModel() )
prop_animatable:SetPos( ragPos )
prop_animatable:SetAngles( ent:GetAngles() )
prop_animatable:SetSequence( ent:GetSequence() )
prop_animatable:SetCycle( ent:GetCycle() )
--prop_animatable:SetPlaybackRate( ent:GetPlaybackRate() )
if ( IsValid( ply ) ) then
ply:AddCount( "prop_animatable", prop_animatable )
ply:AddCleanup( "prop_animatable", prop_animatable )
prop_animatable:SetPlayer( ply )
end
prop_animatable:SetSkin( ent:GetSkin() or 0 )
prop_animatable:SetFlexScale( ent:GetFlexScale() )
for i = 0, ent:GetFlexNum() - 1 do prop_animatable:SetFlexWeight( i, ent:GetFlexWeight( i ) ) end
for i = 0, ( ent:GetNumBodyGroups() or 0 ) - 1 do prop_animatable:SetBodygroup( i, ent:GetBodygroup( i ) ) end
for i = 0, ent:GetNumPoseParameters() - 1 do prop_animatable:SetPoseParameter( ent:GetPoseParameterName( i ) , ent:GetPoseParameter( i ) ) end
for i = 0, ent:GetBoneCount() do
prop_animatable:ManipulateBoneScale( i, ent:GetManipulateBoneScale( i ) )
prop_animatable:ManipulateBoneAngles( i, ent:GetManipulateBoneAngles( i ) )
prop_animatable:ManipulateBonePosition( i, ent:GetManipulateBonePosition( i ) )
prop_animatable:ManipulateBoneJiggle( i, ent:GetManipulateBoneJiggle( i ) )
end
-- prop_animatable:InvalidateBoneCache()
prop_animatable:Spawn()
prop_animatable:Activate()
prop_animatable.EntityMods = ent.EntityMods
prop_animatable.BoneMods = ent.BoneMods
duplicator.ApplyEntityModifiers( ply, prop_animatable )
duplicator.ApplyBoneModifiers( ply, prop_animatable )
-- We use string find because there are might be subclasses, like prop_ragdoll_multiplayer or something
if ( string.find( entActual:GetClass(), "prop_ragdoll" ) or entActual:IsNPC() ) then
prop_animatable:FixRagdoll() -- This WILL have false-positives, but it will have to do for now
end
undo.ReplaceEntity( entActual, prop_animatable )
cleanup.ReplaceEntity( entActual, prop_animatable )
constraint.RemoveAll( entActual ) -- Remove all constraints ( this stops ropes from hanging around )
entActual:Remove()
end
} )
properties.Add( "rb655_make_ragdoll", {
MenuLabel = "#tool.rb655_easy_animation.property_ragdoll",
Order = 653,
MenuIcon = "icon16/tick.png",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) or !gamemode.Call( "CanProperty", ply, "rb655_make_ragdoll", ent ) ) then return false end
if ( ent:GetClass() != "prop_animatable" ) then return false end
if ( !ent.GetIsRagdoll or !ent:GetIsRagdoll() ) then return false end
return true
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, len, ply )
local ent = net.ReadEntity()
if ( !IsValid( ply ) or !IsValid( ent ) or !self:Filter( ent, ply ) ) then return false end
ent:BecomeRagdollLua()
end
} )
local function MakeDTVarToggleProperty( class, tab )
local origTab = {
Type = "toggle",
Filter = function( self, ent, ply )
if ( !IsValid( ent ) ) then return false end
if ( !gamemode.Call( "CanProperty", ply, class, ent ) ) then return false end
if ( self.ClassRestrict and ent:GetClass() != self.ClassRestrict ) then return false end
return true
end,
Checked = function( self, ent, ply )
-- This should never happen
if ( !isfunction( ent[ "Get" .. self.DTVariable ] ) ) then return false end
return ent[ "Get" .. self.DTVariable ]( ent )
end,
Action = function( self, ent )
self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive = function( self, length, ply )
local ent = net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) then return end
if ( !self:Filter( ent, ply ) ) then return end
if ( !isfunction( ent[ "Get" .. self.DTVariable ] ) ) then return end
if ( !isfunction( ent[ "Set" .. self.DTVariable ] ) ) then return end
ent[ "Set" .. self.DTVariable ]( ent, !ent[ "Get" .. self.DTVariable ]( ent ) )
end
}
properties.Add( class, table.Merge( origTab, tab ) )
end
MakeDTVarToggleProperty( "rb655_animatable_body_xy", {
MenuLabel = "#tool.rb655_easy_animation.property_bodyxy",
Order = 600,
ClassRestrict = "prop_animatable",
DTVariable = "AnimateBodyXY"
} )
MakeDTVarToggleProperty( "rb655_animatable_ragdoll_on_dmg", {
MenuLabel = "#tool.rb655_easy_animation.property_damageragdoll",
Order = 601,
ClassRestrict = "prop_animatable",
DTVariable = "BecomeRagdoll"
} )

158
lua/autorun/sam.lua Normal file
View File

@@ -0,0 +1,158 @@
--[[
| 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/
--]]
if SAM_LOADED then return end
local version = tonumber("148") or 148
sam = {}
sam.config = {}
sam.language = {}
sam.player = {}
sam.ranks = {}
sam.permissions = {}
sam.author = "Srlion"
sam.version = version
function sam.print(...)
MsgC(
Color(236, 240, 241), "(",
Color(244, 67, 54), "SAM",
Color(236, 240, 241), ") ",
Color(236, 240, 241), ...
) Msg("\n")
end
local FAILED = false
do
local types = {
sv_ = SERVER and include or function() end,
cl_ = SERVER and AddCSLuaFile or include,
sh_ = function(name)
if SERVER then
AddCSLuaFile(name)
end
return include(name)
end
}
sam.load_file = function(name, type)
if FAILED then return end
if type and not type:EndsWith("_") then
type = type .. "_"
end
local func = types[type] or types[name:GetFileFromFilename():sub(1, 3)] or types["sh_"]
if func then
local rets = {func(name)}
if rets[1] == false then
FAILED = true
sam.print("Failed to load!")
end
return unpack(rets)
end
end
end
local load_file = sam.load_file
sam.print("Loading...")
load_file("sam/libs/sh_types.lua")
load_file("sam/libs/sh_pon.lua")
load_file("sam/libs/sh_mp.lua")
load_file("sam/libs/sh_netstream.lua")
load_file("sam/libs/sh_async_netstream.lua")
load_file("sam/libs/sh_globals.lua")
load_file("sam/libs/sql/sv_init.lua")
sam.Promise = load_file("sam/libs/sh_promises.lua")
load_file("sam/sh_colors.lua")
load_file("sam/sh_util.lua")
load_file("sam/sh_lang.lua")
load_file("sam/sv_sql.lua")
load_file("sam/sh_permissions.lua")
load_file("sam/ranks/sh_ranks.lua")
load_file("sam/ranks/sv_ranks.lua")
load_file("sam/config/sh_config.lua")
load_file("sam/config/sv_config.lua")
load_file("sam/config/cl_config.lua")
load_file("sam/player/sh_player.lua")
load_file("sam/player/sh_nw_vars.lua")
load_file("sam/player/sv_player.lua")
load_file("sam/player/cl_player.lua")
load_file("sam/player/sv_ranks.lua")
load_file("sam/player/sv_auth.lua")
load_file("sam/player/sv_bans.lua")
load_file("sam/command/sh_command.lua")
load_file("sam/command/sv_command.lua")
load_file("sam/command/cl_command.lua")
for _, f in ipairs(file.Find("sam/command/arguments/*.lua", "LUA")) do
load_file("sam/command/arguments/" .. f, "sh")
end
load_file("sam/sh_restrictions.lua")
load_file("sam/menu/sh_init.lua")
load_file("sam/menu/cl_init.lua")
load_file("sam/sh_motd.lua")
local modules = file.Find("sam/modules/*.lua", "LUA")
for _, module in ipairs(modules) do
load_file("sam/modules/" .. module)
end
load_file("sam/reports/cl_reports.lua")
load_file("sam/reports/sv_reports.lua")
do
if SERVER then
hook.Add("SAM.LoadedConfig", "SAM.AdvertsMain", function(config)
if not config.Adverts then
sam.config.set("Adverts", {})
end
end)
end
load_file("sam/cl_adverts.lua")
end
if not FAILED then
sam.print("Loaded!")
end
if SERVER then
local path = "sam/importers/"
concommand.Add("sam_import", function(ply, _, args)
if IsValid(ply) then return end
local admin_mod = args[1]
if not admin_mod then
sam.print("You need to provide an admin mod to import!")
return
end
if not file.Exists(path .. admin_mod, "LUA") then
sam.print("There is no importer for '" .. admin_mod .. "'")
return
end
CompileFile(path .. admin_mod .. "/main.lua")()
end, nil, nil, FCVAR_PROTECTED)
end
SAM_LOADED = true

View File

@@ -0,0 +1,26 @@
--[[
| 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/
--]]
AddCSLuaFile( "autorun/client/campaignents_clientfuncs_2.lua" )
AddCSLuaFile()
local aiVar = GetConVar( "ai_disabled" )
function saveents_EnabledAi()
return aiVar:GetInt() == 0
end
local ignorePly = GetConVar( "ai_ignoreplayers" )
function saveents_IgnoringPlayers()
return ignorePly:GetInt() == 1
end

View File

@@ -0,0 +1,45 @@
--[[
| 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/
--]]
--[[---------------------------------------------------------
Name: KickId2
Desc: Allows admins to use the kickid2 command to kick people.
-----------------------------------------------------------]]
local function KickId( player, command, arguments )
if ( !player:IsAdmin() ) then return end
local id = arguments[1]
local reason = arguments[2] or "Kicked"
RunConsoleCommand( "kickid", id, Format( "%s (%s)", reason, player:Nick() ) )
end
concommand.Add( "kickid2", KickId, nil, "", { FCVAR_DONTRECORD } )
--[[---------------------------------------------------------
Name: BanId2
Desc: Allows admins to use the banid2 command to ban people.
-----------------------------------------------------------]]
local function BanID( player, command, arguments )
if ( !player:IsAdmin() ) then return end
local length = arguments[1]
local id = arguments[2]
RunConsoleCommand( "banid", length, id )
end
concommand.Add( "banid2", BanID, nil, "", { FCVAR_DONTRECORD } )

View File

@@ -0,0 +1,26 @@
--[[
| 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/
--]]
//Global variable to inform Export To Lua addon that the core addon is installed
SpecialEffectsD2KIsInstalled = true
//Find effects and cut the sound they're making
local function OnEffectRemove_D2K(effect_d2k)
//Stop sounds
if effect_d2k.SFX_Sound then
effect_d2k.SFX_Sound:Stop()
end
end
//Add hook
hook.Add("EntityRemoved", "EffectRemoveHook_D2K", OnEffectRemove_D2K)

View File

@@ -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/
--]]
//Find effects and stop their sounds
local function OnEffectRemove(effect)
//Stop sounds
if effect.Sound then
effect.Sound:Stop()
end
end
//Add hook
hook.Add("EntityRemoved", "EffectRemoveHook", OnEffectRemove)

View File

@@ -0,0 +1,289 @@
--[[
| 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/
--]]
// adding materials to the material toolguns list
list.Add( "OverrideMaterials", "models/XQM//Deg360" )
list.Add( "OverrideMaterials", "models/XQM//LightLinesGB" )
list.Add( "OverrideMaterials", "models/XQM//LightLinesRed" )
list.Add( "OverrideMaterials", "models/XQM//SquaredMat" )
list.Add( "OverrideMaterials", "models/XQM//WoodTexture_1" )
list.Add( "OverrideMaterials", "models/airboat/airboat_blur02" )
list.Add( "OverrideMaterials", "models/alyx/emptool_glow" )
list.Add( "OverrideMaterials", "models/antlion/antlion_innards" )
list.Add( "OverrideMaterials", "models/barnacle/roots" )
list.Add( "OverrideMaterials", "models/combine_advisor/body9" )
list.Add( "OverrideMaterials", "models/combine_advisor/mask" )
list.Add( "OverrideMaterials", "models/combine_scanner/scanner_eye" )
list.Add( "OverrideMaterials", "models/debug/debugwhite" )
list.Add( "OverrideMaterials", "models/dog/eyeglass" )
list.Add( "OverrideMaterials", "models/effects/portalrift_sheet" )
list.Add( "OverrideMaterials", "models/effects/slimebubble_sheet" )
list.Add( "OverrideMaterials", "models/effects/splode1_sheet" )
list.Add( "OverrideMaterials", "models/effects/splode_sheet" )
list.Add( "OverrideMaterials", "models/gibs/metalgibs/metal_gibs" )
list.Add( "OverrideMaterials", "models/gibs/woodgibs/woodgibs01" )
list.Add( "OverrideMaterials", "models/gibs/woodgibs/woodgibs02" )
list.Add( "OverrideMaterials", "models/gibs/woodgibs/woodgibs03" )
list.Add( "OverrideMaterials", "models/player/player_chrome1" )
list.Add( "OverrideMaterials", "models/props_animated_breakable/smokestack/brickwall002a" )
list.Add( "OverrideMaterials", "models/props_building_details/courtyard_template001c_bars" )
list.Add( "OverrideMaterials", "models/props_building_details/courtyard_template001c_bars" )
list.Add( "OverrideMaterials", "models/props_buildings/destroyedbuilldingwall01a" )
list.Add( "OverrideMaterials", "models/props_buildings/plasterwall021a" )
list.Add( "OverrideMaterials", "models/props_c17/frostedglass_01a" )
list.Add( "OverrideMaterials", "models/props_c17/furniturefabric001a" )
list.Add( "OverrideMaterials", "models/props_c17/furniturefabric002a" )
list.Add( "OverrideMaterials", "models/props_c17/furnituremetal001a" )
list.Add( "OverrideMaterials", "models/props_c17/gate_door02a" )
list.Add( "OverrideMaterials", "models/props_c17/metalladder001" )
list.Add( "OverrideMaterials", "models/props_c17/metalladder002" )
list.Add( "OverrideMaterials", "models/props_c17/metalladder003" )
list.Add( "OverrideMaterials", "models/props_canal/canal_bridge_railing_01a" )
list.Add( "OverrideMaterials", "models/props_canal/canal_bridge_railing_01b" )
list.Add( "OverrideMaterials", "models/props_canal/canal_bridge_railing_01c" )
list.Add( "OverrideMaterials", "models/props_canal/canalmap_sheet" )
list.Add( "OverrideMaterials", "models/props_canal/coastmap_sheet" )
list.Add( "OverrideMaterials", "models/props_canal/metalcrate001d" )
list.Add( "OverrideMaterials", "models/props_canal/metalwall005b" )
list.Add( "OverrideMaterials", "models/props_canal/rock_riverbed01a" )
list.Add( "OverrideMaterials", "models/props_combine/citadel_cable" )
list.Add( "OverrideMaterials", "models/props_combine/citadel_cable_b" )
list.Add( "OverrideMaterials", "models/props_combine/com_shield001a" )
list.Add( "OverrideMaterials", "models/props_combine/combine_interface_disp" )
list.Add( "OverrideMaterials", "models/props_combine/combine_monitorbay_disp" )
list.Add( "OverrideMaterials", "models/props_combine/metal_combinebridge001" )
list.Add( "OverrideMaterials", "models/props_combine/pipes01" )
list.Add( "OverrideMaterials", "models/props_combine/pipes03" )
list.Add( "OverrideMaterials", "models/props_combine/prtl_sky_sheet" )
list.Add( "OverrideMaterials", "models/props_combine/stasisfield_beam" )
list.Add( "OverrideMaterials", "models/props_debris/building_template010a" )
list.Add( "OverrideMaterials", "models/props_debris/building_template022j" )
list.Add( "OverrideMaterials", "models/props_debris/composite_debris" )
list.Add( "OverrideMaterials", "models/props_debris/concretefloor013a" )
list.Add( "OverrideMaterials", "models/props_debris/concretefloor020a" )
list.Add( "OverrideMaterials", "models/props_debris/concretewall019a" )
list.Add( "OverrideMaterials", "models/props_debris/metalwall001a" )
list.Add( "OverrideMaterials", "models/props_debris/plasterceiling008a" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall009d" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall021a" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall034a" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall034d" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall039c" )
list.Add( "OverrideMaterials", "models/props_debris/plasterwall040c" )
list.Add( "OverrideMaterials", "models/props_debris/tilefloor001c" )
list.Add( "OverrideMaterials", "models/props_foliage/driftwood_01a" )
list.Add( "OverrideMaterials", "models/props_foliage/oak_tree01" )
list.Add( "OverrideMaterials", "models/props_foliage/tree_deciduous_01a_trunk" )
list.Add( "OverrideMaterials", "models/props_interiors/metalfence007a" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01a" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01b" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01c" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01d" )
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01e" )
list.Add( "OverrideMaterials", "models/props_lab/Tank_Glass001" )
list.Add( "OverrideMaterials", "models/props_lab/cornerunit_cloud" )
list.Add( "OverrideMaterials", "models/props_lab/door_klab01" )
list.Add( "OverrideMaterials", "models/props_lab/security_screens" )
list.Add( "OverrideMaterials", "models/props_lab/security_screens2" )
list.Add( "OverrideMaterials", "models/props_lab/warp_sheet" )
list.Add( "OverrideMaterials", "models/props_lab/xencrystal_sheet" )
list.Add( "OverrideMaterials", "models/props_pipes/GutterMetal01a")
list.Add( "OverrideMaterials", "models/props_pipes/destroyedpipes01a" )
list.Add( "OverrideMaterials", "models/props_pipes/pipemetal001a" )
list.Add( "OverrideMaterials", "models/props_pipes/pipeset_metal02" )
list.Add( "OverrideMaterials", "models/props_pipes/pipesystem01a_skin1" )
list.Add( "OverrideMaterials", "models/props_pipes/pipesystem01a_skin2" )
list.Add( "OverrideMaterials", "models/props_vents/borealis_vent001" )
list.Add( "OverrideMaterials", "models/props_vents/borealis_vent001b" )
list.Add( "OverrideMaterials", "models/props_vents/borealis_vent001c" )
list.Add( "OverrideMaterials", "models/props_wasteland/concretefloor010a" )
list.Add( "OverrideMaterials", "models/props_wasteland/concretewall064b" )
list.Add( "OverrideMaterials", "models/props_wasteland/concretewall066a" )
list.Add( "OverrideMaterials", "models/props_wasteland/dirtwall001a" )
list.Add( "OverrideMaterials", "models/props_wasteland/metal_tram001a" )
list.Add( "OverrideMaterials", "models/props_wasteland/quarryobjects01" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff02a" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff02b" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff02c" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff04a" )
list.Add( "OverrideMaterials", "models/props_wasteland/rockgranite02a" )
list.Add( "OverrideMaterials", "models/props_wasteland/tugboat01" )
list.Add( "OverrideMaterials", "models/props_wasteland/tugboat02" )
list.Add( "OverrideMaterials", "models/props_wasteland/wood_fence01a" )
list.Add( "OverrideMaterials", "models/props_wasteland/wood_fence01a_skin2" )
list.Add( "OverrideMaterials", "models/shadertest/predator" )
list.Add( "OverrideMaterials", "models/weapons/v_crossbow/rebar_glow" )
list.Add( "OverrideMaterials", "models/weapons/v_crowbar/crowbar_cyl" )
list.Add( "OverrideMaterials", "models/weapons/v_grenade/grenade body" )
list.Add( "OverrideMaterials", "models/weapons/v_slam/new light1" )
list.Add( "OverrideMaterials", "models/weapons/v_slam/new light2" )
list.Add( "OverrideMaterials", "models/weapons/v_smg1/texture5" )
list.Add( "OverrideMaterials", "models/XQM/BoxFull_diffuse" )
list.Add( "OverrideMaterials", "models/XQM/CellShadedCamo_diffuse" )
list.Add( "OverrideMaterials", "models/XQM/CinderBlock_Tex" )
list.Add( "OverrideMaterials", "models/XQM/JetBody2TailPiece_diffuse" )
list.Add( "OverrideMaterials", "models/XQM/PoleX1_diffuse" )
list.Add( "OverrideMaterials", "models/XQM/Rails/gumball_1" )
list.Add( "OverrideMaterials", "models/XQM/SquaredMatInverted" )
list.Add( "OverrideMaterials", "models/XQM/WoodPlankTexture" )
list.Add( "OverrideMaterials", "models/XQM/boxfull_diffuse" )
list.Add( "OverrideMaterials", "models/dav0r/hoverball" )
list.Add( "OverrideMaterials", "models/spawn_effect" )
list.Add( "OverrideMaterials", "phoenix_storms/Fender_chrome" )
list.Add( "OverrideMaterials", "phoenix_storms/Fender_white" )
list.Add( "OverrideMaterials", "phoenix_storms/Fender_wood" )
list.Add( "OverrideMaterials", "phoenix_storms/Future_vents" )
list.Add( "OverrideMaterials", "phoenix_storms/FuturisticTrackRamp_1-2" )
list.Add( "OverrideMaterials", "phoenix_storms/OfficeWindow_1-1" )
list.Add( "OverrideMaterials", "phoenix_storms/Pro_gear_side" )
list.Add( "OverrideMaterials", "phoenix_storms/black_brushes" )
list.Add( "OverrideMaterials", "phoenix_storms/black_chrome" )
list.Add( "OverrideMaterials", "phoenix_storms/blue_steel" )
list.Add( "OverrideMaterials", "phoenix_storms/camera" )
list.Add( "OverrideMaterials", "phoenix_storms/car_tire" )
list.Add( "OverrideMaterials", "phoenix_storms/checkers_map" )
list.Add( "OverrideMaterials", "phoenix_storms/cigar" )
list.Add( "OverrideMaterials", "phoenix_storms/concrete0" )
list.Add( "OverrideMaterials", "phoenix_storms/concrete1" )
list.Add( "OverrideMaterials", "phoenix_storms/concrete2" )
list.Add( "OverrideMaterials", "phoenix_storms/concrete3" )
list.Add( "OverrideMaterials", "phoenix_storms/construct/concrete_barrier00" )
list.Add( "OverrideMaterials", "phoenix_storms/construct/concrete_barrier2_00" )
list.Add( "OverrideMaterials", "phoenix_storms/construct/concrete_pipe_00" )
list.Add( "OverrideMaterials", "phoenix_storms/egg" )
list.Add( "OverrideMaterials", "phoenix_storms/gear" )
list.Add( "OverrideMaterials", "phoenix_storms/gear_top" )
list.Add( "OverrideMaterials", "phoenix_storms/grey_chrome" )
list.Add( "OverrideMaterials", "phoenix_storms/grey_steel" )
list.Add( "OverrideMaterials", "phoenix_storms/heli" )
list.Add( "OverrideMaterials", "phoenix_storms/indentTiles2" )
list.Add( "OverrideMaterials", "phoenix_storms/iron_rails" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_carbonfiber" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_carbonfiber2" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_metallic" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_metallic2" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_plastic" )
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_plastic2" )
list.Add( "OverrideMaterials", "phoenix_storms/metal_plate" )
list.Add( "OverrideMaterials", "phoenix_storms/metal_wheel" )
list.Add( "OverrideMaterials", "phoenix_storms/metalbox" )
list.Add( "OverrideMaterials", "phoenix_storms/metalbox2" )
list.Add( "OverrideMaterials", "phoenix_storms/metalfence004a" )
list.Add( "OverrideMaterials", "phoenix_storms/middle" )
list.Add( "OverrideMaterials", "phoenix_storms/mrref2" )
list.Add( "OverrideMaterials", "phoenix_storms/output_jack" )
list.Add( "OverrideMaterials", "phoenix_storms/pack2/chrome" )
list.Add( "OverrideMaterials", "phoenix_storms/pack2/interior_sides" )
list.Add( "OverrideMaterials", "phoenix_storms/pack2/train_floor" )
list.Add( "OverrideMaterials", "phoenix_storms/potato" )
list.Add( "OverrideMaterials", "phoenix_storms/pro_gear_top2" )
list.Add( "OverrideMaterials", "phoenix_storms/ps_grass" )
list.Add( "OverrideMaterials", "phoenix_storms/road" )
list.Add( "OverrideMaterials", "phoenix_storms/roadside" )
list.Add( "OverrideMaterials", "phoenix_storms/scrnspace" )
list.Add( "OverrideMaterials", "phoenix_storms/side" )
list.Add( "OverrideMaterials", "phoenix_storms/simplyMetallic1" )
list.Add( "OverrideMaterials", "phoenix_storms/simplyMetallic2" )
list.Add( "OverrideMaterials", "phoenix_storms/smallwheel" )
list.Add( "OverrideMaterials", "phoenix_storms/spheremappy" )
list.Add( "OverrideMaterials", "phoenix_storms/t_light" )
list.Add( "OverrideMaterials", "phoenix_storms/thruster" )
list.Add( "OverrideMaterials", "phoenix_storms/tiles2" )
list.Add( "OverrideMaterials", "phoenix_storms/top" )
list.Add( "OverrideMaterials", "phoenix_storms/torpedo" )
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_beamside" )
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_beamtop" )
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_plate" )
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_plateside" )
list.Add( "OverrideMaterials", "phoenix_storms/white_brushes" )
list.Add( "OverrideMaterials", "phoenix_storms/white_fps" )
list.Add( "OverrideMaterials", "phoenix_storms/window" )
list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_blue" )
list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_green" )
list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_red" )
list.Add( "OverrideMaterials", "phoenix_storms/wood_dome" )
list.Add( "OverrideMaterials", "phoenix_storms/wood_side" )
// Checking if CSS is mounted and adding CSS textures if it is
function engine.IsMounted(g)
for k,v in pairs(engine.GetGames()) do
if (' cstrike' ) then
return true;
end
end
end
if IsMounted( 'cstrike' ) and (engine.IsMounted('cstrike')) then
list.Add( "OverrideMaterials", "models/cs_havana/wndb" )
list.Add( "OverrideMaterials", "models/cs_havana/wndd" )
list.Add( "OverrideMaterials", "models/cs_italy/light_orange" )
list.Add( "OverrideMaterials", "models/cs_italy/plaster" )
list.Add( "OverrideMaterials", "models/cs_italy/pwtrim2" )
list.Add( "OverrideMaterials", "models/de_cbble/wndarch" )
list.Add( "OverrideMaterials", "models/de_chateau/ch_arch_b1" )
list.Add( "OverrideMaterials", "models/pi_window/plaster" )
list.Add( "OverrideMaterials", "models/pi_window/trim128" )
list.Add( "OverrideMaterials", "models/props/cs_assault/dollar" )
list.Add( "OverrideMaterials", "models/props/cs_assault/fireescapefloor" )
list.Add( "OverrideMaterials", "models/props/cs_assault/metal_stairs1" )
list.Add( "OverrideMaterials", "models/props/cs_assault/moneywrap" )
list.Add( "OverrideMaterials", "models/props/cs_assault/moneywrap02" )
list.Add( "OverrideMaterials", "models/props/cs_assault/moneytop" )
list.Add( "OverrideMaterials", "models/props/cs_assault/pylon" )
list.Add( "OverrideMaterials", "models/props/CS_militia/boulder01" )
list.Add( "OverrideMaterials", "models/props/CS_militia/milceil001" )
list.Add( "OverrideMaterials", "models/props/CS_militia/militiarock" )
list.Add( "OverrideMaterials", "models/props/CS_militia/militiarockb" )
list.Add( "OverrideMaterials", "models/props/CS_militia/milwall006" )
list.Add( "OverrideMaterials", "models/props/CS_militia/rocks01" )
list.Add( "OverrideMaterials", "models/props/CS_militia/roofbeams01" )
list.Add( "OverrideMaterials", "models/props/CS_militia/roofbeams02" )
list.Add( "OverrideMaterials", "models/props/CS_militia/roofbeams03" )
list.Add( "OverrideMaterials", "models/props/CS_militia/RoofEdges" )
list.Add( "OverrideMaterials", "models/props/cs_office/clouds" )
list.Add( "OverrideMaterials", "models/props/cs_office/file_cabinet2" )
list.Add( "OverrideMaterials", "models/props/cs_office/file_cabinet3" )
list.Add( "OverrideMaterials", "models/props/cs_office/screen" )
list.Add( "OverrideMaterials", "models/props/cs_office/snowmana" )
list.Add( "OverrideMaterials", "models/props/de_inferno/de_inferno_boulder_03" )
list.Add( "OverrideMaterials", "models/props/de_inferno/infflra" )
list.Add( "OverrideMaterials", "models/props/de_inferno/infflrd" )
list.Add( "OverrideMaterials", "models/props/de_inferno/inftowertop" )
list.Add( "OverrideMaterials", "models/props/de_inferno/offwndwb_break" )
list.Add( "OverrideMaterials", "models/props/de_inferno/roofbits" )
list.Add( "OverrideMaterials", "models/props/de_inferno/tileroof01" )
list.Add( "OverrideMaterials", "models/props/de_inferno/woodfloor008a" )
list.Add( "OverrideMaterials", "models/props/de_nuke/nukconcretewalla" )
list.Add( "OverrideMaterials", "models/props/de_nuke/nukecardboard" )
list.Add( "OverrideMaterials", "models/props/de_nuke/pipeset_metal" )
end
// Making sure there's no double materials in the list in case of other addons, plus sorting them
timer.Simple(0, function()
local mats = list.GetForEdit("OverrideMaterials");
local cleaner = {};
for i, mat in pairs(mats) do
cleaner[mat] = true;
mats[i] = nil;
end
local i = 1;
for mat in pairs(cleaner) do
mats[i] = mat;
i = i + 1;
end
table.sort(mats);
end);

View File

@@ -0,0 +1,107 @@
--[[
| 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/
--]]
resource.AddWorkshop( "104619813" )
hook.Add( "EntityKeyValue", "rb655_keyval_fix", function( ent, key, val )
if ( ent:GetClass() == "env_headcrabcanister" ) then
if ( key == "HeadcrabType" ) then ent.headcrab = val end
if ( key == "HeadcrabCount" ) then ent.count = val end
if ( key == "FlightSpeed" ) then ent.speed = val end
if ( key == "FlightTime" ) then ent.time = val end
if ( key == "StartingHeight" ) then ent.height = val end
if ( key == "Damage" ) then ent.damage = val end
if ( key == "DamageRadius" ) then ent.radius = val end
if ( key == "SmokeLifetime" ) then ent.duration = val end
if ( key == "spawnflags" ) then ent.spawnflags = val end
if ( key == "targetname" ) then ent.targetname = val end
elseif ( ent:GetClass() == "prop_thumper" ) then
if ( key == "dustscale" ) then ent.dustscale = val end
if ( key == "targetname" ) then ent.targetname = val end
elseif ( ent:GetClass() == "prop_door_rotating" ) then
if ( !ent.rb655_dupe_data ) then ent.rb655_dupe_data = { ismapcreated = ent:CreatedByMap() } end
if ( key == "speed" ) then ent.rb655_dupe_data.speed = val end
if ( key == "distance" ) then ent.rb655_dupe_data.distance = val end
if ( key == "hardware" ) then ent.rb655_dupe_data.hardware = val end
if ( key == "returndelay" ) then ent.rb655_dupe_data.returndelay = val end
if ( key == "skin" ) then ent.rb655_dupe_data.skin = val end
if ( key == "angles" ) then ent.rb655_dupe_data.initialAngles = Angle( val ) end
if ( key == "ajarangles" ) then ent.rb655_dupe_data.ajarangles = val end
if ( key == "spawnflags" ) then ent.rb655_dupe_data.spawnflags = val end
if ( key == "spawnpos" ) then ent.rb655_dupe_data.spawnpos = val end
if ( key == "targetname" ) then ent.rb655_dupe_data.targetname = val end
--if ( key == "slavename" ) then print( "slavename", key, val ) ent.rb655_dupe_data.targetname = val end
function ent:PreEntityCopy()
self.rb655_door_opened = self:GetInternalVariable( "m_eDoorState" ) != 0
self.rb655_door_locked = self:GetInternalVariable( "m_bLocked" )
end
elseif ( ent:GetClass() == "item_ammo_crate" ) then
if ( key == "AmmoType" ) then ent.type = val end
elseif ( ent:GetClass() == "item_item_crate" ) then
if ( key == "ItemCount" ) then ent.amount = val end
if ( key == "ItemClass" ) then ent.class = val end
if ( key == "CrateAppearance" ) then ent.appearance = val end
if ( key == "targetname" ) then ent.targetname = val end
end
end )
-- Ehhh... We gotta copy over wire_base_entity stuff for dupes
function rb655_hl2_CopyWireModMethods( targetEnt )
local oldPreFunc = targetEnt.PreEntityCopy
function targetEnt:PreEntityCopy()
if ( oldPreFunc ) then oldPreFunc( self ) end
duplicator.ClearEntityModifier( self, "WireDupeInfo" )
-- build the DupeInfo table and save it as an entity mod
local DupeInfo = WireLib.BuildDupeInfo( self )
if ( DupeInfo ) then
duplicator.StoreEntityModifier( self, "WireDupeInfo", DupeInfo )
end
end
local function EntityLookup( createdEntities )
return function( id, default )
if ( id == nil ) then return default end
if ( id == 0 ) then return game.GetWorld() end
local ent = createdEntities[ id ]
if ( IsValid( ent ) ) then return ent else return default end
end
end
local oldPostFunc = targetEnt.PostEntityPaste
function targetEnt:PostEntityPaste( player, ent, createdEntities )
-- We manually apply the entity mod here rather than using a
-- duplicator.RegisterEntityModifier because we need access to the
-- CreatedEntities table.
if ( ent.EntityMods and ent.EntityMods.WireDupeInfo ) then
WireLib.ApplyDupeInfo( player, ent, ent.EntityMods.WireDupeInfo, EntityLookup( createdEntities ) )
end
if ( oldPostFunc ) then oldPostFunc( self, player, ent, createdEntities ) end
end
end

View File

@@ -0,0 +1,129 @@
--[[
| 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/
--]]
--
-- These are the physics bone numbers
--
local PLVS = 0
local SPNE = 1
local TRSO = 2
local RSLD = 3
local LSLD = 4
local LARM = 5
local LWST = 6
local LHND = 7
local RARM = 8
local RWST = 9
local RHND = 10
local RTHY = 11
local RCLF = 12
local LTHY = 13
local LCLF = 14
local HEAD = 15
local Builder =
{
PrePosition = function( self, sensor )
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 1.0
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch )
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch )
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch )
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch )
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch )
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch )
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch )
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch )
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.5 )
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * 0.2 )
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * 0.2 )
-- sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * 0.3 )
end,
--
-- Which on the sensor should we use for which ones on our model
--
PositionTable =
{
[PLVS] = SENSORBONE.HIP,
[TRSO] = SENSORBONE.SPINE,
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
[LSLD] = SENSORBONE.SHOULDER_LEFT,
[LARM] = SENSORBONE.ELBOW_LEFT,
[LHND] = SENSORBONE.WRIST_LEFT,
[RARM] = SENSORBONE.ELBOW_RIGHT,
[RHND] = SENSORBONE.WRIST_RIGHT,
[LTHY] = SENSORBONE.HIP_LEFT,
[RTHY] = SENSORBONE.HIP_RIGHT,
[RCLF] = SENSORBONE.KNEE_RIGHT,
[LCLF] = SENSORBONE.KNEE_LEFT,
[HEAD] = SENSORBONE.HEAD,
[SPNE] = SENSORBONE.SPINE,
},
--
-- Which bones should we use to determine our bone angles
--
AnglesTable =
{
[PLVS] = { from = LTHY, to = RTHY, up = "hips_fwd" },
[SPNE] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SPINE, up = "chest_rgt" },
[TRSO] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SPINE, up = "chest_rgt" },
[HEAD] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SHOULDER, up = "chest_lft" },
[RSLD] = { from = RSLD, to = LSLD, up = "chest_bck" },
[LSLD] = { from = LSLD, to = RSLD, up = "chest_fwd" },
[RARM] = { from = RARM, to = RSLD, up = "chest_up" },
[LARM] = { from = LARM, to = LSLD, up = "chest_dn" },
[RWST] = { from = RHND, to = RARM, up = "chest_up" },
[LWST] = { from = LHND, to = LARM, up = "chest_dn" },
[RTHY] = { from = RCLF, to = RTHY, up_up = SPNE },
[RCLF] = { from_sensor = SENSORBONE.ANKLE_RIGHT, to_sensor = SENSORBONE.KNEE_RIGHT, up_up = RTHY },
[LTHY] = { from = LCLF, to = LTHY, up_up = SPNE },
[LCLF] = { from_sensor = SENSORBONE.ANKLE_LEFT, to_sensor = SENSORBONE.KNEE_LEFT, up_up = LTHY },
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_lft = RARM },
[LHND] = { from_sensor = SENSORBONE.HAND_LEFT, to_sensor = SENSORBONE.WRIST_LEFT, up_rgt = LARM },
[LWST] = { from = LHND, to = LARM, up = "chest_dn" },
},
--
-- Any polishing that can't be done with the above tables
--
Complete = function( self, player, sensor, rotation, pos, ang )
pos[SPNE] = LerpVector( 0.45, pos[SPNE], pos[HEAD] )
pos[RWST] = pos[RARM]
pos[LWST] = pos[LARM]
end,
-- We're used as a default - no need to return true to anything here.
IsApplicable = function( self, ent )
local mdl = ent:GetModel()
if ( mdl:EndsWith( "models/player/ct_gign.mdl" ) ) then return true end
if ( mdl:EndsWith( "models/player/ct_sas.mdl" ) ) then return true end
if ( mdl:EndsWith( "models/player/ct_urban.mdl" ) ) then return true end
if ( mdl:EndsWith( "models//player/ct_gsg9.mdl" ) ) then return true end
if ( mdl:EndsWith( "models/player/t_guerilla.mdl" ) ) then return true end
if ( mdl:EndsWith( "models/player/t_leet.mdl" ) ) then return true end
if ( mdl:EndsWith( "models/player/t_phoenix.mdl" ) ) then return true end
if ( mdl:EndsWith( "models//player/t_arctic.mdl" ) ) then return true end
return false
end,
}
list.Set( "SkeletonConvertor", "CounterStrikeSource", Builder )

View 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/
--]]
--
-- These are the physics bone numbers
--
local PLVS = 0
local LTHY = 1
local SPNE = 2
local RSLD = 3
local RARM = 4
local LSLD = 5
local LARM = 6
local LHND = 7
local HEAD = 8
local RHND = 9
local RTHY = 10
local RCLF = 11
local LCLF = 12
local RFOT = 13
local Builder =
{
PrePosition = function( self, sensor )
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 0.7
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch )
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch )
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch )
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch )
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch )
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch )
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch )
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch )
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.5 )
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * 0.3 )
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * 0.3 )
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.HIP_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 0.2 )
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 0.2 )
end,
--
-- Which on the sensor should we use for which ones on our model
--
PositionTable =
{
[PLVS] = SENSORBONE.HIP,
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
[LSLD] = SENSORBONE.SHOULDER_LEFT,
[LARM] = SENSORBONE.ELBOW_LEFT,
[LHND] = SENSORBONE.WRIST_LEFT,
[RARM] = SENSORBONE.ELBOW_RIGHT,
[RHND] = SENSORBONE.WRIST_RIGHT,
[LTHY] = SENSORBONE.HIP_LEFT,
[RTHY] = SENSORBONE.HIP_RIGHT,
[RCLF] = SENSORBONE.KNEE_RIGHT,
[LCLF] = SENSORBONE.KNEE_LEFT,
[RFOT] = SENSORBONE.ANKLE_RIGHT,
[HEAD] = SENSORBONE.HEAD,
[SPNE] = SENSORBONE.SPINE,
},
--
-- Which bones should we use to determine our bone angles
--
AnglesTable =
{
[PLVS] = { from = LTHY, to = RTHY, up = "hips_fwd" },
[SPNE] = { from = HEAD, to = SPNE, up = "chest_rgt" },
[HEAD] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SPINE, up = "chest_lft" },
[RSLD] = { from = RARM, to = RSLD, up = "chest_up" },
[RARM] = { from = RHND, to = RARM, up_up = RSLD },
[LSLD] = { from = LARM, to = LSLD, up = "chest_dn" },
[LARM] = { from = LHND, to = LARM, up_up = LSLD },
[RTHY] = { from = RCLF, to = RTHY, up_up = SPNE },
[RCLF] = { from = RFOT, to = RCLF, up_up = RTHY },
[LTHY] = { from = LCLF, to = LTHY, up_up = SPNE },
[LCLF] = { from_sensor = SENSORBONE.ANKLE_LEFT, to = LCLF, up_up = LTHY },
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_lft = RARM },
[LHND] = { from_sensor = SENSORBONE.HAND_LEFT, to_sensor = SENSORBONE.WRIST_LEFT, up_rgt = LARM }
},
--
-- Any polishing that can't be done with the above tables
--
Complete = function( self, player, sensor, rotation, pos, ang )
pos[SPNE] = LerpVector( 0.4, pos[SPNE], pos[HEAD] )
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
ang[RFOT] = ang[RCLF]:Right():AngleEx( ang[RCLF]:Up() ) + Angle( 20, 0, 0 )
end,
-- Should this entity use this builder?
IsApplicable = function( self, ent )
return ent:GetModel():EndsWith( "models/eli.mdl" )
end,
}
list.Set( "SkeletonConvertor", "Eli", Builder )

Some files were not shown because too many files have changed in this diff Show More