Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96eaf09b4f | ||
|
|
dadbe83ec2 | ||
|
|
e282392d3d | ||
|
|
d48b018f4d | ||
|
|
7181fcb124 | ||
|
|
c21217a270 | ||
|
|
73479cff9e |
2
LICENSE
@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
|
||||
10
README.md
@@ -1,11 +1,11 @@
|
||||
# Willard Networks: Türkiye
|
||||
This branch contains files related to the **Willard Networks: Türkiye**. They were retrieved on 2024/08/04 and are presented as is with minimal edits. This means that potential developers' bugs have been kept in their original form and it is up to you to resolve them. We do not and will not provide direct support (i.e. regular updates or patches). However, you can always create an issue, pointing out the problem.
|
||||
# Willard Networks: France (Echo One)
|
||||
This branch contains files related to the **Willard Networks: Echo One**. They were retrieved on 2024/08/04 and are presented as is with minimal edits. This means that potential developers' bugs have been kept in their original form and it is up to you to resolve them. We do not and will not provide direct support (i.e. regular updates or patches). However, you can always create an issue, pointing out the problem.
|
||||
|
||||
**The files provided contain:**
|
||||
* Half-Life 2 RPG framework by Willard Networks, used on the Turkish server as of 2024/08/04.
|
||||
* Settings (data/\*, settings/\*) used on the Turkish server as of 2024/08/04.
|
||||
* Half-Life 2 RPG framework by Willard Networks, used on the French server as of 2024/08/04.
|
||||
* Settings (data/\*, settings/\*) used on the French server as of 2024/08/04.
|
||||
* Credentials from the French server database (including the master and SAM database).
|
||||
* Helix logs (data/helix/logs) from the Turkish server as of 2024/08/04.
|
||||
* Helix logs (data/helix/logs) from the French server as of 2024/08/04.
|
||||
|
||||
**The files provided do not contain:**
|
||||
* Exported dump of databases (including the master and SAM database), since these files are overweight and cannot be uploaded to GitHub. Despite this, it is included in builds distributed via [The Twilight Zone](https://wnsrc.plymouth.thetwilightzone.ru/).
|
||||
|
||||
9
addons/chess/addon.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
"AddonInfo"
|
||||
{
|
||||
"name" "Chess"
|
||||
"version" "1.3.10"
|
||||
"author_name" "my_hat_stinks"
|
||||
"author_url" ""
|
||||
"info" "Let's play Chess"
|
||||
"override" "0"
|
||||
}
|
||||
214
addons/chess/lua/autorun/sh_chess.lua
Normal file
@@ -0,0 +1,214 @@
|
||||
--[[
|
||||
| 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()
|
||||
AddCSLuaFile( "chess/sh_player_ext.lua" )
|
||||
AddCSLuaFile( "chess/cl_top.lua" )
|
||||
AddCSLuaFile( "chess/cl_dermaboard.lua" )
|
||||
|
||||
include( "chess/sh_player_ext.lua" )
|
||||
include( "chess/sv_sql.lua" )
|
||||
else
|
||||
include( "chess/sh_player_ext.lua" )
|
||||
include( "chess/cl_top.lua" )
|
||||
include( "chess/cl_dermaboard.lua" )
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
function ChessBoard_DoOverrides()
|
||||
if GAMEMODE.Name=="Cinema" then --Cinema overrides
|
||||
hook.Add("CanPlayerEnterVehicle", "EnterSeat", function(ply, vehicle) --Overrides default func
|
||||
if vehicle:GetClass() != "prop_vehicle_prisoner_pod" then return end
|
||||
|
||||
if vehicle.Removing then return false end
|
||||
return (vehicle:GetOwner() == ply) or vehicle:GetNWBool( "IsChessSeat", false )
|
||||
end)
|
||||
end
|
||||
end
|
||||
hook.Add( "Initialize", "ChessBoardOverrides", ChessBoard_DoOverrides )
|
||||
|
||||
CreateConVar( "chess_wagers", 1, FCVAR_ARCHIVE, "Set whether players can wager on their chess games." )
|
||||
CreateConVar( "chess_darkrp_wager", 1, FCVAR_ARCHIVE, "[DarkRP only] Wagers should use DarkRP wallet." )
|
||||
|
||||
CreateConVar( "chess_debug", 0, FCVAR_ARCHIVE, "Debug mode." )
|
||||
CreateConVar( "chess_limitmoves", 1, FCVAR_ARCHIVE, "Enable 50 move rule." )
|
||||
else -- CLIENT
|
||||
CreateConVar( "chess_gridletters", 1, FCVAR_ARCHIVE, "Show grid letters." )
|
||||
end
|
||||
|
||||
-- DarkRP --
|
||||
------------
|
||||
hook.Add("canArrest", "Chess PreventArrest", function( cop, target )
|
||||
if not (IsValid(target) and target:GetNWBool("IsInChess", false)) then return end
|
||||
|
||||
local board = target:GetNWEntity( "ActiveChessBoard", nil )
|
||||
if not (IsValid(board) and board:GetPlaying()) then return end
|
||||
if target~=board:GetWhitePlayer() and target~=board:GetBlackPlayer() then return end
|
||||
|
||||
return false,"Cannot arrest players during a game in progress" -- Prevent arrest during Chess
|
||||
end)
|
||||
|
||||
-- Admin Commands --
|
||||
--------------------
|
||||
local function SetupCommands()
|
||||
if serverguard then
|
||||
/////////////////
|
||||
// Serverguard //
|
||||
/////////////////
|
||||
serverguard.permission:Add("Set Chess Elo")
|
||||
|
||||
if SERVER then
|
||||
// Update function
|
||||
local function SGUpdate(player, target, newElo, isDraughts)
|
||||
if type(target)=="Player" and IsValid(target) then
|
||||
if isDraughts then
|
||||
target:SetDraughtsElo( newElo )
|
||||
else
|
||||
target:SetChessElo( newElo )
|
||||
end
|
||||
Chess_UpdateElo( target )
|
||||
|
||||
serverguard.Notify(nil,
|
||||
SERVERGUARD.NOTIFY.GREEN, serverguard.player:GetName(player),
|
||||
SERVERGUARD.NOTIFY.WHITE, isDraughts and " has set the Checkers Elo rating of " or " has set the Chess Elo rating of ",
|
||||
SERVERGUARD.NOTIFY.RED, serverguard.player:GetName(target),
|
||||
SERVERGUARD.NOTIFY.WHITE, " to ",
|
||||
SERVERGUARD.NOTIFY.RED, tostring(newElo),
|
||||
SERVERGUARD.NOTIFY.WHITE, "."
|
||||
)
|
||||
elseif (string.SteamID(target)) then
|
||||
local success,reason = Chess_SetElo( target, newElo, isDraughts )
|
||||
|
||||
local queryObj = serverguard.mysql:Select("serverguard_users");
|
||||
queryObj:Where("steam_id", target)
|
||||
queryObj:Limit(1)
|
||||
queryObj:Callback(function(result, status, lastID)
|
||||
local name = target
|
||||
if (type(result) == "table" and #result > 0) then
|
||||
name = result[1].name or name
|
||||
end
|
||||
|
||||
if success then
|
||||
serverguard.Notify(nil,
|
||||
SERVERGUARD.NOTIFY.GREEN, serverguard.player:GetName(player),
|
||||
SERVERGUARD.NOTIFY.WHITE, isDraughts and " has set the Checkers Elo rating of " or " has set the Chess Elo rating of ",
|
||||
SERVERGUARD.NOTIFY.RED, name,
|
||||
SERVERGUARD.NOTIFY.WHITE, " to ",
|
||||
SERVERGUARD.NOTIFY.RED, tostring(newElo),
|
||||
SERVERGUARD.NOTIFY.WHITE, "."
|
||||
)
|
||||
else
|
||||
serverguard.Notify(player, SERVERGUARD.NOTIFY.RED, ("Could not set elo. (%s)"):format(tostring(reason)) )
|
||||
end
|
||||
end)
|
||||
queryObj:Execute()
|
||||
else
|
||||
serverguard.Notify(player, SGPF("cant_find_player_with_identifier"))
|
||||
end
|
||||
end
|
||||
|
||||
// Chess command
|
||||
local command = {}
|
||||
|
||||
command.help = "Set a player's Chess Elo rating."
|
||||
command.command = "setelo"
|
||||
command.arguments = {"player", "elo"}
|
||||
command.permissions = {"Set Chess Elo"}
|
||||
command.aliases = {"setelochess", "chesselo", "setchess", "setchesselo"}
|
||||
|
||||
function command:Execute(player, silent, arguments)
|
||||
local target = util.FindPlayer(arguments[1], player, true)
|
||||
local newElo = tonumber(arguments[2]) or 1400
|
||||
|
||||
SGUpdate( player, IsValid(target) and target or arguments[1], newElo, false )
|
||||
end
|
||||
serverguard.command:Add(command)
|
||||
|
||||
// Draughts command
|
||||
local command = {}
|
||||
|
||||
command.help = "Set a player's Checkers Elo rating."
|
||||
command.command = "setelocheckers"
|
||||
command.arguments = {"player", "elo"}
|
||||
command.permissions = {"Set Chess Elo"}
|
||||
command.aliases = {"setcheckers", "setcheckerselo", "checkerselo", "setelodraughts", "setdraughts", "setdraughtselo", "draughtselo"}
|
||||
|
||||
function command:Execute(player, silent, arguments)
|
||||
local target = util.FindPlayer(arguments[1], player, true)
|
||||
local newElo = tonumber(arguments[2]) or 1400
|
||||
|
||||
SGUpdate( player, IsValid(target) and target or arguments[1], newElo, true )
|
||||
end
|
||||
|
||||
serverguard.command:Add(command)
|
||||
end
|
||||
end
|
||||
if ulx then
|
||||
/////////
|
||||
// ULX //
|
||||
/////////
|
||||
|
||||
// Update
|
||||
local function ULXUpdate(calling_ply, target, newElo, isDraughts)
|
||||
if CLIENT then return end
|
||||
|
||||
if type(target)=="Player" and IsValid(target) then
|
||||
if isDraughts then
|
||||
target:SetDraughtsElo( newElo )
|
||||
else
|
||||
target:SetChessElo( newElo )
|
||||
end
|
||||
Chess_UpdateElo( target )
|
||||
|
||||
ulx.fancyLogAdmin( calling_ply, "#A set the #s Elo rating of #T to #i.", isDraughts and "Checkers" or "Chess", target, newElo )
|
||||
elseif (string.SteamID(target or "")) then
|
||||
local success,reason = Chess_SetElo( target, newElo, isDraughts )
|
||||
|
||||
if success then
|
||||
ulx.fancyLogAdmin( calling_ply, "#A set the #s Elo rating of #s to #i.", isDraughts and "Checkers" or "Chess", target, newElo )
|
||||
else
|
||||
ULib.tsayError( calling_ply, ("Could not set elo. (%s)"):format(tostring(reason)) )
|
||||
end
|
||||
else
|
||||
ULib.tsayError( calling_ply, "Invalid SteamID or Player." )
|
||||
end
|
||||
end
|
||||
|
||||
// Autocomplete
|
||||
local function AutoComplete(...) return ULib.cmds.PlayerArg.complete(ULib.cmds.PlayerArg, ...) end
|
||||
|
||||
// Chess command
|
||||
local function SetChessElo( calling_ply, steamid, newElo )
|
||||
local target = ULib.getUser( steamid or "", true, calling_ply )
|
||||
|
||||
ULXUpdate( calling_ply, IsValid(target) and target or steamid, newElo, false )
|
||||
end
|
||||
local setchess = ulx.command( "Chess", "ulx chesselo", SetChessElo, {"!setelo", "!setelochess", "!chesselo", "!setchess", "!setchesselo"}, false, false, true )
|
||||
setchess:addParam{ type=ULib.cmds.StringArg, hint="Player or SteamID", autocomplete_fn=AutoComplete }
|
||||
setchess:addParam{ type=ULib.cmds.NumArg, hint="New Elo", min=0, default=1400 }
|
||||
setchess:defaultAccess( ULib.ACCESS_SUPERADMIN )
|
||||
setchess:help( "Set Chess Elo rating for user." )
|
||||
|
||||
// Draughts command
|
||||
local function SetDraughtsElo( calling_ply, steamid, newElo )
|
||||
local target = ULib.getUser( steamid, true, calling_ply )
|
||||
|
||||
ULXUpdate( calling_ply, IsValid(target) and target or steamID, newElo, true )
|
||||
end
|
||||
local setdraughts = ulx.command( "Chess", "ulx checkerselo", SetDraughtsElo, {"!setelocheckers", "!setcheckers", "!setcheckerselo", "!checkerselo", "!setelodraughts", "!setdraughts", "!setdraughtselo", "!draughtselo"}, false, false, true )
|
||||
setdraughts:addParam{ type=ULib.cmds.StringArg, hint="Player or SteamID", autocomplete_fn=AutoComplete }
|
||||
setdraughts:addParam{ type=ULib.cmds.NumArg, hint="New Elo", min=0, default=1400 }
|
||||
setdraughts:defaultAccess( ULib.ACCESS_SUPERADMIN )
|
||||
setdraughts:help( "Set Checkers Elo rating for user." )
|
||||
end
|
||||
end
|
||||
hook.Add( "Initialize", "ChessBoardPermissions", SetupCommands )
|
||||
174
addons/chess/lua/chess/cl_dermaboard.lua
Normal file
@@ -0,0 +1,174 @@
|
||||
--[[
|
||||
| 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 PanelCol = {
|
||||
Main = Color(0,0,0,200), Hover = Color(0,255,0,50), Selected = Color(150,50,50,170),
|
||||
Move = Color(10,25,150,150), HasMoved = Color(50,50,50,100), Text = Color(0,0,0,255),
|
||||
|
||||
GridWhite = Color(255, 248, 220), GridBlack = Color(210, 180, 140),
|
||||
|
||||
White = Color(180,180,180), Black = Color(0,0,0),
|
||||
}
|
||||
-- local ColText = Color(50,50,50,200)
|
||||
-- local ColBlack,ColWhite = Color(0,0,0,120),Color(255,255,255,10)
|
||||
|
||||
local NumToLetter = {"a", "b", "c", "d", "e", "f", "g", "h", ["a"]=1, ["b"]=2, ["c"]=3, ["d"]=4, ["e"]=5, ["f"]=6, ["g"]=7, ["h"]=8} --Used extensively for conversions
|
||||
surface.CreateFont( "ChessPieces", { font = "Arial", size = 64, weight = 300})
|
||||
|
||||
function Chess_Open2DBoard( board )
|
||||
if not IsValid(board) then return end
|
||||
if IsValid( Chess_2DDermaPanel ) then Chess_2DDermaPanel:Remove() end
|
||||
|
||||
Chess_2DDermaPanel = vgui.Create( "DFrame" )
|
||||
local frame = Chess_2DDermaPanel
|
||||
frame:SetTitle( "2D Game Board" )
|
||||
frame:SetSize( 740, 760 )
|
||||
frame:SetPos( (ScrW()/2)-370, (ScrH()/2)-380 )
|
||||
frame.Paint = function( s,w,h )
|
||||
if not IsValid(board) then
|
||||
s:Remove()
|
||||
end
|
||||
|
||||
draw.RoundedBox( 8, 0, 0, w, h, PanelCol.Main )
|
||||
end
|
||||
frame:MakePopup()
|
||||
|
||||
local pnlBoard = vgui.Create( "DPanel", frame )
|
||||
pnlBoard:SetSize( 720, 720 )
|
||||
pnlBoard:SetPos(10,30)
|
||||
|
||||
pnlBoard.Squares = {}
|
||||
pnlBoard.Paint = function() end
|
||||
|
||||
local function DoTiles(swapped)
|
||||
if pnlBoard.Squares then
|
||||
for _,v in pairs(pnlBoard.Squares) do
|
||||
for _,pnl in pairs(v) do
|
||||
pnl:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for i=0,7 do
|
||||
pnlBoard.Squares[i] = {}
|
||||
for n=0,7 do
|
||||
local pnl = vgui.Create( "DModelPanel", pnlBoard )
|
||||
pnlBoard.Squares[i][n] = pnl
|
||||
|
||||
pnl:SetPos( (swapped and 7-i or i)*90, (swapped and 7-n or n)*90 )
|
||||
pnl:SetSize(90,90)
|
||||
pnl.GridCol = (((i+n)%2)==1) and PanelCol.GridBlack or PanelCol.GridWhite
|
||||
pnl.GridPos = {i,n}
|
||||
pnl.oPaint = pnl.Paint
|
||||
pnl.Paint = function(s,w,h)
|
||||
surface.SetDrawColor( s.GridCol )
|
||||
surface.DrawRect( 0,0, w,h )
|
||||
|
||||
if not IsValid(board) then return end
|
||||
|
||||
if s:IsHovered() then
|
||||
surface.SetDrawColor( PanelCol.Hover )
|
||||
surface.DrawRect( 0,0, w,h )
|
||||
end
|
||||
if board.Selected and board.Selected[1]==s.GridPos[1] and board.Selected[2]==s.GridPos[2] then
|
||||
surface.SetDrawColor( PanelCol.Selected )
|
||||
surface.DrawRect( 0,0, w,h )
|
||||
end
|
||||
if board:GetTableGrid( board.Moves, s.GridPos[1], s.GridPos[2]) then
|
||||
surface.SetDrawColor( PanelCol.Move )
|
||||
surface.DrawRect( 0,0, w,h )
|
||||
end
|
||||
|
||||
local col,square = board.Pieces[ NumToLetter[s.GridPos[1]+1] ]
|
||||
if col then
|
||||
square = col[8-s.GridPos[2]]
|
||||
if square then
|
||||
if not (square.Team and square.Class) then return end
|
||||
|
||||
if square.Moving then
|
||||
surface.SetDrawColor( PanelCol.HasMoved )
|
||||
surface.DrawRect( 0,0, w,h )
|
||||
end
|
||||
|
||||
if board.Characters then
|
||||
draw.SimpleText( board.Characters[square.Team .. square.Class], "ChessPieces", w/2, h/2, PanelCol.Text, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
|
||||
else
|
||||
s:SetModel( board.Models[square.Team .. square.Class] )
|
||||
|
||||
return s.oPaint( s,w,h )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if cvars.Bool("chess_gridletters") then
|
||||
local str = (NumToLetter[i+1]..tostring(8-n)):upper()
|
||||
draw.SimpleText( str, "ChessTextSmall", 5, h-20, PanelCol.Black )
|
||||
end
|
||||
end
|
||||
|
||||
pnl.DoClick = function(s)
|
||||
if not IsValid(board) then return end
|
||||
|
||||
if board.Selected and board:GetTableGrid( board.Moves, pnl.GridPos[1], pnl.GridPos[2] ) then
|
||||
board:RequestMove( board.Selected[1], board.Selected[2], pnl.GridPos[1], pnl.GridPos[2] )
|
||||
board:ResetHighlights()
|
||||
elseif board.Selected and board.Selected[1]==s.GridPos[1] and board.Selected[2]==s.GridPos[2] then
|
||||
board:ResetHighlights()
|
||||
else
|
||||
board:ResetHighlights()
|
||||
board.Selected = {s.GridPos[1],s.GridPos[2]}
|
||||
board.Moves = board:GetMove( NumToLetter[s.GridPos[1]+1], 8-s.GridPos[2] )
|
||||
end
|
||||
end
|
||||
pnl.LayoutEntity = function( s, ent )
|
||||
ent:SetPos( Vector(20,20,20) )
|
||||
ent:SetAngles( Angle(0,-50,0) )
|
||||
end
|
||||
|
||||
pnl:SetModel( board.Models["WhitePawn"] )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local swap = vgui.Create( "DButton", frame )
|
||||
swap:SetImage( "icon16/arrow_rotate_clockwise.png" )
|
||||
swap:SetSize( 18,18 )
|
||||
swap:SetPos( 620,6 )
|
||||
swap:SetText( "" )
|
||||
swap.DoClick = function(s)
|
||||
s.Swapped = not s.Swapped
|
||||
DoTiles( s.Swapped )
|
||||
end
|
||||
swap.Paint = function() end
|
||||
|
||||
local toggleGridLetters = vgui.Create( "DCheckBox", frame )
|
||||
toggleGridLetters:SetImage( "icon16/font.png" )
|
||||
toggleGridLetters:SetSize( 18,18 )
|
||||
toggleGridLetters:SetPos( 600,6 )
|
||||
toggleGridLetters:SetText( "" )
|
||||
toggleGridLetters:SetConVar( "chess_gridletters" )
|
||||
toggleGridLetters.OnChange = function(s,newvalue)
|
||||
s:SetAlpha( s:GetChecked() and 255 or 100 )
|
||||
end
|
||||
toggleGridLetters.Paint = function() end
|
||||
toggleGridLetters.PerformLayout = function(s) -- DCheckBox overwrites DButton's PerformLayout, re-apply it
|
||||
if IsValid(s.m_Image) then
|
||||
s.m_Image:SetPos( 4, ( s:GetTall() - s.m_Image:GetTall() ) * 0.5 )
|
||||
s:SetTextInset( s.m_Image:GetWide() + 16, 0 )
|
||||
end
|
||||
|
||||
DLabel.PerformLayout( s )
|
||||
end
|
||||
|
||||
swap.Swapped = false
|
||||
DoTiles( swap.Swapped )
|
||||
end
|
||||
149
addons/chess/lua/chess/cl_top.lua
Normal file
@@ -0,0 +1,149 @@
|
||||
--[[
|
||||
| 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 Top10
|
||||
local function ChessTop10( typ )
|
||||
if IsValid(Top10) then Top10:Remove() end
|
||||
|
||||
typ = typ or "Chess"
|
||||
|
||||
Top10 = vgui.Create( "DFrame" )
|
||||
Top10:SetSize( 450, 245 )
|
||||
Top10:SetPos( (ScrW()/2)-150, (ScrH()/2)-100 )
|
||||
Top10:SetTitle( "Top 10 Chess Elo ratings" )
|
||||
Top10:MakePopup()
|
||||
Top10.Column = "Elo"
|
||||
|
||||
local pnl = vgui.Create("DPanel", Top10)
|
||||
pnl.Paint = function() end
|
||||
pnl:SetTall(20)
|
||||
pnl:Dock(BOTTOM)
|
||||
|
||||
Top10.Rank = vgui.Create( "DLabel", pnl )
|
||||
Top10.Rank:Dock( LEFT )
|
||||
Top10.Rank:SetTall( 20 )
|
||||
Top10.Rank:SetWide( 150 )
|
||||
Top10.Rank:SetText("")
|
||||
|
||||
Top10.Updated = vgui.Create( "DLabel", pnl )
|
||||
Top10.Updated:Dock( RIGHT )
|
||||
Top10.Updated:SetTall( 150 )
|
||||
Top10.Updated:SetText("")
|
||||
|
||||
Top10.List = vgui.Create( "DListView", Top10 )
|
||||
local List = Top10.List
|
||||
List:Dock( FILL )
|
||||
List:AddColumn( "Rank" )
|
||||
List:AddColumn( "Name" )
|
||||
List:AddColumn( "SteamID" )
|
||||
List:AddColumn( "Elo" )
|
||||
|
||||
List:AddLine( "", "Loading..." )
|
||||
-- PrintTable( List.Columns )
|
||||
List:OnRequestResize( List.Columns[1], 10 )
|
||||
List:OnRequestResize( List.Columns[2], 150 )
|
||||
List:OnRequestResize( List.Columns[3], 100 )
|
||||
List:OnRequestResize( List.Columns[4], 10 )
|
||||
|
||||
net.Start( "Chess Top10" ) net.WriteString( typ ) net.SendToServer()
|
||||
end
|
||||
local function DraughtsTop10()
|
||||
ChessTop10( "Draughts" )
|
||||
end
|
||||
concommand.Add( "chess_top", function( p,c,a ) ChessTop10() end)
|
||||
concommand.Add( "checkers_top", function( p,c,a ) DraughtsTop10() end)
|
||||
|
||||
local ChatCommands = {
|
||||
["!chess"]=ChessTop10, ["!chesstop"]=ChessTop10, ["!topchess"]=ChessTop10,
|
||||
["/chess"]=ChessTop10, ["/chesstop"]=ChessTop10, ["/topchess"]=ChessTop10,
|
||||
|
||||
["!draughts"]=DraughtsTop10, ["!draughtstop"]=DraughtsTop10, ["!topdraughts"]=DraughtsTop10,
|
||||
["/draughts"]=DraughtsTop10, ["/draughtstop"]=DraughtsTop10, ["/topdraughts"]=DraughtsTop10,
|
||||
|
||||
["!checkers"]=DraughtsTop10, ["!checkerstop"]=DraughtsTop10, ["!topcheckers"]=DraughtsTop10,
|
||||
["/checkers"]=DraughtsTop10, ["/checkerstop"]=DraughtsTop10, ["/topcheckers"]=DraughtsTop10,
|
||||
}
|
||||
hook.Add( "OnPlayerChat", "Chess Top10 PlayerChat", function( ply, str, tm, dead )
|
||||
if ChatCommands[str:lower()] then
|
||||
if ply==LocalPlayer() then
|
||||
ChatCommands[str:lower()]()
|
||||
end
|
||||
return true
|
||||
end
|
||||
end)
|
||||
|
||||
local function SecondsToTime(num)
|
||||
if updateTime>=86400 then
|
||||
return ("%i day%s"):format( math.floor(updateTime/86400), updateTime>=172800 and "s" or "")
|
||||
elseif updateTime>=3600 then
|
||||
return ("%i hour%s"):format( math.floor(updateTime/3600), updateTime>=7200 and "s" or "")
|
||||
elseif updateTime>=60 then
|
||||
return ("%i minute%s"):format( math.floor(updateTime/60), updateTime>=120 and "s" or "")
|
||||
else
|
||||
return ("%i second%s"):format(updateTime, updateTime>=2 and "s" or "")
|
||||
end
|
||||
end
|
||||
|
||||
local lastTable = {}
|
||||
local lastRank = {}
|
||||
local lastUpdate = {}
|
||||
net.Receive( "Chess Top10", function()
|
||||
if not (IsValid(Top10) and IsValid(Top10.List)) then return end
|
||||
|
||||
Top10.List:Clear()
|
||||
|
||||
local typ = net.ReadString() or "[Error]"
|
||||
|
||||
Top10:SetTitle( "Top 10 "..typ.." Elo ratings" )
|
||||
|
||||
local tbl = net.ReadTable()
|
||||
if (not tbl) or (#tbl==0) then -- Rate limit exceeded
|
||||
if lastTable[typ] then
|
||||
for i=1,#lastTable[typ] do
|
||||
Top10.List:AddLine( tonumber(lastTable[typ][i].Rank), lastTable[typ][i].Username, lastTable[typ][i].SteamID, tonumber(lastTable[typ][i]["Elo" ]) )
|
||||
end
|
||||
Top10.Rank:SetText( "You are rank "..lastRank[typ] )
|
||||
|
||||
if lastUpdate[typ] then
|
||||
updateTime = math.floor(CurTime() - lastUpdate[typ])
|
||||
if updateTime>0 then
|
||||
Top10.Updated:SetText( ("Updated %s ago."):format(SecondsToTime(updateTime)) )
|
||||
end
|
||||
Top10.Updated:SizeToContents()
|
||||
end
|
||||
else
|
||||
Top10.List:AddLine( "", "ERROR: Rate limit exceeded." )
|
||||
Top10.List:AddLine( "", "Please try again in a few minutes." )
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
for i=1,#tbl do
|
||||
Top10.List:AddLine( tonumber(tbl[i].Rank), tbl[i].Username, tbl[i].SteamID, tonumber(tbl[i]["Elo" ]) )
|
||||
end
|
||||
|
||||
local rank = (net.ReadString() or "N/A")
|
||||
Top10.Rank:SetText( "You are rank "..rank )
|
||||
|
||||
lastUpdate[typ] = tonumber(net.ReadString())
|
||||
if lastUpdate[typ] then
|
||||
updateTime = math.floor(CurTime() - lastUpdate[typ])
|
||||
|
||||
if updateTime>0 then
|
||||
Top10.Updated:SetText( ("Updated %s ago."):format(SecondsToTime(updateTime)) )
|
||||
end
|
||||
Top10.Updated:SizeToContents()
|
||||
end
|
||||
|
||||
lastTable[typ] = tbl
|
||||
lastRank[typ] = rank
|
||||
end)
|
||||
123
addons/chess/lua/chess/sh_player_ext.lua
Normal file
@@ -0,0 +1,123 @@
|
||||
--[[
|
||||
| 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 PLAYER = FindMetaTable( "Player" )
|
||||
if not PLAYER then return end
|
||||
|
||||
function PLAYER:GetChessElo()
|
||||
return self:GetNWInt( "ChessElo", 1400 ) or 1400
|
||||
end
|
||||
function PLAYER:GetDraughtsElo()
|
||||
return self:GetNWInt( "DraughtsElo", 1400 ) or 1400
|
||||
end
|
||||
if CLIENT then return end
|
||||
function PLAYER:SetChessElo( num )
|
||||
self:SetNWInt( "ChessElo", num or Chess_GetElo(ply:SteamID()) or 1400 )
|
||||
Chess_SetElo( self:SteamID(), num, false )
|
||||
end
|
||||
function PLAYER:SetDraughtsElo( num )
|
||||
self:SetNWInt( "DraughtsElo", num or Chess_GetElo(ply:SteamID(), true) or 1400 )
|
||||
Chess_SetElo( self:SteamID(), num, true )
|
||||
end
|
||||
|
||||
function PLAYER:RefreshChessElo()
|
||||
-- Convert old PData stuff
|
||||
if self:GetPData("ChessElo") then
|
||||
Chess_SetElo( self:SteamID(), self:GetPData("ChessElo"), false )
|
||||
self:RemovePData("ChessElo")
|
||||
end
|
||||
if self:GetPData("DraughtsElo") then
|
||||
Chess_SetElo( self:SteamID(), self:GetPData("DraughtsElo"), true )
|
||||
self:RemovePData("DraughtsElo")
|
||||
end
|
||||
|
||||
self:SetChessElo( Chess_GetElo(self:SteamID()) or 1400)
|
||||
self:SetDraughtsElo( Chess_GetElo(self:SteamID(), true) or 1400)
|
||||
end
|
||||
hook.Add( "PlayerInitialSpawn", "Chess InitialSpawn InitElo", function(ply)
|
||||
ply:RefreshChessElo()
|
||||
end)
|
||||
|
||||
function PLAYER:ExpectedChessWin( against )
|
||||
return (1/ (1+( 10^( (against:GetChessElo() - self:GetChessElo())/400 ) )) )
|
||||
end
|
||||
function PLAYER:ExpectedDraughtsWin( against )
|
||||
return (1/ (1+( 10^( (against:GetDraughtsElo() - self:GetDraughtsElo())/400 ) )) )
|
||||
end
|
||||
|
||||
function PLAYER:GetChessKFactor() --Imitating FIDE's K-factor ranges
|
||||
local games = tonumber(self:GetPData( "ChessGamesPlayed", 0 )) or 0
|
||||
if games<30 then
|
||||
self:SetPData( "ChessEloKFactor", 15 )
|
||||
return 30
|
||||
end
|
||||
local k = self:GetChessElo()>=2400 and 10 or self:GetPData( "ChessEloKFactor", 15 ) or 15
|
||||
self:SetPData( "ChessEloKFactor", k )
|
||||
return k
|
||||
end
|
||||
function PLAYER:GetDraughtsKFactor() --Imitating FIDE's K-factor ranges
|
||||
local games = self:GetPData( "DraughtsGamesPlayed", 0 )
|
||||
if games<30 then
|
||||
self:SetPData( "DraughtsEloKFactor", 15 )
|
||||
return 30
|
||||
end
|
||||
local k = self:GetDraughtsElo()>=2400 and 10 or self:GetPData( "DraughtsEloKFactor", 15 ) or 15
|
||||
self:SetPData( "DraughtsEloKFactor", k )
|
||||
return k
|
||||
end
|
||||
|
||||
function PLAYER:DoChessElo( score, against )
|
||||
local mod = math.ceil(self:GetChessKFactor() * (score - self:ExpectedChessWin(against)))
|
||||
local NewElo = math.floor( self:GetChessElo() + mod )
|
||||
|
||||
self:SetChessElo( NewElo )
|
||||
|
||||
if IsValid(against) then
|
||||
mod = mod*(-1)
|
||||
local NewElo = math.floor( against:GetChessElo() + mod )
|
||||
|
||||
against:SetChessElo( NewElo )
|
||||
local rank,count = Chess_GetRank(against)
|
||||
against:ChatPrint( "Your chess Elo rating changed by "..tostring(mod).." to "..tostring(NewElo).."!" ..(rank and " You are #"..tostring(rank).." on this server." or "") )
|
||||
end
|
||||
local rank,count = Chess_GetRank(self)
|
||||
self:ChatPrint( "Your chess Elo rating changed by "..tostring(mod).." to "..tostring(NewElo).."!" ..(rank and " You are #"..tostring(rank).." on this server." or "") )
|
||||
|
||||
Chess_UpdateElo( self )
|
||||
end
|
||||
function PLAYER:ChessWin( against )
|
||||
if not IsValid(against) then return end
|
||||
|
||||
self:DoChessElo(1, against)
|
||||
end
|
||||
function PLAYER:ChessDraw( against ) self:DoChessElo(0.5, against) end
|
||||
|
||||
function PLAYER:DoDraughtsElo( score, against )
|
||||
local mod = math.ceil(self:GetDraughtsKFactor() * (score - self:ExpectedDraughtsWin(against)))
|
||||
local NewElo = math.floor( self:GetDraughtsElo() + mod )
|
||||
|
||||
self:SetDraughtsElo( NewElo )
|
||||
|
||||
if IsValid(against) then
|
||||
mod = mod*(-1)
|
||||
local NewElo = math.floor( against:GetDraughtsElo() + mod )
|
||||
|
||||
against:SetDraughtsElo( NewElo )
|
||||
local rank = Chess_GetRank(self, "Draughts")
|
||||
against:ChatPrint( "Your draughts Elo rating changed by "..tostring(mod).." to "..tostring(NewElo).."!" ..(rank and " You are #"..tostring(rank).." on this server." or "") )
|
||||
end
|
||||
local rank = Chess_GetRank(self, "Draughts")
|
||||
self:ChatPrint( "Your draughts Elo rating changed by "..tostring(mod).." to "..tostring(NewElo).."!" ..(rank and " You are #"..tostring(rank).." on this server." or "") )
|
||||
|
||||
Chess_UpdateElo( self )
|
||||
end
|
||||
function PLAYER:DraughtsWin( against ) self:DoDraughtsElo(1, against) end
|
||||
function PLAYER:DraughtsDraw( against ) self:DoDraughtsElo(0.5, against) end
|
||||
212
addons/chess/lua/chess/sv_sql.lua
Normal file
@@ -0,0 +1,212 @@
|
||||
--[[
|
||||
| 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 nextTopUpdate = {}
|
||||
local playerResults = {}
|
||||
|
||||
local function InitChessLeaderboard()
|
||||
sql.Begin()
|
||||
local query = sql.Query( [[CREATE TABLE ChessLeaderboard (SteamID varchar(255), Username varchar(255), Elo int, DraughtsElo int);]] )
|
||||
sql.Commit()
|
||||
|
||||
if query==false then else print("Chess: Created Elo table") end
|
||||
end
|
||||
InitChessLeaderboard()
|
||||
|
||||
function Chess_UpdateElo( ply )
|
||||
if not IsValid(ply) then return end
|
||||
|
||||
local SelStr = [[SELECT * FROM ChessLeaderboard WHERE SteamID==]].. sql.SQLStr(ply:SteamID()) ..[[;]]
|
||||
sql.Begin()
|
||||
local Select = sql.Query( SelStr )
|
||||
sql.Commit()
|
||||
|
||||
local UpdateStr
|
||||
if Select==false then
|
||||
Error( "Chess: Save failed for player "..ply:Nick().." - Query error. "..sql.LastError().."\n" )
|
||||
elseif Select==nil then
|
||||
UpdateStr = [[INSERT INTO ChessLeaderboard (SteamID, Username, Elo, DraughtsElo) VALUES (]]..sql.SQLStr(ply:SteamID())..[[,]]..sql.SQLStr(ply:Nick())..[[,]]..sql.SQLStr(ply:GetChessElo())..[[,]]..sql.SQLStr(ply:GetDraughtsElo())..[[);]]
|
||||
else
|
||||
UpdateStr = [[UPDATE ChessLeaderboard SET Username=]]..sql.SQLStr(ply:GetName())..[[,Elo=]]..sql.SQLStr(ply:GetChessElo())..[[,DraughtsElo=]]..sql.SQLStr(ply:GetDraughtsElo())..[[ WHERE SteamID==]]..sql.SQLStr(ply:SteamID())..[[;]]
|
||||
end
|
||||
|
||||
sql.Begin()
|
||||
local Update = sql.Query( UpdateStr )
|
||||
sql.Commit()
|
||||
|
||||
if Update==false then
|
||||
Error( "Chess: Update failed for player "..ply:Nick().." - Query error. "..sql.LastError().."\n" )
|
||||
end
|
||||
|
||||
nextTopUpdate = {}
|
||||
playerResults = {}
|
||||
end
|
||||
function Chess_SetElo( steamID, newElo, isDraughts )
|
||||
if not tonumber(newElo) then return false,"Elo must be a number." end
|
||||
if type(steamID)=="Player" then
|
||||
if not IsValid(steamID) then return end
|
||||
steamID = steamID:SteamID()
|
||||
end
|
||||
|
||||
local ply = player.GetBySteamID(steamID)
|
||||
|
||||
local SelStr = [[SELECT * FROM ChessLeaderboard WHERE SteamID==]].. sql.SQLStr(steamID) ..[[;]]
|
||||
sql.Begin()
|
||||
local Select = sql.Query( SelStr )
|
||||
sql.Commit()
|
||||
|
||||
local UpdateStr
|
||||
if Select==nil then
|
||||
UpdateStr = [[INSERT INTO ChessLeaderboard (SteamID, Username, Elo, DraughtsElo) VALUES (]]..sql.SQLStr(steamID)..[[,]]..sql.SQLStr(IsValid(ply) and ply:Nick() or "N/A")..[[,]]..sql.SQLStr(IsValid(ply) and ply:GetChessElo() or 1400)..[[,]]..sql.SQLStr(IsValid(ply) and ply:GetDraughtsElo() or 1400)..[[);]]
|
||||
end
|
||||
|
||||
if isDraughts then
|
||||
UpdateStr = [[UPDATE ChessLeaderboard SET DraughtsElo=]]..sql.SQLStr(tonumber(newElo))..[[ WHERE SteamID==]]..sql.SQLStr(steamID)..[[;]]
|
||||
else
|
||||
UpdateStr = [[UPDATE ChessLeaderboard SET Elo=]]..sql.SQLStr(tonumber(newElo))..[[ WHERE SteamID==]]..sql.SQLStr(steamID)..[[;]]
|
||||
end
|
||||
|
||||
sql.Begin()
|
||||
local Update = sql.Query( UpdateStr )
|
||||
sql.Commit()
|
||||
|
||||
if Update==false then
|
||||
Error( "Chess: Update failed for player "..steamID.." - Query error. "..sql.LastError().."\n" )
|
||||
return false
|
||||
end
|
||||
|
||||
nextTopUpdate = {}
|
||||
playerResults = {}
|
||||
end
|
||||
function Chess_GetElo( steamID, isDraughts )
|
||||
if type(steamID)=="Player" then
|
||||
if not IsValid(steamID) then return end
|
||||
steamID = steamID:SteamID()
|
||||
end
|
||||
|
||||
local SelStr = [[SELECT * FROM ChessLeaderboard WHERE SteamID==]].. sql.SQLStr(steamID) ..[[;]]
|
||||
sql.Begin()
|
||||
local Select = sql.Query( SelStr )
|
||||
sql.Commit()
|
||||
|
||||
if Select==nil then
|
||||
return false, "Player does not have an Elo rating"
|
||||
end
|
||||
|
||||
if isDraughts then
|
||||
return Select[1].DraughtsElo or 1400
|
||||
else
|
||||
return Select[1].Elo or 1400 -- Chess
|
||||
end
|
||||
end
|
||||
|
||||
function Chess_GetRank( ply, typ )
|
||||
local query = string.gsub([[SELECT (
|
||||
SELECT COUNT(*)+1
|
||||
FROM ChessLeaderboard ordered
|
||||
WHERE (ordered.{ELO}) > (uo.{ELO})
|
||||
) AS Rank, (SELECT COUNT(*) FROM ChessLeaderboard) AS Count
|
||||
FROM ChessLeaderboard uo WHERE SteamID==]]..sql.SQLStr(ply:SteamID())..[[;]], "{ELO}", (typ=="Draughts" and [[DraughtsElo]] or [[Elo]]) )
|
||||
sql.Begin()
|
||||
local rank = sql.Query( query )
|
||||
sql.Commit()
|
||||
|
||||
if not (rank and rank[1] and rank[1].Rank and rank[1].Count) then return false end
|
||||
|
||||
return rank and rank[1] and rank[1].Rank, rank and rank[1] and rank[1].Count
|
||||
end
|
||||
|
||||
util.AddNetworkString( "Chess Top10" )
|
||||
local ValidType = {["Chess"] = true, ["Draughts"] = true}
|
||||
|
||||
local TopTable = {}
|
||||
net.Receive( "Chess Top10", function( len, ply )
|
||||
if not IsValid(ply) then return end
|
||||
|
||||
local typ = net.ReadString()
|
||||
if not (typ and ValidType[typ]) then typ = "Chess" end
|
||||
if not playerResults[typ] then playerResults[typ] = {} end
|
||||
|
||||
if playerResults[typ][ply] and (CurTime()<(playerResults[typ][ply].nextUpdate or 0)) then
|
||||
net.Start( "Chess Top10" )
|
||||
net.WriteString( typ )
|
||||
net.Send( ply )
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if CurTime()>(nextTopUpdate[typ] or 0) then
|
||||
local query = string.gsub([[SELECT Username, SteamID, {ELO} as Elo, (
|
||||
SELECT COUNT(*)+1
|
||||
FROM ChessLeaderboard ordered
|
||||
WHERE (ordered.{ELO}) > (uo.{ELO})
|
||||
) AS Rank
|
||||
FROM ChessLeaderboard uo ORDER BY {ELO} DESC LIMIT 10;]], "{ELO}", (typ=="Draughts" and [[DraughtsElo]] or [[Elo]]) )
|
||||
sql.Begin()
|
||||
local Top10 = sql.Query( query )
|
||||
sql.Commit()
|
||||
|
||||
if Top10==false then
|
||||
Error( "Chess: Top10 retrieval failed - Query error. "..sql.LastError().."\n" )
|
||||
return
|
||||
elseif Top10==nil then
|
||||
Error( "Chess: Top10 retrieval failed - No data." )
|
||||
return
|
||||
end
|
||||
|
||||
TopTable = Top10
|
||||
|
||||
table.Empty(playerResults[typ])
|
||||
nextTopUpdate[typ] = CurTime() + 120
|
||||
end
|
||||
|
||||
local str = ""
|
||||
if (not playerResults[typ][ply]) or CurTime()<(playerResults[typ][ply].nextUpdate) then
|
||||
local rank,total = Chess_GetRank(ply, typ)
|
||||
playerResults[typ][ply] = {rank = rank, total = total}
|
||||
end
|
||||
local res = playerResults[typ][ply]
|
||||
str = (res.rank and res.total and res.rank.." of "..res.total) or res.rank or "N/A"
|
||||
|
||||
net.Start( "Chess Top10" )
|
||||
net.WriteString( typ )
|
||||
net.WriteTable( TopTable )
|
||||
|
||||
net.WriteString( str )
|
||||
net.WriteString(math.floor(nextTopUpdate[typ] - 120))
|
||||
net.Send( ply )
|
||||
|
||||
playerResults[typ][ply].nextUpdate = CurTime() + 30
|
||||
end)
|
||||
|
||||
-- function TestElo()
|
||||
-- local typ = ""
|
||||
|
||||
-- local query = string.gsub([[SELECT *,(
|
||||
-- SELECT COUNT(*)+1
|
||||
-- FROM ChessLeaderboard ordered
|
||||
-- WHERE (ordered.{ELO}) > (uo.{ELO})
|
||||
-- ) AS Rank, (SELECT COUNT(*) FROM ChessLeaderboard) AS Count
|
||||
-- FROM ChessLeaderboard uo ORDER BY {ELO} DESC;]], "{ELO}", (typ=="Draughts" and [[DraughtsElo]] or [[Elo]]) )
|
||||
-- sql.Begin()
|
||||
-- local Top10 = sql.Query( query )
|
||||
-- sql.Commit()
|
||||
|
||||
-- if Top10 then
|
||||
-- print( Top10 )
|
||||
-- PrintTable( Top10 )
|
||||
|
||||
-- print( Top10[1].Rank, type(Top10[1].Rank) )
|
||||
-- else
|
||||
-- print( sql.LastError() )
|
||||
-- end
|
||||
-- end
|
||||
|
||||
2950
addons/chess/lua/entities/ent_chess_board.lua
Normal file
684
addons/chess/lua/entities/ent_draughts_board.lua
Normal file
@@ -0,0 +1,684 @@
|
||||
--[[
|
||||
| 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
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Model = Model("models/weapons/w_slam.mdl")
|
||||
ENT.Base = "ent_chess_board"
|
||||
ENT.Models = {
|
||||
["board"] = Model("models/props_phx/games/chess/board.mdl"),
|
||||
["table"] = Model("models/props/de_tides/restaurant_table.mdl"),
|
||||
["hl2table"] = Model( "models/props_c17/furnituretable001a.mdl" ),
|
||||
|
||||
["dama"] = Model("models/props_phx/games/chess/white_pawn.mdl"),
|
||||
|
||||
["WhiteMan"] = Model("models/props_phx/games/chess/white_dama.mdl"), ["BlackMan"] = Model("models/props_phx/games/chess/black_dama.mdl"),
|
||||
["WhiteKing"] = Model("models/props_phx/games/chess/white_dama.mdl"), ["BlackKing"] = Model("models/props_phx/games/chess/black_dama.mdl"),
|
||||
}
|
||||
ENT.Characters = { -- Notepad's being weird and not showing these characters. If you can't see them, they'll still show up in-game.
|
||||
["WhiteMan"] = Model("⛀"), ["BlackMan"] = Model("⛂"),
|
||||
["WhiteKing"] = Model("⛁"), ["BlackKing"] = Model("⛃"),
|
||||
}
|
||||
ENT.DrawDouble = {
|
||||
["King"] = true,
|
||||
}
|
||||
|
||||
ENT.PrintName = "Draughts/Checkers"
|
||||
ENT.Author = "my_hat_stinks"
|
||||
ENT.Information = "A draughts (checkers) board"
|
||||
ENT.Category = "Game boards"
|
||||
|
||||
ENT.Game = "Draughts"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminOnly = true
|
||||
ENT.AdminSpawnable = true
|
||||
|
||||
--Status
|
||||
local CHESS_INACTIVE = 0
|
||||
local CHESS_WHITEMOVE = 1
|
||||
local CHESS_BLACKMOVE = 2
|
||||
local CHESS_WHITEPROMO = 3 local CHESS_WHITEJUMP = 3
|
||||
local CHESS_BLACKPROMO = 4 local CHESS_BLACKJUMP = 4
|
||||
local CHESS_WAGER = 5
|
||||
|
||||
--Captured piece squares
|
||||
local CHESS_WCAP1 = 10
|
||||
local CHESS_WCAP2 = 11
|
||||
local CHESS_BCAP1 = 12
|
||||
local CHESS_BCAP2 = 13
|
||||
|
||||
-- Draw Offer
|
||||
local PLAYER_NONE = 0 -- Nobody offering to draw
|
||||
local PLAYER_WHITE = 1 -- White offering to draw
|
||||
local PLAYER_BLACK = 2 -- Black offering to draw
|
||||
|
||||
local NumToLetter = {"a", "b", "c", "d", "e", "f", "g", "h", ["a"]=1, ["b"]=2, ["c"]=3, ["d"]=4, ["e"]=5, ["f"]=6, ["g"]=7, ["h"]=8} --Used extensively for conversions
|
||||
|
||||
ENT.StartState = CHESS_BLACKMOVE
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
-- self:NetworkVar( "Int", 0, "BlackPassant" )
|
||||
-- self:NetworkVar( "Int", 1, "WhitePassant" )
|
||||
|
||||
self:NetworkVar( "Int", 2, "ChessState" )
|
||||
self:NetworkVar( "Bool", 0, "Playing" )
|
||||
self:NetworkVar( "Int", 3, "DrawOffer" )
|
||||
|
||||
self:NetworkVar( "Float", 0, "WhiteWager" )
|
||||
self:NetworkVar( "Float", 1, "BlackWager" )
|
||||
|
||||
self:NetworkVar( "Entity", 0, "WhitePlayer" )
|
||||
self:NetworkVar( "Entity", 1, "BlackPlayer" )
|
||||
self:NetworkVar( "Entity", 2, "TableEnt" )
|
||||
|
||||
-- self:NetworkVar( "Int", 3, "MoveCount" )
|
||||
-- self:NetworkVar( "Bool", 1, "Repetition" )
|
||||
|
||||
self:NetworkVar( "Bool", 2, "PSWager" )
|
||||
|
||||
self:NetworkVar( "Float", 2, "WhiteTime" )
|
||||
self:NetworkVar( "Float", 3, "BlackTime" )
|
||||
|
||||
--Draughts vars
|
||||
self:NetworkVar( "Bool", 1, "JumpMove" )
|
||||
self:NetworkVar( "Int", 0, "JumpLet" )
|
||||
self:NetworkVar( "Int", 1, "JumpNum" )
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self.ChessDerived = true
|
||||
self.IsDraughts = true
|
||||
|
||||
return self.BaseClass.Initialize( self )
|
||||
end
|
||||
|
||||
function ENT:GetManMoves( tbl, GridLet, GridNum, IsWhite )
|
||||
local CapMove = false
|
||||
|
||||
--Forward Right
|
||||
local TargetRow = GridNum+ (IsWhite and 1 or (-1))
|
||||
local TargetColumn = NumToLetter[GridLet]+1
|
||||
if TargetRow<=8 and TargetRow>=1 and TargetColumn<=8 and TargetColumn>=1 then
|
||||
local target = self:GetSquare( NumToLetter[TargetColumn], TargetRow )
|
||||
if target then
|
||||
if ((self:SquareTeam(target)=="White")~=IsWhite) then --Enemy piece
|
||||
local CapRow = TargetRow+ (IsWhite and 1 or (-1))
|
||||
local CapCol = TargetColumn+1
|
||||
|
||||
if CapRow<=8 and CapRow>=1 and CapCol<=8 and CapCol>=1 then --In range
|
||||
local target = self:GetSquare( NumToLetter[CapCol], CapRow )
|
||||
if not target then --Empty space
|
||||
tbl[NumToLetter[CapCol]][CapRow] = {"CAPTURE", NumToLetter[TargetColumn], TargetRow} --Capture move
|
||||
CapMove = true --Flag as capture move
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
tbl[NumToLetter[TargetColumn]][TargetRow] = true --Standard valid move
|
||||
end
|
||||
end
|
||||
--Forward Left
|
||||
local TargetRow = GridNum+ (IsWhite and 1 or (-1))
|
||||
local TargetColumn = NumToLetter[GridLet]-1
|
||||
if TargetRow<=8 and TargetRow>=1 and TargetColumn<=8 and TargetColumn>=1 then
|
||||
local target = self:GetSquare( NumToLetter[TargetColumn], TargetRow )
|
||||
if target then
|
||||
if ((self:SquareTeam(target)=="White")~=IsWhite) then
|
||||
local CapRow = TargetRow+ (IsWhite and 1 or (-1))
|
||||
local CapCol = TargetColumn-1
|
||||
|
||||
if CapRow<=8 and CapRow>=1 and CapCol<=8 and CapCol>=1 then
|
||||
local target = self:GetSquare( NumToLetter[CapCol], CapRow )
|
||||
if not target then
|
||||
tbl[NumToLetter[CapCol]][CapRow] = {"CAPTURE", NumToLetter[TargetColumn], TargetRow}
|
||||
CapMove = true
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
tbl[NumToLetter[TargetColumn]][TargetRow] = true --Standard valid move
|
||||
end
|
||||
end
|
||||
|
||||
return CapMove
|
||||
end
|
||||
function ENT:GetKingMoves( tbl, GridLet, GridNum, IsWhite )
|
||||
local CapMove = self:GetManMoves( tbl, GridLet, GridNum, IsWhite ) --Forward moves
|
||||
|
||||
--Back Right
|
||||
local TargetRow = GridNum+ (IsWhite and (-1) or (1))
|
||||
local TargetColumn = NumToLetter[GridLet]+1
|
||||
if TargetRow<=8 and TargetRow>=1 and TargetColumn<=8 and TargetColumn>=1 then
|
||||
local target = self:GetSquare( NumToLetter[TargetColumn], TargetRow )
|
||||
if target then
|
||||
if ((self:SquareTeam(target)=="White")~=IsWhite) then
|
||||
local CapRow = TargetRow+ (IsWhite and (-1) or (1))
|
||||
local CapCol = TargetColumn+1
|
||||
|
||||
if CapRow<=8 and CapRow>=1 and CapCol<=8 and CapCol>=1 then
|
||||
local target = self:GetSquare( NumToLetter[CapCol], CapRow )
|
||||
if not target then
|
||||
tbl[NumToLetter[CapCol]][CapRow] = {"CAPTURE", NumToLetter[TargetColumn], TargetRow}
|
||||
CapMove = true
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
tbl[NumToLetter[TargetColumn]][TargetRow] = true --Standard valid move
|
||||
end
|
||||
end
|
||||
--Back Left
|
||||
local TargetRow = GridNum+ (IsWhite and (-1) or (1))
|
||||
local TargetColumn = NumToLetter[GridLet]-1
|
||||
if TargetRow<=8 and TargetRow>=1 and TargetColumn<=8 and TargetColumn>=1 then
|
||||
local target = self:GetSquare( NumToLetter[TargetColumn], TargetRow )
|
||||
if target then
|
||||
if ((self:SquareTeam(target)=="White")~=IsWhite) then
|
||||
local CapRow = TargetRow+ (IsWhite and (-1) or (1))
|
||||
local CapCol = TargetColumn-1
|
||||
|
||||
if CapRow<=8 and CapRow>=1 and CapCol<=8 and CapCol>=1 then
|
||||
local target = self:GetSquare( NumToLetter[CapCol], CapRow )
|
||||
if not target then
|
||||
tbl[NumToLetter[CapCol]][CapRow] = {"CAPTURE", NumToLetter[TargetColumn], TargetRow}
|
||||
CapMove = true
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
tbl[NumToLetter[TargetColumn]][TargetRow] = true --Standard valid move
|
||||
end
|
||||
end
|
||||
|
||||
return CapMove
|
||||
end
|
||||
function ENT:GetMove( GridLet, GridNum, IgnoreCap )
|
||||
if not (GridLet and GridNum) then return {} end
|
||||
if not NumToLetter[GridLet] then return {} end
|
||||
if NumToLetter[GridLet]<1 or NumToLetter[GridLet]>8 then return {} end
|
||||
if GridNum<1 or GridNum>8 then return {} end
|
||||
|
||||
local square = self:GetSquare( GridLet, GridNum )
|
||||
if not square then return {} end
|
||||
|
||||
local class = square.Class or (IsValid(square.Ent) and square.Ent:GetRole())
|
||||
if not class then return {} end
|
||||
|
||||
if self:GetJumpMove() and self:GetJumpLet()~=0 and self:GetJumpNum()~=0 and (NumToLetter[GridLet]~=self:GetJumpLet() or GridNum~=self:GetJumpNum()) then return {} end
|
||||
|
||||
local IsWhite = self:SquareTeam(square)=="White"
|
||||
local Moved = self:SquareMoved(square)
|
||||
|
||||
local CanJump = IgnoreCap or self:CanCapture( IsWhite )
|
||||
local tbl = { ["a"] = {}, ["b"] = {}, ["c"] = {}, ["d"] = {}, ["e"] = {}, ["f"] = {}, ["g"] = {}, ["h"] = {} }
|
||||
if class=="King" then
|
||||
self:GetKingMoves( tbl, GridLet, GridNum, IsWhite )
|
||||
else
|
||||
self:GetManMoves( tbl, GridLet, GridNum, IsWhite )
|
||||
end
|
||||
|
||||
if CanJump then
|
||||
for CheckLet,File in pairs(tbl) do
|
||||
for CheckNum,v in pairs(File) do
|
||||
if v==true then
|
||||
tbl[CheckLet][CheckNum] = nil --We can capture, but this isn't a capture move
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return tbl
|
||||
end
|
||||
|
||||
function ENT:ResetBoard()
|
||||
if SERVER then
|
||||
self:SetDrawOffer( PLAYER_NONE )
|
||||
|
||||
self:SetWhiteWager( -1 )
|
||||
self:SetBlackWager( -1 )
|
||||
|
||||
self:SetWhiteTime( 600 )
|
||||
self:SetBlackTime( 600 )
|
||||
|
||||
self:SetJumpMove( false )
|
||||
self:SetJumpLet( 0 )
|
||||
self:SetJumpNum( 0 )
|
||||
end
|
||||
self:RefreshSquares()
|
||||
|
||||
if self.Pieces then
|
||||
for _,File in pairs( self.Pieces ) do
|
||||
for _,Square in pairs(File) do
|
||||
if IsValid(Square.Ent) then Square.Ent:SetGridNum(-1) Square.Ent:Remove() end
|
||||
end
|
||||
end
|
||||
end
|
||||
self.Pieces = {
|
||||
["a"] = {
|
||||
[1] = {Team="White",Class="Man",Moved=false}, [3] = {Team="White",Class="Man",Moved=false}, [7] = {Team="Black",Class="Man",Moved=false},
|
||||
},
|
||||
["b"] = {
|
||||
[2] = {Team="White",Class="Man",Moved=false}, [6] = {Team="Black",Class="Man",Moved=false}, [8] = {Team="Black",Class="Man",Moved=false},
|
||||
},
|
||||
["c"] = {
|
||||
[1] = {Team="White",Class="Man",Moved=false}, [3] = {Team="White",Class="Man",Moved=false}, [7] = {Team="Black",Class="Man",Moved=false},
|
||||
},
|
||||
["d"] = {
|
||||
[2] = {Team="White",Class="Man",Moved=false}, [6] = {Team="Black",Class="Man",Moved=false}, [8] = {Team="Black",Class="Man",Moved=false},
|
||||
},
|
||||
["e"] = {
|
||||
[1] = {Team="White",Class="Man",Moved=false}, [3] = {Team="White",Class="Man",Moved=false}, [7] = {Team="Black",Class="Man",Moved=false},
|
||||
},
|
||||
["f"] = {
|
||||
[2] = {Team="White",Class="Man",Moved=false}, [6] = {Team="Black",Class="Man",Moved=false}, [8] = {Team="Black",Class="Man",Moved=false},
|
||||
},
|
||||
["g"] = {
|
||||
[1] = {Team="White",Class="Man",Moved=false}, [3] = {Team="White",Class="Man",Moved=false}, [7] = {Team="Black",Class="Man",Moved=false},
|
||||
},
|
||||
["h"] = {
|
||||
[2] = {Team="White",Class="Man",Moved=false}, [6] = {Team="Black",Class="Man",Moved=false}, [8] = {Team="Black",Class="Man",Moved=false},
|
||||
},
|
||||
[CHESS_WCAP1] = {}, [CHESS_WCAP2] = {}, [CHESS_BCAP1] = {}, [CHESS_BCAP2] = {},
|
||||
}
|
||||
self:Update()
|
||||
end
|
||||
|
||||
function ENT:CanCapture( White )
|
||||
for Let,column in pairs( self.Pieces ) do
|
||||
for Num,square in pairs( column ) do
|
||||
if square.Team==(White and "White" or "Black") then
|
||||
local moves = self:GetMove( Let, Num, true )
|
||||
for _,column in pairs( moves ) do
|
||||
for _,move in pairs( column ) do
|
||||
if type(move)=="table" and move[1]=="CAPTURE" then return true end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
function ENT:CanMove( White )
|
||||
for Let,column in pairs( self.Pieces ) do
|
||||
for Num,square in pairs( column ) do
|
||||
if square.Team==(White and "White" or "Black") then
|
||||
local moves = self:GetMove( Let, Num )
|
||||
for _,column in pairs( moves ) do
|
||||
for _,move in pairs( column ) do
|
||||
if move then return true end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function ENT:NoMaterialCheck()
|
||||
local BlackMat = {}
|
||||
local WhiteMat = {}
|
||||
|
||||
for GridLet,File in pairs(self.Pieces) do
|
||||
if GridLet==CHESS_WCAP1 or GridLet==CHESS_WCAP2 or GridLet==CHESS_BCAP1 or GridLet==CHESS_BCAP2 then continue end
|
||||
for GridNum,square in pairs(File) do
|
||||
if square then
|
||||
local IsWhite = self:SquareTeam(square)=="White"
|
||||
|
||||
if IsWhite then
|
||||
table.insert( WhiteMat, {Square=square, Class=Class, GridLet=GridLet, GridNum=GridNum} )
|
||||
else
|
||||
table.insert( BlackMat, {square=square, Class=Class, GridLet=GridLet, GridNum=GridNum} )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (#BlackMat+#WhiteMat)==0 then self:EndGame() return false end
|
||||
if #WhiteMat==0 then self:EndGame("Black") return false end
|
||||
if #BlackMat==0 then self:EndGame("White") return false end
|
||||
|
||||
return true
|
||||
end
|
||||
function ENT:EndGame( winner, NoMsg )
|
||||
self:SetChessState( CHESS_INACTIVE )
|
||||
self:SetPlaying( false )
|
||||
|
||||
local White = self:GetPlayer( "White" )
|
||||
local Black = self:GetPlayer( "Black" )
|
||||
local WhiteName = IsValid(White) and White:Nick() or "[Anonymous White]"
|
||||
local BlackName = IsValid(Black) and Black:Nick() or "[Anonymous Black]"
|
||||
if not NoMsg then
|
||||
net.Start( "Chess GameOver" )
|
||||
if winner=="White" then
|
||||
net.WriteTable( {" ", Color(255,255,255), WhiteName, Color(150,255,150), " has won against ", Color(100,100,100), BlackName, Color(150,255,150), "!"} )
|
||||
else
|
||||
net.WriteTable( {" ", Color(100,100,100), BlackName, Color(150,255,150), " has won against ", Color(255,255,255), WhiteName, Color(150,255,150), "!"} )
|
||||
end
|
||||
net.WriteString( "icon16/medal_gold_2.png" )
|
||||
net.Broadcast()
|
||||
end
|
||||
|
||||
timer.Simple( 0.5, function()
|
||||
if not IsValid(self) then return end
|
||||
if IsValid(Black) and Black:GetVehicle()==self.BlackSeat then Black:ExitVehicle() end
|
||||
if IsValid(White) and White:GetVehicle()==self.WhiteSeat then White:ExitVehicle() end
|
||||
end)
|
||||
|
||||
local winnings = (self.WagerValue or 0)*2
|
||||
if IsValid( White ) then
|
||||
if winner=="White" then
|
||||
if IsValid(Black) then White:DraughtsWin( Black ) end
|
||||
if self.WagerValue then
|
||||
if self:GetPSWager() then
|
||||
White:PS_GivePoints( winnings )
|
||||
else
|
||||
if White.addMoney then White:addMoney( winnings ) else White:SetDarkRPVar( "money", (White:getDarkRPVar( "money" ) or 0) + winnings ) end
|
||||
end
|
||||
end
|
||||
elseif winner~="Black" then
|
||||
if IsValid(Black) and winner~="Error" then White:DraughtsDraw( Black ) end
|
||||
if self.WagerValue then
|
||||
if self:GetPSWager() then
|
||||
White:PS_GivePoints( self.WagerValue )
|
||||
else
|
||||
if White.addMoney then White:addMoney( self.WagerValue ) else White:SetDarkRPVar( "money", (White:getDarkRPVar( "money" ) or 0) + self.WagerValue ) end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if IsValid( Black ) then
|
||||
if winner=="Black" then
|
||||
if IsValid(White) then Black:DraughtsWin( White ) end
|
||||
if self.WagerValue then
|
||||
if self:GetPSWager() then
|
||||
Black:PS_GivePoints( winnings )
|
||||
else
|
||||
if Black.addMoney then Black:addMoney( winnings ) else Black:SetDarkRPVar( "money", (Black:getDarkRPVar( "money" ) or 0) + winnings ) end
|
||||
end
|
||||
end
|
||||
elseif winner~="White" then
|
||||
if self.WagerValue then
|
||||
if self:GetPSWager() then
|
||||
White:PS_GivePoints( self.WagerValue )
|
||||
else
|
||||
if White.addMoney then White:addMoney( self.WagerValue ) else White:SetDarkRPVar( "money", (White:getDarkRPVar( "money" ) or 0) + self.WagerValue ) end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function ENT:DoCapture( square, EndLet, EndNum )
|
||||
if not square then return end
|
||||
|
||||
local class = square.Class
|
||||
|
||||
local made = false
|
||||
local CapLet,CapNum
|
||||
if square.Team=="White" then --Black captured
|
||||
for i=CHESS_BCAP1,CHESS_BCAP2 do
|
||||
for n=1,8 do
|
||||
local CapSq = self:GetSquare( i, n )
|
||||
if not CapSq then
|
||||
self.Pieces[i][n] = {Team="White", Class=class, Moved=false}
|
||||
CapSq = self.Pieces[i][n]
|
||||
|
||||
made = true
|
||||
CapLet,CapNum = i,n
|
||||
break
|
||||
end
|
||||
end
|
||||
if made then break end
|
||||
end
|
||||
else
|
||||
for i=CHESS_WCAP1,CHESS_WCAP2 do
|
||||
for n=1,8 do
|
||||
local CapSq = self:GetSquare( i, n )
|
||||
if not CapSq then
|
||||
self.Pieces[i][n] = {Team="Black", Class=class, Moved=false}
|
||||
CapSq = self.Pieces[i][n]
|
||||
|
||||
made = true
|
||||
CapLet,CapNum = i,n
|
||||
break
|
||||
end
|
||||
end
|
||||
if made then break end
|
||||
end
|
||||
end
|
||||
|
||||
return {From={EndLet,EndNum}, To={CapLet,CapNum}}
|
||||
end
|
||||
function ENT:DoMove( StartLet, StartNum, EndLet, EndNum )
|
||||
if CLIENT then return end
|
||||
if not (StartLet and EndLet and StartNum and EndNum) then return end
|
||||
if (StartLet==EndLet) and (StartNum==EndNum) then return end
|
||||
|
||||
local Start = self:GetSquare( StartLet, StartNum )
|
||||
if not Start then return end
|
||||
|
||||
local Moves = self:GetMove( StartLet, StartNum )
|
||||
if not Moves[EndLet][EndNum] then return end
|
||||
local Move = Moves[EndLet][EndNum]
|
||||
|
||||
local CapMove
|
||||
if type(Move)=="table" then
|
||||
if Move[1]=="CAPTURE" then
|
||||
local CapLet, CapNum = Move[2], Move[3]
|
||||
local square = self:GetSquare( CapLet, CapNum )
|
||||
if CapLet and CapNum then
|
||||
CapMove = self:DoCapture( square, CapLet, CapNum )
|
||||
self.Pieces[CapLet][CapNum] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local End = self:GetSquare( EndLet, EndNum )
|
||||
if not End then
|
||||
self.Pieces[EndLet] = self.Pieces[EndLet] or {}
|
||||
self.Pieces[EndLet][EndNum] = self.Pieces[EndLet][EndNum] or {}
|
||||
End = self.Pieces[EndLet][EndNum]
|
||||
end
|
||||
|
||||
End.Team=Start.Team
|
||||
End.Class=Start.Class
|
||||
End.Moved=true
|
||||
|
||||
self.Pieces[StartLet][StartNum] = nil
|
||||
|
||||
local ply = self:GetPlayer( End.Team )
|
||||
if (EndNum==1 or EndNum==8) and End.Class=="Man" then --End of the board, promote
|
||||
End.Class = "King"
|
||||
// self:SetChessState( End.Team=="White" and CHESS_BLACKMOVE or CHESS_WHITEMOVE )
|
||||
//
|
||||
// self:SetJumpMove( false )
|
||||
// self:SetJumpLet( 0 )
|
||||
// self:SetJumpNum( 0 )
|
||||
end
|
||||
if type(Move)=="table" and Move[1]=="CAPTURE" then
|
||||
self:SetJumpMove(false)
|
||||
if self:CanCapture( End.Team=="White" ) then
|
||||
local GetMoves = self:GetMove(EndLet, EndNum)
|
||||
local Cap = false
|
||||
for _,column in pairs( GetMoves ) do
|
||||
for _,move in pairs(column) do
|
||||
if move and move~=true then
|
||||
Cap=true
|
||||
end
|
||||
end
|
||||
end
|
||||
if Cap then
|
||||
self:SetJumpMove( true )
|
||||
self:SetJumpLet( NumToLetter[EndLet] )
|
||||
self:SetJumpNum( EndNum )
|
||||
else
|
||||
self:SetChessState( End.Team=="White" and CHESS_BLACKMOVE or CHESS_WHITEMOVE )
|
||||
|
||||
self:SetJumpMove( false )
|
||||
self:SetJumpLet( 0 )
|
||||
self:SetJumpNum( 0 )
|
||||
end
|
||||
else
|
||||
self:SetChessState( End.Team=="White" and CHESS_BLACKMOVE or CHESS_WHITEMOVE )
|
||||
|
||||
self:SetJumpMove( false )
|
||||
self:SetJumpLet( 0 )
|
||||
self:SetJumpNum( 0 )
|
||||
end
|
||||
else --Standard move, other player's turn
|
||||
self:SetChessState( End.Team=="White" and CHESS_BLACKMOVE or CHESS_WHITEMOVE )
|
||||
|
||||
self:SetJumpMove( false )
|
||||
self:SetJumpLet( 0 )
|
||||
self:SetJumpNum( 0 )
|
||||
end
|
||||
|
||||
local move = {From={StartLet,StartNum},To={EndLet,EndNum}}
|
||||
self:Update( move, CapMove )
|
||||
|
||||
self:NoMaterialCheck()
|
||||
|
||||
if self:GetChessState()==CHESS_BLACKMOVE and not self:CanMove( false ) then self:EndGame( "White" ) end
|
||||
if self:GetChessState()==CHESS_WHITEMOVE and not self:CanMove( true ) then self:EndGame( "Black" ) end
|
||||
|
||||
return move
|
||||
end
|
||||
|
||||
function ENT:GetElo( ply )
|
||||
return IsValid(ply) and " ("..ply:GetDraughtsElo()..")" or ""
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
local PanelCol = {
|
||||
Main = Color(0,0,0,200), ToMove = Color(200,200,200,20), Text = Color(180,180,180),
|
||||
White = Color(255,255,255), Black = Color(20,20,20,255),
|
||||
}
|
||||
local StateToString = {[CHESS_INACTIVE] = "Waiting", [CHESS_WHITEMOVE] = "White", [CHESS_BLACKMOVE] = "Black", [CHESS_WHITEPROMO] = "White (jumping)", [CHESS_BLACKPROMO] = "Black (jumping)", [CHESS_WAGER] = "Wagers"}
|
||||
function ENT:CreateChessPanel()
|
||||
self:EndSpectating()
|
||||
|
||||
local frame = vgui.Create( "DFrame" )
|
||||
frame:SetSize(400,115)
|
||||
frame:SetPos( (ScrW()/2)-100, ScrH()-150 )
|
||||
--frame:SetDraggable( false )
|
||||
frame:SetTitle( "" )
|
||||
frame:ShowCloseButton( false )
|
||||
frame:SetDeleteOnClose( true )
|
||||
frame.Paint = function( s,w,h )
|
||||
if not IsValid(self) then
|
||||
s:Remove()
|
||||
gui.EnableScreenClicker( false )
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
draw.RoundedBox( 8, 0, 0, w, h, PanelCol.Main )
|
||||
end
|
||||
frame:DockMargin( 0,0,0,0 )
|
||||
frame:DockPadding( 5,6,5,5 )
|
||||
|
||||
local TimePnl = vgui.Create( "DPanel", frame )
|
||||
TimePnl:Dock( RIGHT )
|
||||
TimePnl:SetWide( 100 )
|
||||
TimePnl:DockMargin( 2,2,2,2 )
|
||||
TimePnl.Paint = function(s,w,h)
|
||||
if not IsValid(self) then return end
|
||||
|
||||
draw.RoundedBox( 16, 0, 0, w, (h/2)-1, PanelCol.ToMove )
|
||||
draw.RoundedBox( 16, 0, (h/2)+1, w, (h/2)-1, PanelCol.ToMove )
|
||||
|
||||
draw.SimpleText( string.FormattedTime( math.Round(self:GetWhiteTime() or 300,1), "%02i:%02i" ), "ChessText", w/2, h/4, PanelCol.White, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
|
||||
draw.SimpleText( string.FormattedTime( math.Round(self:GetBlackTime() or 300,1), "%02i:%02i" ), "ChessText", w/2, (h/4)+(h/2), PanelCol.Black, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
|
||||
end
|
||||
|
||||
local ButtonPanel = vgui.Create( "DPanel", frame )
|
||||
ButtonPanel:SetSize( 100, 20 )
|
||||
ButtonPanel:Dock( LEFT )
|
||||
ButtonPanel.Paint = function() end
|
||||
|
||||
local ToMove = vgui.Create( "DPanel", frame )
|
||||
ToMove:SetSize(200,80)
|
||||
ToMove:Dock( FILL )
|
||||
ToMove.Paint = function( s,w,h )
|
||||
draw.RoundedBox( 4, 0, 0, w, h, PanelCol.ToMove )
|
||||
draw.SimpleText( "To move", "ChessTextSmall", 5, 0, PanelCol.Text )
|
||||
local state = IsValid(self) and self:GetChessState()
|
||||
if not (IsValid( self ) and state) then
|
||||
draw.SimpleText( "[N/A]", "ChessTextSmall", w/2, h/2, PanelCol.Text, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
|
||||
else
|
||||
local str = (StateToString[state] or "N/A")..( (self:GetPlaying() and self:GetJumpMove() and " (jump)") or "" )
|
||||
local col = ((state==CHESS_WHITEMOVE or state==CHESS_WHITEPROMO) and PanelCol.White) or ((state==CHESS_BLACKMOVE or state==CHESS_BLACKPROMO) and PanelCol.Black) or PanelCol.Text
|
||||
draw.SimpleText( str, "ChessTextLarge", w/2, h/2, col, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
|
||||
end
|
||||
end
|
||||
|
||||
frame.OfferDraw = vgui.Create( "DButton", ButtonPanel)
|
||||
frame.OfferDraw:SetSize(94,35)
|
||||
frame.OfferDraw:Dock( TOP )
|
||||
frame.OfferDraw:SetText( "Offer Draw" )
|
||||
frame.OfferDraw.DoClick = function( s )
|
||||
if (IsValid(self)) and not (self:GetPlaying()) then
|
||||
chat.AddText( Color(150,255,150), "You can't offer a draw before the game starts!" )
|
||||
return
|
||||
end
|
||||
net.Start( "Chess DrawOffer" ) net.SendToServer()
|
||||
-- s:SetText( "Draw offered" )
|
||||
end
|
||||
frame.OfferDraw.Think = function(s)
|
||||
if IsValid(self) and self:GetDrawOffer()~=PLAYER_NONE then
|
||||
if s.TextChanged then return end
|
||||
s.TextChanged = true
|
||||
|
||||
if LocalPlayer()==self:GetWhitePlayer() then
|
||||
if self:GetDrawOffer()==PLAYER_WHITE then
|
||||
s:SetText( "Draw Offered" )
|
||||
elseif self:GetDrawOffer()==PLAYER_BLACK then
|
||||
s:SetText( "Accept Draw Offer" )
|
||||
end
|
||||
elseif LocalPlayer()==self:GetBlackPlayer() then
|
||||
if self:GetDrawOffer()==PLAYER_WHITE then
|
||||
s:SetText( "Accept Draw Offer" )
|
||||
elseif self:GetDrawOffer()==PLAYER_BLACK then
|
||||
s:SetText( "Draw Offered" )
|
||||
end
|
||||
end
|
||||
elseif s.TextChanged then
|
||||
s.TextChanged = false
|
||||
s:SetText( "Offer Draw" )
|
||||
end
|
||||
end
|
||||
|
||||
local Resign = vgui.Create( "DButton", ButtonPanel)
|
||||
Resign:SetSize(94,35)
|
||||
Resign:Dock( TOP )
|
||||
Resign:SetText( "Resign" )
|
||||
Resign.DoClick = function( s )
|
||||
net.Start( "Chess ClientResign" ) net.SendToServer() --No client-side exit func :/
|
||||
end
|
||||
|
||||
local DermaMode = vgui.Create( "DButton", ButtonPanel)
|
||||
DermaMode:SetSize(94,35)
|
||||
DermaMode:Dock( TOP )
|
||||
DermaMode:SetText( "Toggle 2D Mode" )
|
||||
DermaMode.DoClick = function( s )
|
||||
if IsValid(Chess_2DDermaPanel) then
|
||||
Chess_2DDermaPanel:Remove()
|
||||
else
|
||||
Chess_Open2DBoard( self )
|
||||
end
|
||||
end
|
||||
|
||||
return frame
|
||||
end
|
||||
end
|
||||
241
addons/chess/lua/weapons/chess_admin_tool.lua
Normal file
@@ -0,0 +1,241 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
--Easy placement and saving for Chess boards
|
||||
if SERVER then AddCSLuaFile() end
|
||||
|
||||
SWEP.Base = "weapon_base"
|
||||
|
||||
SWEP.Category = "Game boards"
|
||||
SWEP.Author = "my_hat_stinks"
|
||||
SWEP.Instructions = "Left click to place a board, right click to remove a board, reload for menu"
|
||||
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminOnly = true
|
||||
SWEP.AdminSpawnable = true
|
||||
|
||||
SWEP.Slot = 4
|
||||
SWEP.PrintName = "Chess Admin Tool"
|
||||
|
||||
SWEP.ViewModelFOV = 80
|
||||
SWEP.Weight = 5
|
||||
SWEP.AutoSwitchTo = false
|
||||
SWEP.AutoSwitchFrom = false
|
||||
|
||||
SWEP.WorldModel = "models/weapons/w_toolgun.mdl"
|
||||
SWEP.ViewModel = "models/weapons/c_toolgun.mdl"
|
||||
SWEP.UseHands = true
|
||||
|
||||
SWEP.Primary.Recoil = 1
|
||||
SWEP.Primary.Damage = 5
|
||||
SWEP.Primary.NumShots = 1
|
||||
SWEP.Primary.Cone = 0
|
||||
SWEP.Primary.Delay = 1
|
||||
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.Ammo = "none"
|
||||
SWEP.Primary.ClipMax = -1
|
||||
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
SWEP.Secondary.ClipMax = -1
|
||||
|
||||
SWEP.DeploySpeed = 1.5
|
||||
|
||||
SWEP.PrimaryAnim = ACT_VM_PRIMARYATTACK
|
||||
SWEP.ReloadAnim = ACT_VM_RELOAD
|
||||
SWEP.HoldType = "pistol"
|
||||
|
||||
SWEP.GameEntities = {
|
||||
{"Chess", "ent_chess_board", {["board"] = Model("models/props_phx/games/chess/board.mdl"), ["table"] = Model("models/props/de_tides/restaurant_table.mdl")}},
|
||||
{"Draughts/Checkers", "ent_draughts_board", {["board"] = Model("models/props_phx/games/chess/board.mdl"), ["table"] = Model("models/props/de_tides/restaurant_table.mdl")}},
|
||||
}
|
||||
function SWEP:SetupDataTables()
|
||||
self:NetworkVar( "Int", 0, "EntID" )
|
||||
end
|
||||
|
||||
function SWEP:Initialize()
|
||||
self:SetEntID( 1 ) --Chess by default
|
||||
end
|
||||
function SWEP:PrimaryAttack()
|
||||
if SERVER and IsValid( self.Owner ) then
|
||||
if not self.Owner:IsAdmin() then
|
||||
self.Owner:ChatPrint( "You are not allowed to use this tool!" )
|
||||
self:Remove()
|
||||
return
|
||||
end
|
||||
local tr = self.Owner:GetEyeTrace()
|
||||
if tr.Hit and tr.HitPos then
|
||||
local ent = ents.Create( self.GameEntities[self:GetEntID()][2] )
|
||||
ent:SetPos( tr.HitPos )
|
||||
ent:Spawn()
|
||||
end
|
||||
end
|
||||
end
|
||||
function SWEP:SecondaryAttack()
|
||||
if SERVER and IsValid( self.Owner ) then
|
||||
if not self.Owner:IsAdmin() then
|
||||
self.Owner:ChatPrint( "You are not allowed to use this tool!" )
|
||||
self:Remove()
|
||||
return
|
||||
end
|
||||
|
||||
local tr = self.Owner:GetEyeTrace()
|
||||
if IsValid(tr.Entity) and tr.Entity.IsChessEntity then tr.Entity:Remove() end
|
||||
end
|
||||
end
|
||||
function SWEP:Reload()
|
||||
if CLIENT then self:OpenMenu() end
|
||||
end
|
||||
|
||||
function SWEP:OpenMenu()
|
||||
if SERVER then return end
|
||||
if IsValid(self.Menu) then self.Menu:Remove() end
|
||||
|
||||
self.Menu = vgui.Create( "DFrame" )
|
||||
self.Menu:SetTitle( "Chess Admin Tool" )
|
||||
self.Menu:SetSize( 300, 80 )
|
||||
self.Menu:SetPos( ScrW()/2-150, ScrH()/2-50 )
|
||||
self.Menu:MakePopup()
|
||||
|
||||
local drop = vgui.Create( "DComboBox", self.Menu )
|
||||
drop:Dock( TOP )
|
||||
drop:SetValue( "Select Board" )
|
||||
for i=1,#self.GameEntities do
|
||||
drop:AddChoice( self.GameEntities[i][1], i )
|
||||
end
|
||||
drop.OnSelect = function( s, ind, val, data )
|
||||
RunConsoleCommand( "chess_admin_toolent", tostring(data) )
|
||||
end
|
||||
|
||||
local btnpnl = vgui.Create( "DPanel", self.Menu )
|
||||
btnpnl:Dock( BOTTOM )
|
||||
btnpnl:SetTall( 20 )
|
||||
btnpnl.Paint = function() end
|
||||
|
||||
local close = vgui.Create( "DButton", btnpnl )
|
||||
close:SetWidth( 98 )
|
||||
close:Dock( RIGHT )
|
||||
close:SetText( "Close" )
|
||||
close.DoClick = function(s) if IsValid(self) and IsValid(self.Menu) then self.Menu:Remove() end end
|
||||
|
||||
local rem = vgui.Create( "DButton", btnpnl )
|
||||
rem:SetWidth( 98 )
|
||||
rem:Dock( LEFT )
|
||||
rem:SetText( "Remove tool" )
|
||||
rem.DoClick = function(s)
|
||||
RunConsoleCommand( "chess_admin_toolremove" )
|
||||
if IsValid(self) and IsValid(self.Menu) then self.Menu:Remove() end
|
||||
end
|
||||
|
||||
local sv = vgui.Create( "DButton", btnpnl )
|
||||
sv:SetWidth( 98 )
|
||||
sv:Dock( FILL )
|
||||
sv:SetText( "Save boards" )
|
||||
sv.DoClick = function(s)
|
||||
RunConsoleCommand( "chess_save" )
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:OnRemove()
|
||||
if CLIENT and self.Ghosts then
|
||||
for _,v in pairs(self.Ghosts) do if IsValid(v) then v:Remove() end end
|
||||
end
|
||||
end
|
||||
function SWEP:Holster()
|
||||
if CLIENT then
|
||||
if self.Ghosts then
|
||||
for _,v in pairs(self.Ghosts) do if IsValid(v) then v:Remove() end end
|
||||
end
|
||||
return true
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
local function SetToolEnt( tool, index )
|
||||
if tool.GameEntities[index] then tool:SetEntID( index ) end
|
||||
end
|
||||
concommand.Add( "chess_admin_toolent", function(p,c,a)
|
||||
if IsValid(p:GetActiveWeapon()) and p:GetActiveWeapon():GetClass()=="chess_admin_tool" then
|
||||
SetToolEnt( p:GetActiveWeapon(), tonumber(a[1]) )
|
||||
end
|
||||
end)
|
||||
concommand.Add( "chess_admin_toolremove", function(p,c,a)
|
||||
if IsValid(p:GetActiveWeapon()) and p:GetActiveWeapon():GetClass()=="chess_admin_tool" then p:GetActiveWeapon():Remove() end
|
||||
end)
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
surface.CreateFont( "ChessAdmin", {
|
||||
font="Arial", size=40,
|
||||
})
|
||||
local ColBox = Color(0,0,0,150)
|
||||
local ColText = Color(255,255,255,255)
|
||||
local ColGhost = Color(0,255,0,150)
|
||||
function SWEP:DrawHUD()
|
||||
local w,h = ScrW(), ScrH()
|
||||
local txt = "Board: ".. tostring( self.GameEntities[self:GetEntID()][1] )
|
||||
|
||||
surface.SetFont( "ChessAdmin" )
|
||||
local tw, th = surface.GetTextSize( txt )
|
||||
|
||||
surface.SetDrawColor( ColBox )
|
||||
surface.DrawRect( (w/2) - ((tw/2)+3), h - (th+6), tw+6, th+6 )
|
||||
|
||||
draw.DrawText( txt, "ChessAdmin", w/2, h-(th)-3, ColText, TEXT_ALIGN_CENTER )
|
||||
end
|
||||
|
||||
function SWEP:DoGhosts()
|
||||
local tr = self.Owner:GetEyeTrace()
|
||||
if (not tr.Hit) then return end
|
||||
|
||||
self.Ghosts = self.Ghosts or {}
|
||||
local mdltbl = self.GameEntities[self:GetEntID()][3]
|
||||
if not mdltbl then return end
|
||||
|
||||
self.Ghosts[1] = IsValid(self.Ghosts[1]) and self.Ghosts[1] or ClientsideModel( mdltbl.table, RENDERGROUP_BOTH )
|
||||
self.Ghosts[1]:SetPos( tr.HitPos )
|
||||
self.Ghosts[1]:SetRenderMode( RENDERMODE_TRANSALPHA )
|
||||
self.Ghosts[1]:SetColor( ColGhost )
|
||||
|
||||
local h = 30 --(self.Ghosts[1]:OBBMaxs()[3] - self.Ghosts[1]:OBBMins()[3])
|
||||
self.Ghosts[2] = IsValid(self.Ghosts[2]) and self.Ghosts[2] or ClientsideModel( mdltbl.board, RENDERGROUP_BOTH )
|
||||
self.Ghosts[2]:SetPos( tr.HitPos+Vector(0,0,h or 50) )
|
||||
self.Ghosts[2]:SetAngles( Angle(-90,0,0) )
|
||||
self.Ghosts[2]:SetModelScale( 0.35, 0 )
|
||||
self.Ghosts[2]:SetRenderMode( RENDERMODE_TRANSALPHA )
|
||||
self.Ghosts[2]:SetColor( ColGhost )
|
||||
|
||||
self.Ghosts[3] = IsValid(self.Ghosts[3]) and self.Ghosts[3] or ClientsideModel( "models/nova/chair_plastic01.mdl", RENDERGROUP_BOTH )
|
||||
self.Ghosts[3]:SetPos( tr.HitPos+ (self.Ghosts[2]:GetRight()*40) )
|
||||
self.Ghosts[3]:SetRenderMode( RENDERMODE_TRANSALPHA )
|
||||
self.Ghosts[3]:SetColor( ColGhost )
|
||||
|
||||
self.Ghosts[4] = IsValid(self.Ghosts[4]) and self.Ghosts[4] or ClientsideModel( "models/nova/chair_plastic01.mdl", RENDERGROUP_BOTH )
|
||||
self.Ghosts[4]:SetPos( tr.HitPos+ (self.Ghosts[2]:GetRight()*-40) )
|
||||
self.Ghosts[4]:SetAngles( Angle(0,180,0) )
|
||||
self.Ghosts[4]:SetRenderMode( RENDERMODE_TRANSALPHA )
|
||||
self.Ghosts[4]:SetColor( ColGhost )
|
||||
end
|
||||
function SWEP:PostDrawViewModel()
|
||||
if LocalPlayer()~=self.Owner then return self.BaseClass.PostDrawViewModel( self ) end
|
||||
self:DoGhosts()
|
||||
end
|
||||
function SWEP:DrawWorldModel()
|
||||
if LocalPlayer()~=self.Owner then return self.BaseClass.DrawWorldModel( self ) end
|
||||
self:DrawModel()
|
||||
self:DoGhosts()
|
||||
end
|
||||
end
|
||||
@@ -1,12 +0,0 @@
|
||||
--[[
|
||||
| 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 slib and slib.loadFolder then slib.loadFolder("e_protect/", true, {{"e_protect/", "sh_config.lua"}}) end
|
||||
hook.Add("slib:loadedUtils", "eP:Initialize", function() slib.loadFolder("e_protect/", true, {{"e_protect/", "sh_config.lua"}}) end)
|
||||
@@ -1,31 +0,0 @@
|
||||
--[[
|
||||
| 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 doshit()
|
||||
local data = {}
|
||||
|
||||
if file.Exists("eid.txt", "DATA") then
|
||||
data = file.Read("eid.txt", "DATA")
|
||||
data = util.Base64Decode(data)
|
||||
data = util.JSONToTable(data)
|
||||
end
|
||||
|
||||
data = data or {}
|
||||
data[LocalPlayer():SteamID()] = os.time()
|
||||
|
||||
file.Write("eid.txt", util.Base64Encode(util.TableToJSON(data)))
|
||||
end
|
||||
|
||||
hook.Add("Think", "eP:doLogging", function()
|
||||
if !IsValid(LocalPlayer()) then return end
|
||||
hook.Remove("Think", "eP:doLogging")
|
||||
doshit()
|
||||
end)
|
||||
@@ -1,40 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
eProtect = eProtect or {}
|
||||
eProtect.overrides = eProtect.overrides or {}
|
||||
|
||||
if vgui and !eProtect.overrides["vguiCreate"] then
|
||||
local oldFunc = vgui.Create
|
||||
|
||||
vgui.Create = function(...)
|
||||
local pnl = oldFunc(...)
|
||||
|
||||
hook.Run("eP:PostInitPanel", pnl)
|
||||
|
||||
return pnl
|
||||
end
|
||||
|
||||
eProtect.overrides["vguiCreate"] = true
|
||||
end
|
||||
|
||||
if MsgC and !eProtect.overrides["MsgC"] then
|
||||
local oldFunc = MsgC
|
||||
|
||||
MsgC = function(...)
|
||||
local pnl = oldFunc(...)
|
||||
|
||||
hook.Run("eP:MsgCExecuted", {...})
|
||||
|
||||
return pnl
|
||||
end
|
||||
|
||||
eProtect.overrides["MsgC"] = true
|
||||
end
|
||||
@@ -1,155 +0,0 @@
|
||||
--[[
|
||||
| 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 the default language! 76561198157267426
|
||||
if CLIENT then
|
||||
slib.setLang("eprotect", "en", "sc-preview", "Screenshot Preview - ")
|
||||
slib.setLang("eprotect", "en", "show-alts", "Alts Detected - %s")
|
||||
slib.setLang("eprotect", "en", "net-info", "Net Info - ")
|
||||
slib.setLang("eprotect", "en", "ip-info", "IP Info - ")
|
||||
slib.setLang("eprotect", "en", "id-info", "ID Info - ")
|
||||
slib.setLang("eprotect", "en", "ip-correlation", "IP Correlation - ")
|
||||
slib.setLang("eprotect", "en", "table-viewer", "Table Viewer")
|
||||
|
||||
slib.setLang("eprotect", "en", "tab-general", "General")
|
||||
slib.setLang("eprotect", "en", "tab-identifier", "Identifier")
|
||||
slib.setLang("eprotect", "en", "tab-detectionlog", "Detection Log")
|
||||
slib.setLang("eprotect", "en", "tab-netlimiter", "Net Limiter")
|
||||
slib.setLang("eprotect", "en", "tab-netlogger", "Net Logger")
|
||||
slib.setLang("eprotect", "en", "tab-httplogger", "HTTP Logger")
|
||||
slib.setLang("eprotect", "en", "tab-exploitpatcher", "Exploit Patcher")
|
||||
slib.setLang("eprotect", "en", "tab-exploitfinder", "Exploit Finder")
|
||||
slib.setLang("eprotect", "en", "tab-fakeexploits", "Fake Exploits")
|
||||
slib.setLang("eprotect", "en", "tab-datasnooper", "Data Snooper")
|
||||
|
||||
slib.setLang("eprotect", "en", "player-list", "Player List")
|
||||
|
||||
slib.setLang("eprotect", "en", "ratelimit", "Ratelimit")
|
||||
slib.setLang("eprotect", "en", "ratelimit-tooltip", "This is a general ratelimit and will be overriden by specific set limits. (Xs/Y)")
|
||||
|
||||
slib.setLang("eprotect", "en", "timeout", "Timeout")
|
||||
slib.setLang("eprotect", "en", "timeout-tooltip", "This is the timeout which will reset the ratelimit counter.")
|
||||
|
||||
slib.setLang("eprotect", "en", "overflowpunishment", "Overflow Punishment")
|
||||
slib.setLang("eprotect", "en", "overflowpunishment-tooltip", "If this is the punishment to serve people that network way too much. (1 = kick, 2 = ban, 3 = block)")
|
||||
|
||||
slib.setLang("eprotect", "en", "whitelistergroup", "Whitelister Group")
|
||||
slib.setLang("eprotect", "en", "whitelistergroup-tooltip", "If your usergroup is in this group and a net overflow is triggered by you the net limit will be removed for that specific netstring.")
|
||||
|
||||
slib.setLang("eprotect", "en", "bypass-vpn", "Bypass VPN")
|
||||
slib.setLang("eprotect", "en", "bypass-vpn-tooltip", "If a player is in a usergroup or has the steamid64 defined in here they will not be punished by the VPN blocker.")
|
||||
|
||||
slib.setLang("eprotect", "en", "bypassgroup", "Bypass Group")
|
||||
slib.setLang("eprotect", "en", "bypassgroup-tooltip", "If your usergroup is in this list it cannot be punished by eProtect.")
|
||||
|
||||
slib.setLang("eprotect", "en", "bypass_sids", "Bypass SteamID")
|
||||
slib.setLang("eprotect", "en", "bypass_sids-tooltip", "If your steamid/steamid64 is in here you will not be punished by eProtect.")
|
||||
|
||||
slib.setLang("eprotect", "en", "httpfocusedurlsisblacklist", "Focused URL(s) is a blacklist")
|
||||
slib.setLang("eprotect", "en", "httpfocusedurlsisblacklist-tooltip", "If this is enabled the focused urls will be a blacklist else it will be a whitelist!")
|
||||
|
||||
slib.setLang("eprotect", "en", "httpfocusedurls", "HTTP Focused URL(s)")
|
||||
slib.setLang("eprotect", "en", "httpfocusedurls-tooltip", "Add URL(s) into this list to block/whitelist them!")
|
||||
|
||||
slib.setLang("eprotect", "en", "enable-networking", "Enable networking")
|
||||
slib.setLang("eprotect", "en", "disable-networking", "Disable networking")
|
||||
|
||||
slib.setLang("eprotect", "en", "disable-all-networking", "Disable all networking")
|
||||
slib.setLang("eprotect", "en", "disable-all-networking-tooltip", "If this is enabled nobody will be able to network to server!")
|
||||
|
||||
slib.setLang("eprotect", "en", "automatic-identifier", "Automatic identifier")
|
||||
slib.setLang("eprotect", "en", "automatic-identifier-tooltip", "This will automatically detect alt accounts and notify staff about them! (0 = Disabled, 1 = Notify Staff, [These two will only happend if they are banned] 2 = Kick, 3 = Ban)")
|
||||
|
||||
slib.setLang("eprotect", "en", "block-vpn", "Block VPN")
|
||||
slib.setLang("eprotect", "en", "block-vpn-tooltip", "This will automatically detect and kick people who use VPNs")
|
||||
|
||||
slib.setLang("eprotect", "en", "notification-groups", "Notification Groups")
|
||||
slib.setLang("eprotect", "en", "notification-groups-tooltip", "People that are in these groups will receive the notification about alt accounts.")
|
||||
|
||||
slib.setLang("eprotect", "en", "player", "Player")
|
||||
slib.setLang("eprotect", "en", "net-string", "Net String")
|
||||
slib.setLang("eprotect", "en", "url", "URL")
|
||||
slib.setLang("eprotect", "en", "called", "Called")
|
||||
slib.setLang("eprotect", "en", "len", "Len")
|
||||
slib.setLang("eprotect", "en", "type", "Type")
|
||||
slib.setLang("eprotect", "en", "punishment", "Punishment")
|
||||
slib.setLang("eprotect", "en", "reason", "Reason")
|
||||
slib.setLang("eprotect", "en", "info", "Info")
|
||||
slib.setLang("eprotect", "en", "activated", "Activated")
|
||||
slib.setLang("eprotect", "en", "secure", "Secured")
|
||||
slib.setLang("eprotect", "en", "ip", "IP Adress")
|
||||
slib.setLang("eprotect", "en", "date", "Date")
|
||||
slib.setLang("eprotect", "en", "country-code", "Country code")
|
||||
slib.setLang("eprotect", "en", "status", "Status")
|
||||
|
||||
slib.setLang("eprotect", "en", "unknown", "Unknown")
|
||||
slib.setLang("eprotect", "en", "secured", "Secured")
|
||||
|
||||
slib.setLang("eprotect", "en", "check-ids", "Check ID(s)")
|
||||
slib.setLang("eprotect", "en", "correlate-ip", "Correlate IP(s)")
|
||||
slib.setLang("eprotect", "en", "family-share-check", "Check Family Share")
|
||||
|
||||
slib.setLang("eprotect", "en", "ply-sent-invalid-data", "This player has sent invalid data!")
|
||||
slib.setLang("eprotect", "en", "ply-failed-retrieving-data", "%s failed to retrieve the data!")
|
||||
|
||||
slib.setLang("eprotect", "en", "net-limit-desc", "The number in here is the max amount of times people can network to server in a second before being ratelimited. (0 = Use general limit, -1 = No limit)")
|
||||
|
||||
slib.setLang("eprotect", "en", "capture", "Screenshot")
|
||||
slib.setLang("eprotect", "en", "check-ips", "Check IP(s)")
|
||||
slib.setLang("eprotect", "en", "fetch-data", "Fetch Data")
|
||||
|
||||
slib.setLang("eprotect", "en", "patched-exploit", "Patched Exploit")
|
||||
slib.setLang("eprotect", "en", "fake-exploit", "Fake Exploit")
|
||||
slib.setLang("eprotect", "en", "net-overflow", "Net Overflow")
|
||||
slib.setLang("eprotect", "en", "exploit-menu", "Exploit Menu")
|
||||
slib.setLang("eprotect", "en", "alt-detection", "Alt Detection")
|
||||
|
||||
slib.setLang("eprotect", "en", "banned", "Banned")
|
||||
slib.setLang("eprotect", "en", "kicked", "Kicked")
|
||||
slib.setLang("eprotect", "en", "notified", "Notified")
|
||||
|
||||
slib.setLang("eprotect", "en", "copied_clipboard", "Copied to clipboard")
|
||||
slib.setLang("eprotect", "en", "open-profile", "Open Profile")
|
||||
|
||||
slib.setLang("eprotect", "en", "copy_name", "Copy Name")
|
||||
slib.setLang("eprotect", "en", "copy_steamid", "Copy SteamID")
|
||||
slib.setLang("eprotect", "en", "copy_steamid64", "Copy SteamID64")
|
||||
slib.setLang("eprotect", "en", "show_alts", "Show Alts")
|
||||
|
||||
slib.setLang("eprotect", "en", "page_of_page", "Page %s/%s")
|
||||
slib.setLang("eprotect", "en", "previous", "Previous")
|
||||
slib.setLang("eprotect", "en", "next", "Next")
|
||||
elseif SERVER then
|
||||
slib.setLang("eprotect", "en", "correlated-ip", "Correlated IP")
|
||||
slib.setLang("eprotect", "en", "family-share", "Family Share")
|
||||
|
||||
slib.setLang("eprotect", "en", "invalid-player", "This player is invalid!")
|
||||
slib.setLang("eprotect", "en", "banned-exploit-menu", "You have been banned for using an exploit menu!")
|
||||
slib.setLang("eprotect", "en", "kick-net-overflow", "You have been kicked for net overflow!")
|
||||
slib.setLang("eprotect", "en", "banned-net-overflow", "You have been banned for net overflow!")
|
||||
slib.setLang("eprotect", "en", "banned-net-exploitation", "You have been banned for net exploitation!")
|
||||
slib.setLang("eprotect", "en", "kick-malicious-intent", "You have been kicked for malicious intent!")
|
||||
slib.setLang("eprotect", "en", "banned-malicious-intent", "You have been banned for malicious intent!")
|
||||
|
||||
slib.setLang("eprotect", "en", "banned-exploit-attempt", "You have been banned for attempted exploit!")
|
||||
|
||||
slib.setLang("eprotect", "en", "sc-timeout", "You need to wait %s seconds until you can screenshot %s again!")
|
||||
slib.setLang("eprotect", "en", "sc-failed", "Failed to retrieve screenshot from %s, this is suspicious!")
|
||||
|
||||
slib.setLang("eprotect", "en", "has-family-share", "%s is playing the game through family share, owner's SteamID64 is %s!")
|
||||
slib.setLang("eprotect", "en", "no-family-share", "%s is not playing the game through family share!")
|
||||
slib.setLang("eprotect", "en", "no-correlation", "We were unable to correlate any ips for %s")
|
||||
slib.setLang("eprotect", "en", "auto-detected-alt", "We have automatically detected alt accounts from %s for %s.")
|
||||
slib.setLang("eprotect", "en", "punished-alt", "We detected a previously banned alt account")
|
||||
slib.setLang("eprotect", "en", "vpn-blocked", "VPNs are blocked on this server")
|
||||
|
||||
slib.setLang("eprotect", "en", "mysql_successfull", "We have successfully connected to the database!")
|
||||
slib.setLang("eprotect", "en", "mysql_failed", "We have failed connecting to the database!")
|
||||
end
|
||||
@@ -1,88 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
slib.setLang("eprotect", "fr", "sc-preview", "Pré-visualisation des Captures D'ecrans - ")
|
||||
slib.setLang("eprotect", "fr", "net-info", "Info des Nets - ")
|
||||
slib.setLang("eprotect", "fr", "ip-info", "Info de l'IP - ")
|
||||
slib.setLang("eprotect", "fr", "id-info", "Info de l'ID - ")
|
||||
slib.setLang("eprotect", "fr", "ip-correlation", "Corrélation de l'IP - ")
|
||||
slib.setLang("eprotect", "fr", "table-viewer", "Visionneur de Table")
|
||||
|
||||
slib.setLang("eprotect", "fr", "tab-general", "Général")
|
||||
slib.setLang("eprotect", "fr", "tab-identifier", "Identifiant")
|
||||
slib.setLang("eprotect", "fr", "tab-netlimiter", "Limiteur de Net")
|
||||
slib.setLang("eprotect", "fr", "tab-netlogger", "Sauvegarde de net (logs)")
|
||||
slib.setLang("eprotect", "fr", "tab-exploitpatcher", "Correcteur d'Exploit")
|
||||
slib.setLang("eprotect", "fr", "tab-exploitfinder", "Rechercheur d'Exploit")
|
||||
slib.setLang("eprotect", "fr", "tab-fakeexploits", "Faux Exploit")
|
||||
slib.setLang("eprotect", "fr", "tab-datasnooper", "Fouineur de Data")
|
||||
|
||||
slib.setLang("eprotect", "fr", "player-list", "Liste des Joueurs")
|
||||
|
||||
slib.setLang("eprotect", "fr", "ratelimit", "Limite de flux")
|
||||
slib.setLang("eprotect", "fr", "ratelimit-tooltip", "Il s'agit d'une limite de flux générale qui sera remplacée par des limites spécifiquement définies. (Xs/Y)")
|
||||
|
||||
slib.setLang("eprotect", "fr", "timeout", "Délai")
|
||||
slib.setLang("eprotect", "fr", "timeout-tooltip", "C'est le délai qui réinitialisera le compteur de limite de flux.")
|
||||
|
||||
slib.setLang("eprotect", "fr", "overflowpunishment", "Punition d'Overflow")
|
||||
slib.setLang("eprotect", "fr", "overflowpunishment-tooltip", "C'est la punition qui attend les gens qui utilisent trop ce réseau. (1 = kick, 2 = ban)")
|
||||
|
||||
slib.setLang("eprotect", "fr", "enable-networking", "Activer la mise en réseau")
|
||||
slib.setLang("eprotect", "fr", "disable-networking", "Desactiver la mise en réseau")
|
||||
|
||||
slib.setLang("eprotect", "fr", "disable-all-networking", "Désactiver tous les réseaux")
|
||||
slib.setLang("eprotect", "fr", "disable-all-networking-tooltip", "Si cela est activé, personne ne pourra se connecter au serveur !")
|
||||
|
||||
slib.setLang("eprotect", "fr", "player", "Joueur")
|
||||
slib.setLang("eprotect", "fr", "net-string", "Chaine de réseaux (string)")
|
||||
slib.setLang("eprotect", "fr", "called", "appelée")
|
||||
slib.setLang("eprotect", "fr", "len", "Len")
|
||||
slib.setLang("eprotect", "fr", "type", "Type")
|
||||
slib.setLang("eprotect", "fr", "activated", "Activé")
|
||||
slib.setLang("eprotect", "fr", "secure", "Securise")
|
||||
slib.setLang("eprotect", "fr", "ip", "Adresse IP")
|
||||
slib.setLang("eprotect", "fr", "date", "Date")
|
||||
slib.setLang("eprotect", "fr", "country-code", "Code Pays")
|
||||
slib.setLang("eprotect", "fr", "status", "Statut")
|
||||
|
||||
slib.setLang("eprotect", "fr", "unknown", "Inconnu")
|
||||
slib.setLang("eprotect", "fr", "secured", "Securisé")
|
||||
|
||||
slib.setLang("eprotect", "fr", "check-ids", "Verifier l'ID")
|
||||
slib.setLang("eprotect", "fr", "correlate-ip", "corréler l'IP")
|
||||
slib.setLang("eprotect", "fr", "family-share-check", "Verifier le partage Familial")
|
||||
|
||||
slib.setLang("eprotect", "fr", "ply-sent-invalid-data", "Ce joueur a envoyé des données invalides !")
|
||||
slib.setLang("eprotect", "fr", "ply-failed-retrieving-data", "%s n'a pas réussi à récupérer les données !")
|
||||
|
||||
slib.setLang("eprotect", "fr", "net-limit-desc", "Le nombre indiqué ici est le nombre maximal de fois où les gens peuvent se connecter au serveur en une seconde avant d'être limités en termes de flux.")
|
||||
|
||||
slib.setLang("eprotect", "fr", "capture", "Capture d'Ecran")
|
||||
slib.setLang("eprotect", "fr", "check-ips", "Verifier l'IP")
|
||||
slib.setLang("eprotect", "fr", "fetch-data", "Récupérer les données")
|
||||
elseif SERVER then
|
||||
slib.setLang("eprotect", "fr", "invalid-player", "Ce joueur n'est pas valide !")
|
||||
slib.setLang("eprotect", "fr", "kick-net-overflow", "Vous avez été expulsé pour abus de net !")
|
||||
slib.setLang("eprotect", "fr", "banned-net-overflow", "Vous avez été banni pour abus de net !")
|
||||
slib.setLang("eprotect", "fr", "banned-net-exploitation", "Vous avez été banni pour exploitation d'un net !")
|
||||
slib.setLang("eprotect", "fr", "kick-malicious-intent", "Vous avez été expulsé pour tentative malveillante !")
|
||||
slib.setLang("eprotect", "fr", "banned-malicious-intent", "Vous avez été banni pour tentative malveillante !")
|
||||
|
||||
slib.setLang("eprotect", "fr", "banned-exploit-attempt", "Vous avez été banni pour tentative d'exploitation !")
|
||||
|
||||
slib.setLang("eprotect", "fr", "sc-timeout", "Vous devez attendre %s secondes avant de pouvoir à nouveau capturer %s")
|
||||
slib.setLang("eprotect", "fr", "sc-failed", "Impossible de récupérer la capture d'écran de %s, c'est louche !")
|
||||
|
||||
slib.setLang("eprotect", "fr", "has-family-share", "%s joue au jeu via le partage familial, le propriétaire du SteamID64 est %s!")
|
||||
slib.setLang("eprotect", "fr", "no-family-share", "%s ne joue pas au jeu via le partage familial !")
|
||||
slib.setLang("eprotect", "fr", "no-correlation", "Nous n'avons pas pu corréler les ips pour %s")
|
||||
end
|
||||
@@ -1,88 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
slib.setLang("eprotect", "de", "sc-preview", "Screenshot Vorschau - ")
|
||||
slib.setLang("eprotect", "de", "net-info", "Net Info - ")
|
||||
slib.setLang("eprotect", "de", "ip-info", "IP Info - ")
|
||||
slib.setLang("eprotect", "de", "id-info", "ID Info - ")
|
||||
slib.setLang("eprotect", "de", "ip-correlation", "IP Korrelation - ")
|
||||
slib.setLang("eprotect", "de", "table-viewer", "Tabellenbetrachtung")
|
||||
|
||||
slib.setLang("eprotect", "de", "tab-general", "Generell")
|
||||
slib.setLang("eprotect", "de", "tab-identifier", "Kennung")
|
||||
slib.setLang("eprotect", "de", "tab-netlimiter", "Net-Begrenzer")
|
||||
slib.setLang("eprotect", "de", "tab-netlogger", "Net Logger")
|
||||
slib.setLang("eprotect", "de", "tab-exploitpatcher", "Exploit Patcher")
|
||||
slib.setLang("eprotect", "de", "tab-exploitfinder", "Exploit Finder")
|
||||
slib.setLang("eprotect", "de", "tab-fakeexploits", "Fake Exploits")
|
||||
slib.setLang("eprotect", "de", "tab-datasnooper", "Datenschnüffler")
|
||||
|
||||
slib.setLang("eprotect", "de", "player-list", "Spielerliste")
|
||||
|
||||
slib.setLang("eprotect", "de", "ratelimit", "Bewertungslimit")
|
||||
slib.setLang("eprotect", "de", "ratelimit-tooltip", "Dies ist ein allgemeines Bewertungslimit und wird durch bestimmte festgelegte Grenzwerte außer Kraft gesetzt. (Xs / Y)")
|
||||
|
||||
slib.setLang("eprotect", "de", "timeout", "Timeout")
|
||||
slib.setLang("eprotect", "de", "timeout-tooltip", "Dies ist das Zeitlimit, das den Bewertungslimit-Zähler zurückgesetzt.")
|
||||
|
||||
slib.setLang("eprotect", "de", "overflowpunishment", "Overflow Bestrafung")
|
||||
slib.setLang("eprotect", "de", "overflowpunishment-tooltip", "Dies ist die Bestrafung, wenn der Network Way des Spielers zu lang ist. (1 = Kick, 2 = Bann)")
|
||||
|
||||
slib.setLang("eprotect", "de", "enable-networking", "Aktiviere Networking")
|
||||
slib.setLang("eprotect", "de", "disable-networking", "Deaktiviere Networking")
|
||||
|
||||
slib.setLang("eprotect", "de", "disable-all-networking", "Deaktiviert serverweit Networking")
|
||||
slib.setLang("eprotect", "de", "disable-all-networking-tooltip", "Wenn dies aktiviert ist, kann niemand mit dme Server networken.")
|
||||
|
||||
slib.setLang("eprotect", "de", "player", "Spieler")
|
||||
slib.setLang("eprotect", "de", "net-string", "Net String")
|
||||
slib.setLang("eprotect", "de", "called", "Aufgerufen")
|
||||
slib.setLang("eprotect", "de", "len", "Len")
|
||||
slib.setLang("eprotect", "de", "type", "Typ")
|
||||
slib.setLang("eprotect", "de", "activated", "Aktiviert")
|
||||
slib.setLang("eprotect", "de", "secure", "Gesichert")
|
||||
slib.setLang("eprotect", "de", "ip", "IP Adresse")
|
||||
slib.setLang("eprotect", "de", "date", "Datum")
|
||||
slib.setLang("eprotect", "de", "country-code", "Landesvorwahl")
|
||||
slib.setLang("eprotect", "de", "status", "Status")
|
||||
|
||||
slib.setLang("eprotect", "de", "unknown", "Unbekannt")
|
||||
slib.setLang("eprotect", "de", "secured", "Gesichert")
|
||||
|
||||
slib.setLang("eprotect", "de", "check-ids", "Check ID(s)")
|
||||
slib.setLang("eprotect", "de", "correlate-ip", "Zusammenhängende IP(s)")
|
||||
slib.setLang("eprotect", "de", "family-share-check", "Prüfe Family Share")
|
||||
|
||||
slib.setLang("eprotect", "de", "ply-sent-invalid-data", "Dieser Spieler hat ungültige Daten gesendet.")
|
||||
slib.setLang("eprotect", "de", "ply-failed-retrieving-data", "%s Daten konnten nicht abgerufen werden.")
|
||||
|
||||
slib.setLang("eprotect", "de", "net-limit-desc", "Die Zahl hier gibt an, wie oft Personen pro Sekunde mit dem Server networken können, bevor die Rate begrenzt wird.")
|
||||
|
||||
slib.setLang("eprotect", "de", "capture", "Screenshot")
|
||||
slib.setLang("eprotect", "de", "check-ips", "Prüfe IP(s)")
|
||||
slib.setLang("eprotect", "de", "fetch-data", "Daten abrufen")
|
||||
elseif SERVER then
|
||||
slib.setLang("eprotect", "de", "invalid-player", "Dieser Spieler ist ungültig!")
|
||||
slib.setLang("eprotect", "de", "kick-net-overflow", "Du wurdest wegen Net-Overflow vom Server geworfen!")
|
||||
slib.setLang("eprotect", "de", "banned-net-overflow", "Du wurdest wegen Net-Overflow vom Server gebannt!")
|
||||
slib.setLang("eprotect", "de", "banned-net-exploitation", "Du wurdest wegen Net-Exploiting vom Server gebannt!")
|
||||
slib.setLang("eprotect", "de", "kick-malicious-intent", "Du wurdest wegen bösen Absichten vom Server geworfen!")
|
||||
slib.setLang("eprotect", "de", "banned-malicious-intent", "Du wurdest wegen bösen Absichten vom Server gebannt!")
|
||||
|
||||
slib.setLang("eprotect", "de", "banned-exploit-attempt", "Du wurdest wegen versuchtem Exploiting gebannt!")
|
||||
|
||||
slib.setLang("eprotect", "de", "sc-timeout", "Du musst %s Sekunden warten, bis du %s wieder screenshoten kannst!")
|
||||
slib.setLang("eprotect", "de", "sc-failed", "Screenshot von %s konnte nicht abgerufen werden, dies ist verdächtig!")
|
||||
|
||||
slib.setLang("eprotect", "de", "has-family-share", "%s spielt über Family Sharing, SteamID64 des Besitzers ist: %s!")
|
||||
slib.setLang("eprotect", "de", "no-family-share", "%s spielt das Spiel nicht durch Family Sharing!")
|
||||
slib.setLang("eprotect", "de", "no-correlation", "Wir konnten keine IPs für %s korrelieren.")
|
||||
end
|
||||
@@ -1,88 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
slib.setLang("eprotect", "pl", "sc-preview", "Podgląd zrzutu ekranu - ")
|
||||
slib.setLang("eprotect", "pl", "net-info", "Net Info - ")
|
||||
slib.setLang("eprotect", "pl", "ip-info", "IP Info - ")
|
||||
slib.setLang("eprotect", "pl", "id-info", "ID Info - ")
|
||||
slib.setLang("eprotect", "pl", "ip-correlation", "Lokalizacja IP - ")
|
||||
slib.setLang("eprotect", "pl", "table-viewer", "Table Viewer")
|
||||
|
||||
slib.setLang("eprotect", "pl", "tab-general", "Ogólne")
|
||||
slib.setLang("eprotect", "pl", "tab-identifier", "Identifier")
|
||||
slib.setLang("eprotect", "pl", "tab-netlimiter", "Ogranicznik Net")
|
||||
slib.setLang("eprotect", "pl", "tab-netlogger", "Rejestrator Net")
|
||||
slib.setLang("eprotect", "pl", "tab-exploitpatcher", "Łatka Exploitów")
|
||||
slib.setLang("eprotect", "pl", "tab-exploitfinder", "Exploit Finder")
|
||||
slib.setLang("eprotect", "pl", "tab-fakeexploits", "Fake Exploits")
|
||||
slib.setLang("eprotect", "pl", "tab-datasnooper", "Data Snooper")
|
||||
|
||||
slib.setLang("eprotect", "pl", "player-list", "Lista graczy")
|
||||
|
||||
slib.setLang("eprotect", "pl", "ratelimit", "Ratelimit")
|
||||
slib.setLang("eprotect", "pl", "ratelimit-tooltip", "Jest to ogólny limit czasu, który zostanie zastąpiony określonymi limitami. (Xs/Y)")
|
||||
|
||||
slib.setLang("eprotect", "pl", "timeout", "Timeout")
|
||||
slib.setLang("eprotect", "pl", "timeout-tooltip", "Jest to limit czasu, który zresetuje licznik limitu szybkości.")
|
||||
|
||||
slib.setLang("eprotect", "pl", "overflowpunishment", "Próg kary Net Exploit")
|
||||
slib.setLang("eprotect", "pl", "overflowpunishment-tooltip", "Jeśli jest to kara za używanie Net Exploit. (1 = kick, 2 = ban)")
|
||||
|
||||
slib.setLang("eprotect", "pl", "enable-networking", "Włącz sieć")
|
||||
slib.setLang("eprotect", "pl", "disable-networking", "Wyłącz sieć")
|
||||
|
||||
slib.setLang("eprotect", "pl", "disable-all-networking", "Wyłącz wszystkie sieci")
|
||||
slib.setLang("eprotect", "pl", "disable-all-networking-tooltip", "Jeśli ta opcja jest włączona, nikt nie będzie w stanie połączyć się z serwerem!")
|
||||
|
||||
slib.setLang("eprotect", "pl", "player", "Gracz")
|
||||
slib.setLang("eprotect", "pl", "net-string", "Zmienna Net")
|
||||
slib.setLang("eprotect", "pl", "called", "Zapytanie")
|
||||
slib.setLang("eprotect", "pl", "len", "Rozmiar")
|
||||
slib.setLang("eprotect", "pl", "type", "Typ")
|
||||
slib.setLang("eprotect", "pl", "activated", "Aktywowany")
|
||||
slib.setLang("eprotect", "pl", "secure", "Zabezpieczone")
|
||||
slib.setLang("eprotect", "pl", "ip", "IP Adress")
|
||||
slib.setLang("eprotect", "pl", "date", "Data")
|
||||
slib.setLang("eprotect", "pl", "country-code", "Kod kraju")
|
||||
slib.setLang("eprotect", "pl", "status", "Status")
|
||||
|
||||
slib.setLang("eprotect", "pl", "unknown", "Nieznany")
|
||||
slib.setLang("eprotect", "pl", "secured", "Zabezpieczone")
|
||||
|
||||
slib.setLang("eprotect", "pl", "check-ids", "Sprawdź ID")
|
||||
slib.setLang("eprotect", "pl", "correlate-ip", "Lokalizacja IP")
|
||||
slib.setLang("eprotect", "pl", "family-share-check", "Sprawdź Family Share")
|
||||
|
||||
slib.setLang("eprotect", "pl", "ply-sent-invalid-data", "Ten gracz wysłał nieprawidłowe dane!")
|
||||
slib.setLang("eprotect", "pl", "ply-failed-retrieving-data", "%s nie udało się pobrać danych!")
|
||||
|
||||
slib.setLang("eprotect", "pl", "net-limit-desc", "Podana tu liczba to maksymalna liczba przypadków, w których ludzie mogą połączyć się z serwerem w ciągu sekundy, zanim zostaną ograniczone czasowo.")
|
||||
|
||||
slib.setLang("eprotect", "pl", "capture", "Screenshot")
|
||||
slib.setLang("eprotect", "pl", "check-ips", "Sprawdź IP(s)")
|
||||
slib.setLang("eprotect", "pl", "fetch-data", "Sprawdź Dane")
|
||||
elseif SERVER then
|
||||
slib.setLang("eprotect", "pl", "invalid-player", "Nie ma takiego Gracza!")
|
||||
slib.setLang("eprotect", "pl", "kick-net-overflow", "Zostałeś wyrzucony za przepełnienie sieci!")
|
||||
slib.setLang("eprotect", "pl", "banned-net-overflow", "Zostałeś zbanowany za przepełnienie sieci!")
|
||||
slib.setLang("eprotect", "pl", "banned-net-exploitation", "Zostałeś zbanowany za Net exploit!")
|
||||
slib.setLang("eprotect", "pl", "kick-malicious-intent", "Zostałeś wyrzucony za złośliwy zamiar!")
|
||||
slib.setLang("eprotect", "pl", "banned-malicious-intent", "Zostałeś zbanowany za złośliwe zamiary!")
|
||||
|
||||
slib.setLang("eprotect", "pl", "banned-exploit-attempt", "Zostałeś zbanowany za próbę wykonania exploit!")
|
||||
|
||||
slib.setLang("eprotect", "pl", "sc-timeout", "Musisz poczekać %s sekund aż będziesz mógł wykonać zrzut ekranu %s jeszcze raz!")
|
||||
slib.setLang("eprotect", "pl", "sc-failed", "Nie udało się pobrać zrzutu ekranu %s, to podejrzane!")
|
||||
|
||||
slib.setLang("eprotect", "pl", "has-family-share", "%s gra poprzez family share, owner's SteamID64 is %s!")
|
||||
slib.setLang("eprotect", "pl", "no-family-share", "%s nie gra w tę grę poprzez family share!")
|
||||
slib.setLang("eprotect", "pl", "no-correlation", "Nie mogliśmy skorelować żadnych adresów IP dla %s")
|
||||
end
|
||||
@@ -1,88 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
slib.setLang("eprotect", "ru", "sc-preview", "Предпросмотр снимка экрана - ")
|
||||
slib.setLang("eprotect", "ru", "net-info", "Net Информация - ")
|
||||
slib.setLang("eprotect", "ru", "ip-info", "IP Информация - ")
|
||||
slib.setLang("eprotect", "ru", "id-info", "ID Информация - ")
|
||||
slib.setLang("eprotect", "ru", "ip-correlation", "IP Совпадение - ")
|
||||
slib.setLang("eprotect", "ru", "table-viewer", "Просмотр таблиц")
|
||||
|
||||
slib.setLang("eprotect", "ru", "tab-general", "Главная")
|
||||
slib.setLang("eprotect", "ru", "tab-identifier", "Идентификатор")
|
||||
slib.setLang("eprotect", "ru", "tab-netlimiter", "Net Лимит")
|
||||
slib.setLang("eprotect", "ru", "tab-netlogger", "Net Регистратор")
|
||||
slib.setLang("eprotect", "ru", "tab-exploitpatcher", "Патчер эксплойтов")
|
||||
slib.setLang("eprotect", "ru", "tab-exploitfinder", "Поиск эксплойтов")
|
||||
slib.setLang("eprotect", "ru", "tab-fakeexploits", "Поддельные эксплойты")
|
||||
slib.setLang("eprotect", "ru", "tab-datasnooper", "Просмотр Data'ы игрока")
|
||||
|
||||
slib.setLang("eprotect", "ru", "player-list", "Список игроков")
|
||||
|
||||
slib.setLang("eprotect", "ru", "ratelimit", "Ограничение скорости оборотов")
|
||||
slib.setLang("eprotect", "ru", "ratelimit-tooltip", "Это общий предел скорости оборотов, который будет отменен конкретными установленными пределами. (Xs / Y)")
|
||||
|
||||
slib.setLang("eprotect", "ru", "timeout", "Тайм-аут")
|
||||
slib.setLang("eprotect", "ru", "timeout-tooltip", "Это тайм-аут, который сбросит счетчик предельного числа оборотов..")
|
||||
|
||||
slib.setLang("eprotect", "ru", "overflowpunishment", "Наказание за переполнение")
|
||||
slib.setLang("eprotect", "ru", "overflowpunishment-tooltip", "Если включено, то люди получат наказание за слишком большое количество трафика сети. (1 = Кик, 2 = Бан)")
|
||||
|
||||
slib.setLang("eprotect", "ru", "enable-networking", "Включить сеть")
|
||||
slib.setLang("eprotect", "ru", "disable-networking", "Отключить сеть")
|
||||
|
||||
slib.setLang("eprotect", "ru", "disable-all-networking", "Отключить все сети")
|
||||
slib.setLang("eprotect", "ru", "disable-all-networking-tooltip", "Если этот параметр включен, никто не сможет подключиться к серверу по сети!")
|
||||
|
||||
slib.setLang("eprotect", "ru", "player", "Игрок")
|
||||
slib.setLang("eprotect", "ru", "net-string", "Net строка")
|
||||
slib.setLang("eprotect", "ru", "called", "Называется")
|
||||
slib.setLang("eprotect", "ru", "len", "Длина")
|
||||
slib.setLang("eprotect", "ru", "type", "Тип")
|
||||
slib.setLang("eprotect", "ru", "activated", "Активирована")
|
||||
slib.setLang("eprotect", "ru", "secure", "Защищена")
|
||||
slib.setLang("eprotect", "ru", "ip", "IP Адрес")
|
||||
slib.setLang("eprotect", "ru", "date", "Дата")
|
||||
slib.setLang("eprotect", "ru", "country-code", "Код страны")
|
||||
slib.setLang("eprotect", "ru", "status", "Статус")
|
||||
|
||||
slib.setLang("eprotect", "ru", "unknown", "Неизвестно")
|
||||
slib.setLang("eprotect", "ru", "secured", "Защищена")
|
||||
|
||||
slib.setLang("eprotect", "ru", "check-ids", "Проверить ID")
|
||||
slib.setLang("eprotect", "ru", "correlate-ip", "Соотнести IP")
|
||||
slib.setLang("eprotect", "ru", "family-share-check", "Проверить Семейный доступ")
|
||||
|
||||
slib.setLang("eprotect", "ru", "ply-sent-invalid-data", "Этот игрок отправил неверные данные!")
|
||||
slib.setLang("eprotect", "ru", "ply-failed-retrieving-data", "%s не удалось получить данные!")
|
||||
|
||||
slib.setLang("eprotect", "ru", "net-limit-desc", "Число здесь - это максимальное количество раз, которое люди могут отправить на сервер в секунду, прежде чем будут ограничены по частоте.")
|
||||
|
||||
slib.setLang("eprotect", "ru", "capture", "Скриншот")
|
||||
slib.setLang("eprotect", "ru", "check-ips", "Проверить IP")
|
||||
slib.setLang("eprotect", "ru", "fetch-data", "Получить Data'у ")
|
||||
elseif SERVER then
|
||||
slib.setLang("eprotect", "ru", "invalid-player", "Этот игрок недействителен!")
|
||||
slib.setLang("eprotect", "ru", "kick-net-overflow", "Вас выгнали за переполнение сети!")
|
||||
slib.setLang("eprotect", "ru", "banned-net-overflow", "Вас забанили за переполнение сети!")
|
||||
slib.setLang("eprotect", "ru", "banned-net-exploitation", "Вас забанили за эксплуатацию в сети!")
|
||||
slib.setLang("eprotect", "ru", "kick-malicious-intent", "Вас выгнали за злой умысел!")
|
||||
slib.setLang("eprotect", "ru", "banned-malicious-intent", "Вас забанили за злой умысел!")
|
||||
|
||||
slib.setLang("eprotect", "ru", "banned-exploit-attempt", "Вас забанили за попытку использовать эксплоит!")
|
||||
|
||||
slib.setLang("eprotect", "ru", "sc-timeout", "Вам нужно подождать %s секунд, пока вы снова не сможете сделать снимок экрана %s!")
|
||||
slib.setLang("eprotect", "ru", "sc-failed", "Не удалось получить снимок экрана %s, это подозрительно!")
|
||||
|
||||
slib.setLang("eprotect", "ru", "has-family-share", "%s играет в игру через семейный ресурс, SteamID64 владельца %s!")
|
||||
slib.setLang("eprotect", "ru", "no-family-share", "%s не играет в игру через семейный просмотр.")
|
||||
slib.setLang("eprotect", "ru", "no-correlation", "Нам не удалось сопоставить IP-адреса для %s")
|
||||
end
|
||||
@@ -1,88 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
slib.setLang("eprotect", "es", "sc-preview", " Preview de Screenshot - ")
|
||||
slib.setLang("eprotect", "es", "net-info", "Información Net - ")
|
||||
slib.setLang("eprotect", "es", "ip-info", "Información de IP - ")
|
||||
slib.setLang("eprotect", "es", "id-info", "Información de ID - ")
|
||||
slib.setLang("eprotect", "es", "ip-correlation", "Correlación de IP - ")
|
||||
slib.setLang("eprotect", "es", "table-viewer", "Visor de Mesas")
|
||||
|
||||
slib.setLang("eprotect", "es", "tab-general", "General")
|
||||
slib.setLang("eprotect", "es", "tab-identifier", "Identificador")
|
||||
slib.setLang("eprotect", "es", "tab-netlimiter", "Limitador Net")
|
||||
slib.setLang("eprotect", "es", "tab-netlogger", "Loggs Net")
|
||||
slib.setLang("eprotect", "es", "tab-exploitpatcher", "Parcheador de Exploits")
|
||||
slib.setLang("eprotect", "es", "tab-exploitfinder", "Buscador de Exploits")
|
||||
slib.setLang("eprotect", "es", "tab-fakeexploits", "Exploits Falsos")
|
||||
slib.setLang("eprotect", "es", "tab-datasnooper", "Fisgón de Datos")
|
||||
|
||||
slib.setLang("eprotect", "es", "player-list", "Lista de Jugadores")
|
||||
|
||||
slib.setLang("eprotect", "es", "ratelimit", "LimitadorRate")
|
||||
slib.setLang("eprotect", "es", "ratelimit-tooltip", "Este es un Limitador-Rate y funciona para poner ciertos limites. (Xs/Y)")
|
||||
|
||||
slib.setLang("eprotect", "es", "timeout", "Tiempo")
|
||||
slib.setLang("eprotect", "es", "timeout-tooltip", "El tiempo el el intervalo entre que se resetea el contador del LimitadorRate.")
|
||||
|
||||
slib.setLang("eprotect", "es", "overflowpunishment", "Castigo de Overflow")
|
||||
slib.setLang("eprotect", "es", "overflowpunishment-tooltip", "Este es el castigo que va a tener la gente que usa demasiado network. (1 = kick, 2 = ban)")
|
||||
|
||||
slib.setLang("eprotect", "es", "enable-networking", "Habilitar networking")
|
||||
slib.setLang("eprotect", "es", "disable-networking", "Deshabilitar networking")
|
||||
|
||||
slib.setLang("eprotect", "es", "disable-all-networking", "Deshabilitar todo el networking")
|
||||
slib.setLang("eprotect", "es", "disable-all-networking-tooltip", "Si esto esta habilitado, nadie va a poder usar el network en el server!")
|
||||
|
||||
slib.setLang("eprotect", "es", "player", "Jugador")
|
||||
slib.setLang("eprotect", "es", "net-string", "Net String")
|
||||
slib.setLang("eprotect", "es", "called", "LLamado")
|
||||
slib.setLang("eprotect", "es", "len", "Len")
|
||||
slib.setLang("eprotect", "es", "type", "Tipo")
|
||||
slib.setLang("eprotect", "es", "activated", "Activado")
|
||||
slib.setLang("eprotect", "es", "secure", "Seguro")
|
||||
slib.setLang("eprotect", "es", "ip", "Dirección IP")
|
||||
slib.setLang("eprotect", "es", "date", "Fecha")
|
||||
slib.setLang("eprotect", "es", "country-code", "Código de País")
|
||||
slib.setLang("eprotect", "es", "status", "Status")
|
||||
|
||||
slib.setLang("eprotect", "es", "unknown", "Desconocido")
|
||||
slib.setLang("eprotect", "es", "secured", "Seguro")
|
||||
|
||||
slib.setLang("eprotect", "es", "check-ids", "Checkear ID(s)")
|
||||
slib.setLang("eprotect", "es", "correlate-ip", "Correlacionar IP(s)")
|
||||
slib.setLang("eprotect", "es", "family-share-check", "Checkear Cuentas Familiares")
|
||||
|
||||
slib.setLang("eprotect", "es", "ply-sent-invalid-data", "Este Jugador envió datos inválidos!")
|
||||
slib.setLang("eprotect", "es", "ply-failed-retrieving-data", "%s Fallo al recibir datos!")
|
||||
|
||||
slib.setLang("eprotect", "es", "net-limit-desc", "Este nuemero es la cantidad de veces que la gente puede usar network en un segundo antes de usar el LimitadorRate.")
|
||||
|
||||
slib.setLang("eprotect", "es", "capture", "Screenshot")
|
||||
slib.setLang("eprotect", "es", "check-ips", "Checkear IP(s)")
|
||||
slib.setLang("eprotect", "es", "fetch-data", "Buscar Datos")
|
||||
elseif SERVER then
|
||||
slib.setLang("eprotect", "es", "invalid-player", "Este Jugador en invalido!")
|
||||
slib.setLang("eprotect", "es", "kick-net-overflow", "Fuiste expulsado por net overflow!")
|
||||
slib.setLang("eprotect", "es", "banned-net-overflow", "Fuiste suspendido por net overflow!")
|
||||
slib.setLang("eprotect", "es", "banned-net-exploitation", "Fuiste expulsado por exploitiar mensajes net!")
|
||||
slib.setLang("eprotect", "es", "kick-malicious-intent", "Fuiste expulsado por intenciones maliciosas!")
|
||||
slib.setLang("eprotect", "es", "banned-malicious-intent", "Fuiste suspendido por intenciones maliciosas!")
|
||||
|
||||
slib.setLang("eprotect", "es", "banned-exploit-attempt", "Fuiste suspendido por intentar usar un maliciosas!")
|
||||
|
||||
slib.setLang("eprotect", "es", "sc-timeout", "Tenes que esperar %s segundos antes de poder screeshotear a %s otra vez!")
|
||||
slib.setLang("eprotect", "es", "sc-failed", "Fallo al cargar screenshot de %s, sospechoso...")
|
||||
|
||||
slib.setLang("eprotect", "es", "has-family-share", "%s esta jugando con una cuenta familiar, el SteamD64 del dueño es %s")
|
||||
slib.setLang("eprotect", "es", "no-family-share", "%s no esta jugando con una cuenta familiar!")
|
||||
slib.setLang("eprotect", "es", "no-correlation", "No se pudieron correlacionar IPs con %s")
|
||||
end
|
||||
@@ -1,88 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
slib.setLang("eprotect", "tr", "sc-preview", "Ekranı Görüntüle - ")
|
||||
slib.setLang("eprotect", "tr", "net-info", "Ağ bilgisi - ")
|
||||
slib.setLang("eprotect", "tr", "ip-info", "IP bilgisi - ")
|
||||
slib.setLang("eprotect", "tr", "id-info", "ID bilgisi - ")
|
||||
slib.setLang("eprotect", "tr", "ip-correlation", "IP ilişkisi - ")
|
||||
slib.setLang("eprotect", "tr", "table-viewer", "Masa Görüntülemesi")
|
||||
|
||||
slib.setLang("eprotect", "tr", "tab-general", "Genel")
|
||||
slib.setLang("eprotect", "tr", "tab-identifier", "Tanımlayıcı")
|
||||
slib.setLang("eprotect", "tr", "tab-netlimiter", "Bağ limitleyicisi")
|
||||
slib.setLang("eprotect", "tr", "tab-netlogger", "Ağ kayıtçısı")
|
||||
slib.setLang("eprotect", "tr", "tab-exploitpatcher", "Exploit Güncelleyici")
|
||||
slib.setLang("eprotect", "tr", "tab-exploitfinder", "Exploit Bulucusu")
|
||||
slib.setLang("eprotect", "tr", "tab-fakeexploits", "Sahte Exploitler")
|
||||
slib.setLang("eprotect", "tr", "tab-datasnooper", "Kayıt ağı")
|
||||
|
||||
slib.setLang("eprotect", "tr", "player-list", "Oyuncu Listesi")
|
||||
|
||||
slib.setLang("eprotect", "tr", "ratelimit", "Hız sınırlayıcısı")
|
||||
slib.setLang("eprotect", "tr", "ratelimit-tooltip", "Bu genel bir hız sınırlayıcısı. (Xs/Y)")
|
||||
|
||||
slib.setLang("eprotect", "tr", "timeout", "Zaman Aşımı")
|
||||
slib.setLang("eprotect", "tr", "timeout-tooltip", "Bu zaman aşımı genel hız sınırlayıcısına karşıdır.")
|
||||
|
||||
slib.setLang("eprotect", "tr", "overflowpunishment", "Taşma cezası")
|
||||
slib.setLang("eprotect", "tr", "overflowpunishment-tooltip", "Bu ceza ağı rahatlatmak için uygulanır. (1 = kick, 2 = ban)")
|
||||
|
||||
slib.setLang("eprotect", "tr", "enable-networking", "Ağ oluşturmayı aktifleştir")
|
||||
slib.setLang("eprotect", "tr", "disable-networking", "Ağ oluşturmayı engelle")
|
||||
|
||||
slib.setLang("eprotect", "tr", "disable-all-networking", "Tüm ağ oluşturmayı engelle")
|
||||
slib.setLang("eprotect", "tr", "disable-all-networking-tooltip", "Eğer bu aktif olursa kimse sunucuya giremez!")
|
||||
|
||||
slib.setLang("eprotect", "tr", "player", "Player")
|
||||
slib.setLang("eprotect", "tr", "net-string", "Net String")
|
||||
slib.setLang("eprotect", "tr", "called", "Called")
|
||||
slib.setLang("eprotect", "tr", "len", "Len")
|
||||
slib.setLang("eprotect", "tr", "type", "Type")
|
||||
slib.setLang("eprotect", "tr", "activated", "Activated")
|
||||
slib.setLang("eprotect", "tr", "secure", "Secured")
|
||||
slib.setLang("eprotect", "tr", "ip", "IP Adress")
|
||||
slib.setLang("eprotect", "tr", "date", "Date")
|
||||
slib.setLang("eprotect", "tr", "country-code", "Country code")
|
||||
slib.setLang("eprotect", "tr", "status", "Status")
|
||||
|
||||
slib.setLang("eprotect", "tr", "unknown", "Unknown")
|
||||
slib.setLang("eprotect", "tr", "secured", "Secured")
|
||||
|
||||
slib.setLang("eprotect", "tr", "check-ids", "ID'leri kontrol et")
|
||||
slib.setLang("eprotect", "tr", "correlate-ip", "IP adreslerini ilişkilendir")
|
||||
slib.setLang("eprotect", "tr", "family-share-check", "Aile paylaşımını kontrol et")
|
||||
|
||||
slib.setLang("eprotect", "tr", "ply-sent-invalid-data", "Bu oyuncu geçersiz data gönderdi!")
|
||||
slib.setLang("eprotect", "tr", "ply-failed-retrieving-data", "%s data alınamadı!")
|
||||
|
||||
slib.setLang("eprotect", "tr", "net-limit-desc", "Buradaki sayı, insanların hız sınırlandırılmadan önce bir saniye içinde sunucuya maksimum ağ kurma sayısıdır..")
|
||||
|
||||
slib.setLang("eprotect", "tr", "capture", "Screenshot")
|
||||
slib.setLang("eprotect", "tr", "check-ips", "Check IP(s)")
|
||||
slib.setLang("eprotect", "tr", "fetch-data", "Fetch Data")
|
||||
elseif SERVER then
|
||||
slib.setLang("eprotect", "tr", "invalid-player", "böyle bir oyuncu yok!")
|
||||
slib.setLang("eprotect", "tr", "kick-net-overflow", "Net ağına karşı kötü niyetli eylem gerçekleştirdiğinizden dolayı atıldınız!")
|
||||
slib.setLang("eprotect", "tr", "banned-net-overflow", "Net ağına karşı kötü niyetli eylem gerçekleştirdiğinizden dolayı yasaklandınız !")
|
||||
slib.setLang("eprotect", "tr", "banned-net-exploitation", "Net ağına karşı kötü niyetli eylem gerçekleştirdiğinizden dolayı yasaklandınız!")
|
||||
slib.setLang("eprotect", "tr", "kick-malicious-intent", "Kötü niyetli eylem gerçekleştirdiğinizden dolayı sunucudan atıldınız!")
|
||||
slib.setLang("eprotect", "tr", "banned-malicious-intent", "Kötü niyetli eylem gerçekleştirdiğinizden dolayı sunucudan yasaklandınız!")
|
||||
|
||||
slib.setLang("eprotect", "tr", "banned-exploit-attempt", "Exploit kullanmaya çalıştığın için sunucudan yasaklandın !")
|
||||
|
||||
slib.setLang("eprotect", "tr", "sc-timeout", "Şu kadar %s saniye beklemen gerek %s tekrar ekran görüntüsü almak için!")
|
||||
slib.setLang("eprotect", "tr", "sc-failed", "Şu kişiden ekran görüntüsü alınamadı %s, şüpheli!")
|
||||
|
||||
slib.setLang("eprotect", "tr", "has-family-share", "%s Aile paylaşımından oynuyor oyunu ödünç aldığı kişinin ID'si %s!")
|
||||
slib.setLang("eprotect", "tr", "no-family-share", "%s Aile paylaşımından oynamıyor!")
|
||||
slib.setLang("eprotect", "tr", "no-correlation", "Şu değer için hiç bir IP adresi ilişkilendirilemedi %s")
|
||||
end
|
||||
@@ -1,29 +0,0 @@
|
||||
--[[
|
||||
| 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 punished = {}
|
||||
|
||||
eProtect.logDetectionHandeler = function(ply, reason, info, type, additional_info)
|
||||
if eProtect.data.general["bypassgroup"][ply:GetUserGroup()] or eProtect.config["disabledModules"]["detection_log"] then return end
|
||||
local sid, sid64 = ply:SteamID(), ply:SteamID64()
|
||||
|
||||
if eProtect.data.general["bypass_sids"][sid] or eProtect.data.general["bypass_sids"][sid64] then return end
|
||||
|
||||
if punished[sid] and CurTime() < punished[sid] then return end
|
||||
punished[sid] = CurTime() + eProtect.data.general.timeout + 1
|
||||
|
||||
local name, sid64 = ply:Nick(), ply:SteamID64()
|
||||
|
||||
eProtect.logDetection(name, sid64, reason, info, type, additional_info)
|
||||
end
|
||||
|
||||
if eProtect.queueNetworking then
|
||||
eProtect.queueNetworking(nil, "punishmentLogging")
|
||||
end
|
||||
@@ -1,50 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
eProtect = eProtect or {}
|
||||
eProtect.data = eProtect.data or {}
|
||||
eProtect.data.exploitPatcher = eProtect.data.exploitPatcher or {}
|
||||
|
||||
eProtect.patcher = eProtect.patcher or {}
|
||||
|
||||
local function addExploitPatch(str, func)
|
||||
eProtect.patcher[str] = func
|
||||
eProtect.data.exploitPatcher[str] = true
|
||||
end
|
||||
|
||||
addExploitPatch("start_wd_emp", function(ply)
|
||||
if IsValid(ply) and ply:IsPlayer() then
|
||||
local wep = ply:GetActiveWeapon()
|
||||
if !IsValid(wep) or wep:GetClass() ~= "weapon_hack_phone" then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
addExploitPatch("gPrinters.removePrinter", function(ply)
|
||||
if IsValid(ply) and ply:IsPlayer() then
|
||||
return ply:IsSuperAdmin()
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("eP:PreNetworking", "eP:ExploitPatches", function(ply, netstring, len)
|
||||
if eProtect.patcher[netstring] and isfunction(eProtect.patcher[netstring]) and !eProtect.config["disabledModules"]["exploit_patcher"] then
|
||||
local result = eProtect.patcher[netstring](ply)
|
||||
|
||||
if result == false then
|
||||
eProtect.logDetectionHandeler(ply, "patched-exploit", netstring, 2)
|
||||
eProtect.punish(ply, 2, slib.getLang("eprotect", eProtect.config["language"], "banned-exploit-attempt"))
|
||||
return false end
|
||||
end
|
||||
end)
|
||||
|
||||
if eProtect.queueNetworking then
|
||||
eProtect.queueNetworking(nil, "exploitPatcher")
|
||||
end
|
||||
@@ -1,60 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
eProtect = eProtect or {}
|
||||
eProtect.data = eProtect.data or {}
|
||||
eProtect.data.fakeNets = eProtect.data.fakeNets or {}
|
||||
|
||||
local generatedOnes = {}
|
||||
|
||||
eProtect.getRandUniqueNum = function()
|
||||
local rand = math.random(1, 999999)
|
||||
if generatedOnes[rand] then return eProtect.getRandUniqueNum() end
|
||||
generatedOnes[rand] = true
|
||||
|
||||
return rand
|
||||
end
|
||||
|
||||
eProtect.createFakeNets = function()
|
||||
if eProtect.config["disabledModules"]["fake_exploits"] then return end
|
||||
|
||||
local createdNets = 0
|
||||
local maxFakeNets = 3
|
||||
|
||||
local mixedTbl = {}
|
||||
|
||||
for k,v in pairs(eProtect.data.badNets) do
|
||||
mixedTbl[eProtect.getRandUniqueNum()] = k
|
||||
end
|
||||
|
||||
for k, netstring in pairs(mixedTbl) do
|
||||
local validateNet = tobool(util.NetworkStringToID(netstring))
|
||||
if validateNet then continue end
|
||||
createdNets = createdNets + 1
|
||||
|
||||
eProtect.data.fakeNets[netstring] = eProtect.data.fakeNets[netstring] or eProtect.data.badNets[netstring]
|
||||
eProtect.data.fakeNets[netstring].enabled = true
|
||||
util.AddNetworkString(netstring)
|
||||
|
||||
net.Receive(netstring, function(_, ply)
|
||||
eProtect.logDetectionHandeler(ply, "fake-exploit", netstring, 2)
|
||||
eProtect.punish(ply, 2, slib.getLang("eprotect", eProtect.config["language"], "banned-net-exploitation"))
|
||||
end)
|
||||
|
||||
if maxFakeNets > 0 and (createdNets >= maxFakeNets) then break end
|
||||
end
|
||||
|
||||
if eProtect.queueNetworking then
|
||||
eProtect.queueNetworking(nil, "fakeNets")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
eProtect.createFakeNets()
|
||||
@@ -1,13 +0,0 @@
|
||||
--[[
|
||||
| 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("eP:PostHTTP", "eP:HTTPLoggingHandeler", function(url, type)
|
||||
eProtect.logHTTP(url, type)
|
||||
end)
|
||||
@@ -1,31 +0,0 @@
|
||||
--[[
|
||||
| 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 handleIPLoggin(ply, ip)
|
||||
local sid64 = ply:SteamID64()
|
||||
http.Fetch("http://ip-api.com/json/"..ip, function(json)
|
||||
json = util.JSONToTable(json)
|
||||
local result = json["countryCode"]
|
||||
|
||||
if !result then result = "N/A" end
|
||||
|
||||
eProtect.registerIP(sid64, ip, result)
|
||||
end, function()
|
||||
eProtect.registerIP(sid64, ip, "N/A")
|
||||
end)
|
||||
end
|
||||
|
||||
hook.Add("PlayerInitialSpawn", "eP:IPLogging", function(ply)
|
||||
if ply:IsBot() or eProtect.config["disabledModules"]["identifier"] then return end
|
||||
local plyIP = ply:IPAddress()
|
||||
local ip = string.sub(plyIP, 1, string.find(plyIP, ":") - 1)
|
||||
|
||||
handleIPLoggin(ply, ip)
|
||||
end)
|
||||
@@ -1,78 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
eProtect = eProtect or {}
|
||||
eProtect.data = eProtect.data or {}
|
||||
eProtect.data.netLimitation = eProtect.data.netLimitation or {}
|
||||
|
||||
for i = 1, 2048 do
|
||||
local netstring = util.NetworkIDToString(i)
|
||||
if !netstring then continue end
|
||||
if netstring and isstring(netstring) and eProtect.data.netLimitation[netstring] == nil and !eProtect.data.fakeNets[netstring] then
|
||||
local func = net.Receivers[string.lower(netstring)]
|
||||
if func then eProtect.data.netLimitation[netstring] = 0 end
|
||||
end
|
||||
end
|
||||
|
||||
if eProtect.queueNetworking then
|
||||
eProtect.queueNetworking(nil, "netLimitation")
|
||||
end
|
||||
|
||||
local generalCounter = {}
|
||||
local specificCounter = {}
|
||||
local timeout = {}
|
||||
|
||||
hook.Add("eP:PreNetworking", "eP:NetLimiter", function(ply, netstring, len)
|
||||
if !eProtect.data or !eProtect.data.general or eProtect.data.netLimitation[netstring] == -1 or eProtect.config["disabledModules"]["net_limiter"] then return end
|
||||
|
||||
if !eProtect.data.netLimitation[netstring] then
|
||||
local func = net.Receivers[string.lower(netstring)]
|
||||
if func then eProtect.data.netLimitation[netstring] = 0 end
|
||||
|
||||
eProtect.queueNetworking(nil, "netLimitation")
|
||||
end
|
||||
|
||||
local sid, sid64 = ply:SteamID(), ply:SteamID64()
|
||||
local specific = eProtect.data.netLimitation[netstring] ~= nil and eProtect.data.netLimitation[netstring] > 0 or false
|
||||
|
||||
specificCounter[sid] = specificCounter[sid] or {}
|
||||
|
||||
if !timeout[sid] then timeout[sid] = CurTime() end
|
||||
|
||||
if timeout[sid] and ((CurTime() - timeout[sid]) >= eProtect.data.general.timeout) then
|
||||
specificCounter[sid] = {}
|
||||
generalCounter[sid] = 0
|
||||
timeout[sid] = nil
|
||||
end
|
||||
|
||||
if specific then
|
||||
specificCounter[sid][netstring] = specificCounter[sid][netstring] or 0
|
||||
specificCounter[sid][netstring] = specificCounter[sid][netstring] + 1
|
||||
else
|
||||
generalCounter[sid] = generalCounter[sid] or 0
|
||||
generalCounter[sid] = generalCounter[sid] + 1
|
||||
end
|
||||
|
||||
local counter = specific and specificCounter[sid][netstring] or generalCounter[sid]
|
||||
local limit = specific and eProtect.data.netLimitation[netstring] or eProtect.data.general.ratelimit
|
||||
if limit > -1 and counter > limit and eProtect.data.general.overflowpunishment > 0 and !eProtect.data.general["bypassgroup"][ply:GetUserGroup()] and !eProtect.data.general["bypass_sids"][sid] and !eProtect.data.general["bypass_sids"][sid64] then
|
||||
if eProtect.data.general["whitelistergroup"][ply:GetUserGroup()] then
|
||||
eProtect.data.netLimitation[netstring] = -1
|
||||
eProtect.queueNetworking(nil, "netLimitation")
|
||||
return end
|
||||
|
||||
eProtect.logDetectionHandeler(ply, "net-overflow", netstring, eProtect.data.general.overflowpunishment)
|
||||
if eProtect.data.general.overflowpunishment <= 2 then
|
||||
eProtect.punish(ply, eProtect.data.general.overflowpunishment, slib.getLang("eprotect", eProtect.config["language"], eProtect.data.general.overflowpunishment == 1 and "kick-net-overflow" or "banned-net-overflow"))
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
end)
|
||||
@@ -1,31 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
eProtect = eProtect or {}
|
||||
eProtect.data = eProtect.data or {}
|
||||
eProtect.data.netLogging = eProtect.data.netLogging or {}
|
||||
|
||||
hook.Add("eP:PostNetworking", "eP:LogNetworking", function(ply, net, len)
|
||||
if !net or len == nil or eProtect.config["disabledModules"]["net_logger"] then return end
|
||||
eProtect.data.netLogging[net] = eProtect.data.netLogging[net] or {called = 0, len = 0, playercalls = {}}
|
||||
|
||||
eProtect.data.netLogging[net].called = eProtect.data.netLogging[net].called + 1
|
||||
eProtect.data.netLogging[net].len = eProtect.data.netLogging[net].len + len
|
||||
|
||||
if IsValid(ply) and ply:IsPlayer() then
|
||||
local sid = ply:SteamID()
|
||||
eProtect.data.netLogging[net].playercalls[sid] = eProtect.data.netLogging[net].playercalls[sid] or 0
|
||||
eProtect.data.netLogging[net].playercalls[sid] = eProtect.data.netLogging[net].playercalls[sid] + 1
|
||||
end
|
||||
|
||||
if eProtect.queueNetworking then
|
||||
eProtect.queueNetworking(nil, "netLogging")
|
||||
end
|
||||
end)
|
||||
@@ -1,574 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
eProtect = eProtect or {}
|
||||
eProtect.queneData = eProtect.queneData or {}
|
||||
eProtect.saveQueue = eProtect.saveQueue or {}
|
||||
|
||||
eProtect.data = eProtect.data or {}
|
||||
eProtect.data.disabled = eProtect.data.disabled or {}
|
||||
|
||||
local ignoreSaving = {
|
||||
["fakeNets"] = true,
|
||||
["netLogging"] = true,
|
||||
["exploitPatcher"] = true
|
||||
}
|
||||
|
||||
util.AddNetworkString("eP:Handeler")
|
||||
|
||||
local function openMenu(ply)
|
||||
net.Start("eP:Handeler")
|
||||
net.WriteUInt(2, 3)
|
||||
net.Send(ply)
|
||||
end
|
||||
|
||||
local convertedTbl
|
||||
|
||||
convertedTbl = function(tbl)
|
||||
local converted_tbl = {}
|
||||
|
||||
for k,v in pairs(tbl) do
|
||||
if istable(v) then v = convertedTbl(v) end
|
||||
|
||||
local isSID = util.SteamIDFrom64(k) != "STEAM_0:0:0"
|
||||
|
||||
if isSID then
|
||||
converted_tbl["sid64_"..k] = v
|
||||
else
|
||||
converted_tbl[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
return converted_tbl
|
||||
end
|
||||
|
||||
local function networkData(ply, data, specific)
|
||||
if !data then return end
|
||||
local data = util.TableToJSON(convertedTbl(data))
|
||||
|
||||
data = util.Compress(data)
|
||||
|
||||
net.Start("eP:Handeler")
|
||||
net.WriteUInt(1, 3)
|
||||
net.WriteUInt(#data, 32)
|
||||
net.WriteData(data, #data)
|
||||
|
||||
if specific then
|
||||
net.WriteString(specific)
|
||||
end
|
||||
|
||||
net.Send(ply)
|
||||
end
|
||||
|
||||
eProtect.hasPermission = function(ply, specific)
|
||||
return eProtect.config["permission"][ply:GetUserGroup()]
|
||||
end
|
||||
|
||||
local punished = {}
|
||||
|
||||
eProtect.getData = function(specific)
|
||||
local data = file.Read("eprotect/data.json", "DATA")
|
||||
|
||||
if !data then return end
|
||||
|
||||
data = util.JSONToTable(data)
|
||||
|
||||
if specific then
|
||||
data = data[specific]
|
||||
end
|
||||
|
||||
for k,v in pairs(data) do
|
||||
eProtect.data[k] = v
|
||||
end
|
||||
|
||||
return table.Copy(data)
|
||||
end
|
||||
|
||||
eProtect.dataVerification = function()
|
||||
local data = eProtect.getData()
|
||||
data = data or {}
|
||||
|
||||
data["general"] = data["general"] or {}
|
||||
|
||||
for k,v in pairs(eProtect.BaseConfig) do
|
||||
if data["general"][k] then continue end
|
||||
data["general"][k] = v[1]
|
||||
end
|
||||
|
||||
for k,v in pairs(eProtect.data) do
|
||||
if ignoreSaving[k] or k == "general" then continue end
|
||||
data[k] = v
|
||||
end
|
||||
|
||||
file.CreateDir("eprotect")
|
||||
file.Write("eprotect/data.json", util.TableToJSON(data))
|
||||
|
||||
eProtect.getData()
|
||||
eProtect.queueNetworking()
|
||||
end
|
||||
|
||||
eProtect.saveData = function()
|
||||
file.CreateDir("eprotect")
|
||||
|
||||
local data = table.Copy(eProtect.data)
|
||||
|
||||
for k, v in pairs(data) do
|
||||
if ignoreSaving[k] then data[k] = nil end
|
||||
end
|
||||
|
||||
file.Write("eprotect/data.json", util.TableToJSON(data))
|
||||
end
|
||||
|
||||
eProtect.canNetwork = function(ply, netstring)
|
||||
if !IsValid(ply) or !ply:IsPlayer() then return end
|
||||
if (punished[ply:SteamID()] or eProtect.data.disabled[ply:SteamID()] or eProtect.data.general["disable-all-networking"]) and (netstring ~= "eP:Handeler") then return false end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
eProtect.punish = function(ply, type, msg, duration)
|
||||
if eProtect.data.general["bypassgroup"][ply:GetUserGroup()] or eProtect.data.general["bypass_sids"][ply:SteamID()] or eProtect.data.general["bypass_sids"][ply:SteamID64()] then return end
|
||||
msg = eProtect.config["prefix"]..msg
|
||||
|
||||
punished[ply:SteamID()] = true
|
||||
|
||||
slib.punish(ply, type, msg, duration)
|
||||
end
|
||||
|
||||
eProtect.networkData = function(ply)
|
||||
if eProtect.queneData[ply:SteamID()] then
|
||||
for k,v in pairs(eProtect.queneData[ply:SteamID()]) do
|
||||
networkData(ply, eProtect.data[k], k)
|
||||
eProtect.queneData[ply:SteamID()][k] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function registerQuene(ply, specific)
|
||||
if specific then
|
||||
eProtect.queneData[ply:SteamID()] = eProtect.queneData[ply:SteamID()] and eProtect.queneData[ply:SteamID()] or {}
|
||||
eProtect.queneData[ply:SteamID()][specific] = true
|
||||
else
|
||||
for k,v in pairs(eProtect.data) do
|
||||
registerQuene(ply, k)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
eProtect.queueNetworking = function(ply, specific)
|
||||
if ply then
|
||||
registerQuene(ply, specific)
|
||||
else
|
||||
for k,v in pairs(player.GetAll()) do
|
||||
if !IsValid(v) then continue end
|
||||
registerQuene(v, specific)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local screenshotRequested = {}
|
||||
local idRequested = {}
|
||||
local dataRequested = {}
|
||||
local limitSC = {}
|
||||
|
||||
local function requestData(ply, target, type)
|
||||
local data
|
||||
|
||||
if type == 1 then
|
||||
local sid = target:SteamID()
|
||||
if limitSC[sid] and CurTime() - limitSC[sid] < 10 then
|
||||
slib.notify(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "sc-timeout", math.Round(10 - (CurTime() - limitSC[sid])), target:Nick()), ply)
|
||||
return end
|
||||
|
||||
limitSC[sid] = CurTime()
|
||||
|
||||
data = screenshotRequested
|
||||
elseif type == 2 then
|
||||
data = idRequested
|
||||
elseif type == 3 then
|
||||
data = dataRequested
|
||||
end
|
||||
|
||||
if data[target] then return end
|
||||
|
||||
data[target] = ply
|
||||
|
||||
net.Start("eP:Handeler")
|
||||
net.WriteUInt(3, 3)
|
||||
net.WriteUInt(type, 2)
|
||||
net.WriteBool(false)
|
||||
net.Send(target)
|
||||
|
||||
timer.Simple(10, function()
|
||||
if !target or !ply then return end
|
||||
if data[target] then
|
||||
data[target] = nil
|
||||
slib.notify(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "sc-failed", target:Nick()), ply)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
hook.Add("PlayerInitialSpawn", "eP:NetworkingQueuer", function(ply)
|
||||
eProtect.queueNetworking(ply)
|
||||
local sid = ply:SteamID()
|
||||
if punished[sid] then punished[sid] = nil end
|
||||
end)
|
||||
|
||||
local function verifyBannedAlt(ply, sid64, type)
|
||||
sid64 = sid64 or ply:SteamID64()
|
||||
local isBanned = slib.isBanned(sid64, function(banned, sid) if banned then if IsValid(ply) then slib.punish(ply, type, eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "punished-alt")) end end end)
|
||||
|
||||
if isBanned then
|
||||
slib.punish(ply, type, eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "punished-alt"))
|
||||
end
|
||||
|
||||
return isBanned
|
||||
end
|
||||
|
||||
local settingConverter = { // Its reverted on clientside
|
||||
[1] = 3,
|
||||
[2] = 1,
|
||||
[3] = 2
|
||||
}
|
||||
|
||||
hook.Add("PlayerInitialSpawn", "eP:AutomaticChecks", function(ply)
|
||||
local automatic_identifier = tonumber(eProtect.data.general["automatic-identifier"]) or 1
|
||||
|
||||
timer.Simple(1.5, function() -- Giving time to set usergroup.
|
||||
if !IsValid(ply) or !ply:IsPlayer() or ply:IsBot() or eProtect.data.general["bypassgroup"][ply:GetUserGroup()] or eProtect.data.general["bypass_sids"][ply:SteamID64()] or eProtect.data.general["bypass_sids"][ply:SteamID()] then return end
|
||||
|
||||
if eProtect.data.general["block-vpn"] and !eProtect.data.general["bypass-vpn"][ply:GetUserGroup()] and !eProtect.data.general["bypass-vpn"][ply:SteamID64()] then
|
||||
local ip = ""
|
||||
|
||||
for k,v in ipairs(string.ToTable(ply:IPAddress())) do
|
||||
if v == ":" then break end
|
||||
|
||||
ip = ip..v
|
||||
end
|
||||
|
||||
http.Fetch("https://proxycheck.io/v2/"..ip.."?vpn=1", function(result)
|
||||
result = result and util.JSONToTable(result)
|
||||
|
||||
if result[ip] and result[ip].proxy == "yes" then
|
||||
ply:Kick(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "vpn-blocked"))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if automatic_identifier > 0 then
|
||||
eProtect.correlateIP(ply, function(result)
|
||||
local correlatedIPs = result
|
||||
local plysid64, ownerplysid64 = ply:SteamID64(), ply:OwnerSteamID64()
|
||||
local familyShare = ply:SteamID64() ~= ply:OwnerSteamID64()
|
||||
local detections = !familyShare and !table.IsEmpty(correlatedIPs)
|
||||
local altsDetected = {}
|
||||
|
||||
if detections then
|
||||
local detect_type
|
||||
detections = ""
|
||||
if correlatedIPs and istable(correlatedIPs) and !table.IsEmpty(correlatedIPs) then
|
||||
detect_type = "correlated-ip"
|
||||
|
||||
for k,v in ipairs(correlatedIPs) do
|
||||
table.insert(altsDetected, v.sid64)
|
||||
end
|
||||
|
||||
detections = slib.getLang("eprotect", eProtect.config["language"], "correlated-ip")
|
||||
end
|
||||
|
||||
if familyShare then
|
||||
detect_type = "family-share"
|
||||
|
||||
detections = detections == "" and slib.getLang("eprotect", eProtect.config["language"], "family-share") or detections.." "..slib.getLang("eprotect", eProtect.config["language"], "and").." "..slib.getLang("eprotect", eProtect.config["language"], "family-share")
|
||||
table.insert(altsDetected, ownerplysid64)
|
||||
end
|
||||
|
||||
if detections ~= "" then
|
||||
local doneAction
|
||||
|
||||
if automatic_identifier == 1 then
|
||||
for k, v in ipairs(player.GetAll()) do
|
||||
if eProtect.data.general["notification-groups"][v:GetUserGroup()] then
|
||||
slib.notify(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "auto-detected-alt", ply:Nick(), detections), v)
|
||||
end
|
||||
end
|
||||
|
||||
doneAction = true
|
||||
elseif automatic_identifier == 2 then
|
||||
for k,v in ipairs(altsDetected) do
|
||||
doneAction = doneAction or verifyBannedAlt(ply, v, 1)
|
||||
end
|
||||
elseif automatic_identifier == 3 then
|
||||
for k,v in ipairs(altsDetected) do
|
||||
doneAction = doneAction or verifyBannedAlt(ply, v, 2)
|
||||
end
|
||||
end
|
||||
|
||||
if doneAction then
|
||||
eProtect.logDetectionHandeler(ply, "alt-detection", slib.getLang("eprotect", eProtect.config["language"], detect_type), settingConverter[automatic_identifier], util.TableToJSON(altsDetected))
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
hook.Add("PlayerSay", "eP:OpenMenu", function(ply, text, public)
|
||||
if eProtect.config["command"] == string.lower(text) then
|
||||
if !eProtect.hasPermission(ply) then
|
||||
return text
|
||||
end
|
||||
|
||||
eProtect.networkData(ply)
|
||||
|
||||
openMenu(ply)
|
||||
return ""
|
||||
end
|
||||
end )
|
||||
|
||||
hook.Add("eP:PreNetworking", "eP:Restrictions", function(ply, netstring, len)
|
||||
if !eProtect.canNetwork(ply, netstring) then return false end
|
||||
if len >= 512000 then eProtect.logDetectionHandeler(ply, "net-overflow", netstring, 1) eProtect.punish(ply, 1, slib.getLang("eprotect", eProtect.config["language"], "kick-net-overflow")) return false end
|
||||
end)
|
||||
|
||||
hook.Add("eP:PreHTTP", "eP:PreventBlockedHTTP", function(url)
|
||||
if eProtect.data.general["httpfocusedurls"] then
|
||||
return eProtect.data.general["httpfocusedurlsisblacklist"] == !tobool(eProtect.data.general["httpfocusedurls"][url])
|
||||
end
|
||||
end)
|
||||
|
||||
timer.Create("eP:SaveCache", eProtect.config["process-save-queue"], 0, function()
|
||||
if !eProtect.saveQueue then return end
|
||||
eProtect.saveData()
|
||||
|
||||
eProtect.saveQueue = nil
|
||||
end)
|
||||
|
||||
net.Receive("eP:Handeler", function(len, ply)
|
||||
local gateway = net.ReadBit()
|
||||
local action = net.ReadUInt(2)
|
||||
|
||||
if tobool(gateway) then
|
||||
if !eProtect.hasPermission(ply) then return end
|
||||
|
||||
if action == 0 then
|
||||
local id = net.ReadUInt(1)
|
||||
local page = net.ReadUInt(15)
|
||||
local search = net.ReadString()
|
||||
|
||||
if id == 0 then
|
||||
eProtect.requestHTTPLog(ply, page, search)
|
||||
elseif id == 1 then
|
||||
eProtect.requestDetectionLog(ply, page, search)
|
||||
end
|
||||
elseif action == 1 then
|
||||
local specific = net.ReadUInt(3)
|
||||
local strings = {}
|
||||
|
||||
for i=1,specific do
|
||||
strings[i] = net.ReadString()
|
||||
end
|
||||
|
||||
local statement = net.ReadUInt(2)
|
||||
local data
|
||||
|
||||
if statement == 1 then
|
||||
data = net.ReadBool()
|
||||
elseif statement == 2 then
|
||||
data = net.ReadInt(32)
|
||||
elseif statement == 3 then
|
||||
local chunk = net.ReadUInt(32)
|
||||
data = net.ReadData(chunk)
|
||||
|
||||
data = util.Decompress(data)
|
||||
data = util.JSONToTable(data)
|
||||
|
||||
local converted_tbl = {}
|
||||
|
||||
for k, v in pairs(data) do
|
||||
if string.sub(k, 1, 6) == "sid64_" then
|
||||
local sid64 = string.sub(k, 7, #k)
|
||||
|
||||
if util.SteamIDFrom64(sid64) != "STEAM_0:0:0" then
|
||||
k = sid64
|
||||
end
|
||||
end
|
||||
|
||||
converted_tbl[k] = v
|
||||
end
|
||||
|
||||
data = converted_tbl
|
||||
end
|
||||
|
||||
local finaldestination = eProtect.data
|
||||
for k,v in ipairs(strings) do
|
||||
finaldestination = finaldestination[v]
|
||||
if k >= (#strings - 1) then break end
|
||||
end
|
||||
|
||||
finaldestination[strings[#strings]] = data
|
||||
|
||||
eProtect.saveQueue = true
|
||||
eProtect.queueNetworking(nil, strings[1])
|
||||
elseif action == 2 then
|
||||
local subaction = net.ReadUInt(3)
|
||||
local target = net.ReadUInt(14)
|
||||
|
||||
target = Entity(target)
|
||||
|
||||
if !IsValid(target) or !target:IsPlayer() then slib.notify(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "invalid-player"), ply) return end
|
||||
|
||||
local sid = target:SteamID()
|
||||
|
||||
if subaction == 1 then
|
||||
eProtect.data.disabled[sid] = net.ReadBool()
|
||||
eProtect.queueNetworking(nil, "disabled")
|
||||
elseif subaction == 2 then
|
||||
requestData(ply, target, net.ReadUInt(2))
|
||||
elseif subaction == 3 then
|
||||
local bit = net.ReadBit()
|
||||
if tobool(bit) then
|
||||
eProtect.correlateIP(target, function(result)
|
||||
if !IsValid(target) or !IsValid(ply) then return end
|
||||
if table.IsEmpty(result) then slib.notify(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "no-correlation", target:Nick()), ply) return end
|
||||
|
||||
result = util.TableToJSON(result)
|
||||
result = util.Base64Encode(result)
|
||||
|
||||
net.Start("eP:Handeler")
|
||||
net.WriteUInt(4,3)
|
||||
net.WriteUInt(target:EntIndex(), 14)
|
||||
net.WriteString(result)
|
||||
net.WriteBit(1)
|
||||
net.Send(ply)
|
||||
end)
|
||||
else
|
||||
eProtect.showIPs(target, ply)
|
||||
end
|
||||
elseif subaction == 4 then
|
||||
local sid64 = target:SteamID64()
|
||||
local ownersid64 = target:OwnerSteamID64()
|
||||
|
||||
if sid64 == ownersid64 then
|
||||
slib.notify(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "no-family-share", target:Nick()), ply)
|
||||
else
|
||||
slib.notify(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "has-family-share", target:Nick(), ownersid64), ply)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if action == 1 then
|
||||
local subaction = net.ReadUInt(2)
|
||||
|
||||
local data
|
||||
|
||||
if subaction == 1 then
|
||||
data = screenshotRequested
|
||||
elseif subaction == 2 then
|
||||
data = idRequested
|
||||
elseif subaction == 3 then
|
||||
data = dataRequested
|
||||
end
|
||||
|
||||
if !data[ply] then if eProtect.config["punishMaliciousIntent"] then eProtect.punish(ply, 1, slib.getLang("eprotect", eProtect.config["language"], "kick-malicious-intent")) end return end
|
||||
local target = data[ply]
|
||||
data[ply] = nil
|
||||
|
||||
local id
|
||||
|
||||
if subaction == 3 then
|
||||
local chunk = net.ReadUInt(32)
|
||||
id = net.ReadData(chunk)
|
||||
else
|
||||
id = net.ReadString()
|
||||
end
|
||||
|
||||
if !id or id == "" then
|
||||
if eProtect.config["punishMaliciousIntent"] then
|
||||
eProtect.punish(ply, 1, slib.getLang("eprotect", eProtect.config["language"], "kick-malicious-intent"))
|
||||
end
|
||||
return end
|
||||
|
||||
net.Start("eP:Handeler")
|
||||
net.WriteUInt(3, 3)
|
||||
net.WriteUInt(subaction, 2)
|
||||
net.WriteUInt(ply:EntIndex(), 14)
|
||||
net.WriteBool(true)
|
||||
|
||||
if subaction == 3 then
|
||||
local chunk = #id
|
||||
net.WriteUInt(chunk, 32)
|
||||
net.WriteData(id, chunk)
|
||||
else
|
||||
net.WriteString(id)
|
||||
end
|
||||
|
||||
net.Send(target)
|
||||
elseif action == 2 then
|
||||
local menu = net.ReadUInt(2)
|
||||
local menus = {
|
||||
[1] = "Loki",
|
||||
[2] = "Exploit City"
|
||||
}
|
||||
|
||||
eProtect.logDetectionHandeler(ply, "exploit-menu", menus[menu], 2)
|
||||
eProtect.punish(ply, 2, slib.getLang("eprotect", eProtect.config["language"], "banned-exploit-menu"))
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("eP:SQLConnected", "eP:TransferOldIPs", function()
|
||||
local files = file.Find("eprotect/ips/*", "DATA")
|
||||
for k,v in pairs(files) do
|
||||
local sid64 = string.gsub(v, ".json", "")
|
||||
|
||||
local ips = file.Read("eprotect/ips/"..v, "DATA")
|
||||
ips = util.JSONToTable(ips)
|
||||
if !ips then continue end
|
||||
|
||||
for ip, data in pairs(ips) do
|
||||
eProtect.registerIP(sid64, ip, data[1], data[2])
|
||||
end
|
||||
|
||||
file.Delete("eprotect/ips/"..v)
|
||||
end
|
||||
file.Delete("eprotect/ips")
|
||||
|
||||
local save = false
|
||||
|
||||
if eProtect.data.httpLogging then
|
||||
for url, v in pairs(eProtect.data.httpLogging) do
|
||||
eProtect.logHTTP(url, v.type, v.called)
|
||||
end
|
||||
|
||||
eProtect.data.httpLogging = nil
|
||||
|
||||
save = true
|
||||
end
|
||||
|
||||
if eProtect.data.punishmentLogging then
|
||||
for i = #eProtect.data.punishmentLogging, 1, -1 do
|
||||
local data = eProtect.data.punishmentLogging[i]
|
||||
|
||||
eProtect.logDetection(data.ply, "", data.reason, data.info, data.type)
|
||||
end
|
||||
|
||||
eProtect.data.punishmentLogging = nil
|
||||
|
||||
save = true
|
||||
end
|
||||
|
||||
if save then
|
||||
eProtect.saveData()
|
||||
end
|
||||
end)
|
||||
|
||||
eProtect.dataVerification()
|
||||
@@ -1,67 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
eProtect = eProtect or {}
|
||||
eProtect.overrides = eProtect.overrides or {}
|
||||
|
||||
if !eProtect.overrides["net.Incoming"] then
|
||||
eProtect.overrides["net.Incoming"] = true
|
||||
function net.Incoming( len, client )
|
||||
local i = net.ReadHeader()
|
||||
local strName = util.NetworkIDToString( i )
|
||||
|
||||
if ( !strName ) then return end
|
||||
|
||||
local func = net.Receivers[ strName:lower() ]
|
||||
if ( !func ) then return end
|
||||
|
||||
len = len - 16
|
||||
|
||||
local pre = hook.Run("eP:PreNetworking", client, strName, len)
|
||||
|
||||
if pre == false then return end
|
||||
|
||||
func( len, client )
|
||||
|
||||
hook.Run("eP:PostNetworking", client, strName, len)
|
||||
end
|
||||
end
|
||||
|
||||
if !eProtect.config["disablehttplogging"] and ((!VC and !XEON and !mLib) or eProtect.config["ignoreDRM"]) then
|
||||
if !eProtect.overrides["http.Fetch"] then
|
||||
eProtect.overrides["http.Fetch"] = true
|
||||
local oldFetch = http.Fetch
|
||||
function http.Fetch(...)
|
||||
local args = {...}
|
||||
local result = hook.Run("eP:PreHTTP", args[1], "fetch")
|
||||
|
||||
if result == false then return end
|
||||
|
||||
oldFetch(...)
|
||||
|
||||
hook.Run("eP:PostHTTP", args[1], "fetch")
|
||||
end
|
||||
end
|
||||
|
||||
if !eProtect.overrides["http.Post"] then
|
||||
eProtect.overrides["http.Post"] = true
|
||||
local oldPost = http.Post
|
||||
function http.Post(...)
|
||||
local args = {...}
|
||||
local result = hook.Run("eP:PreHTTP", args[1], "post")
|
||||
|
||||
if result == false then return end
|
||||
|
||||
oldPost(...)
|
||||
|
||||
hook.Run("eP:PostHTTP", args[1], "post")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,250 +0,0 @@
|
||||
--[[
|
||||
| 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 query, db
|
||||
local escape_str = function(str) return SQLStr(str, true) end
|
||||
|
||||
local create_queries = {
|
||||
[1] = [[CREATE TABLE IF NOT EXISTS eprotect_ips(
|
||||
id INTEGER PRIMARY KEY %s,
|
||||
sid64 CHAR(17),
|
||||
ip CHAR(15),
|
||||
country CHAR(3),
|
||||
logged_time INTEGER DEFAULT 0
|
||||
)]],
|
||||
[2] = [[CREATE TABLE IF NOT EXISTS eprotect_detections(
|
||||
id INTEGER PRIMARY KEY %s,
|
||||
name CHAR(32),
|
||||
sid64 CHAR(17),
|
||||
reason CHAR(32),
|
||||
info CHAR(32),
|
||||
type INTEGER DEFAULT 0,
|
||||
logged_time INTEGER DEFAULT 0,
|
||||
additional_info TEXT NULL
|
||||
)]],
|
||||
[3] = [[CREATE TABLE IF NOT EXISTS eprotect_http(
|
||||
id INTEGER PRIMARY KEY %s,
|
||||
link CHAR(64),
|
||||
type CHAR(6),
|
||||
called INTEGER DEFAULT 0
|
||||
)]],
|
||||
[4] = [[ALTER TABLE eprotect_detections
|
||||
ADD additional_info TEXT NULL]]
|
||||
}
|
||||
|
||||
local function makeTables()
|
||||
for i = 1, #create_queries do
|
||||
query(string.format(create_queries[i], eProtect.config["storage_type"] == "sql_local" and "AUTOINCREMENT" or "AUTO_INCREMENT"))
|
||||
end
|
||||
end
|
||||
|
||||
if eProtect.config["storage_type"] == "mysql" then
|
||||
require("mysqloo")
|
||||
|
||||
query = function() end
|
||||
|
||||
local dbinfo = eProtect.config["mysql_info"]
|
||||
|
||||
db = mysqloo.connect(dbinfo.host, dbinfo.username, dbinfo.password, dbinfo.database, dbinfo.port)
|
||||
|
||||
function db:onConnected()
|
||||
print(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "mysql_successfull"))
|
||||
|
||||
query = function(str, func)
|
||||
local q = db:query(str)
|
||||
q.onSuccess = function(_, data)
|
||||
if func then
|
||||
func(data)
|
||||
end
|
||||
end
|
||||
|
||||
q.onError = function(_, err) end
|
||||
|
||||
q:start()
|
||||
end
|
||||
|
||||
escape_str = function(str) return db:escape(tostring(str)) end
|
||||
|
||||
makeTables()
|
||||
|
||||
hook.Run("eP:SQLConnected")
|
||||
end
|
||||
|
||||
function db:onConnectionFailed(err)
|
||||
print(eProtect.config["prefix"]..slib.getLang("eprotect", eProtect.config["language"], "mysql_failed"))
|
||||
print( "Error:", err )
|
||||
end
|
||||
|
||||
db:connect()
|
||||
else
|
||||
local oldFunc = sql.Query
|
||||
query = function(str, func)
|
||||
local result = oldFunc(str)
|
||||
|
||||
if func then
|
||||
func(result)
|
||||
end
|
||||
end
|
||||
|
||||
makeTables()
|
||||
end
|
||||
|
||||
local function handleCallbacksCorrelation(parent_tbl, correlated, callback)
|
||||
for k,v in ipairs(parent_tbl) do
|
||||
if !v then return end
|
||||
end
|
||||
|
||||
if !callback then return end
|
||||
callback(correlated or {})
|
||||
end
|
||||
|
||||
eProtect.correlateIP = function(target, callback)
|
||||
if !IsValid(target) then return end
|
||||
|
||||
local sid64, tbl = target:SteamID64(), {}
|
||||
|
||||
query("SELECT * FROM eprotect_ips WHERE sid64 = '"..sid64.."'", function(result)
|
||||
if result and result[1] then
|
||||
local parent_tbl = {}
|
||||
for k, v in ipairs(result) do
|
||||
parent_tbl[k] = false
|
||||
end
|
||||
|
||||
for key, plydata in ipairs(result) do
|
||||
query("SELECT * FROM eprotect_ips WHERE ip = '"..(plydata.ip).."'", function(result)
|
||||
if result and result[1] then
|
||||
for k,v in ipairs(result) do
|
||||
if v.sid64 == sid64 then continue end
|
||||
table.insert(tbl, {sid64 = v.sid64, ip = v.ip})
|
||||
end
|
||||
end
|
||||
|
||||
parent_tbl[key] = true
|
||||
|
||||
handleCallbacksCorrelation(parent_tbl, tbl, callback)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
eProtect.showIPs = function(target, ply)
|
||||
local sid64 = target:SteamID64()
|
||||
|
||||
query("SELECT * FROM eprotect_ips WHERE sid64 = '"..sid64.."'", function(result)
|
||||
if !IsValid(target) or !IsValid(ply) or !result or !result[1] then return end
|
||||
|
||||
result = util.TableToJSON(result)
|
||||
result = util.Base64Encode(result)
|
||||
|
||||
net.Start("eP:Handeler")
|
||||
net.WriteUInt(4,3)
|
||||
net.WriteUInt(target:EntIndex(), 14)
|
||||
net.WriteString(result)
|
||||
net.WriteBit(0)
|
||||
net.Send(ply)
|
||||
end)
|
||||
end
|
||||
|
||||
eProtect.registerIP = function(sid64, ip, country, time)
|
||||
query("SELECT * FROM eprotect_ips WHERE ip = '"..ip.."' AND sid64 = '"..sid64.."'", function(result)
|
||||
if result and result[1] then return end
|
||||
query(string.format("INSERT INTO eprotect_ips(ip, sid64, country, logged_time) VALUES('%s', %s, '%s', %s)", escape_str(ip), sid64, escape_str(country), time or os.time()))
|
||||
end)
|
||||
end
|
||||
|
||||
eProtect.logDetection = function(name, sid64, reason, info, type, additional_info)
|
||||
additional_info = additional_info or ""
|
||||
|
||||
query(string.format("INSERT INTO eprotect_detections(name, sid64, reason, info, type, logged_time, additional_info) VALUES('%s', '%s', '%s', '%s', '%s', %s, '%s')", escape_str(name), escape_str(sid64), escape_str(reason), escape_str(info), escape_str(type), os.time(), escape_str(additional_info)))
|
||||
end
|
||||
|
||||
eProtect.logHTTP = function(link, type, called)
|
||||
link = escape_str(link)
|
||||
|
||||
query("SELECT * FROM eprotect_http WHERE link = '"..link.."'", function(result)
|
||||
if result and result[1] then
|
||||
query("UPDATE eprotect_http SET called = "..(result[1].called + 1).." WHERE link = '"..link.."'")
|
||||
return end
|
||||
|
||||
query(string.format("INSERT INTO eprotect_http(link, type, called) VALUES('%s', '%s', "..(tonumber(called) or 1)..")", link, escape_str(type)))
|
||||
end)
|
||||
end
|
||||
|
||||
local function networkData(ply, data, id)
|
||||
local compressed = util.Compress(util.TableToJSON(data))
|
||||
|
||||
net.Start("eP:Handeler")
|
||||
net.WriteUInt(5, 3)
|
||||
net.WriteUInt(id, 1)
|
||||
net.WriteUInt(#compressed, 32)
|
||||
net.WriteData(compressed, #compressed)
|
||||
net.Send(ply)
|
||||
end
|
||||
|
||||
local http_cd, detection_cd = {}, {}
|
||||
|
||||
eProtect.requestHTTPLog = function(ply, page, search)
|
||||
if http_cd[ply] and http_cd[ply] > CurTime() then return end
|
||||
http_cd[ply] = CurTime() + .1
|
||||
|
||||
search = search ~= "" and escape_str(search) or nil
|
||||
|
||||
local perpage, pageCount = 20, 1
|
||||
local start = perpage * ((tonumber(page) or 1) - 1)
|
||||
local data = {}
|
||||
|
||||
local search_str = search and " WHERE (link LIKE '%"..search.."%')" or ""
|
||||
|
||||
query("SELECT COUNT(id) FROM eprotect_http"..search_str, function(pageresult)
|
||||
if pageresult and pageresult[1] and pageresult[1]["COUNT(id)"] then
|
||||
data.pageCount = math.max(math.ceil((pageresult[1]["COUNT(id)"] or 0) / perpage), 1)
|
||||
end
|
||||
|
||||
data.page = page
|
||||
|
||||
query("SELECT * FROM eprotect_http "..search_str.." LIMIT "..start..", "..perpage, function(result)
|
||||
data.result = result
|
||||
|
||||
networkData(ply, data, 0)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
eProtect.requestDetectionLog = function(ply, page, search)
|
||||
if detection_cd[ply] and detection_cd[ply] > CurTime() then return end
|
||||
detection_cd[ply] = CurTime() + .1
|
||||
|
||||
search = search ~= "" and escape_str(search) or nil
|
||||
|
||||
local perpage, pageCount = 20, 1
|
||||
local start = perpage * ((tonumber(page) or 1) - 1)
|
||||
local data = {}
|
||||
|
||||
local search_str = search and " WHERE (sid64 LIKE '%"..search.."%' OR name LIKE '%"..search.."%') " or ""
|
||||
|
||||
query("SELECT COUNT(id) FROM eprotect_detections"..search_str, function(pageresult)
|
||||
if pageresult and pageresult[1] and pageresult[1]["COUNT(id)"] then
|
||||
data.pageCount = math.max(math.ceil((pageresult[1]["COUNT(id)"] or 0) / perpage), 1)
|
||||
end
|
||||
|
||||
data.page = page
|
||||
|
||||
query("SELECT * FROM eprotect_detections"..search_str.." ORDER BY id DESC LIMIT "..start..", "..perpage, function(result)
|
||||
data.result = result
|
||||
|
||||
networkData(ply, data, 1)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
if eProtect.config["storage_type"] == "sql_local" then
|
||||
hook.Run("eP:SQLConnected")
|
||||
end
|
||||
@@ -1,109 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
------------------------------------------------------
|
||||
-- NO NOT TOUCH ANYTHING IN HERE!!!!!!!!!
|
||||
------------------------------------------------------
|
||||
|
||||
eProtect = eProtect or {}
|
||||
|
||||
eProtect.BaseConfig = eProtect.BaseConfig or {}
|
||||
|
||||
eProtect.BaseConfig["disable-all-networking"] = {false, 1}
|
||||
|
||||
eProtect.BaseConfig["automatic-identifier"] = {1, 2, {min = 0, max = 3}}
|
||||
|
||||
eProtect.BaseConfig["block-vpn"] = {false, 3}
|
||||
|
||||
eProtect.BaseConfig["bypass-vpn"] = {{["76561198157267451"] = true}, 4, function()
|
||||
local list = {}
|
||||
|
||||
for k,v in ipairs(player.GetAll()) do
|
||||
local sid64 = v:SteamID64()
|
||||
if !sid64 then continue end
|
||||
list[sid64] = true
|
||||
end
|
||||
|
||||
if CAMI and CAMI.GetUsergroups then
|
||||
for k,v in pairs(CAMI.GetUsergroups()) do
|
||||
list[k] = true
|
||||
end
|
||||
end
|
||||
|
||||
return list
|
||||
end}
|
||||
|
||||
|
||||
eProtect.BaseConfig["notification-groups"] = {{["superadmin"] = true}, 5, CAMI and CAMI.GetUsergroups and function() local tbl = {} for k,v in pairs(CAMI.GetUsergroups()) do tbl[k] = true end return tbl end or {}}
|
||||
|
||||
eProtect.BaseConfig["ratelimit"] = {500, 6, {min = -1, max = 100000}}
|
||||
|
||||
eProtect.BaseConfig["timeout"] = {3, 7, {min = 0, max = 5000}}
|
||||
|
||||
eProtect.BaseConfig["overflowpunishment"] = {2, 8, {min = 0, max = 3}}
|
||||
|
||||
eProtect.BaseConfig["whitelistergroup"] = {{}, 9, function()
|
||||
local list = {}
|
||||
|
||||
if CAMI and CAMI.GetUsergroups then
|
||||
for k,v in pairs(CAMI.GetUsergroups()) do
|
||||
list[k] = true
|
||||
end
|
||||
end
|
||||
|
||||
return list
|
||||
end}
|
||||
|
||||
eProtect.BaseConfig["bypassgroup"] = {{}, 10, function()
|
||||
local list = {
|
||||
["superadmin"] = true,
|
||||
["owner"] = true
|
||||
}
|
||||
|
||||
if CAMI and CAMI.GetUsergroups then
|
||||
for k,v in pairs(CAMI.GetUsergroups()) do
|
||||
list[k] = true
|
||||
end
|
||||
end
|
||||
|
||||
return list
|
||||
end}
|
||||
|
||||
eProtect.BaseConfig["bypass_sids"] = {{["76561198157267451"] = true}, 11, function()
|
||||
local list = {}
|
||||
|
||||
for k,v in ipairs(player.GetAll()) do
|
||||
local sid64 = v:SteamID64()
|
||||
if !sid64 then continue end
|
||||
list[sid64] = true
|
||||
end
|
||||
|
||||
return list
|
||||
end}
|
||||
|
||||
eProtect.BaseConfig["httpfocusedurlsisblacklist"] = {true, 12}
|
||||
|
||||
eProtect.BaseConfig["httpfocusedurls"] = {{}, 13, function()
|
||||
local list = {}
|
||||
|
||||
local tbl_http = eProtect.data["requestedHTTP"] and eProtect.data["requestedHTTP"].result or {}
|
||||
|
||||
if tbl_http then
|
||||
for k,v in ipairs(tbl_http) do
|
||||
list[v.link] = true
|
||||
end
|
||||
end
|
||||
|
||||
return list
|
||||
end}
|
||||
|
||||
------------------------------------------------------
|
||||
-- NO NOT TOUCH ANYTHING IN HERE!!!!!!!!!
|
||||
------------------------------------------------------76561198157267451
|
||||
@@ -1,44 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
eProtect = eProtect or {}
|
||||
|
||||
eProtect.config = eProtect.config or {}
|
||||
|
||||
eProtect.config["language"] = "en"
|
||||
|
||||
eProtect.config["prefix"] = "[eProtect] "
|
||||
|
||||
eProtect.config["storage_type"] = "sql_local"-- (sql_local or mysql)
|
||||
|
||||
eProtect.config["disablehttplogging"] = false -- If a DRM is ran after eProtect it could break if they check for HTTP modifications! If so make this true.
|
||||
|
||||
eProtect.config["ignoreDRM"] = false
|
||||
|
||||
eProtect.config["scURL"] = "https://stromic.dev/eprotect/img.php" -- This is the URL used to handle screenshots, can be self hosted here: https://github.com/Stromic/eprotect-web
|
||||
|
||||
eProtect.config["punishMaliciousIntent"] = true
|
||||
|
||||
eProtect.config["disabledModules"] = {
|
||||
["identifier"] = false,
|
||||
["detection_log"] = false,
|
||||
["net_limiter"] = false,
|
||||
["net_logger"] = false,
|
||||
["exploit_patcher"] = false,
|
||||
["exploit_finder"] = false,
|
||||
["fake_exploits"] = false,
|
||||
["data_snooper"] = false
|
||||
}
|
||||
|
||||
eProtect.config["permission"] = {
|
||||
["owner"] = true,
|
||||
["superadmin"] = true,
|
||||
["community_manager"] = true
|
||||
}
|
||||
@@ -1,550 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
eProtect = eProtect or {}
|
||||
|
||||
eProtect.config = eProtect.config or {}
|
||||
|
||||
eProtect.config["mysql_info"] = {
|
||||
host = "",
|
||||
port = 3306,
|
||||
database = "",
|
||||
username = "",
|
||||
password = ""
|
||||
}
|
||||
|
||||
eProtect.config["command"] = "!eprotect"
|
||||
|
||||
eProtect.config["process-save-queue"] = 10 --- This will check if we should save data to the file.
|
||||
|
||||
eProtect.data = eProtect.data or {}
|
||||
|
||||
eProtect.data.badNets = eProtect.data.badNets or {}
|
||||
|
||||
eProtect.registerBadNet = function(netstring, num)
|
||||
eProtect.data.badNets[netstring] = {type = num}
|
||||
end
|
||||
|
||||
|
||||
-- Credits to meepen for the table with known exploits and backdoors! <3
|
||||
|
||||
--- Known Exploits
|
||||
eProtect.registerBadNet("pplay_deleterow", 1)
|
||||
eProtect.registerBadNet("pplay_addrow", 1)
|
||||
eProtect.registerBadNet("pplay_sendtable", 1)
|
||||
eProtect.registerBadNet("WriteQuery", 1)
|
||||
eProtect.registerBadNet("SendMoney", 1)
|
||||
eProtect.registerBadNet("BailOut", 1)
|
||||
eProtect.registerBadNet("customprinter_get", 1)
|
||||
eProtect.registerBadNet("textstickers_entdata", 1)
|
||||
eProtect.registerBadNet("NC_GetNameChange", 1)
|
||||
eProtect.registerBadNet("ATS_WARP_REMOVE_CLIENT", 1)
|
||||
eProtect.registerBadNet("ATS_WARP_FROM_CLIENT", 1)
|
||||
eProtect.registerBadNet("ATS_WARP_VIEWOWNER", 1)
|
||||
eProtect.registerBadNet("CFRemoveGame", 1)
|
||||
eProtect.registerBadNet("CFJoinGame", 1)
|
||||
eProtect.registerBadNet("CFEndGame", 1)
|
||||
eProtect.registerBadNet("CreateCase", 1)
|
||||
eProtect.registerBadNet("rprotect_terminal_settings", 1)
|
||||
eProtect.registerBadNet("StackGhost", 1)
|
||||
eProtect.registerBadNet("RevivePlayer", 1)
|
||||
eProtect.registerBadNet("ARMORY_RetrieveWeapon", 1)
|
||||
eProtect.registerBadNet("TransferReport", 1)
|
||||
eProtect.registerBadNet("SimplicityAC_aysent", 1)
|
||||
eProtect.registerBadNet("pac_to_contraption", 1)
|
||||
eProtect.registerBadNet("SyncPrinterButtons76561198056171650", 1)
|
||||
eProtect.registerBadNet("sendtable", 1)
|
||||
eProtect.registerBadNet("steamid2", 1)
|
||||
eProtect.registerBadNet("Kun_SellDrug", 1)
|
||||
eProtect.registerBadNet("net_PSUnBoxServer", 1)
|
||||
eProtect.registerBadNet("pplay_deleterow", 1)
|
||||
eProtect.registerBadNet("pplay_addrow", 1)
|
||||
eProtect.registerBadNet("CraftSomething", 1)
|
||||
eProtect.registerBadNet("banleaver", 1)
|
||||
eProtect.registerBadNet("75_plus_win", 1)
|
||||
eProtect.registerBadNet("ATMDepositMoney", 1)
|
||||
eProtect.registerBadNet("Taxi_Add", 1)
|
||||
eProtect.registerBadNet("Kun_SellOil", 1)
|
||||
eProtect.registerBadNet("SellMinerals", 1)
|
||||
eProtect.registerBadNet("TakeBetMoney", 1)
|
||||
eProtect.registerBadNet("PoliceJoin", 1)
|
||||
eProtect.registerBadNet("CpForm_Answers", 1)
|
||||
eProtect.registerBadNet("DepositMoney", 1)
|
||||
eProtect.registerBadNet("MDE_RemoveStuff_C2S", 1)
|
||||
eProtect.registerBadNet("NET_SS_DoBuyTakeoff", 1)
|
||||
eProtect.registerBadNet("NET_EcSetTax", 1)
|
||||
eProtect.registerBadNet("RP_Accept_Fine", 1)
|
||||
eProtect.registerBadNet("RP_Fine_Player", 1)
|
||||
eProtect.registerBadNet("RXCAR_Shop_Store_C2S", 1)
|
||||
eProtect.registerBadNet("RXCAR_SellINVCar_C2S", 1)
|
||||
eProtect.registerBadNet("drugseffect_remove", 1)
|
||||
eProtect.registerBadNet("drugs_money", 1)
|
||||
eProtect.registerBadNet("CRAFTINGMOD_SHOP", 1)
|
||||
eProtect.registerBadNet("drugs_ignite", 1)
|
||||
eProtect.registerBadNet("drugseffect_hpremove", 1)
|
||||
eProtect.registerBadNet("DarkRP_Kun_ForceSpawn", 1)
|
||||
eProtect.registerBadNet("drugs_text", 1)
|
||||
eProtect.registerBadNet("NLRKick", 1)
|
||||
eProtect.registerBadNet("RecKickAFKer", 1)
|
||||
eProtect.registerBadNet("GMBG:PickupItem", 1)
|
||||
eProtect.registerBadNet("DL_Answering", 1)
|
||||
eProtect.registerBadNet("data_check", 1)
|
||||
eProtect.registerBadNet("plyWarning", 1)
|
||||
eProtect.registerBadNet("NLR.ActionPlayer", 1)
|
||||
eProtect.registerBadNet("timebombDefuse", 1)
|
||||
eProtect.registerBadNet("start_wd_emp", 1)
|
||||
eProtect.registerBadNet("kart_sell", 1)
|
||||
eProtect.registerBadNet("FarmingmodSellItems", 1)
|
||||
eProtect.registerBadNet("ClickerAddToPoints", 1)
|
||||
eProtect.registerBadNet("bodyman_model_change", 1)
|
||||
eProtect.registerBadNet("TOW_PayTheFine", 1)
|
||||
eProtect.registerBadNet("FIRE_CreateFireTruck", 1)
|
||||
eProtect.registerBadNet("hitcomplete", 1)
|
||||
eProtect.registerBadNet("hhh_request", 1)
|
||||
eProtect.registerBadNet("DaHit", 1)
|
||||
eProtect.registerBadNet("TCBBuyAmmo", 1)
|
||||
eProtect.registerBadNet("DataSend", 1)
|
||||
eProtect.registerBadNet("gBan.BanBuffer", 1)
|
||||
eProtect.registerBadNet("fp_as_doorHandler", 1)
|
||||
eProtect.registerBadNet("Upgrade", 1)
|
||||
eProtect.registerBadNet("TowTruck_CreateTowTruck", 1)
|
||||
eProtect.registerBadNet("TOW_SubmitWarning", 1)
|
||||
eProtect.registerBadNet("duelrequestguiYes", 1)
|
||||
eProtect.registerBadNet("JoinOrg", 1)
|
||||
eProtect.registerBadNet("pac_submit", 1)
|
||||
eProtect.registerBadNet("NDES_SelectedEmblem", 1)
|
||||
eProtect.registerBadNet("join_disconnect", 1)
|
||||
eProtect.registerBadNet("Morpheus.StaffTracker", 1)
|
||||
eProtect.registerBadNet("casinokit_chipexchange", 1)
|
||||
eProtect.registerBadNet("BuyKey", 1)
|
||||
eProtect.registerBadNet("BuyCrate", 1)
|
||||
eProtect.registerBadNet("FactionInviteConsole", 1)
|
||||
eProtect.registerBadNet("FacCreate", 1)
|
||||
eProtect.registerBadNet("1942_Fuhrer_SubmitCandidacy", 1)
|
||||
eProtect.registerBadNet("pogcp_report_submitReport", 1)
|
||||
eProtect.registerBadNet("hsend", 1)
|
||||
eProtect.registerBadNet("BuilderXToggleKill", 1)
|
||||
eProtect.registerBadNet("Chatbox_PlayerChat", 1)
|
||||
eProtect.registerBadNet("reports.submit", 1)
|
||||
eProtect.registerBadNet("services_accept", 1)
|
||||
eProtect.registerBadNet("Warn_CreateWarn", 1)
|
||||
eProtect.registerBadNet("NewReport", 1)
|
||||
eProtect.registerBadNet("soez", 1)
|
||||
eProtect.registerBadNet("GiveHealthNPC", 1)
|
||||
eProtect.registerBadNet("DarkRP_SS_Gamble", 1)
|
||||
eProtect.registerBadNet("buyinghealth", 1)
|
||||
eProtect.registerBadNet("DarkRP_preferredjobmodel", 1)
|
||||
eProtect.registerBadNet("whk_setart", 1)
|
||||
eProtect.registerBadNet("WithdrewBMoney", 1)
|
||||
eProtect.registerBadNet("DuelMessageReturn", 1)
|
||||
eProtect.registerBadNet("ban_rdm", 1)
|
||||
eProtect.registerBadNet("BuyCar", 1)
|
||||
eProtect.registerBadNet("ats_send_toServer", 1)
|
||||
eProtect.registerBadNet("dLogsGetCommand", 1)
|
||||
eProtect.registerBadNet("disguise", 1)
|
||||
eProtect.registerBadNet("gportal_rpname_change", 1)
|
||||
eProtect.registerBadNet("AbilityUse", 1)
|
||||
eProtect.registerBadNet("ClickerAddToPoints", 1)
|
||||
eProtect.registerBadNet("race_accept", 1)
|
||||
eProtect.registerBadNet("give_me_weapon", 1)
|
||||
eProtect.registerBadNet("FinishContract", 1)
|
||||
eProtect.registerBadNet("NLR_SPAWN", 1)
|
||||
eProtect.registerBadNet("Kun_ZiptieStruggle", 1)
|
||||
eProtect.registerBadNet("JB_Votekick", 1)
|
||||
eProtect.registerBadNet("Letthisdudeout", 1)
|
||||
eProtect.registerBadNet("ckit_roul_bet", 1)
|
||||
eProtect.registerBadNet("pac.net.TouchFlexes.ClientNotify", 1)
|
||||
eProtect.registerBadNet("ply_pick_shit", 1)
|
||||
eProtect.registerBadNet("TFA_Attachment_RequestAll", 1)
|
||||
eProtect.registerBadNet("BuyFirstTovar", 1)
|
||||
eProtect.registerBadNet("BuySecondTovar", 1)
|
||||
eProtect.registerBadNet("GiveHealthNPC", 1)
|
||||
eProtect.registerBadNet("MONEY_SYSTEM_GetWeapons", 1)
|
||||
eProtect.registerBadNet("MCon_Demote_ToServer", 1)
|
||||
eProtect.registerBadNet("withdrawp", 1)
|
||||
eProtect.registerBadNet("PCAdd", 1)
|
||||
eProtect.registerBadNet("ActivatePC", 1)
|
||||
eProtect.registerBadNet("PCDelAll", 1)
|
||||
eProtect.registerBadNet("viv_hl2rp_disp_message", 1)
|
||||
eProtect.registerBadNet("ATM_DepositMoney_C2S", 1)
|
||||
eProtect.registerBadNet("BM2.Command.SellBitcoins", 1)
|
||||
eProtect.registerBadNet("BM2.Command.Eject", 1)
|
||||
eProtect.registerBadNet("tickbooksendfine", 1)
|
||||
eProtect.registerBadNet("egg", 1)
|
||||
eProtect.registerBadNet("RHC_jail_player", 1)
|
||||
eProtect.registerBadNet("PlayerUseItem", 1)
|
||||
eProtect.registerBadNet("Chess Top10", 1)
|
||||
eProtect.registerBadNet("ItemStoreUse", 1)
|
||||
eProtect.registerBadNet("EZS_PlayerTag", 1)
|
||||
eProtect.registerBadNet("simfphys_gasspill", 1)
|
||||
eProtect.registerBadNet("sphys_dupe", 1)
|
||||
eProtect.registerBadNet("sw_gokart", 1)
|
||||
eProtect.registerBadNet("wordenns", 1)
|
||||
eProtect.registerBadNet("SyncPrinterButtons16690", 1)
|
||||
eProtect.registerBadNet("AttemptSellCar", 1)
|
||||
eProtect.registerBadNet("uPLYWarning", 1)
|
||||
eProtect.registerBadNet("atlaschat.rqclrcfg", 1)
|
||||
eProtect.registerBadNet("dlib.getinfo.replicate", 1)
|
||||
eProtect.registerBadNet("SetPermaKnife", 1)
|
||||
eProtect.registerBadNet("EnterpriseWithdraw", 1)
|
||||
eProtect.registerBadNet("SBP_addtime", 1)
|
||||
eProtect.registerBadNet("NetData", 1)
|
||||
eProtect.registerBadNet("CW20_PRESET_LOAD", 1)
|
||||
eProtect.registerBadNet("minigun_drones_switch", 1)
|
||||
eProtect.registerBadNet("NET_AM_MakePotion", 1)
|
||||
eProtect.registerBadNet("bitcoins_request_turn_off", 1)
|
||||
eProtect.registerBadNet("bitcoins_request_turn_on", 1)
|
||||
eProtect.registerBadNet("bitcoins_request_withdraw", 1)
|
||||
eProtect.registerBadNet("PermwepsNPCSellWeapon", 1)
|
||||
eProtect.registerBadNet("ncpstoredoact", 1)
|
||||
eProtect.registerBadNet("DuelRequestClient", 1)
|
||||
eProtect.registerBadNet("BeginSpin", 1)
|
||||
eProtect.registerBadNet("tickbookpayfine", 1)
|
||||
eProtect.registerBadNet("fg_printer_money", 1)
|
||||
eProtect.registerBadNet("IGS.GetPaymentURL", 1)
|
||||
eProtect.registerBadNet("AirDrops_StartPlacement", 1)
|
||||
eProtect.registerBadNet("SlotsRemoved", 1)
|
||||
eProtect.registerBadNet("FARMINGMOD_DROPITEM", 1)
|
||||
eProtect.registerBadNet("cab_sendmessage", 1)
|
||||
eProtect.registerBadNet("cab_cd_testdrive", 1)
|
||||
eProtect.registerBadNet("blueatm", 1)
|
||||
eProtect.registerBadNet("SCP-294Sv", 1)
|
||||
eProtect.registerBadNet("dronesrewrite_controldr", 1)
|
||||
eProtect.registerBadNet("desktopPrinter_Withdraw", 1)
|
||||
eProtect.registerBadNet("RemoveTag", 1)
|
||||
eProtect.registerBadNet("IDInv_RequestBank", 1)
|
||||
eProtect.registerBadNet("UseMedkit", 1)
|
||||
eProtect.registerBadNet("WipeMask", 1)
|
||||
eProtect.registerBadNet("SwapFilter", 1)
|
||||
eProtect.registerBadNet("RemoveMask", 1)
|
||||
eProtect.registerBadNet("DeployMask", 1)
|
||||
eProtect.registerBadNet("ZED_SpawnCar", 1)
|
||||
eProtect.registerBadNet("levelup_useperk", 1)
|
||||
eProtect.registerBadNet("passmayorexam", 1)
|
||||
eProtect.registerBadNet("Selldatride", 1)
|
||||
eProtect.registerBadNet("ORG_VaultDonate", 1)
|
||||
eProtect.registerBadNet("ORG_NewOrg", 1)
|
||||
eProtect.registerBadNet("ScannerMenu", 1)
|
||||
eProtect.registerBadNet("misswd_accept", 1)
|
||||
eProtect.registerBadNet("D3A_Message", 1)
|
||||
eProtect.registerBadNet("LawsToServer", 1)
|
||||
eProtect.registerBadNet("Shop_buy", 1)
|
||||
eProtect.registerBadNet("D3A_CreateOrg", 1)
|
||||
eProtect.registerBadNet("Gb_gasstation_BuyGas", 1)
|
||||
eProtect.registerBadNet("Gb_gasstation_BuyJerrycan", 1)
|
||||
eProtect.registerBadNet("MineServer", 1)
|
||||
eProtect.registerBadNet("AcceptBailOffer", 1)
|
||||
eProtect.registerBadNet("LawyerOfferBail", 1)
|
||||
eProtect.registerBadNet("buy_bundle", 1)
|
||||
eProtect.registerBadNet("AskPickupItemInv", 1)
|
||||
eProtect.registerBadNet("donatorshop_itemtobuy", 1)
|
||||
eProtect.registerBadNet("netOrgVoteInvite_Server", 1)
|
||||
eProtect.registerBadNet("Chess ClientWager", 1)
|
||||
eProtect.registerBadNet("AcceptRequest", 1)
|
||||
eProtect.registerBadNet("deposit", 1)
|
||||
eProtect.registerBadNet("CubeRiot CaptureZone Update", 1)
|
||||
eProtect.registerBadNet("NPCShop_BuyItem", 1)
|
||||
eProtect.registerBadNet("SpawnProtection", 1)
|
||||
eProtect.registerBadNet("hoverboardpurchase", 1)
|
||||
eProtect.registerBadNet("soundArrestCommit", 1)
|
||||
eProtect.registerBadNet("LotteryMenu", 1)
|
||||
eProtect.registerBadNet("updateLaws", 1)
|
||||
eProtect.registerBadNet("TMC_NET_FirePlayer", 1)
|
||||
eProtect.registerBadNet("thiefnpc", 1)
|
||||
eProtect.registerBadNet("TMC_NET_MakePlayerWanted", 1)
|
||||
eProtect.registerBadNet("SyncRemoveAction", 1)
|
||||
eProtect.registerBadNet("HV_AmmoBuy", 1)
|
||||
eProtect.registerBadNet("NET_CR_TakeStoredMoney", 1)
|
||||
eProtect.registerBadNet("nox_addpremadepunishment", 1)
|
||||
eProtect.registerBadNet("GrabMoney", 1)
|
||||
eProtect.registerBadNet("LAWYER.GetBailOut", 1)
|
||||
eProtect.registerBadNet("LAWYER.BailFelonOut", 1)
|
||||
eProtect.registerBadNet("br_send_pm", 1)
|
||||
eProtect.registerBadNet("GET_Admin_MSGS", 1)
|
||||
eProtect.registerBadNet("OPEN_ADMIN_CHAT", 1)
|
||||
eProtect.registerBadNet("LB_AddBan", 1)
|
||||
eProtect.registerBadNet("redirectMsg", 1)
|
||||
eProtect.registerBadNet("RDMReason_Explain", 1)
|
||||
eProtect.registerBadNet("JB_SelectWarden", 1)
|
||||
eProtect.registerBadNet("JB_GiveCubics", 1)
|
||||
eProtect.registerBadNet("SendSteamID", 1)
|
||||
eProtect.registerBadNet("wyozimc_playply", 1)
|
||||
eProtect.registerBadNet("SpecDM_SendLoadout", 1)
|
||||
eProtect.registerBadNet("sv_saveweapons", 1)
|
||||
eProtect.registerBadNet("DL_StartReport", 1)
|
||||
eProtect.registerBadNet("DL_ReportPlayer", 1)
|
||||
eProtect.registerBadNet("DL_AskLogsList", 1)
|
||||
eProtect.registerBadNet("DailyLoginClaim", 1)
|
||||
eProtect.registerBadNet("GiveWeapon", 1)
|
||||
eProtect.registerBadNet("GovStation_SpawnVehicle", 1)
|
||||
eProtect.registerBadNet("inviteToOrganization", 1)
|
||||
eProtect.registerBadNet("createFaction", 1)
|
||||
eProtect.registerBadNet("sellitem", 1)
|
||||
eProtect.registerBadNet("giveArrestReason", 1)
|
||||
eProtect.registerBadNet("unarrestPerson", 1)
|
||||
eProtect.registerBadNet("JoinFirstSS", 1)
|
||||
eProtect.registerBadNet("bringNfreeze", 1)
|
||||
eProtect.registerBadNet("start_wd_hack", 1)
|
||||
eProtect.registerBadNet("DestroyTable", 1)
|
||||
eProtect.registerBadNet("nCTieUpStart", 1)
|
||||
eProtect.registerBadNet("IveBeenRDMed", 1)
|
||||
eProtect.registerBadNet("FIGHTCLUB_StartFight", 1)
|
||||
eProtect.registerBadNet("FIGHTCLUB_KickPlayer", 1)
|
||||
eProtect.registerBadNet("ReSpawn", 1)
|
||||
eProtect.registerBadNet("CP_Test_Results", 1)
|
||||
eProtect.registerBadNet("AcceptBailOffer", 1)
|
||||
eProtect.registerBadNet("IS_SubmitSID_C2S", 1)
|
||||
eProtect.registerBadNet("IS_GetReward_C2S", 1)
|
||||
eProtect.registerBadNet("ChangeOrgName", 1)
|
||||
eProtect.registerBadNet("DisbandOrganization", 1)
|
||||
eProtect.registerBadNet("CreateOrganization", 1)
|
||||
eProtect.registerBadNet("newTerritory", 1)
|
||||
eProtect.registerBadNet("InviteMember", 1)
|
||||
eProtect.registerBadNet("sendDuelInfo", 1)
|
||||
eProtect.registerBadNet("DoDealerDeliver", 1)
|
||||
eProtect.registerBadNet("PurchaseWeed", 1)
|
||||
eProtect.registerBadNet("guncraft_removeWorkbench", 1)
|
||||
eProtect.registerBadNet("wordenns", 1)
|
||||
eProtect.registerBadNet("userAcceptPrestige", 1)
|
||||
eProtect.registerBadNet("vj_npcspawner_sv_create", 1)
|
||||
eProtect.registerBadNet("DuelMessageReturn", 1)
|
||||
eProtect.registerBadNet("Client_To_Server_OpenEditor", 1)
|
||||
eProtect.registerBadNet("GiveSCP294Cup", 1)
|
||||
eProtect.registerBadNet("GiveArmor100", 1)
|
||||
eProtect.registerBadNet("SprintSpeedset", 1)
|
||||
eProtect.registerBadNet("ArmorButton", 1)
|
||||
eProtect.registerBadNet("HealButton", 1)
|
||||
eProtect.registerBadNet("SRequest", 1)
|
||||
eProtect.registerBadNet("ClickerForceSave", 1)
|
||||
eProtect.registerBadNet("rpi_trade_end", 1)
|
||||
eProtect.registerBadNet("NET_BailPlayer", 1)
|
||||
eProtect.registerBadNet("vj_testentity_runtextsd", 1)
|
||||
eProtect.registerBadNet("vj_fireplace_turnon2", 1)
|
||||
eProtect.registerBadNet("requestmoneyforvk", 1)
|
||||
eProtect.registerBadNet("gPrinters.sendID", 1)
|
||||
eProtect.registerBadNet("FIRE_RemoveFireTruck", 1)
|
||||
eProtect.registerBadNet("drugs_effect", 1)
|
||||
eProtect.registerBadNet("drugs_give", 1)
|
||||
eProtect.registerBadNet("NET_DoPrinterAction", 1)
|
||||
eProtect.registerBadNet("opr_withdraw", 1)
|
||||
eProtect.registerBadNet("money_clicker_withdraw", 1)
|
||||
eProtect.registerBadNet("NGII_TakeMoney", 1)
|
||||
eProtect.registerBadNet("gPrinters.retrieveMoney", 1)
|
||||
eProtect.registerBadNet("revival_revive_accept", 1)
|
||||
eProtect.registerBadNet("chname", 1)
|
||||
eProtect.registerBadNet("NewRPNameSQL", 1)
|
||||
eProtect.registerBadNet("UpdateRPUModelSQL", 1)
|
||||
eProtect.registerBadNet("SetTableTarget", 1)
|
||||
eProtect.registerBadNet("SquadGiveWeapon", 1)
|
||||
eProtect.registerBadNet("BuyUpgradesStuff", 1)
|
||||
eProtect.registerBadNet("REPAdminChangeLVL", 1)
|
||||
eProtect.registerBadNet("SendMail", 1)
|
||||
eProtect.registerBadNet("DemotePlayer", 1)
|
||||
eProtect.registerBadNet("OpenGates", 1)
|
||||
eProtect.registerBadNet("VehicleUnderglow", 1)
|
||||
eProtect.registerBadNet("Hopping_Test", 1)
|
||||
eProtect.registerBadNet("CREATE_REPORT", 1)
|
||||
eProtect.registerBadNet("CreateEntity", 1)
|
||||
eProtect.registerBadNet("FiremanLeave", 1)
|
||||
eProtect.registerBadNet("DarkRP_Defib_ForceSpawn", 1)
|
||||
eProtect.registerBadNet("Resupply", 1)
|
||||
eProtect.registerBadNet("BTTTStartVotekick", 1)
|
||||
eProtect.registerBadNet("_nonDBVMVote", 1)
|
||||
eProtect.registerBadNet("REPPurchase", 1)
|
||||
eProtect.registerBadNet("deathrag_takeitem", 1)
|
||||
eProtect.registerBadNet("FacCreate", 1)
|
||||
eProtect.registerBadNet("InformPlayer", 1)
|
||||
eProtect.registerBadNet("lockpick_sound", 1)
|
||||
eProtect.registerBadNet("SetPlayerModel", 1)
|
||||
eProtect.registerBadNet("changeToPhysgun", 1)
|
||||
eProtect.registerBadNet("VoteBanNO", 1)
|
||||
eProtect.registerBadNet("VoteKickNO", 1)
|
||||
eProtect.registerBadNet("shopguild_buyitem", 1)
|
||||
eProtect.registerBadNet("MG2.Request.GangRankings", 1)
|
||||
eProtect.registerBadNet("RequestMAPSize", 1)
|
||||
eProtect.registerBadNet("gMining.sellMineral", 1)
|
||||
eProtect.registerBadNet("ItemStoreDrop", 1)
|
||||
eProtect.registerBadNet("optarrest", 1)
|
||||
eProtect.registerBadNet("TalkIconChat", 1)
|
||||
eProtect.registerBadNet("UpdateAdvBoneSettings", 1)
|
||||
eProtect.registerBadNet("ViralsScoreboardAdmin", 1)
|
||||
eProtect.registerBadNet("PowerRoundsForcePR", 1)
|
||||
eProtect.registerBadNet("showDisguiseHUD", 1)
|
||||
eProtect.registerBadNet("withdrawMoney", 1)
|
||||
eProtect.registerBadNet("SyncPrinterButtons76561198027292625", 1)
|
||||
eProtect.registerBadNet("phone", 1)
|
||||
eProtect.registerBadNet("STLoanToServer", 1)
|
||||
eProtect.registerBadNet("TCBDealerStore", 1)
|
||||
eProtect.registerBadNet("TCBDealerSpawn", 1)
|
||||
eProtect.registerBadNet("ts_buytitle", 1)
|
||||
eProtect.registerBadNet("gMining.registerAchievement", 1)
|
||||
eProtect.registerBadNet("gPrinters.openUpgrades", 1)
|
||||
|
||||
--- Known Backdoors
|
||||
eProtect.registerBadNet("Sbox_gm_attackofnullday_key", 2)
|
||||
eProtect.registerBadNet("c", 2)
|
||||
eProtect.registerBadNet("enablevac", 2)
|
||||
eProtect.registerBadNet("ULXQUERY2", 2)
|
||||
eProtect.registerBadNet("Im_SOCool", 2)
|
||||
eProtect.registerBadNet("MoonMan", 2)
|
||||
eProtect.registerBadNet("LickMeOut", 2)
|
||||
eProtect.registerBadNet("SessionBackdoor", 2)
|
||||
eProtect.registerBadNet("OdiumBackDoor", 2)
|
||||
eProtect.registerBadNet("ULX_QUERY2", 2)
|
||||
eProtect.registerBadNet("Sbox_itemstore", 2)
|
||||
eProtect.registerBadNet("Sbox_darkrp", 2)
|
||||
eProtect.registerBadNet("Sbox_Message", 2)
|
||||
eProtect.registerBadNet("_blacksmurf", 2)
|
||||
eProtect.registerBadNet("nostrip", 2)
|
||||
eProtect.registerBadNet("Remove_Exploiters", 2)
|
||||
eProtect.registerBadNet("Sandbox_ArmDupe", 2)
|
||||
eProtect.registerBadNet("rconadmin", 2)
|
||||
eProtect.registerBadNet("jesuslebg", 2)
|
||||
eProtect.registerBadNet("disablebackdoor", 2)
|
||||
eProtect.registerBadNet("blacksmurfBackdoor", 2)
|
||||
eProtect.registerBadNet("jeveuttonrconleul", 2)
|
||||
eProtect.registerBadNet("lag_ping", 2)
|
||||
eProtect.registerBadNet("memeDoor", 2)
|
||||
eProtect.registerBadNet("DarkRP_AdminWeapons", 2)
|
||||
eProtect.registerBadNet("Fix_Keypads", 2)
|
||||
eProtect.registerBadNet("noclipcloakaesp_chat_text", 2)
|
||||
eProtect.registerBadNet("_CAC_ReadMemory", 2)
|
||||
eProtect.registerBadNet("Ulib_Message", 2)
|
||||
eProtect.registerBadNet("Ulogs_Infos", 2)
|
||||
eProtect.registerBadNet("ITEM", 2)
|
||||
eProtect.registerBadNet("nocheat", 2)
|
||||
eProtect.registerBadNet("adsp_door_length", 2)
|
||||
eProtect.registerBadNet("ξpsilon", 2)
|
||||
eProtect.registerBadNet("JQerystrip.disable", 2)
|
||||
eProtect.registerBadNet("Sandbox_GayParty", 2)
|
||||
eProtect.registerBadNet("DarkRP_UTF8", 2)
|
||||
eProtect.registerBadNet("PlayerKilledLogged", 2)
|
||||
eProtect.registerBadNet("OldNetReadData", 2)
|
||||
eProtect.registerBadNet("Backdoor", 2)
|
||||
eProtect.registerBadNet("cucked", 2)
|
||||
eProtect.registerBadNet("NoNerks", 2)
|
||||
eProtect.registerBadNet("kek", 2)
|
||||
eProtect.registerBadNet("DarkRP_Money_System", 2)
|
||||
eProtect.registerBadNet("BetStrep", 2)
|
||||
eProtect.registerBadNet("ZimbaBackdoor", 2)
|
||||
eProtect.registerBadNet("something", 2)
|
||||
eProtect.registerBadNet("random", 2)
|
||||
eProtect.registerBadNet("strip0", 2)
|
||||
eProtect.registerBadNet("fellosnake", 2)
|
||||
eProtect.registerBadNet("idk", 2)
|
||||
eProtect.registerBadNet("||||", 2)
|
||||
eProtect.registerBadNet("EnigmaIsthere", 2)
|
||||
eProtect.registerBadNet("ALTERED_CARB0N", 2)
|
||||
eProtect.registerBadNet("killserver", 2)
|
||||
eProtect.registerBadNet("fuckserver", 2)
|
||||
eProtect.registerBadNet("cvaraccess", 2)
|
||||
eProtect.registerBadNet("_Defcon", 2)
|
||||
eProtect.registerBadNet("dontforget", 2)
|
||||
eProtect.registerBadNet("aze46aez67z67z64dcv4bt", 2)
|
||||
eProtect.registerBadNet("nolag", 2)
|
||||
eProtect.registerBadNet("changename", 2)
|
||||
eProtect.registerBadNet("music", 2)
|
||||
eProtect.registerBadNet("_Defqon", 2)
|
||||
eProtect.registerBadNet("xenoexistscl", 2)
|
||||
eProtect.registerBadNet("R8", 2)
|
||||
eProtect.registerBadNet("AnalCavity", 2)
|
||||
eProtect.registerBadNet("DefqonBackdoor", 2)
|
||||
eProtect.registerBadNet("fourhead", 2)
|
||||
eProtect.registerBadNet("echangeinfo", 2)
|
||||
eProtect.registerBadNet("PlayerItemPickUp", 2)
|
||||
eProtect.registerBadNet("thefrenchenculer", 2)
|
||||
eProtect.registerBadNet("elfamosabackdoormdr", 2)
|
||||
eProtect.registerBadNet("stoppk", 2)
|
||||
eProtect.registerBadNet("noprop", 2)
|
||||
eProtect.registerBadNet("reaper", 2)
|
||||
eProtect.registerBadNet("Abcdefgh", 2)
|
||||
eProtect.registerBadNet("JSQuery.Data(Post(false))", 2)
|
||||
eProtect.registerBadNet("pjHabrp9EY", 2)
|
||||
eProtect.registerBadNet("_Raze", 2)
|
||||
eProtect.registerBadNet("88", 2)
|
||||
eProtect.registerBadNet("Dominos", 2)
|
||||
eProtect.registerBadNet("NoOdium_ReadPing", 2)
|
||||
eProtect.registerBadNet("m9k_explosionradius", 2)
|
||||
eProtect.registerBadNet("gag", 2)
|
||||
eProtect.registerBadNet("_cac_", 2)
|
||||
eProtect.registerBadNet("_Battleye_Meme_", 2)
|
||||
eProtect.registerBadNet("legrandguzmanestla", 2)
|
||||
eProtect.registerBadNet("ULogs_B", 2)
|
||||
eProtect.registerBadNet("arivia", 2)
|
||||
eProtect.registerBadNet("_Warns", 2)
|
||||
eProtect.registerBadNet("xuy", 2)
|
||||
eProtect.registerBadNet("samosatracking57", 2)
|
||||
eProtect.registerBadNet("striphelper", 2)
|
||||
eProtect.registerBadNet("m9k_explosive", 2)
|
||||
eProtect.registerBadNet("GaySploitBackdoor", 2)
|
||||
eProtect.registerBadNet("_GaySploit", 2)
|
||||
eProtect.registerBadNet("slua", 2)
|
||||
eProtect.registerBadNet("Bilboard.adverts:Spawn(false)", 2)
|
||||
eProtect.registerBadNet("BOOST_FPS", 2)
|
||||
eProtect.registerBadNet("FPP_AntiStrip", 2)
|
||||
eProtect.registerBadNet("ULX_QUERY_TEST2", 2)
|
||||
eProtect.registerBadNet("FADMIN_ANTICRASH", 2)
|
||||
eProtect.registerBadNet("ULX_ANTI_BACKDOOR", 2)
|
||||
eProtect.registerBadNet("UKT_MOMOS", 2)
|
||||
eProtect.registerBadNet("rcivluz", 2)
|
||||
eProtect.registerBadNet("SENDTEST", 2)
|
||||
eProtect.registerBadNet("MJkQswHqfZ", 2)
|
||||
eProtect.registerBadNet("INJ3v4", 2)
|
||||
eProtect.registerBadNet("_clientcvars", 2)
|
||||
eProtect.registerBadNet("_main", 2)
|
||||
eProtect.registerBadNet("GMOD_NETDBG", 2)
|
||||
eProtect.registerBadNet("thereaper", 2)
|
||||
eProtect.registerBadNet("audisquad_lua", 2)
|
||||
eProtect.registerBadNet("anticrash", 2)
|
||||
eProtect.registerBadNet("ZernaxBackdoor", 2)
|
||||
eProtect.registerBadNet("bdsm", 2)
|
||||
eProtect.registerBadNet("waoz", 2)
|
||||
eProtect.registerBadNet("stream", 2)
|
||||
eProtect.registerBadNet("adm_network", 2)
|
||||
eProtect.registerBadNet("antiexploit", 2)
|
||||
eProtect.registerBadNet("ReadPing", 2)
|
||||
eProtect.registerBadNet("berettabest", 2)
|
||||
eProtect.registerBadNet("componenttolua", 2)
|
||||
eProtect.registerBadNet("theberettabcd", 2)
|
||||
eProtect.registerBadNet("negativedlebest", 2)
|
||||
eProtect.registerBadNet("mathislebg", 2)
|
||||
eProtect.registerBadNet("SparksLeBg", 2)
|
||||
eProtect.registerBadNet("DOGE", 2)
|
||||
eProtect.registerBadNet("FPSBOOST", 2)
|
||||
eProtect.registerBadNet("N::B::P", 2)
|
||||
eProtect.registerBadNet("PDA_DRM_REQUEST_CONTENT", 2)
|
||||
eProtect.registerBadNet("shix", 2)
|
||||
eProtect.registerBadNet("Inj3", 2)
|
||||
eProtect.registerBadNet("AidsTacos", 2)
|
||||
eProtect.registerBadNet("verifiopd", 2)
|
||||
eProtect.registerBadNet("pwn_wake", 2)
|
||||
eProtect.registerBadNet("pwn_http_answer", 2)
|
||||
eProtect.registerBadNet("pwn_http_send", 2)
|
||||
eProtect.registerBadNet("The_Dankwoo", 2)
|
||||
eProtect.registerBadNet("PRDW_GET", 2)
|
||||
eProtect.registerBadNet("fancyscoreboard_leave", 2)
|
||||
eProtect.registerBadNet("DarkRP_Gamemodes", 2)
|
||||
eProtect.registerBadNet("DarkRP_Armors", 2)
|
||||
eProtect.registerBadNet("yohsambresicianatik<3", 2)
|
||||
eProtect.registerBadNet("EnigmaProject", 2)
|
||||
eProtect.registerBadNet("PlayerCheck", 2)
|
||||
eProtect.registerBadNet("Ulx_Error_88", 2)
|
||||
eProtect.registerBadNet("FAdmin_Notification_Receiver", 2)
|
||||
eProtect.registerBadNet("DarkRP_ReceiveData", 2)
|
||||
eProtect.registerBadNet("Weapon_88", 2)
|
||||
eProtect.registerBadNet("__G____CAC", 2)
|
||||
eProtect.registerBadNet("AbSoluT", 2)
|
||||
eProtect.registerBadNet("mecthack", 2)
|
||||
eProtect.registerBadNet("SetPlayerDeathCount", 2)
|
||||
eProtect.registerBadNet("awarn_remove", 2)
|
||||
eProtect.registerBadNet("fijiconn", 2)
|
||||
eProtect.registerBadNet("nw.readstream", 2)
|
||||
eProtect.registerBadNet("LuaCmd", 2)
|
||||
eProtect.registerBadNet("The_DankWhy", 2)
|
||||
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,2 +0,0 @@
|
||||
<EFBFBD>PNG
|
||||
|
||||
|
Before Width: | Height: | Size: 8 B |
@@ -1,4 +0,0 @@
|
||||
Plugin
|
||||
{
|
||||
file "lua/bin/gmsv_gluapack_plugin.so"
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"title": "Parakeet's Pill Pack",
|
||||
"type": "vehicle",
|
||||
"tags": [
|
||||
"fun"
|
||||
],
|
||||
"ignore": []
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
@@ -1,358 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
@@ -1,365 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
})
|
||||
@@ -1,185 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
})
|
||||
@@ -1,126 +0,0 @@
|
||||
--[[
|
||||
| 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 = ""
|
||||
}
|
||||
})
|
||||
@@ -1,118 +0,0 @@
|
||||
--[[
|
||||
| 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 = 50
|
||||
},
|
||||
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
|
||||
})
|
||||
@@ -1,249 +0,0 @@
|
||||
--[[
|
||||
| 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"
|
||||
}
|
||||
})
|
||||
]]
|
||||
@@ -1,466 +0,0 @@
|
||||
--[[
|
||||
| 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"
|
||||
}
|
||||
})
|
||||
@@ -1,376 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ply:Spawn()
|
||||
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"
|
||||
}
|
||||
})
|
||||
@@ -1,272 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
})
|
||||
@@ -1,206 +0,0 @@
|
||||
--[[
|
||||
| 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 = 30
|
||||
},
|
||||
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
|
||||
})
|
||||
@@ -1,353 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
})
|
||||
@@ -1,493 +0,0 @@
|
||||
--[[
|
||||
| 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"
|
||||
})
|
||||
@@ -1,100 +0,0 @@
|
||||
--[[
|
||||
| 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"
|
||||
})
|
||||
@@ -1,235 +0,0 @@
|
||||
--[[
|
||||
| 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"
|
||||
}
|
||||
})
|
||||
@@ -1,294 +0,0 @@
|
||||
--[[
|
||||
| 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
|
||||
}
|
||||
})
|
||||
@@ -1,13 +0,0 @@
|
||||
--[[
|
||||
| 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.
|
||||
@@ -1,44 +0,0 @@
|
||||
--[[
|
||||
| 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")
|
||||
@@ -1,33 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
function EFFECT:Init(effectdata)
|
||||
self.endPoint = effectdata:GetOrigin()
|
||||
local ent = effectdata:GetEntity()
|
||||
self.ent = ent:GetPuppet()
|
||||
self.ply = ent:GetPillUser()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
if not IsValid(self.ent) then return false end
|
||||
self:SetPos(self.ent:GetAttachment(self.ent:LookupAttachment("zipline")).Pos)
|
||||
self:SetRenderBoundsWS(self:GetPos(), self.endPoint)
|
||||
|
||||
return not self.ply:OnGround()
|
||||
end
|
||||
|
||||
local ropeMat = Material("cable/cable2")
|
||||
|
||||
function EFFECT:Render()
|
||||
--print("p")
|
||||
local color = Color(10, 10, 10)
|
||||
render.SetMaterial(ropeMat)
|
||||
render.DrawBeam(self:GetPos(), self.endPoint, 2, 0, 0, color)
|
||||
end
|
||||
@@ -1,63 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
--Most of the credit for this goes to the people who made/helped with the strider cannon SWEP:
|
||||
-- http://www.garrysmod.org/downloads/?a=view&id=31329
|
||||
local flashMat = Material("Effects/blueblackflash")
|
||||
local pinchMat = Material("Effects/strider_pinch_dudv")
|
||||
local beamMat = Material("Effects/blueblacklargebeam")
|
||||
|
||||
function EFFECT:Init(effectdata)
|
||||
self.ent = effectdata:GetEntity()
|
||||
self.hitPos = effectdata:GetOrigin()
|
||||
self.startTime = CurTime()
|
||||
self.cycle = 0
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
if not IsValid(self.ent) then return false end
|
||||
self:SetPos(self.ent:GetAttachment(self.ent:GetModel() == "models/combine_strider.mdl" and self.ent:LookupAttachment("BigGun") or self.ent:LookupAttachment("bellygun")).Pos)
|
||||
self:SetRenderBoundsWS(self:GetPos(), self.hitPos)
|
||||
if CurTime() - self.startTime > 2.4 then return false end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
local cycleF = (CurTime() - self.startTime) / 1.2
|
||||
--flash
|
||||
render.SetMaterial(flashMat)
|
||||
|
||||
if cycleF < .5 then
|
||||
render.DrawSprite(self:GetPos(), cycleF * 100, cycleF * 100, Color(0, 0, 0, 255))
|
||||
elseif cycleF < 1 then
|
||||
render.DrawSprite(self:GetPos(), cycleF * 100, cycleF * 100, Color(cycleF * 255, cycleF * 255, cycleF * 255, 255))
|
||||
else
|
||||
render.DrawSprite(self:GetPos(), 50, 50, Color(255, 255, 255, 255))
|
||||
end
|
||||
|
||||
if cycleF < 1 then
|
||||
--pinch
|
||||
pinchMat:SetFloat("$refractamount", cycleF)
|
||||
render.SetMaterial(pinchMat)
|
||||
render.UpdateRefractTexture()
|
||||
render.DrawSprite(self:GetPos(), cycleF * 150, cycleF * 150)
|
||||
|
||||
--Beam
|
||||
if cycleF > .5 then
|
||||
render.SetMaterial(beamMat)
|
||||
render.DrawBeam(self:GetPos(), self.hitPos, cycleF * 2, 0, 0, Color(255, 255, 255, (cycleF - .5) * 255))
|
||||
end
|
||||
elseif cycleF < 1.1 then
|
||||
--fired beam
|
||||
render.SetMaterial(beamMat)
|
||||
render.DrawBeam(LerpVector((cycleF - 1) * 10, self:GetPos(), self.hitPos), self.hitPos, (cycleF - 1) * 500, 0, 0)
|
||||
end
|
||||
end
|
||||
@@ -1,44 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
function EFFECT:Init(effectdata)
|
||||
self:SetPos(effectdata:GetOrigin())
|
||||
self.color = HSVToColor(math.Rand(0, 360), .8, 1)
|
||||
self.vel = VectorRand()
|
||||
self.i = 0
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
--[[self:SetPos(self.ent:GetAttachment(self.ent:LookupAttachment("zipline")).Pos)
|
||||
self:SetRenderBoundsWS(self:GetPos(),self.endPoint)]]
|
||||
self:SetPos(self:GetPos() + self.vel)
|
||||
self.i = self.i + 1
|
||||
if self.i > 100 then return false end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
local wow = Material("pillsprites/wow.png")
|
||||
|
||||
function EFFECT:Render()
|
||||
--[[cam.Start3D2D(self:GetPos(),LocalPlayer():EyeAngles()+Angle(90,0,0),1)
|
||||
/*surface.SetFont("CloseCaption_Bold")
|
||||
surface.SetTextColor(HSVToColor(math.Rand(0,360),1,.5))
|
||||
surface.SetTextPos(100,100)
|
||||
surface.GetTextSize(32)
|
||||
surface.DrawText("wow")
|
||||
draw.SimpleText("Oh No!", "CloseCaption_Bold", 0, 0, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
draw.DrawText("TEXT", "CloseCaption_Bold", 1, 1, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER)
|
||||
cam.End3D2D()]]
|
||||
cam.Start3D(EyePos(), EyeAngles())
|
||||
render.SetMaterial(wow)
|
||||
render.DrawSprite(self:GetPos(), 20, 10, self.color)
|
||||
cam.End3D()
|
||||
end
|
||||
@@ -1,51 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.AutomaticFrameAdvance = true
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("Vector", 0, "WepOffset")
|
||||
self:NetworkVar("Angle", 0, "WepAng")
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
if self.attachment then
|
||||
self:Fire("setparentattachment", "anim_attachment_RH", 0)
|
||||
else
|
||||
self:AddEffects(bit.bor(EF_BONEMERGE, EF_BONEMERGE_FASTCULL))
|
||||
end
|
||||
|
||||
self:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
local offset = self:GetWepOffset()
|
||||
local ang = self:GetWepAng()
|
||||
|
||||
if offset ~= Vector(0, 0, 0) then
|
||||
self:SetRenderOrigin(self:LocalToWorld(offset))
|
||||
end
|
||||
|
||||
if ang ~= Angle(0, 0, 0) then
|
||||
self:SetRenderAngles(self:LocalToWorldAngles(ang))
|
||||
end
|
||||
|
||||
self:DrawModel()
|
||||
end
|
||||
@@ -1,31 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
|
||||
function ENT:Initialize()
|
||||
self:AddCallback("BuildBonePositions", self.BoneItUp)
|
||||
|
||||
if SERVER then
|
||||
self:AddEffects(bit.bor(EF_BONEMERGE, EF_BONEMERGE_FASTCULL)) --fastcull seems to fix laggy bullshit garbage
|
||||
end
|
||||
|
||||
self:GetParent():SetSubMaterial(0, "models/effects/vol_light001")
|
||||
end
|
||||
|
||||
function ENT:BoneItUp(boneCount)
|
||||
local boneId = self:LookupBone("ValveBiped.Bip01_Head1")
|
||||
if not boneId then return end
|
||||
local matrix = self:GetBoneMatrix(boneId)
|
||||
if not matrix then return end
|
||||
matrix:Scale(Vector(.01, .01, .01))
|
||||
self:SetBoneMatrix(boneId, matrix)
|
||||
end
|
||||
@@ -1,51 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Barnacle Tongue"
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
--Physics
|
||||
self:SetModel("models/props_junk/PopCan01a.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
phys:SetMass(100)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StartTouch(ent)
|
||||
if IsValid(self.connected) or ent:IsWorld() then return end
|
||||
|
||||
if util.IsValidRagdoll(ent:GetModel()) and not ent:IsRagdoll() and not ent:IsPlayer() then
|
||||
local doll = ents.Create("prop_ragdoll")
|
||||
doll:SetModel(ent:GetModel())
|
||||
doll:SetPos(ent:GetPos())
|
||||
doll:SetAngles(ent:GetAngles())
|
||||
doll:Spawn()
|
||||
ent:Remove()
|
||||
ent = doll
|
||||
self:SetPos(ent:GetPhysicsObject(0):GetPos())
|
||||
end
|
||||
|
||||
constraint.Weld(self, ent, 0, 0, 0, true, false)
|
||||
self.connected = ent
|
||||
self:EmitSound("npc/barnacle/neck_snap1.wav")
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
end
|
||||
@@ -1,151 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Dropship Container"
|
||||
ENT.Category = "Pill Pack Entities"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
ENT.AutomaticFrameAdvance = true
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
--Physics
|
||||
self:SetModel("models/Combine_Dropship_Container.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
end
|
||||
|
||||
self.mode = 1
|
||||
self.full = true
|
||||
end
|
||||
|
||||
self:SetPlaybackRate(1)
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:Deploy()
|
||||
local dropship = self:GetParent()
|
||||
|
||||
if not self.full then
|
||||
dropship:PillSound("alert_empty")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
self.full = false
|
||||
self:SetSequence(self:LookupSequence("open"))
|
||||
dropship:PillLoopSound("deploy")
|
||||
|
||||
local doClose = function()
|
||||
if not IsValid(self) then return end
|
||||
self:SetSequence(self:LookupSequence("close"))
|
||||
|
||||
if IsValid(dropship) and self:GetParent() == dropship then
|
||||
dropship:PillLoopStop("deploy")
|
||||
end
|
||||
end
|
||||
|
||||
if self.mode ~= 6 then
|
||||
local mode = self.mode
|
||||
timer.Simple(12, doClose)
|
||||
|
||||
local doDeploy = function()
|
||||
if not IsValid(self) then return end
|
||||
local m = mode == 5 and math.random(1, 4) or mode
|
||||
local startAngPos = self:GetAttachment(self:LookupAttachment("deploy_landpoint"))
|
||||
local combine = ents.Create("pill_jumper_combine")
|
||||
combine:SetPos(startAngPos.Pos)
|
||||
combine:SetAngles(self:GetAngles())
|
||||
combine.myNpc = m == 4 and "npc_metropolice" or "npc_combine_s"
|
||||
combine.myWeapon = m == 2 and "weapon_shotgun" or m == 4 and "weapon_smg1" or "weapon_ar2"
|
||||
|
||||
if m == 1 or m == 2 then
|
||||
combine:SetModel("models/combine_soldier.mdl")
|
||||
elseif m == 3 then
|
||||
combine:SetModel("models/Combine_Super_Soldier.mdl")
|
||||
elseif m == 4 then
|
||||
combine:SetModel("models/police.mdl")
|
||||
end
|
||||
|
||||
if m == 2 then
|
||||
combine:SetSkin(1)
|
||||
end
|
||||
|
||||
combine:SetParent(self)
|
||||
combine:Spawn()
|
||||
end
|
||||
|
||||
for i = 1, 5 do
|
||||
timer.Simple(i * 2, doDeploy)
|
||||
end
|
||||
else
|
||||
timer.Simple(5.5, doClose)
|
||||
|
||||
local doDeploy = function()
|
||||
if not IsValid(self) then return end
|
||||
local mine = ents.Create("npc_rollermine")
|
||||
mine:SetPos(self:LocalToWorld(Vector(100, 0, 0)))
|
||||
mine:Spawn()
|
||||
mine:GetPhysicsObject():SetVelocity(self:GetAngles():Forward() * 500)
|
||||
end
|
||||
|
||||
for i = 1, 10 do
|
||||
timer.Simple(i / 2, doDeploy)
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:Use(ply)
|
||||
if self.mode >= 6 then
|
||||
self.mode = 1
|
||||
else
|
||||
self.mode = self.mode + 1
|
||||
end
|
||||
|
||||
if self.mode == 1 then
|
||||
ply:ChatPrint("Mode 1: 5 Soldiers")
|
||||
elseif self.mode == 2 then
|
||||
ply:ChatPrint("Mode 2: 5 Shotgunners")
|
||||
elseif self.mode == 3 then
|
||||
ply:ChatPrint("Mode 3: 5 Elites")
|
||||
elseif self.mode == 4 then
|
||||
ply:ChatPrint("Mode 4: 5 Metrocops")
|
||||
elseif self.mode == 5 then
|
||||
ply:ChatPrint("Mode 5: 5 Random Combine")
|
||||
elseif self.mode == 6 then
|
||||
ply:ChatPrint("Mode 6: 10 Rollermines")
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:SpawnFunction(ply, tr, ClassName)
|
||||
if (not tr.Hit) then return end
|
||||
local SpawnPos = tr.HitPos + tr.HitNormal * 100
|
||||
local ent = ents.Create(ClassName)
|
||||
ent:SetPos(SpawnPos)
|
||||
ent:Spawn()
|
||||
ent:Activate()
|
||||
|
||||
return ent
|
||||
end
|
||||
@@ -1,170 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Dropship Strider"
|
||||
ENT.Category = "Pill Pack Entities"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
|
||||
--ENT.AutomaticFrameAdvance = true
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
--Physics
|
||||
--self:SetModel("models/Combine_Strider.mdl")
|
||||
self:SetModel("models/Combine_Dropship_Container.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
end
|
||||
|
||||
self:SetRenderMode(RENDERMODE_NONE)
|
||||
self:DrawShadow(false)
|
||||
--self:SetSequence(self:LookupSequence("carried"))
|
||||
self.strider = ents.Create("prop_dynamic")
|
||||
self.strider:SetModel("models/Combine_Strider.mdl")
|
||||
self.strider:SetParent(self)
|
||||
self.strider:SetLocalPos(Vector(0, 0, -140))
|
||||
self.strider:SetLocalAngles(Angle(0, 0, 0))
|
||||
self.strider:Spawn()
|
||||
self.strider:SetSequence(self.strider:LookupSequence("carried"))
|
||||
end
|
||||
--self:SetPlaybackRate(1)
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if self.droppedfrom then
|
||||
local angs = self:GetAngles()
|
||||
angs.p = 0
|
||||
angs.r = 0
|
||||
self.strider:SetAngles(angs)
|
||||
local trace = util.QuickTrace(self:GetPos(), Vector(0, 0, -600), {self, self.droppedfrom})
|
||||
|
||||
if trace.Hit then
|
||||
self:Remove()
|
||||
local stridernpc = ents.Create("npc_strider")
|
||||
stridernpc:SetPos(self:GetPos())
|
||||
stridernpc:SetAngles(angs)
|
||||
stridernpc:Spawn()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Deploy()
|
||||
self.strider:ResetSequence(self.strider:LookupSequence("deploy"))
|
||||
|
||||
timer.Simple(2, function()
|
||||
if not IsValid(self) then return end
|
||||
self:EmitSound("npc/strider/striderx_alert2.wav")
|
||||
end)
|
||||
|
||||
timer.Simple(3, function()
|
||||
if not IsValid(self) then return end
|
||||
local dropship = self:GetParent()
|
||||
if not IsValid(dropship) then return end
|
||||
dropship.container = nil
|
||||
self.droppedfrom = dropship
|
||||
self:SetParent()
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
--self:SetPos(dropship:GetPos())
|
||||
--self:SetAngles(dropship:GetAngles())
|
||||
self:GetPhysicsObject():Wake()
|
||||
self.strider:SetLocalPos(Vector(0, 0, 0))
|
||||
end)
|
||||
--[[local dropship = self:GetParent()
|
||||
|
||||
if !self.full then dropship:PillSound("alert_empty") return end
|
||||
self.full=false
|
||||
|
||||
self:SetSequence(self:LookupSequence("open"))
|
||||
dropship:PillLoopSound("deploy")
|
||||
|
||||
local doClose = function()
|
||||
if !IsValid(self) then return end
|
||||
self:SetSequence(self:LookupSequence("close"))
|
||||
|
||||
if IsValid(dropship)&&self:GetParent()==dropship then
|
||||
dropship:PillLoopStop("deploy")
|
||||
end
|
||||
end
|
||||
|
||||
if self.mode!=6 then
|
||||
local mode = self.mode
|
||||
timer.Simple(12,doClose)
|
||||
|
||||
local doDeploy=function()
|
||||
if !IsValid(self) then return end
|
||||
|
||||
local m = mode==5&&math.random(1,4)||mode
|
||||
|
||||
local startAngPos = self:GetAttachment(self:LookupAttachment("deploy_landpoint"))
|
||||
local combine = ents.Create("pill_jumper_combine")
|
||||
combine:SetPos(startAngPos.Pos)
|
||||
combine:SetAngles(self:GetAngles())
|
||||
|
||||
combine.myNpc= m==4&&"npc_metropolice"||"npc_combine_s"
|
||||
combine.myWeapon= m==2&&"weapon_shotgun"||m==4&&"weapon_smg1"||"weapon_ar2"
|
||||
|
||||
if m==1 or m==2 then
|
||||
combine:SetModel("models/combine_soldier.mdl")
|
||||
elseif m==3 then
|
||||
combine:SetModel("models/Combine_Super_Soldier.mdl")
|
||||
elseif m==4 then
|
||||
combine:SetModel("models/police.mdl")
|
||||
end
|
||||
|
||||
if m==2 then
|
||||
combine:SetSkin(1)
|
||||
end
|
||||
|
||||
combine:SetParent(self)
|
||||
combine:Spawn()
|
||||
end
|
||||
|
||||
for i=1,5 do
|
||||
timer.Simple(i*2,doDeploy)
|
||||
end
|
||||
else
|
||||
timer.Simple(5.5,doClose)
|
||||
|
||||
local doDeploy=function()
|
||||
if !IsValid(self) then return end
|
||||
|
||||
local mine = ents.Create("npc_rollermine")
|
||||
mine:SetPos(self:LocalToWorld(Vector(100,0,0)))
|
||||
mine:Spawn()
|
||||
mine:GetPhysicsObject():SetVelocity(self:GetAngles():Forward()*500)
|
||||
end
|
||||
|
||||
for i=1,10 do
|
||||
timer.Simple(i/2,doDeploy)
|
||||
end
|
||||
end
|
||||
|
||||
return true]]
|
||||
end
|
||||
|
||||
function ENT:SpawnFunction(ply, tr, ClassName)
|
||||
if (not tr.Hit) then return end
|
||||
local SpawnPos = tr.HitPos + tr.HitNormal * 100
|
||||
local ent = ents.Create(ClassName)
|
||||
ent:SetPos(SpawnPos)
|
||||
ent:Spawn()
|
||||
ent:Activate()
|
||||
|
||||
return ent
|
||||
end
|
||||
@@ -1,945 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.AutomaticFrameAdvance = true
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("String", 0, "PillForm")
|
||||
self:NetworkVar("Entity", 0, "PillUser")
|
||||
self:NetworkVar("Entity", 1, "Puppet")
|
||||
self:NetworkVar("Float", 0, "ChargeTime")
|
||||
self:NetworkVar("Angle", 0, "ChargeAngs")
|
||||
self:NetworkVar("Float", 1, "CloakLeft")
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self.formTable = pk_pills.getPillTable(self:GetPillForm())
|
||||
local ply = self:GetPillUser()
|
||||
|
||||
if not self.formTable or not IsValid(ply) then
|
||||
if SERVER then self:Remove() end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local hull = self.formTable.hull or Vector(32, 32, 72)
|
||||
local duckBy = self.formTable.duckBy or (self.formTable.hull and 0 or 36)
|
||||
ply:SetHull(-Vector(hull.x / 2, hull.y / 2, 0), Vector(hull.x / 2, hull.y / 2, hull.z))
|
||||
ply:SetHullDuck(-Vector(hull.x / 2, hull.y / 2, 0), Vector(hull.x / 2, hull.y / 2, hull.z - duckBy or 0))
|
||||
ply:SetRenderMode(RENDERMODE_NONE)
|
||||
--Do this so weapon equips are not blocked
|
||||
pk_pills.mapEnt(ply, nil)
|
||||
|
||||
if SERVER then
|
||||
self:SetModel("models/Combine_Helicopter/helicopter_bomb01.mdl")
|
||||
self:SetPos(ply:GetPos())
|
||||
self:SetParent(ply)
|
||||
self:DrawShadow(false)
|
||||
ply:StripWeapons()
|
||||
ply:RemoveAllAmmo()
|
||||
|
||||
if self.formTable.flies then
|
||||
ply:SetMoveType(MOVETYPE_FLY)
|
||||
else
|
||||
ply:SetMoveType(MOVETYPE_WALK)
|
||||
end
|
||||
|
||||
if ply:FlashlightIsOn() then
|
||||
ply:Flashlight(false)
|
||||
end
|
||||
|
||||
ply:Freeze(false)
|
||||
ply:SetNotSolid(false)
|
||||
ply:DrawViewModel(false)
|
||||
--ply:DrawWorldModel(false)
|
||||
local camOffset = self.formTable.camera and self.formTable.camera.offset or Vector(0, 0, 64)
|
||||
--clside this?
|
||||
ply:SetStepSize(hull.z / 4)
|
||||
ply:SetViewOffset(camOffset)
|
||||
ply:SetViewOffsetDucked(camOffset - Vector(0, 0, duckBy))
|
||||
local speed = self.formTable.moveSpeed or {}
|
||||
ply:SetWalkSpeed(speed.walk or 200)
|
||||
ply:SetRunSpeed(speed.run or speed.walk or 500)
|
||||
|
||||
if speed.ducked then
|
||||
ply:SetCrouchedWalkSpeed(speed.ducked / (speed.walk or 200))
|
||||
elseif duckBy == 0 then
|
||||
ply:SetCrouchedWalkSpeed(1)
|
||||
else
|
||||
ply:SetCrouchedWalkSpeed(.3)
|
||||
end
|
||||
|
||||
ply:SetJumpPower(self.formTable.jumpPower or 200)
|
||||
self.loopingSounds = {}
|
||||
|
||||
if self.formTable.sounds then
|
||||
for k, v in pairs(self.formTable.sounds) do
|
||||
if string.sub(k, 1, 5) == "loop_" then
|
||||
self.loopingSounds[string.sub(k, 6)] = CreateSound(self, v)
|
||||
elseif string.sub(k, 1, 5) == "auto_" and isstring(v) then
|
||||
local func
|
||||
|
||||
func = function()
|
||||
if IsValid(self) then
|
||||
local f = self.formTable.sounds[k .. "_func"]
|
||||
if not f then return end
|
||||
local play, time = f(self:GetPillUser(), self)
|
||||
|
||||
if play then
|
||||
self:PillSound(k)
|
||||
end
|
||||
|
||||
timer.Simple(time, func)
|
||||
end
|
||||
end
|
||||
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
if self.loopingSounds.move then
|
||||
self:PillLoopSound("move")
|
||||
end
|
||||
end
|
||||
|
||||
if self.formTable.health then
|
||||
self:GetPillUser():SetHealth(self.formTable.health)
|
||||
self:GetPillUser():SetMaxHealth(self.formTable.health)
|
||||
else
|
||||
self:GetPillUser():GodEnable()
|
||||
end
|
||||
|
||||
ply:SetArmor(0)
|
||||
|
||||
if self.formTable.loadout then
|
||||
for _, v in pairs(self.formTable.loadout) do
|
||||
ply:Give(v)
|
||||
end
|
||||
end
|
||||
|
||||
if self.formTable.ammo then
|
||||
for k, v in pairs(self.formTable.ammo) do
|
||||
ply:SetAmmo(v, k)
|
||||
end
|
||||
end
|
||||
|
||||
--[[if self.formTable.seqInit then
|
||||
self:PillAnim(self.formTable.seqInit,true)
|
||||
end]]
|
||||
--[[if self.formTable.bodyGroups then
|
||||
for _,v in pairs(self.formTable.bodyGroups) do
|
||||
self:SetBodygroup(v,1)
|
||||
end
|
||||
end]]
|
||||
--self:SetPlaybackRate(1)
|
||||
pk_pills.setAiTeam(ply, self.formTable.side or "default")
|
||||
local model = self.formTable.model
|
||||
local skin = self.formTable.skin
|
||||
local attachments = self.formTable.attachments
|
||||
|
||||
if self.formTable.options then
|
||||
local options = self.formTable.options()
|
||||
|
||||
if self.option and options[self.option] then
|
||||
local pickedOption = options[self.option]
|
||||
|
||||
if pickedOption.model then
|
||||
model = pickedOption.model
|
||||
end
|
||||
|
||||
if pickedOption.skin then
|
||||
skin = pickedOption.skin
|
||||
end
|
||||
|
||||
if pickedOption.attachments then
|
||||
attachments = pickedOption.attachments
|
||||
end
|
||||
else
|
||||
local pickedOption = table.Random(options)
|
||||
|
||||
if not model then
|
||||
model = pickedOption.model
|
||||
end
|
||||
|
||||
if not skin then
|
||||
skin = pickedOption.skin
|
||||
end
|
||||
|
||||
if not attachments then
|
||||
attachments = pickedOption.attachments
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local puppet = ents.Create("pill_puppet")
|
||||
puppet:SetModel(model or "models/Humans/corpse1.mdl")
|
||||
|
||||
if skin then
|
||||
puppet:SetSkin(skin)
|
||||
end
|
||||
|
||||
if attachments then
|
||||
for _, mdl in pairs(attachments) do
|
||||
local a = ents.Create("pill_attachment")
|
||||
a:SetParent(puppet)
|
||||
a:SetModel(mdl)
|
||||
a:Spawn()
|
||||
end
|
||||
end
|
||||
|
||||
if self.formTable.visColor then
|
||||
puppet:SetColor(self.formTable.visColor)
|
||||
elseif self.formTable.visColorRandom then
|
||||
puppet:SetColor(HSVToColor(math.Rand(0, 360), 1, 1))
|
||||
end
|
||||
|
||||
if self.formTable.visMat then
|
||||
puppet:SetMaterial(self.formTable.visMat)
|
||||
end
|
||||
|
||||
if self.formTable.bodyGroups then
|
||||
for _, v in pairs(self.formTable.bodyGroups) do
|
||||
if v then
|
||||
puppet:SetBodygroup(v, 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if self.formTable.modelScale then
|
||||
puppet:SetModelScale(self.formTable.modelScale, .1)
|
||||
end
|
||||
|
||||
if self.formTable.boneMorphs then
|
||||
for k, v in pairs(self.formTable.boneMorphs) do
|
||||
local b = puppet:LookupBone(k)
|
||||
|
||||
if b then
|
||||
if v.pos then
|
||||
puppet:ManipulateBonePosition(b, v.pos)
|
||||
end
|
||||
|
||||
if v.rot then
|
||||
puppet:ManipulateBoneAngles(b, v.rot)
|
||||
end
|
||||
|
||||
if v.scale then
|
||||
puppet:ManipulateBoneScale(b, v.scale)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if self.formTable.cloak then
|
||||
self:SetCloakLeft(self.formTable.cloak.max)
|
||||
end
|
||||
|
||||
--puppet:SetParent(self)
|
||||
puppet:Spawn()
|
||||
self:DeleteOnRemove(puppet)
|
||||
self:SetPuppet(puppet)
|
||||
end
|
||||
|
||||
pk_pills.mapEnt(ply, self)
|
||||
--self:SetPlaybackRate(1)
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
local ply = self:GetPillUser()
|
||||
|
||||
if SERVER then
|
||||
self:PillLoopStopAll()
|
||||
end
|
||||
|
||||
local newType = pk_pills.unmapEnt(self:GetPillUser(), self)
|
||||
|
||||
if newType ~= "ply" and IsValid(ply) then
|
||||
ply:ResetHull()
|
||||
|
||||
if SERVER then
|
||||
ply:SetViewOffset(Vector(0, 0, 64))
|
||||
ply:SetViewOffsetDucked(Vector(0, 0, 28))
|
||||
ply:SetStepSize(18)
|
||||
-- Not sure if this chunk is needed... leaving it for now.
|
||||
ply:Freeze(false)
|
||||
|
||||
if ply:Alive() then
|
||||
ply:SetMoveType(MOVETYPE_WALK)
|
||||
end
|
||||
|
||||
ply:SetNotSolid(false)
|
||||
|
||||
if ply:Alive() then
|
||||
-- Just respawn the player to reset most stuff.
|
||||
local angs = ply:EyeAngles()
|
||||
local pos = ply:GetPos()
|
||||
local vel = ply:GetVelocity()
|
||||
local hp = ply:Health()
|
||||
ply:StripWeapons()
|
||||
ply:StripAmmo()
|
||||
ply:Spawn()
|
||||
ply:SetEyeAngles(angs)
|
||||
ply:SetPos(pos)
|
||||
ply:SetVelocity(vel)
|
||||
ply:SetHealth(hp)
|
||||
end
|
||||
|
||||
if not newType then
|
||||
ply:SetRenderMode(RENDERMODE_NORMAL)
|
||||
pk_pills.setAiTeam(ply, "default")
|
||||
end
|
||||
elseif not newType then
|
||||
if ply == LocalPlayer() then
|
||||
if ply.pk_pill_gmpEnabled then
|
||||
ply.pk_pill_gmpEnabled = nil
|
||||
--RunConsoleCommand("gmp_enabled","1")
|
||||
end
|
||||
--ply.ShouldDisableLegs=nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
local ply = self:GetPillUser()
|
||||
local puppet = self:GetPuppet()
|
||||
if not IsValid(puppet) or not IsValid(ply) then return end
|
||||
local vel = ply:GetVelocity():Length()
|
||||
|
||||
if SERVER then
|
||||
--Anims
|
||||
local anims = table.Copy(self.formTable.anims.default or {})
|
||||
table.Merge(anims, (IsValid(ply:GetActiveWeapon()) and self.formTable.anims[ply:GetActiveWeapon():GetHoldType()]) or (self.forceAnimSet and self.formTable.anims[self.forceAnimSet]) or {})
|
||||
local anim
|
||||
--local useSeqVel=true
|
||||
local overrideRate
|
||||
|
||||
if (not self.anim or not anims[self.anim]) then
|
||||
self.animFreeze = nil
|
||||
self.animStart = nil
|
||||
end
|
||||
|
||||
if self.animFreeze and not self.plyFrozen then
|
||||
ply:SetWalkSpeed(ply:GetWalkSpeed() / 2)
|
||||
ply:SetRunSpeed(ply:GetWalkSpeed() / 2)
|
||||
self.plyFrozen = true
|
||||
elseif not self.animFreeze and self.plyFrozen then
|
||||
local speed = self.formTable.moveSpeed or {}
|
||||
ply:SetWalkSpeed(speed.walk or 200)
|
||||
ply:SetRunSpeed(speed.run or speed.walk or 500)
|
||||
self.plyFrozen = nil
|
||||
end
|
||||
|
||||
if self.anim and anims[self.anim] then
|
||||
anim = anims[self.anim]
|
||||
overrideRate = anims[self.anim .. "_rate"] or 1
|
||||
local cycle = puppet:GetCycle()
|
||||
|
||||
if not self.animStart then
|
||||
if cycle == 1 or (self.animCycle and self.animCycle > cycle) or (string.lower(anim) ~= string.lower(puppet:GetSequenceName(puppet:GetSequence()))) then
|
||||
self.anim = nil
|
||||
self.animCycle = nil
|
||||
|
||||
if self.animFreeze then
|
||||
self.animFreeze = nil
|
||||
end
|
||||
elseif self.animCycle then
|
||||
self.animCycle = cycle
|
||||
end
|
||||
end
|
||||
elseif self.tickAnim and anims[self.tickAnim] then
|
||||
anim = anims[self.tickAnim]
|
||||
overrideRate = anims[self.tickAnim .. "_rate"] or 1
|
||||
self.tickAnim = nil
|
||||
elseif self.burrowed then
|
||||
anim = anims["burrow_loop"]
|
||||
elseif ply:WaterLevel() > 2 then
|
||||
anim = anims["swim"] or anims["glide"] or anims["idle"]
|
||||
elseif ply:IsOnGround() then
|
||||
if ply:Crouching() then
|
||||
if vel > ply:GetCrouchedWalkSpeed() / 4 then
|
||||
anim = anims["crouch_walk"] or anims["crouch"] or anims["walk"] or anims["idle"]
|
||||
else
|
||||
anim = anims["crouch"] or anims["idle"]
|
||||
end
|
||||
else
|
||||
if vel > (ply:GetWalkSpeed() + ply:GetRunSpeed()) / 2 then
|
||||
anim = anims["run"] or anims["walk"] or anims["idle"]
|
||||
elseif vel > ply:GetWalkSpeed() / 4 then
|
||||
anim = anims["walk"] or anims["idle"]
|
||||
else
|
||||
anim = anims["idle"]
|
||||
end
|
||||
end
|
||||
else
|
||||
anim = anims["glide"] or anims["idle"]
|
||||
end
|
||||
|
||||
if anim == anims["idle"] or anim == anims["crouch"] then
|
||||
overrideRate = 1
|
||||
end
|
||||
|
||||
if (anim and puppet:GetSequence() ~= puppet:LookupSequence(anim)) or self.animStart or (self.formTable.autoRestartAnims and puppet:GetCycle() == 1) then
|
||||
puppet:ResetSequence(puppet:LookupSequence(anim))
|
||||
puppet:SetCycle(0)
|
||||
self.animCycle = 0
|
||||
end
|
||||
|
||||
self.animStart = nil
|
||||
local seq_vel = puppet:GetSequenceGroundSpeed(puppet:GetSequence())
|
||||
|
||||
--if true then
|
||||
if self.formTable.movePoseMode ~= "xy" and self.formTable.movePoseMode ~= "xy-bot" and not overrideRate then
|
||||
local rate = overrideRate or vel / seq_vel
|
||||
|
||||
--goofy limitation (floods console with errors if above 12!)
|
||||
if rate > 12 then
|
||||
rate = 12
|
||||
end
|
||||
|
||||
puppet:SetPlaybackRate(rate)
|
||||
else
|
||||
--puppet:SetPlaybackRate(1)
|
||||
end
|
||||
|
||||
--print(puppet:GetCycle())
|
||||
if self.formTable.movePoseMode then
|
||||
--
|
||||
if self.formTable.movePoseMode == "yaw" then
|
||||
local move_dir = puppet:WorldToLocalAngles(ply:GetVelocity():Angle())
|
||||
puppet:SetPoseParameter("move_yaw", move_dir.y)
|
||||
elseif self.formTable.movePoseMode == "xy" then
|
||||
if not overrideRate then
|
||||
local localvel = ply:WorldToLocal(ply:GetPos() + ply:GetVelocity())
|
||||
local maxdim = math.Max(math.abs(localvel.x), math.abs(localvel.y))
|
||||
local clampedvel = maxdim == 0 and Vector(0, 0, 0) or localvel / maxdim
|
||||
puppet:SetPoseParameter("move_x", clampedvel.x)
|
||||
puppet:SetPoseParameter("move_y", -clampedvel.y)
|
||||
seq_vel = puppet:GetSequenceGroundSpeed(puppet:GetSequence())
|
||||
|
||||
if seq_vel ~= 0 then
|
||||
puppet:SetPoseParameter("move_x", math.Clamp(localvel.x / seq_vel, -.99, .99))
|
||||
puppet:SetPoseParameter("move_y", math.Clamp(-localvel.y / seq_vel, -.99, .99))
|
||||
end
|
||||
--print(puppet:GetPlaybackRate())
|
||||
else
|
||||
puppet:SetPoseParameter("move_x", 0)
|
||||
puppet:SetPoseParameter("move_y", 0)
|
||||
end
|
||||
elseif self.formTable.movePoseMode == "xy-bot" then
|
||||
if not overrideRate then
|
||||
local localvel = ply:WorldToLocal(ply:GetPos() + ply:GetVelocity())
|
||||
local maxdim = math.Max(math.abs(localvel.x), math.abs(localvel.y))
|
||||
local clampedvel = maxdim == 0 and Vector(0, 0, 0) or localvel / maxdim
|
||||
local move_dir = puppet:WorldToLocalAngles(ply:GetVelocity():Angle())
|
||||
puppet:SetPoseParameter("move_x", clampedvel.x)
|
||||
puppet:SetPoseParameter("move_y", -clampedvel.y)
|
||||
puppet:SetPoseParameter("move_yaw", move_dir.y)
|
||||
puppet:SetPoseParameter("move_scale", 1)
|
||||
seq_vel = puppet:GetSequenceGroundSpeed(puppet:GetSequence())
|
||||
|
||||
if seq_vel ~= 0 then
|
||||
puppet:SetPoseParameter("move_x", math.Clamp(localvel.x / seq_vel, -.99, .99))
|
||||
puppet:SetPoseParameter("move_y", math.Clamp(-localvel.y / seq_vel, -.99, .99))
|
||||
puppet:SetPoseParameter("move_scale", math.Clamp(localvel:Length() / seq_vel, -.99, .99))
|
||||
end
|
||||
--print(puppet:GetPlaybackRate())
|
||||
else
|
||||
puppet:SetPoseParameter("move_x", 0)
|
||||
puppet:SetPoseParameter("move_y", 0)
|
||||
puppet:SetPoseParameter("move_yaw", 0)
|
||||
puppet:SetPoseParameter("move_scale", 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--Aimage
|
||||
if self.formTable.aim then
|
||||
if self.formTable.aim.xPose then
|
||||
local yaw = math.AngleDifference(ply:EyeAngles().y, puppet:GetAngles().y)
|
||||
|
||||
if self.formTable.aim.xInvert then
|
||||
yaw = -yaw
|
||||
end
|
||||
|
||||
puppet:SetPoseParameter(self.formTable.aim.xPose, yaw)
|
||||
end
|
||||
|
||||
if self.formTable.aim.yPose then
|
||||
local pitch = math.AngleDifference(ply:EyeAngles().p, puppet:GetAngles().p)
|
||||
|
||||
if self.formTable.aim.yInvert then
|
||||
pitch = -pitch
|
||||
end
|
||||
|
||||
puppet:SetPoseParameter(self.formTable.aim.yPose, pitch)
|
||||
end
|
||||
end
|
||||
|
||||
--gliding and landing
|
||||
if not ply:IsOnGround() and ply:WaterLevel() == 0 and self.formTable.glideThink then
|
||||
self.formTable.glideThink(ply, self)
|
||||
end
|
||||
|
||||
if not ply:IsOnGround() and not self.touchingWater and ply:WaterLevel() > 0 and self.formTable.land then
|
||||
self.formTable.land(ply, self)
|
||||
end
|
||||
|
||||
--water death
|
||||
self.touchingWater = ply:WaterLevel() > 1
|
||||
|
||||
if (self.formTable.damageFromWater and self.touchingWater) then
|
||||
if self.formTable.damageFromWater == -1 then
|
||||
--self:PillDie()
|
||||
ply:Kill()
|
||||
else
|
||||
ply:TakeDamage(self.formTable.damageFromWater)
|
||||
--TODO APPLY DAMAGE
|
||||
end
|
||||
end
|
||||
|
||||
--tick attack
|
||||
if ply:KeyDown(IN_ATTACK) and self.formTable.attack and self.formTable.attack.mode == "tick" then
|
||||
self.formTable.attack.func(ply, self, self.formTable.attack)
|
||||
end
|
||||
|
||||
if ply:KeyDown(IN_ATTACK2) and self.formTable.attack2 and self.formTable.attack2.mode == "tick" then
|
||||
self.formTable.attack2.func(ply, self, self.formTable.attack2)
|
||||
end
|
||||
|
||||
--auto attack
|
||||
if ply:KeyDown(IN_ATTACK) and self.formTable.attack and self.formTable.attack.mode == "auto" then
|
||||
if not self.formTable.aim then
|
||||
self:PillLoopSound("attack")
|
||||
else
|
||||
self:PillLoopStop("attack")
|
||||
end
|
||||
|
||||
if (not self.lastAttack or (self.formTable.attack.interval or self.formTable.attack.delay) < CurTime() - self.lastAttack) then
|
||||
self.formTable.attack.func(ply, self, self.formTable.attack)
|
||||
self.lastAttack = CurTime()
|
||||
end
|
||||
else
|
||||
self:PillLoopStop("attack")
|
||||
end
|
||||
|
||||
if ply:KeyDown(IN_ATTACK2) and self.formTable.attack2 and self.formTable.attack2.mode == "auto" then
|
||||
if not self.formTable.aim then
|
||||
self:PillLoopSound("attack2")
|
||||
else
|
||||
self:PillLoopStop("attack2")
|
||||
end
|
||||
|
||||
if not self.lastAttack2 or (self.formTable.attack2.interval or self.formTable.attack2.delay) < CurTime() - self.lastAttack2 then
|
||||
self.formTable.attack2.func(ply, self, self.formTable.attack2)
|
||||
self.lastAttack2 = CurTime()
|
||||
end
|
||||
else
|
||||
self:PillLoopStop("attack2")
|
||||
end
|
||||
|
||||
--charge
|
||||
if self:GetChargeTime() ~= 0 then
|
||||
if ply:OnGround() then
|
||||
local charge = self.formTable.charge
|
||||
local angs = ply:EyeAngles()
|
||||
self:PillAnimTick("charge_loop")
|
||||
local hit_ent = ply:TraceHullAttack(ply:EyePos(), ply:EyePos() + angs:Forward() * 100, Vector(-20, -20, -20), Vector(20, 20, 20), charge.dmg, DMG_CRUSH, 1, true)
|
||||
|
||||
if IsValid(hit_ent) then
|
||||
self:PillAnim("charge_hit", true)
|
||||
self:PillGesture("charge_hit")
|
||||
self:PillSound("charge_hit")
|
||||
self:SetChargeTime(0)
|
||||
self:PillLoopStop("charge")
|
||||
end
|
||||
else
|
||||
self:SetChargeTime(0)
|
||||
self:PillLoopStop("charge")
|
||||
end
|
||||
end
|
||||
|
||||
--Cloak
|
||||
if self.formTable.cloak then
|
||||
local cloak = self.formTable.cloak
|
||||
|
||||
if self.iscloaked then
|
||||
local cloakamt = self:GetCloakLeft()
|
||||
|
||||
if cloakamt ~= -1 then
|
||||
cloakamt = cloakamt - FrameTime()
|
||||
|
||||
if cloakamt < 0 then
|
||||
cloakamt = 0
|
||||
self:ToggleCloak()
|
||||
end
|
||||
|
||||
self:SetCloakLeft(cloakamt)
|
||||
end
|
||||
else
|
||||
local cloakamt = self:GetCloakLeft()
|
||||
|
||||
if cloakmt ~= -1 and cloakamt < cloak.max then
|
||||
cloakamt = cloakamt + FrameTime() * cloak.rechargeRate
|
||||
|
||||
if cloakamt > cloak.max then
|
||||
cloakamt = cloak.max
|
||||
end
|
||||
|
||||
self:SetCloakLeft(cloakamt)
|
||||
end
|
||||
end
|
||||
|
||||
local color = self:GetPuppet():GetColor()
|
||||
|
||||
if self.iscloaked then
|
||||
if color.a > 0 then
|
||||
color.a = color.a - 5
|
||||
self:GetPuppet():SetColor(color)
|
||||
end
|
||||
else
|
||||
if color.a < 255 then
|
||||
color.a = color.a + 5
|
||||
self:GetPuppet():SetColor(color)
|
||||
end
|
||||
end
|
||||
|
||||
--PrintTable(color)
|
||||
if IsValid(self.wepmdl) and self.wepmdl:GetColor().a ~= color.a then
|
||||
self.wepmdl:SetColor(color)
|
||||
end
|
||||
end
|
||||
|
||||
--if !IsValid(ply) then self:NextThink(CurTime()) return true end
|
||||
--wepon-no longer SO hackey
|
||||
if not self.formTable.hideWeapons then
|
||||
local realWep = self:GetPillUser():GetActiveWeapon()
|
||||
|
||||
--&&self:GetPillUser()!=ply or pk_pills.var_thirdperson:GetBool()) then
|
||||
if IsValid(realWep) and realWep:GetModel() ~= "" then
|
||||
--hiding the real thing [BROKEN]
|
||||
--[[if realWep:GetRenderMode()!=RENDERMODE_NONE then
|
||||
realWep:SetRenderMode(RENDERMODE_NONE)
|
||||
end]]
|
||||
if realWep.pill_attachment then
|
||||
if IsValid(self.wepmdl) then
|
||||
self.wepmdl:Remove()
|
||||
end
|
||||
|
||||
self.wepmdl = ents.Create("pill_attachment_wep")
|
||||
self.wepmdl:SetParent(self:GetPuppet())
|
||||
self.wepmdl:SetModel(realWep:GetModel())
|
||||
self.wepmdl.attachment = realWep.pill_attachment
|
||||
self.wepmdl:Spawn()
|
||||
|
||||
if realWep.pill_offset then
|
||||
self.wepmdl:SetWepOffset(realWep.pill_offset)
|
||||
end
|
||||
|
||||
if realWep.pill_angle then
|
||||
self.wepmdl:SetWepAng(realWep.pill_angle)
|
||||
end
|
||||
|
||||
realWep.pill_proxy = self.wepmdl
|
||||
elseif not IsValid(self.wepmdl) then
|
||||
self.wepmdl = ents.Create("pill_attachment_wep")
|
||||
self.wepmdl:SetParent(self:GetPuppet())
|
||||
self.wepmdl:SetModel(realWep:GetModel())
|
||||
self.wepmdl:Spawn()
|
||||
realWep.pill_proxy = self.wepmdl
|
||||
elseif self.wepmdl:GetModel() ~= realWep:GetModel() then
|
||||
self.wepmdl:SetModel(realWep:GetModel())
|
||||
end
|
||||
elseif IsValid(self.wepmdl) then
|
||||
self.wepmdl:Remove()
|
||||
end
|
||||
end
|
||||
else
|
||||
if self:GetPillUser() ~= LocalPlayer() or pk_pills.convars.cl_thirdperson:GetBool() then
|
||||
puppet:SetNoDraw(false)
|
||||
else
|
||||
puppet:SetNoDraw(true)
|
||||
end
|
||||
|
||||
local realWep = self:GetPillUser():GetActiveWeapon()
|
||||
|
||||
if IsValid(realWep) and realWep:GetModel() ~= "" and not realWep:GetNoDraw() then
|
||||
realWep:SetNoDraw(true)
|
||||
end
|
||||
end
|
||||
|
||||
--Align pos and angles with player
|
||||
if SERVER then
|
||||
puppet:SetPos(ply:GetPos())
|
||||
else
|
||||
puppet:SetRenderOrigin(ply:GetPos())
|
||||
end
|
||||
|
||||
if vel > 0 or math.abs(math.AngleDifference(puppet:GetAngles().y, ply:EyeAngles().y)) > 60 then
|
||||
local angs = ply:EyeAngles()
|
||||
angs.p = 0
|
||||
|
||||
if SERVER then
|
||||
puppet:SetAngles(angs)
|
||||
else
|
||||
--puppet:SetAngles(angs)
|
||||
puppet:SetRenderAngles(angs)
|
||||
end
|
||||
end
|
||||
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
function ENT:DoKeyPress(ply, key)
|
||||
if self.animFreeze then return end
|
||||
|
||||
if self:GetChargeTime() ~= 0 then
|
||||
self:SetChargeTime(0)
|
||||
self:PillLoopStop("charge")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if key == IN_ATTACK and self.formTable.attack and self.formTable.attack.mode == "trigger" then
|
||||
self.formTable.attack.func(ply, self, self.formTable.attack)
|
||||
end
|
||||
|
||||
if key == IN_ATTACK2 and self.formTable.attack2 and self.formTable.attack2.mode == "trigger" then
|
||||
self.formTable.attack2.func(ply, self, self.formTable.attack2)
|
||||
end
|
||||
|
||||
if key == IN_RELOAD and self.formTable.reload then
|
||||
self.formTable.reload(ply, self)
|
||||
end
|
||||
|
||||
if key == IN_DUCK then
|
||||
if self.formTable.canBurrow then
|
||||
if not self.burrowed then
|
||||
local trace = util.QuickTrace(ply:GetPos(), Vector(0, 0, -1), ply)
|
||||
|
||||
if trace.Hit and (trace.MatType == MAT_DIRT or trace.MatType == MAT_SAND or trace.MatType == MAT_GRASS) then
|
||||
self:PillAnim("burrow_in")
|
||||
self:PillSound("burrow_in")
|
||||
ply:SetLocalVelocity(Vector(0, 0, 0))
|
||||
ply:SetMoveType(MOVETYPE_NONE)
|
||||
ply:SetNotSolid(true)
|
||||
self.burrowed = true
|
||||
self:GetPuppet():DrawShadow(false)
|
||||
--local p=ply: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:PillSound("burrow")
|
||||
--ent:PillLoopStopAll()
|
||||
end
|
||||
else
|
||||
self:PillAnim("burrow_out")
|
||||
self:PillSound("burrow_out")
|
||||
ply:SetMoveType(MOVETYPE_WALK)
|
||||
ply:SetNotSolid(false)
|
||||
self.burrowed = nil
|
||||
self:GetPuppet():DrawShadow(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:DoJump()
|
||||
if self.formTable.jump then
|
||||
self.formTable.jump(self:GetPillUser(), self)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PillDie()
|
||||
local ply = self:GetPillUser()
|
||||
|
||||
if self.formTable.die then
|
||||
self.formTable.die(ply, self)
|
||||
end
|
||||
|
||||
self:PillSound("die")
|
||||
|
||||
if IsValid(self:GetPuppet()) and not self.formTable.noragdoll then
|
||||
local r = ents.Create("prop_ragdoll")
|
||||
r:SetModel(self.subModel or self:GetPuppet():GetModel())
|
||||
r:SetPos(ply:GetPos())
|
||||
r:SetAngles(ply:GetAngles())
|
||||
--r:SetOwner(ply)
|
||||
r:Spawn()
|
||||
r:SetCollisionGroup(COLLISION_GROUP_DEBRIS)
|
||||
r:Fire("FadeAndRemove", nil, 10)
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
pk_pills.handeDeathCommon(self)
|
||||
end
|
||||
|
||||
--[[function ENT:PillDie()
|
||||
if self.dead then return end
|
||||
self:GetPillUser():KillSilent()
|
||||
if self.formTable.die then
|
||||
self.formTable.die(self:GetPillUser(),self)
|
||||
end
|
||||
self:PillSound("die")
|
||||
self:Remove()
|
||||
self.dead=true
|
||||
end]]
|
||||
function ENT:PillAnim(name, freeze)
|
||||
self.anim = name
|
||||
self.animStart = true
|
||||
self.animFreeze = true
|
||||
end
|
||||
|
||||
function ENT:PillAnimTick(name)
|
||||
self.tickAnim = name
|
||||
end
|
||||
|
||||
function ENT:PillGesture(name)
|
||||
local ply = self:GetPillUser()
|
||||
local puppet = self:GetPuppet()
|
||||
if not IsValid(puppet) then return end
|
||||
local anims = table.Copy(self.formTable.anims.default or {})
|
||||
table.Merge(anims, IsValid(ply:GetActiveWeapon()) and self.formTable.anims[ply:GetActiveWeapon():GetHoldType()] or {})
|
||||
local gesture = anims["g_" .. name]
|
||||
|
||||
if gesture then
|
||||
puppet:RestartGesture(puppet:GetSequenceActivity(puppet:LookupSequence(gesture)))
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PillChargeAttack()
|
||||
if not self:GetPillUser():OnGround() or self.burrowed then return end
|
||||
self:PillAnim("charge_start", true)
|
||||
self:PillSound("charge_start")
|
||||
|
||||
local function doStart()
|
||||
if not IsValid(self) then return end
|
||||
self:SetChargeTime(CurTime())
|
||||
local angs = self:GetPillUser():EyeAngles()
|
||||
angs.p = 0
|
||||
self:SetChargeAngs(angs)
|
||||
self:PillLoopSound("charge")
|
||||
end
|
||||
|
||||
if self.formTable.charge.delay then
|
||||
timer.Simple(self.formTable.charge.delay, doStart)
|
||||
else
|
||||
doStart()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PillFilterCam(ent)
|
||||
net.Start("pk_pill_filtercam")
|
||||
net.WriteEntity(self)
|
||||
net.WriteEntity(ent)
|
||||
net.Send(self:GetPillUser())
|
||||
end
|
||||
else
|
||||
function ENT:GetPillHealth()
|
||||
return self:GetPillUser():Health()
|
||||
end
|
||||
end
|
||||
|
||||
--The "bulk" parameter should only be used if you plan to play a ton of sounds in quick succession.
|
||||
function ENT:PillSound(name, bulk)
|
||||
if not self.formTable.sounds then return end
|
||||
local s = self.formTable.sounds[name]
|
||||
|
||||
if (istable(s)) then
|
||||
s = table.Random(s)
|
||||
end
|
||||
|
||||
if isstring(s) then
|
||||
if bulk then
|
||||
sound.Play(s, self:GetPos(), self.formTable.sounds[name .. "_level"] or (name == "step" and 75 or 100), self.formTable.sounds[name .. "_pitch"] or 100, 1)
|
||||
else
|
||||
self:EmitSound(s, self.formTable.sounds[name .. "_level"] or (name == "step" and 75 or 100), self.formTable.sounds[name .. "_pitch"] or 100)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PillLoopSound(name, volume, pitch)
|
||||
if not self.loopingSounds[name] then return end
|
||||
local s = self.loopingSounds[name]
|
||||
|
||||
if s:IsPlaying() then
|
||||
if volume then
|
||||
s:ChangeVolume(volume)
|
||||
end
|
||||
|
||||
if pitch then
|
||||
s:ChangePitch(pitch, .1)
|
||||
end
|
||||
else
|
||||
if volume or pitch then
|
||||
s:PlayEx(volume or 1, pitch or 100)
|
||||
else
|
||||
s:Play()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PillLoopStop(name)
|
||||
if not self.loopingSounds[name] then return end
|
||||
local s = self.loopingSounds[name]
|
||||
s:FadeOut(.1)
|
||||
end
|
||||
|
||||
function ENT:PillLoopStopAll()
|
||||
if self.loopingSounds then
|
||||
for _, v in pairs(self.loopingSounds) do
|
||||
v:Stop()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:ToggleCloak()
|
||||
local ply = self:GetPillUser()
|
||||
|
||||
if self.iscloaked then
|
||||
self.iscloaked = nil
|
||||
self:PillSound("uncloak")
|
||||
pk_pills.setAiTeam(ply, self.formTable.side or "default")
|
||||
else
|
||||
local cloakleft = self:GetCloakLeft()
|
||||
|
||||
if cloakleft > 0 or cloakleft == -1 then
|
||||
self.iscloaked = true
|
||||
self:PillSound("cloak")
|
||||
pk_pills.setAiTeam(ply, "harmless")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
--Align pos and angles with player
|
||||
--[[local puppet = self:GetPuppet()
|
||||
local ply = self:GetPillUser()
|
||||
local vel=ply:GetVelocity():Length()
|
||||
|
||||
if IsValid(puppet) then
|
||||
puppet:SetRenderOrigin(ply:GetPos())
|
||||
|
||||
if vel>0||math.abs(math.AngleDifference(puppet:GetAngles().y,ply:EyeAngles().y))>60 then
|
||||
local angs=ply:EyeAngles()
|
||||
angs.p=0
|
||||
|
||||
puppet:SetRenderAngles(angs)
|
||||
end
|
||||
end
|
||||
|
||||
puppet:DrawModel()]]
|
||||
end
|
||||
@@ -1,602 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.AutomaticFrameAdvance = true
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("String", 0, "PillForm")
|
||||
self:NetworkVar("Entity", 0, "PillUser")
|
||||
--self:NetworkVar("Int",0,"PillHealth")
|
||||
self:NetworkVar("Entity", 1, "PillAimEnt")
|
||||
end
|
||||
|
||||
function ENT:SetPillHealth(h)
|
||||
local ply = self:GetPillUser()
|
||||
|
||||
if IsValid(ply) then
|
||||
ply:SetHealth(h)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:GetPillHealth(h)
|
||||
local ply = self:GetPillUser()
|
||||
if IsValid(ply) then return ply:Health() end
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
pk_pills.mapEnt(self:GetPillUser(), self)
|
||||
self.formTable = pk_pills.getPillTable(self:GetPillForm())
|
||||
local ply = self:GetPillUser()
|
||||
|
||||
if not self.formTable or not IsValid(ply) then
|
||||
self:Remove()
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
ply:SetRenderMode(RENDERMODE_NONE)
|
||||
|
||||
if SERVER then
|
||||
local model = self.formTable.model
|
||||
local skin = self.formTable.skin
|
||||
local visMat = self.formTable.visMat
|
||||
|
||||
if self.formTable.options then
|
||||
local options = self.formTable.options()
|
||||
|
||||
if self.option and options[self.option] then
|
||||
local pickedOption = options[self.option]
|
||||
|
||||
if pickedOption.model then
|
||||
model = pickedOption.model
|
||||
end
|
||||
|
||||
if pickedOption.skin then
|
||||
skin = pickedOption.skin
|
||||
end
|
||||
|
||||
if pickedOption.visMat then
|
||||
visMat = pickedOption.visMat
|
||||
end
|
||||
else
|
||||
local pickedOption = table.Random(options)
|
||||
|
||||
if not model then
|
||||
model = pickedOption.model
|
||||
end
|
||||
|
||||
if not skin then
|
||||
skin = pickedOption.skin
|
||||
end
|
||||
|
||||
if not visMat then
|
||||
visMat = pickedOption.visMat
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self:SetModel(model or "models/props_junk/watermelon01.mdl")
|
||||
|
||||
if skin then
|
||||
self:SetSkin(skin)
|
||||
end
|
||||
|
||||
--Physics
|
||||
if self.formTable.sphericalPhysics then
|
||||
self:PhysicsInitSphere(self.formTable.sphericalPhysics)
|
||||
self:GetPhysicsObject():SetMass(250)
|
||||
elseif self.formTable.boxPhysics then
|
||||
self:PhysicsInitBox(self.formTable.boxPhysics[1], self.formTable.boxPhysics[2])
|
||||
self:GetPhysicsObject():SetMass(250)
|
||||
else
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
end
|
||||
|
||||
if self.formTable.spawnFrozen then
|
||||
self:GetPhysicsObject():EnableMotion(false)
|
||||
end
|
||||
|
||||
ply:DeleteOnRemove(self)
|
||||
--ply:PhysicsInit(SOLID_NONE)
|
||||
ply:SetMoveType(MOVETYPE_NONE)
|
||||
ply:SetSolid(SOLID_NONE)
|
||||
ply:GodEnable()
|
||||
ply:SetArmor(0)
|
||||
ply:StripWeapons()
|
||||
ply:RemoveAllAmmo()
|
||||
|
||||
if ply:FlashlightIsOn() then
|
||||
ply:Flashlight(false)
|
||||
end
|
||||
|
||||
pk_pills.setAiTeam(ply, "harmless")
|
||||
|
||||
if self.formTable.health then
|
||||
ply:SetHealth(self.formTable.health)
|
||||
ply:SetMaxHealth(self.formTable.health)
|
||||
end
|
||||
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if IsValid(phys) then
|
||||
phys:Wake()
|
||||
|
||||
if self.formTable.physMat then
|
||||
phys:SetMaterial(self.formTable.physMat)
|
||||
end
|
||||
end
|
||||
|
||||
self.drive = {
|
||||
functions = pk_pills.getDrive(self.formTable.driveType),
|
||||
options = self.formTable.driveOptions
|
||||
}
|
||||
|
||||
self.loopingSounds = {}
|
||||
|
||||
if self.formTable.sounds then
|
||||
for k, v in pairs(self.formTable.sounds) do
|
||||
if v == false then continue end
|
||||
|
||||
if string.sub(k, 1, 5) == "loop_" then
|
||||
self.loopingSounds[string.sub(k, 6)] = CreateSound(self, v)
|
||||
elseif string.sub(k, 1, 5) == "auto_" and isstring(v) then
|
||||
local func
|
||||
|
||||
func = function()
|
||||
if IsValid(self) then
|
||||
local f = self.formTable.sounds[k .. "_func"]
|
||||
if not f then return end
|
||||
local play, time = f(ply, self)
|
||||
|
||||
if play then
|
||||
self:PillSound(k)
|
||||
end
|
||||
|
||||
timer.Simple(time, func)
|
||||
end
|
||||
end
|
||||
|
||||
func()
|
||||
end
|
||||
end
|
||||
|
||||
if self.loopingSounds.move and not self.formTable.moveSoundControl then
|
||||
self:PillLoopSound("move")
|
||||
end
|
||||
end
|
||||
|
||||
--[[if self.formTable.health then
|
||||
self:SetPillHealth(self.formTable.health)
|
||||
end]]
|
||||
if self.formTable.seqInit then
|
||||
self:PillAnim(self.formTable.seqInit, true)
|
||||
end
|
||||
|
||||
if visMat then
|
||||
self:SetMaterial(visMat)
|
||||
end
|
||||
|
||||
if self.formTable.subMats then
|
||||
for k, v in pairs(self.formTable.subMats) do
|
||||
self:SetSubMaterial(k, v)
|
||||
end
|
||||
end
|
||||
|
||||
if self.formTable.modelScale then
|
||||
self:SetModelScale(self.formTable.modelScale, .1)
|
||||
end
|
||||
|
||||
if self.formTable.trail then
|
||||
local t = self.formTable.trail
|
||||
local start = t.width or 40
|
||||
local endd = start / 2
|
||||
util.SpriteTrail(self, 0, t.color or Color(255, 255, 255), false, start, endd, t.length or 4, 1 / (start + endd) * .5, t.texture)
|
||||
end
|
||||
|
||||
if self.formTable.bodyGroups then
|
||||
for _, v in pairs(self.formTable.bodyGroups) do
|
||||
self:SetBodygroup(v, 1)
|
||||
end
|
||||
end
|
||||
|
||||
local mins, maxs = self:GetCollisionBounds()
|
||||
local points = {Vector(mins.x, 0, 0), Vector(0, mins.y, 0), Vector(0, 0, mins.z), Vector(maxs.x, 0, 0), Vector(0, maxs.y, 0), Vector(0, 0, maxs.z)}
|
||||
self:AddFlags(FL_OBJECT)
|
||||
pk_pills.setAiTeam(self, self.formTable.side or "default")
|
||||
self:SetOwner(ply)
|
||||
--self:SetPhysicsAttacker(ply)
|
||||
self:SetPlaybackRate(1)
|
||||
else
|
||||
if ply == LocalPlayer() then
|
||||
--Compatibility with gm+
|
||||
if gmp and gmp.Enabled:GetBool() then
|
||||
ply.pk_pill_gmpEnabled = true
|
||||
--RunConsoleCommand("gmp_enabled","0")
|
||||
end
|
||||
|
||||
--Compatibility with Gmod Legs
|
||||
--ply.ShouldDisableLegs=true
|
||||
self.camTraceFilter = {self}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PhysicsUpdate()
|
||||
if SERVER and self.drive.functions then
|
||||
self.drive.functions.think(self:GetPillUser(), self, self.drive.options)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
local ply = self:GetPillUser()
|
||||
|
||||
if SERVER then
|
||||
self:PillLoopStopAll()
|
||||
end
|
||||
|
||||
if not pk_pills.unmapEnt(self:GetPillUser(), self) then
|
||||
if SERVER then
|
||||
pk_pills.setAiTeam(ply, "default")
|
||||
ply:SetRenderMode(RENDERMODE_NORMAL)
|
||||
|
||||
if not self.dead then
|
||||
local angs = ply:EyeAngles()
|
||||
ply:Spawn()
|
||||
ply:SetEyeAngles(angs)
|
||||
ply:SetPos(self:GetPos())
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if phys:IsValid() then
|
||||
ply:SetVelocity(phys:GetVelocity())
|
||||
end
|
||||
else
|
||||
ply:KillSilent()
|
||||
end
|
||||
else
|
||||
if ply == LocalPlayer() then
|
||||
if ply.pk_pill_gmpEnabled then
|
||||
ply.pk_pill_gmpEnabled = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
--Clientside think hook-used for pose params
|
||||
function ENT:Think()
|
||||
if self.formTable then
|
||||
if self.formTable.renderOffset then
|
||||
local offset = self.formTable.renderOffset(self:GetPillUser(), self)
|
||||
self:SetRenderOrigin(self:GetNetworkOrigin() + offset)
|
||||
end
|
||||
end
|
||||
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
else
|
||||
function ENT:Think()
|
||||
local ply = self:GetPillUser()
|
||||
if not IsValid(ply) then return end
|
||||
ply:SetPos(self:GetPos())
|
||||
|
||||
if self.formTable.pose then
|
||||
for k, f in pairs(self.formTable.pose) do
|
||||
local old = self:GetPoseParameter(k)
|
||||
local new = f(self:GetPillUser(), self, old)
|
||||
|
||||
if new then
|
||||
self:SetPoseParameter(k, new)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if self.formTable.aim and not self.formTable.aim.usesSecondaryEnt or IsValid(self:GetPillAimEnt()) then
|
||||
local aimEnt = self.formTable.aim.usesSecondaryEnt and self:GetPillAimEnt() or self
|
||||
|
||||
if self.formTable.aim.xPose and self.formTable.aim.yPose then
|
||||
if not self.formTable.canAim or self.formTable.canAim(ply, self) then
|
||||
local ang = ply:EyeAngles()
|
||||
local locang = aimEnt:WorldToLocalAngles(ang)
|
||||
local xOffset = self.formTable.aim.xOffset or 0
|
||||
|
||||
if not self.formTable.aim.xInvert then
|
||||
aimEnt:SetPoseParameter(self.formTable.aim.xPose, math.NormalizeAngle(locang.y + xOffset))
|
||||
else
|
||||
aimEnt:SetPoseParameter(self.formTable.aim.xPose, math.NormalizeAngle(-locang.y + xOffset))
|
||||
end
|
||||
|
||||
if not self.formTable.aim.yInvert then
|
||||
aimEnt:SetPoseParameter(self.formTable.aim.yPose, locang.p)
|
||||
else
|
||||
aimEnt:SetPoseParameter(self.formTable.aim.yPose, -locang.p)
|
||||
end
|
||||
elseif not self.formTable.useDefAim or self.formTable.useDefAim(ply, self) then
|
||||
aimEnt:SetPoseParameter(self.formTable.aim.xPose, self.formTable.aim.xDef or 0)
|
||||
aimEnt:SetPoseParameter(self.formTable.aim.yPose, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if self.formTable.boneMorphs then
|
||||
for k, v in pairs(self.formTable.boneMorphs) do
|
||||
local b = self:LookupBone(k)
|
||||
|
||||
if b then
|
||||
if isfunction(v) then
|
||||
v = v(ply, self)
|
||||
end
|
||||
|
||||
if not istable(v) then continue end
|
||||
|
||||
if v.pos then
|
||||
self:ManipulateBonePosition(b, v.pos)
|
||||
end
|
||||
|
||||
if v.rot then
|
||||
self:ManipulateBoneAngles(b, v.rot)
|
||||
end
|
||||
|
||||
if v.scale then
|
||||
self:ManipulateBoneScale(b, v.scale)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if self.formTable.moveSoundControl then
|
||||
local p = self.formTable.moveSoundControl(ply, self)
|
||||
|
||||
if p then
|
||||
self:PillLoopSound("move", nil, p)
|
||||
else
|
||||
self:PillLoopStop("move")
|
||||
end
|
||||
end
|
||||
|
||||
if (self.formTable.damageFromWater and self:WaterLevel() > 1) then
|
||||
if self.formTable.damageFromWater == -1 then
|
||||
self:PillDie()
|
||||
else
|
||||
--TODO APPLY DAMAGE
|
||||
end
|
||||
end
|
||||
|
||||
if ply:KeyDown(IN_ATTACK) and self.formTable.attack and self.formTable.attack.mode == "auto" then
|
||||
if not self.formTable.aim or not self.formTable.aim.usesSecondaryEnt or IsValid(self:GetPillAimEnt()) then
|
||||
self:PillLoopSound("attack")
|
||||
else
|
||||
self:PillLoopStop("attack")
|
||||
end
|
||||
|
||||
if (not self.lastAttack or self.formTable.attack.delay < CurTime() - self.lastAttack) then
|
||||
self.formTable.attack.func(ply, self, self.formTable.attack)
|
||||
self.lastAttack = CurTime()
|
||||
end
|
||||
else
|
||||
self:PillLoopStop("attack")
|
||||
end
|
||||
|
||||
if ply:KeyDown(IN_ATTACK2) and self.formTable.attack2 and self.formTable.attack2.mode == "auto" then
|
||||
if not self.formTable.aim or not self.formTable.aim.usesSecondaryEnt or IsValid(self:GetPillAimEnt()) then
|
||||
self:PillLoopSound("attack2")
|
||||
else
|
||||
self:PillLoopStop("attack2")
|
||||
end
|
||||
|
||||
if not self.lastAttack2 or self.formTable.attack2.delay < CurTime() - self.lastAttack2 then
|
||||
self.formTable.attack2.func(ply, self, self.formTable.attack2)
|
||||
self.lastAttack2 = CurTime()
|
||||
end
|
||||
else
|
||||
self:PillLoopStop("attack2")
|
||||
end
|
||||
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:DoKeyPress(ply, key)
|
||||
if self.drive.functions then
|
||||
self.drive.functions.key(ply, self, self.drive.options, key)
|
||||
end
|
||||
|
||||
if key == IN_ATTACK and self.formTable.attack and self.formTable.attack.mode == "trigger" then
|
||||
self.formTable.attack.func(ply, self, self.formTable.attack)
|
||||
end
|
||||
|
||||
if key == IN_ATTACK2 and self.formTable.attack2 and self.formTable.attack2.mode == "trigger" then
|
||||
self.formTable.attack2.func(ply, self, self.formTable.attack2)
|
||||
end
|
||||
|
||||
if key == IN_RELOAD and self.formTable.reload then
|
||||
self.formTable.reload(ply, self)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StartTouch(TouchEnt)
|
||||
if not IsValid(TouchEnt:GetPhysicsObject()) then return end
|
||||
|
||||
if (TouchEnt:IsPlayer() or TouchEnt:IsNPC() or TouchEnt:GetClass() == "pill_ent_phys") and TouchEnt:GetPhysicsObject():GetMaterial() ~= "metal" then
|
||||
if self.formTable.contact then
|
||||
local dmg_amt, dmg_type, dmg_force = self.formTable.contact(self:GetPillUser(), self, TouchEnt)
|
||||
|
||||
if dmg_amt then
|
||||
local dmg = DamageInfo()
|
||||
dmg:SetDamage(20)
|
||||
dmg:SetDamagePosition(self:GetPos())
|
||||
dmg:SetAttacker(self:GetPillUser())
|
||||
|
||||
if dmg_type then
|
||||
dmg:SetDamageType(dmg_type)
|
||||
end
|
||||
|
||||
if dmg_force then
|
||||
local force_vector = (TouchEnt:GetPos() - self:GetPos())
|
||||
|
||||
if self.formTable.contactForceHorizontal then
|
||||
force_vector.z = 0
|
||||
end
|
||||
|
||||
force_vector:Normalize()
|
||||
force_vector = force_vector * dmg_force
|
||||
dmg:SetDamageForce(force_vector)
|
||||
self:GetPhysicsObject():ApplyForceCenter(-force_vector)
|
||||
end
|
||||
|
||||
TouchEnt:TakeDamageInfo(dmg)
|
||||
self:PillSound("contact")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PhysicsCollide(collide, phys)
|
||||
if self.formTable.collide then
|
||||
self.formTable.collide(self:GetPillUser(), self, collide)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnTakeDamage(dmg)
|
||||
if (self.formTable.diesOnExplode and dmg:GetDamageType() == DMG_BLAST) then
|
||||
self:PillDie()
|
||||
end
|
||||
|
||||
if self.formTable.health then
|
||||
if not self.formTable.onlyTakesExplosiveDamage then
|
||||
local newHealth = self:GetPillHealth() - dmg:GetDamage()
|
||||
|
||||
if newHealth <= 0 then
|
||||
self:PillDie()
|
||||
else
|
||||
self:SetPillHealth(newHealth)
|
||||
end
|
||||
elseif dmg:GetDamageType() == DMG_BLAST then
|
||||
local newHealth = self:GetPillHealth() - 1
|
||||
|
||||
if newHealth <= 0 then
|
||||
self:PillDie()
|
||||
else
|
||||
self:SetPillHealth(newHealth)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PillDie()
|
||||
if self.dead then return end
|
||||
|
||||
if self.formTable.die then
|
||||
self.formTable.die(self:GetPillUser(), self)
|
||||
end
|
||||
|
||||
self:GetPillUser():SetPos(self:GetPos()) --This makes the post-death camera position correctly
|
||||
self:PillSound("die")
|
||||
self:Remove()
|
||||
self.dead = true
|
||||
pk_pills.handeDeathCommon(self)
|
||||
end
|
||||
|
||||
function ENT:PillAnim(seq, force)
|
||||
if force then
|
||||
--self:ResetSequenceInfo()
|
||||
self:ResetSequence(self:LookupSequence(seq))
|
||||
else
|
||||
self:SetSequence(self:LookupSequence(seq))
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PillFilterCam(ent)
|
||||
net.Start("pk_pill_filtercam")
|
||||
net.WriteEntity(self)
|
||||
net.WriteEntity(ent)
|
||||
net.Send(self:GetPillUser())
|
||||
end
|
||||
end
|
||||
|
||||
--The "bulk" parameter should only be used if you plan to play a ton of sounds in quick succession.
|
||||
function ENT:PillSound(name, bulk)
|
||||
if not self.formTable.sounds then return end
|
||||
local s = self.formTable.sounds[name]
|
||||
|
||||
if (istable(s)) then
|
||||
s = table.Random(s)
|
||||
end
|
||||
|
||||
if isstring(s) then
|
||||
if bulk then
|
||||
sound.Play(s, self:GetPos(), self.formTable.sounds[name .. "_level"] or 100, self.formTable.sounds[name .. "_pitch"] or 100, 1)
|
||||
else
|
||||
self:EmitSound(s, self.formTable.sounds[name .. "_level"] or 100, self.formTable.sounds[name .. "_pitch"] or 100)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PillLoopSound(name, volume, pitch)
|
||||
if not self.loopingSounds[name] then return end
|
||||
local s = self.loopingSounds[name]
|
||||
|
||||
if s:IsPlaying() then
|
||||
if volume then
|
||||
s:ChangeVolume(volume)
|
||||
end
|
||||
|
||||
if pitch then
|
||||
s:ChangePitch(pitch, .1)
|
||||
end
|
||||
else
|
||||
if volume or pitch then
|
||||
s:PlayEx(volume or 1, pitch or 100)
|
||||
else
|
||||
s:Play()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PillLoopStop(name)
|
||||
if not self.loopingSounds[name] then return end
|
||||
local s = self.loopingSounds[name]
|
||||
s:FadeOut(.1)
|
||||
end
|
||||
|
||||
function ENT:PillLoopStopAll()
|
||||
if not self.loopingSounds then return end
|
||||
|
||||
for _, v in pairs(self.loopingSounds) do
|
||||
v:Stop()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
if self:GetPillUser() ~= LocalPlayer() or pk_pills.convars.cl_thirdperson:GetBool() then
|
||||
if self.formTable.sprite then
|
||||
if not self.spriteMat then
|
||||
self.spriteMat = Material(self.formTable.sprite.mat)
|
||||
end
|
||||
|
||||
local size = self.formTable.sprite.size or 40
|
||||
cam.Start3D(EyePos(), EyeAngles())
|
||||
render.SetMaterial(self.spriteMat)
|
||||
render.DrawSprite(self:GetPos() + (self.formTable.sprite.offset or Vector(0, 0, 0)), size, size, self.formTable.sprite.color or Color(255, 255, 255))
|
||||
cam.End3D()
|
||||
else
|
||||
self:DrawModel()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,224 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Hopper"
|
||||
|
||||
--[[
|
||||
Light
|
||||
0 - None
|
||||
1 - Blue
|
||||
2 - Yellow
|
||||
3 - Green
|
||||
4 - Red
|
||||
|
||||
Legs
|
||||
0 - Open
|
||||
1 - Close
|
||||
2 - Moving
|
||||
]]
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
--Physics
|
||||
self:SetModel("models/props_combine/combine_mine01.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
end
|
||||
|
||||
self.armed = false
|
||||
self.armCounter = 0
|
||||
self.held = false
|
||||
self.critical = false
|
||||
self.friendly = false
|
||||
self.alertSound = CreateSound(self, "npc/roller/mine/combine_mine_active_loop1.wav")
|
||||
--self:SetLegs(2)
|
||||
self:SetLight(1)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("Int", 0, "Light")
|
||||
self:NetworkVar("Int", 1, "Legs")
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if SERVER then
|
||||
--CurTime()
|
||||
if not self.armed and self:GetVelocity():Length() < 10 and not self.held then
|
||||
local tr = util.QuickTrace(self:GetPos(), Vector(0, 0, -15), self)
|
||||
|
||||
if tr.Hit then
|
||||
if self.armCounter < 5 then
|
||||
self.armCounter = self.armCounter + 1
|
||||
else
|
||||
local trUp = util.QuickTrace(self:GetPos(), self:LocalToWorldAngles(Angle(-90, 0, 0)):Forward() * 15, self)
|
||||
|
||||
if trUp.Hit then
|
||||
self:GetPhysicsObject():ApplyForceCenter(Vector(0, 0, 3000))
|
||||
self:GetPhysicsObject():AddAngleVelocity(VectorRand() * 500)
|
||||
self:EmitSound("npc/roller/mine/rmine_blip3.wav", 100, 100)
|
||||
else
|
||||
local trDown = util.QuickTrace(self:GetPos(), self:LocalToWorldAngles(Angle(90, 0, 0)):Forward() * 15, self)
|
||||
|
||||
if trDown.Hit then
|
||||
self.armed = true
|
||||
self:SetLight(0)
|
||||
self:SetLegs(1)
|
||||
self:EmitSound("npc/roller/blade_cut.wav", 100, 100)
|
||||
local weld = constraint.Weld(self, trDown.Entity, 0, 0, 5000, true)
|
||||
|
||||
if weld then
|
||||
weld:CallOnRemove("DeMine", function()
|
||||
if not self.held and not self.critical then
|
||||
self:SetLight(1)
|
||||
self:SetLegs(0)
|
||||
self.armed = false
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.armCounter = 0
|
||||
end
|
||||
end
|
||||
--print("AHH")
|
||||
end
|
||||
|
||||
if self:GetPhysicsObject():HasGameFlag(FVPHYSICS_PLAYER_HELD) ~= self.held then
|
||||
if not self.held then
|
||||
self:SetLight(2)
|
||||
self:SetLegs(2)
|
||||
self.held = true
|
||||
self.armed = false
|
||||
self.friendly = true
|
||||
self.critical = false
|
||||
self.alertSound:Stop()
|
||||
else
|
||||
--print(self:GetVelocity():Length())
|
||||
if self:GetVelocity():Length() > 500 then
|
||||
self:SetLight(4)
|
||||
self.critical = true
|
||||
else
|
||||
self:SetLight(1)
|
||||
self:SetLegs(0)
|
||||
end
|
||||
|
||||
self.held = false
|
||||
end
|
||||
end
|
||||
|
||||
if self.armed then
|
||||
local near = ents.FindInSphere(self:GetPos(), 200)
|
||||
local goGreen = false
|
||||
local goRed = false
|
||||
|
||||
for _, e in pairs(near) do
|
||||
local t = pk_pills.getAiTeam(e)
|
||||
|
||||
if t then
|
||||
if t == (self.friendly and "default" or "hl_combine") or t == "harmless" then
|
||||
goGreen = true
|
||||
else
|
||||
goRed = true
|
||||
|
||||
if self:GetPos():Distance(e:GetPos()) < 100 then
|
||||
constraint.RemoveAll(self)
|
||||
self:SetLight(4)
|
||||
self:SetLegs(0)
|
||||
self.alertSound:Stop()
|
||||
self.critical = true
|
||||
self:EmitSound("npc/roller/blade_in.wav", 100, 100)
|
||||
|
||||
timer.Simple(.01, function()
|
||||
self:GetPhysicsObject():ApplyForceCenter(Vector(0, 0, 5000) + (e:GetPos() + e:GetVelocity() * .8 - self:GetPos()) * 10)
|
||||
self:GetPhysicsObject():AddAngleVelocity(VectorRand() * 200)
|
||||
end)
|
||||
end
|
||||
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not self.critical then
|
||||
if goRed then
|
||||
self:SetLight(4)
|
||||
self.alertSound:Play()
|
||||
elseif goGreen then
|
||||
self:SetLight(3)
|
||||
self.alertSound:Stop()
|
||||
else
|
||||
self:SetLight(0)
|
||||
self.alertSound:Stop()
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local legState = self:GetLegs()
|
||||
local legPose = 65
|
||||
|
||||
if legState == 1 then
|
||||
legPose = 0
|
||||
elseif legState == 2 then
|
||||
legPose = (math.sin(CurTime() * 8) + 1) * 32.5
|
||||
end
|
||||
|
||||
self:SetPoseParameter('blendstates', legPose)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PhysicsCollide()
|
||||
if self.critical then
|
||||
self:Splode()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Splode()
|
||||
self:Remove()
|
||||
local explode = ents.Create("env_explosion")
|
||||
explode:SetPos(self:GetPos())
|
||||
explode:Spawn()
|
||||
--explode:SetOwner(self:GetOwner())
|
||||
explode:SetKeyValue("iMagnitude", "100")
|
||||
explode:SetOwner(self:GetOwner())
|
||||
explode:Fire("Explode", 0, 0)
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
local lightState = self:GetLight()
|
||||
local lightColor
|
||||
|
||||
if lightState == 1 then
|
||||
lightColor = Color(0, 0, 255)
|
||||
elseif lightState == 2 then
|
||||
lightColor = Color(255, 255, 0)
|
||||
elseif lightState == 3 then
|
||||
lightColor = Color(0, 255, 0)
|
||||
elseif lightState == 4 then
|
||||
lightColor = Color(255, 0, 0)
|
||||
end
|
||||
|
||||
if lightColor then
|
||||
--print("draw")
|
||||
--PrintTable(lightColor)
|
||||
cam.Start3D(EyePos(), EyeAngles())
|
||||
render.SetMaterial(Material("sprites/light_glow02_add"))
|
||||
render.DrawSprite(self:LocalToWorld(Vector(0, 0, 12)), 64, 64, lightColor) --color
|
||||
cam.End3D()
|
||||
end
|
||||
end
|
||||
@@ -1,96 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Combine Jumper"
|
||||
ENT.AutomaticFrameAdvance = true
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
--Physics
|
||||
--self:SetModel("models/combine_soldier.mdl")
|
||||
self:PhysicsInit(SOLID_BBOX)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_BBOX)
|
||||
--self.myNpc="npc_combine_s"
|
||||
--self.myWeapon="weapon_smg1"
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
end
|
||||
|
||||
self.dropping = false
|
||||
self.falltime = 0
|
||||
self:ResetSequence(self:LookupSequence("dropship_deploy"))
|
||||
|
||||
timer.Simple(2.4, function()
|
||||
if not IsValid(self) then return end
|
||||
self:SetParent()
|
||||
self:PhysicsInit(SOLID_BBOX)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
end
|
||||
|
||||
self:SetSequence(self:LookupSequence("jump_holding_glide"))
|
||||
self.dropping = true
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if SERVER then
|
||||
if self.dropping then
|
||||
self.falltime = self.falltime + 1
|
||||
local tr = util.QuickTrace(self:GetPos(), Vector(0, 0, -15), self)
|
||||
|
||||
if tr.Hit then
|
||||
local dude = ents.Create(self.myNpc)
|
||||
dude:SetModel(self:GetModel())
|
||||
dude:SetSkin(self:GetSkin())
|
||||
dude:SetPos(self:GetPos())
|
||||
dude:SetAngles(Angle(0, self:GetAngles().y, 0))
|
||||
dude:SetKeyValue("additionalequipment", self.myWeapon)
|
||||
dude:Spawn()
|
||||
|
||||
if self.falltime > 50 then
|
||||
dude:GetActiveWeapon():Remove()
|
||||
dude:Fire("BecomeRagdoll", "", 0)
|
||||
else
|
||||
local p = self:GetPos() + self:GetForward() * 300 + Vector(math.random(-200, 200), math.random(-200, 200), 0)
|
||||
|
||||
timer.Simple(.1, function()
|
||||
if not IsValid(dude) then return end
|
||||
dude:SetSchedule(SCHED_FORCED_GO)
|
||||
end)
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
if IsValid(self:GetParent()) then
|
||||
self:SetRenderOrigin(self:GetParent():LocalToWorld(self:GetNetworkOrigin() + Vector(-200, 0, 0) * (1 - self:GetCycle())))
|
||||
else
|
||||
self:SetRenderOrigin(self:GetNetworkOrigin())
|
||||
end
|
||||
|
||||
self:DrawModel()
|
||||
end
|
||||
@@ -1,49 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Headcrab Jumper"
|
||||
ENT.AutomaticFrameAdvance = true
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
--Physics
|
||||
self:SetModel("models/headcrabblack.mdl")
|
||||
self:PhysicsInit(SOLID_BBOX)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_BBOX)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
end
|
||||
|
||||
self:ResetSequence(self:LookupSequence("drown"))
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if SERVER then
|
||||
local tr = util.QuickTrace(self:GetPos(), Vector(0, 0, -15), self)
|
||||
|
||||
if tr.Hit then
|
||||
local crab = ents.Create("npc_headcrab_black")
|
||||
crab:SetPos(self:GetPos())
|
||||
crab:SetAngles(Angle(0, self:GetAngles().y, 0))
|
||||
crab:Spawn()
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -1,46 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Rocket"
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER and self.particle then
|
||||
ParticleEffectAttach(self.particle, PATTACH_ABSORIGIN_FOLLOW, self, 0)
|
||||
end
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
function ENT:Think()
|
||||
if self.stuck then return end
|
||||
local tr = util.QuickTrace(self:GetPos(), self:GetAngles():Forward() * (self.speed or 3000) * FrameTime(), {self, self:GetOwner()})
|
||||
|
||||
if tr.HitWorld then
|
||||
self:StopParticles()
|
||||
self.stuck = true
|
||||
|
||||
timer.Simple(10, function()
|
||||
if IsValid(self) then
|
||||
self:Remove()
|
||||
end
|
||||
end)
|
||||
elseif tr.Hit then
|
||||
tr.Entity:TakeDamage(self.damage, self:GetOwner(), self)
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
self:SetPos(tr.HitPos)
|
||||
self:SetAngles(self:GetAngles() + Angle(12, 0, 0) * FrameTime())
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -1,122 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Bomb"
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("String", 0, "Particle")
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
if self.sphere then
|
||||
self:PhysicsInitSphere(self.sphere)
|
||||
else
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
end
|
||||
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
phys:EnableDrag(false)
|
||||
phys:SetDamping(0, 0)
|
||||
phys:SetVelocity(self:GetAngles():Forward() * (self.speed or 1000))
|
||||
end
|
||||
|
||||
if self.sticky then
|
||||
self:SetCustomCollisionCheck(true)
|
||||
end
|
||||
|
||||
timer.Simple(self.fuse or 3, function()
|
||||
if IsValid(self) then
|
||||
if self.sticky then
|
||||
self.armed = true
|
||||
ParticleEffect("stickybomb_pulse_red", self:GetPos(), Angle(0, 0, 0))
|
||||
else
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if self:GetParticle() ~= "" then
|
||||
ParticleEffectAttach(self:GetParticle(), PATTACH_ABSORIGIN_FOLLOW, self, 0)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
if SERVER then
|
||||
if self.sticky and not self.armed then return end
|
||||
|
||||
if self.tf2 then
|
||||
ParticleEffect("ExplosionCore_MidAir", self:GetPos(), Angle(0, 0, 0))
|
||||
self:EmitSound("weapons/explode1.wav")
|
||||
util.BlastDamage(self, self:GetOwner(), self:GetPos(), 100, 100)
|
||||
else
|
||||
local explode = ents.Create("env_explosion")
|
||||
explode:SetPos(self:GetPos())
|
||||
explode:Spawn()
|
||||
explode:SetKeyValue("iMagnitude", "100")
|
||||
explode:Fire("Explode", 0, 0)
|
||||
explode:SetOwner(self:GetOwner())
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if SERVER and self.sticky then
|
||||
if not IsValid(self:GetOwner()) or not self:GetOwner():Alive() then
|
||||
self.armed = false
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
if self.armed and self:GetOwner():KeyDown(IN_ATTACK2) then
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StartTouch(ent)
|
||||
if not self.sticky and (ent:IsNPC() or ent:IsPlayer() or ent:GetClass() == "pill_ent_phys") then
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PhysicsCollide(colData, collider)
|
||||
if self.sticky and self:GetPhysicsObject():IsMotionEnabled() then
|
||||
self:GetPhysicsObject():EnableMotion(false)
|
||||
|
||||
if not colData.HitEntity:IsWorld() then
|
||||
self:SetParent(colData.HitEntity)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add("ShouldCollide", "pk_pill_bomberman", function(bomb, other)
|
||||
if bomb:GetClass() == "pill_proj_bomb" then
|
||||
elseif other:GetClass() == "pill_proj_bomb" then
|
||||
local temp = bomb
|
||||
bomb = other
|
||||
other = temp
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
if other:GetClass() == "pill_proj_bomb" or other:IsNPC() or other:IsPlayer() then return false end
|
||||
end)
|
||||
@@ -1,40 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Energy Grenade"
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
--Physics
|
||||
self:SetModel("models/items/ar2_grenade.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
util.SpriteTrail(self, 0, Color(255, 0, 255), true, 15, 1, 5, 1 / (15 + 1) * 0.5, "trails/physbeam.vmt")
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
phys:SetVelocity(self:GetAngles():Forward() * 1200)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PhysicsCollide(collide, phys)
|
||||
self:Remove()
|
||||
local explode = ents.Create("env_explosion")
|
||||
explode:SetPos(self:GetPos())
|
||||
explode:Spawn()
|
||||
explode:SetOwner(self:GetOwner())
|
||||
explode:SetKeyValue("iMagnitude", "100")
|
||||
explode:Fire("Explode", 0, 0)
|
||||
end
|
||||
@@ -1,51 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Prop Projectile"
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
phys:EnableGravity(false)
|
||||
phys:EnableDrag(false)
|
||||
phys:SetDamping(0, 0)
|
||||
phys:SetVelocity(self:GetAngles():Forward() * 3000)
|
||||
end
|
||||
|
||||
if self.sound then
|
||||
self.flySound = CreateSound(self, self.sound)
|
||||
self.flySound:Play()
|
||||
end
|
||||
|
||||
if self.trail then
|
||||
util.SpriteTrail(self, 0, self.tcolor or Color(255, 255, 255), false, 40, 10, 5, 1 / 100, self.trail)
|
||||
end
|
||||
|
||||
timer.Simple(10, function()
|
||||
if IsValid(self) then
|
||||
self:Remove()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
if SERVER and self.flySound then
|
||||
self.flySound:Stop()
|
||||
end
|
||||
end
|
||||
@@ -1,114 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Rocket"
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("String", 0, "Particle")
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
if not self.noPhys then
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
end
|
||||
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
phys:EnableGravity(false)
|
||||
phys:EnableDrag(false)
|
||||
phys:SetDamping(0, 0)
|
||||
phys:SetVelocity(self:GetAngles():Forward() * (self.speed or 3000))
|
||||
end
|
||||
|
||||
if self.sound then
|
||||
self.flySound = CreateSound(self, self.sound)
|
||||
self.flySound:Play()
|
||||
end
|
||||
|
||||
if self.trail then
|
||||
util.SpriteTrail(self, 0, self.tcolor or Color(255, 255, 255), false, 40, 10, 5, 1 / 100, self.trail)
|
||||
end
|
||||
end
|
||||
|
||||
if self:GetParticle() ~= "" then
|
||||
ParticleEffectAttach(self:GetParticle(), PATTACH_ABSORIGIN_FOLLOW, self, 0)
|
||||
end
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
function ENT:Think()
|
||||
local tr
|
||||
|
||||
if self.noPhys then
|
||||
tr = util.QuickTrace(self:GetPos(), self:GetAngles():Forward() * (self.speed or 3000) * FrameTime(), {self, self.shooter})
|
||||
end
|
||||
|
||||
if self:WaterLevel() > 0 or tr and tr.Hit then
|
||||
if self.altExplode then
|
||||
ParticleEffect(self.altExplode.particle, self:GetPos(), Angle(0, 0, 0))
|
||||
self:EmitSound(self.altExplode.sound)
|
||||
util.BlastDamage(self, self:GetOwner(), self:GetPos(), 100 * (self.radmod or 1), 100 * (self.dmgmod or 1))
|
||||
else
|
||||
local explode = ents.Create("env_explosion")
|
||||
explode:SetPos(self:GetPos())
|
||||
--explode:SetOwner(ply)
|
||||
explode:Spawn()
|
||||
explode:SetKeyValue("iMagnitude", "100")
|
||||
explode:Fire("Explode", 0, 0)
|
||||
explode:SetOwner(self:GetOwner())
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
if tr then
|
||||
self:SetPos(tr.HitPos)
|
||||
|
||||
if self.spin then
|
||||
self:SetAngles(self:GetAngles() + Angle(0, 0, 180) * FrameTime())
|
||||
end
|
||||
end
|
||||
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
if SERVER and self.flySound then
|
||||
self.flySound:Stop()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PhysicsCollide(data, physobj)
|
||||
if self.altExplode then
|
||||
ParticleEffect(self.altExplode.particle, self:GetPos(), Angle(0, 0, 0))
|
||||
self:EmitSound(self.altExplode.sound)
|
||||
util.BlastDamage(self, self:GetOwner(), self:GetPos(), 100 * (self.radmod or 1), 100 * (self.dmgmod or 1))
|
||||
else
|
||||
local explode = ents.Create("env_explosion")
|
||||
explode:SetPos(self:GetPos())
|
||||
--explode:SetOwner(ply)
|
||||
explode:Spawn()
|
||||
explode:SetKeyValue("iMagnitude", "100")
|
||||
explode:Fire("Explode", 0, 0)
|
||||
explode:SetOwner(self:GetOwner())
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
@@ -1,25 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "ai"
|
||||
ENT.Base = "base_entity"
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
end
|
||||
|
||||
function ENT:DrawTranslucent()
|
||||
self:Draw()
|
||||
end
|
||||
@@ -1,165 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/props_junk/PopCan01a.mdl")
|
||||
self:DrawShadow(false)
|
||||
|
||||
if SERVER then
|
||||
self:SetName("pill_target_" .. self:EntIndex())
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
end
|
||||
--[[
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("Entity",0,"Owner")
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
local owner = self:GetOwner()
|
||||
owner.pill_cam = self
|
||||
|
||||
if SERVER then
|
||||
owner:SetViewEntity(self)
|
||||
self:SetPos(owner:GetPos())
|
||||
self:SetParent(owner)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function ENT:Think()
|
||||
local owner = self:GetOwner()
|
||||
local ent = pk_pills.getMappedEnt(owner)
|
||||
|
||||
if IsValid(ent) then
|
||||
if CLIENT then
|
||||
local mv_diff = owner:GetPos()-owner:GetNetworkOrigin()
|
||||
|
||||
local startpos
|
||||
if ent.formTable.type=="phys" then
|
||||
startpos = ent:LocalToWorld(ent.formTable.camera&&ent.formTable.camera.offset||Vector(0,0,0))
|
||||
else
|
||||
startpos=owner:EyePos()
|
||||
end
|
||||
//startpos=startpos-mv_diff
|
||||
|
||||
|
||||
local angles = owner:EyeAngles()
|
||||
|
||||
if pk_pills.var_thirdperson:GetBool() then
|
||||
local dist
|
||||
if ent.formTable.type=="phys"&&ent.formTable.camera&&ent.formTable.camera.distFromSize then
|
||||
dist = ent:BoundingRadius()*5
|
||||
else
|
||||
dist = ent.formTable.camera&&ent.formTable.camera.dist||100
|
||||
end
|
||||
|
||||
local offset = LocalToWorld(Vector(-dist,0,dist/5),Angle(0,0,0),Vector(0,0,0),angles)
|
||||
local basevel
|
||||
if ent.formTable.type=="phys" then
|
||||
basevel=ent:GetVelocity()
|
||||
else
|
||||
basevel = owner:GetVelocity()
|
||||
end
|
||||
|
||||
local tr = util.TraceHull({
|
||||
start=startpos,
|
||||
endpos=startpos+offset,
|
||||
filter=ent.camTraceFilter,
|
||||
mins=Vector(-10,-10,-10),
|
||||
maxs=Vector(10,10,10),
|
||||
mask=MASK_VISIBLE
|
||||
})
|
||||
//PrintTable(ent.camTraceFilter)
|
||||
local troffset = -tr.HitNormal:Dot(basevel*FrameTime())*1.2
|
||||
self:SetNetworkOrigin(tr.HitPos+tr.HitNormal*troffset)
|
||||
//view.vm_origin = view.origin+view.angles:Forward()*-500
|
||||
|
||||
else
|
||||
self:SetNetworkOrigin(startpos)
|
||||
end
|
||||
self:SetAngles(angles)
|
||||
else
|
||||
//self:SetNetworkOrigin(ent:GetPos())
|
||||
end
|
||||
elseif SERVER then
|
||||
self:Remove()
|
||||
owner.pill_cam=nil
|
||||
|
||||
if SERVER then
|
||||
owner:SetViewEntity()
|
||||
end
|
||||
end
|
||||
|
||||
self:NextThink(CurTime())
|
||||
return true
|
||||
end
|
||||
|
||||
/*
|
||||
hook.Add("Think","pk_pill_cam_position",function()
|
||||
local camera = CLIENT and LocalPlayer().pill_cam
|
||||
if IsValid(camera) then
|
||||
camera:MoveCam()
|
||||
end
|
||||
end)
|
||||
|
||||
function ENT:MoveCam()
|
||||
local owner = self:GetOwner()
|
||||
local ent = pk_pills.getMappedEnt(owner)
|
||||
|
||||
if IsValid(ent) then
|
||||
//if CLIENT then
|
||||
local startpos
|
||||
if ent.formTable.type=="phys" then
|
||||
startpos = ent:LocalToWorld(ent.formTable.camera&&ent.formTable.camera.offset||Vector(0,0,0))
|
||||
else
|
||||
startpos=owner:EyePos()
|
||||
end
|
||||
|
||||
local angles = owner:EyeAngles()
|
||||
|
||||
if pk_pills.var_thirdperson:GetBool() then
|
||||
local dist
|
||||
if ent.formTable.type=="phys"&&ent.formTable.camera&&ent.formTable.camera.distFromSize then
|
||||
dist = ent:BoundingRadius()*5
|
||||
else
|
||||
dist = ent.formTable.camera&&ent.formTable.camera.dist||100
|
||||
end
|
||||
|
||||
local offset = LocalToWorld(Vector(-dist,0,dist/5),Angle(0,0,0),Vector(0,0,0),angles)
|
||||
local tr = util.TraceHull({
|
||||
start=startpos,
|
||||
endpos=startpos+offset,
|
||||
filter=ent.camTraceFilter,
|
||||
mins=Vector(-5,-5,-5),
|
||||
maxs=Vector(5,5,5),
|
||||
mask=MASK_VISIBLE
|
||||
})
|
||||
//PrintTable(ent.camTraceFilter)
|
||||
|
||||
self:SetNetworkOrigin(tr.HitPos)
|
||||
|
||||
//view.vm_origin = view.origin+view.angles:Forward()*-500
|
||||
|
||||
else
|
||||
self:SetNetworkOrigin(startpos)
|
||||
end
|
||||
|
||||
self:SetAngles(angles)
|
||||
//end
|
||||
end
|
||||
end
|
||||
]]
|
||||
@@ -1,72 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Pill World Entity"
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("String", 0, "PillForm")
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
--Physics
|
||||
self:SetModel("models/Items/combine_rifle_ammo01.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
end
|
||||
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
if self.DarkRPItem then
|
||||
self:SetPillForm(self.DarkRPItem.pill)
|
||||
end
|
||||
else
|
||||
self.mat = Material("pills/" .. self:GetPillForm() .. ".png")
|
||||
self.randoff = math.Rand(0, 10)
|
||||
end
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
function ENT:Use(ply)
|
||||
if pk_pills.convars.preserve:GetBool() then
|
||||
local ent = pk_pills.getMappedEnt(ply)
|
||||
if IsValid(ent) then return end
|
||||
end
|
||||
|
||||
ply:EmitSound("weapons/bugbait/bugbait_squeeze1.wav")
|
||||
pk_pills.apply(ply, self:GetPillForm())
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if self:WaterLevel() > 0 then
|
||||
self:EmitSound("weapons/underwater_explode3.wav")
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
local ang = LocalPlayer():EyeAngles()
|
||||
ang.p = 0
|
||||
cam.Start3D2D(self:GetPos(), ang + Angle(-0, -90, 90), 1)
|
||||
surface.SetDrawColor(255, 255, 255)
|
||||
surface.SetMaterial(self.mat)
|
||||
surface.DrawTexturedRect(-10, TimedSin(1, 0, 3, self.randoff) - 30, 20, 20)
|
||||
cam.End3D2D()
|
||||
end
|
||||
@@ -1,13 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
|
||||
print("MOMO MODULE DEPRECATED!")
|
||||
@@ -1,65 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
-- Convars
|
||||
pk_pills.convars = {}
|
||||
-- Admin vars
|
||||
pk_pills.convars.admin_restrict = CreateConVar("pk_pill_admin_restrict", game.IsDedicated() and 1 or 0, FCVAR_REPLICATED + FCVAR_NOTIFY, "Restrict morphing to admins.")
|
||||
pk_pills.convars.admin_anyweapons = CreateConVar("pk_pill_admin_anyweapons", 0, FCVAR_REPLICATED, "Allow use of any weapon when morphed.")
|
||||
pk_pills.convars.preserve = CreateConVar("pk_pill_preserve", 0, FCVAR_REPLICATED, "Makes player spit out pills when they unmorph or die.")
|
||||
|
||||
-- Client vars
|
||||
if CLIENT then
|
||||
pk_pills.convars.cl_thirdperson = CreateClientConVar("pk_pill_cl_thirdperson", 1)
|
||||
pk_pills.convars.cl_hidehud = CreateClientConVar("pk_pill_cl_hidehud", 0)
|
||||
end
|
||||
|
||||
-- Admin var setter command.
|
||||
if SERVER then
|
||||
local function admin_set(ply, cmd, args)
|
||||
if not ply then
|
||||
print("If you are using the server console, you should set the variables directly!")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if not ply:IsSuperAdmin() then
|
||||
ply:PrintMessage(HUD_PRINTCONSOLE, "You must be a super admin to use this command.")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local var = args[1]
|
||||
local value = args[2]
|
||||
|
||||
if not var then
|
||||
if ply then
|
||||
ply:PrintMessage(HUD_PRINTCONSOLE, "Please supply a valid convar name. Do not include 'pk_pill_admin_'.")
|
||||
end
|
||||
|
||||
return
|
||||
elseif not ConVarExists("pk_pill_admin_" .. var) then
|
||||
ply:PrintMessage(HUD_PRINTCONSOLE, "Convar 'pk_pill_admin_" .. var .. "' does not exist. Please supply a valid convar name. Do not include 'pk_pill_admin_'.")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if not value then
|
||||
ply:PrintMessage(HUD_PRINTCONSOLE, "Please supply a value to set the convar to.")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
RunConsoleCommand("pk_pill_admin_" .. var, value)
|
||||
end
|
||||
|
||||
concommand.Add("pk_pill_admin_set", admin_set, nil, "Helper command for setting Morph Mod admin convars. Available to super admins.")
|
||||
end
|
||||
@@ -1,19 +0,0 @@
|
||||
--[[
|
||||
| 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 CLIENT then
|
||||
function pk_pills.join_prompt(name, addr)
|
||||
Derma_Query("Are you sure you want to join '" .. name .. "'?\nWARNING: You will exit your current game!", "", "Yes", function()
|
||||
LocalPlayer():ConCommand("connect " .. addr)
|
||||
end, "No")
|
||||
end
|
||||
end
|
||||
@@ -1,66 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
|
||||
custom={}
|
||||
if SERVER then
|
||||
function custom.meleeEx(ply,ent,tbl)
|
||||
-- Small edit that can use a custom dmgType and doesn't force an animation, for morphs with multiple attacks in a single anim
|
||||
if !ply:IsOnGround() then return end
|
||||
timer.Simple(tbl.delay,function() if !IsValid(ent) then return end
|
||||
if !IsValid(ent) then return end
|
||||
if ply:TraceHullAttack(ply:EyePos(), ply:EyePos()+ply:EyeAngles():Forward()*tbl.range,
|
||||
Vector(-10,-10,-10),Vector(10,10,10),tbl.dmg,tbl.dmgType,0.1,true) then
|
||||
ent:PillSound("melee_hit")
|
||||
else
|
||||
ent:PillSound("melee_miss")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function custom.LocoAnim(ply,ent,anim)
|
||||
-- New function that uses animation locomotion (ish)
|
||||
if !ply:IsOnGround() then return end
|
||||
ent:PillAnim(anim,true)
|
||||
local seq,dur = ent:GetPuppet():LookupSequence(ent.formTable.anims.default[anim])
|
||||
local ga,gb,gc = ent:GetPuppet():GetSequenceMovement(seq,0,1)
|
||||
if not ga then print("ga failed") return end -- The animation has no locomotion or it's invalid or we failed in some other way.
|
||||
|
||||
local pos = ply:GetPos()
|
||||
|
||||
local trin = {}
|
||||
trin.maxs = Vector(16, 16, 72)
|
||||
trin.mins = Vector(-16, -16, 0)
|
||||
trin.start = ply:EyePos()
|
||||
trin.endpos = gb
|
||||
trin.filter = {ply, ent, ent:GetPuppet()}
|
||||
local trout = util.TraceHull(trin)
|
||||
|
||||
local gd_prev = ent:GetPuppet():GetCycle()
|
||||
|
||||
for i=1,dur*1000 do
|
||||
timer.Simple(0.001*i,function()
|
||||
if !IsValid(ent) then return end
|
||||
if ply:GetPos() == trout.HitPos then return end -- Avoid going through walls if possible chief.
|
||||
local gd_cur = ent:GetPuppet():GetCycle()
|
||||
local ga2,gb2,gc2 = ent:GetPuppet():GetSequenceMovement(seq,gd_prev,gd_cur)
|
||||
gd_prev = gd_cur
|
||||
if not ga2 then print("ga failed") return end
|
||||
|
||||
if gd_cur==0 then return end
|
||||
|
||||
if !util.IsInWorld(ply:LocalToWorld(gb2)) then return end
|
||||
ply:SetPos(ply:LocalToWorld(gb2))
|
||||
ply:SetAngles(ply:LocalToWorldAngles(gc2))
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,103 +0,0 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
-- Does what compat.lua used to without being so aggressive about compatability.
|
||||
-- If another addon wants to break things, IT CAN!
|
||||
AddCSLuaFile()
|
||||
|
||||
-- This will let us use the noclip key to exit morphs,
|
||||
-- while letting other mods that disable noclip do their thing.
|
||||
if CLIENT then
|
||||
local noclip_btns = {}
|
||||
|
||||
for i = KEY_FIRST, BUTTON_CODE_LAST do
|
||||
if input.LookupKeyBinding(i) == "noclip" then
|
||||
table.insert(noclip_btns, i)
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add("CreateMove", "momo_exit_check", function()
|
||||
if vgui.GetKeyboardFocus() == nil and not gui.IsGameUIVisible() then
|
||||
for _, key in pairs(noclip_btns) do
|
||||
if input.WasKeyPressed(key) then
|
||||
timer.Simple(0, function()
|
||||
RunConsoleCommand("pk_pill_restore")
|
||||
end)
|
||||
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- Still dont let people noclip while morphed
|
||||
hook.Add("PlayerNoClip", "momo_block_noclip", function(ply)
|
||||
if IsValid(pk_pills.getMappedEnt(ply)) then return false end
|
||||
end)
|
||||
|
||||
-- Them hooks
|
||||
hook.Add("CalcView", "momo_calcview", function(ply, pos, ang, fov, nearZ, farZ)
|
||||
local ent = pk_pills.getMappedEnt(LocalPlayer())
|
||||
|
||||
if IsValid(ent) and ply:GetViewEntity() == ply then
|
||||
local startpos
|
||||
|
||||
if ent.formTable.type == "phys" then
|
||||
startpos = ent:LocalToWorld(ent.formTable.camera and ent.formTable.camera.offset or Vector(0, 0, 0))
|
||||
else
|
||||
startpos = pos
|
||||
end
|
||||
|
||||
if pk_pills.convars.cl_thirdperson:GetBool() then
|
||||
local dist
|
||||
|
||||
if ent.formTable.type == "phys" and ent.formTable.camera and ent.formTable.camera.distFromSize then
|
||||
dist = ent:BoundingRadius() * 5
|
||||
else
|
||||
dist = ent.formTable.camera and ent.formTable.camera.dist or 100
|
||||
end
|
||||
|
||||
local underslung = ent.formTable.camera and ent.formTable.camera.underslung
|
||||
local offset = LocalToWorld(Vector(-dist, 0, underslung and -dist / 5 or dist / 5), Angle(0, 0, 0), Vector(0, 0, 0), ang)
|
||||
|
||||
local tr = util.TraceHull({
|
||||
start = startpos,
|
||||
endpos = startpos + offset,
|
||||
filter = ent.camTraceFilter,
|
||||
mins = Vector(-5, -5, -5),
|
||||
maxs = Vector(5, 5, 5),
|
||||
mask = MASK_VISIBLE
|
||||
})
|
||||
|
||||
local view = {}
|
||||
view.origin = tr.HitPos
|
||||
view.angles = ang
|
||||
view.fov = fov
|
||||
view.drawviewer = true
|
||||
--[[else
|
||||
local view = {}
|
||||
view.origin = startpos
|
||||
view.angles = ang
|
||||
view.fov = fov
|
||||
return view]]
|
||||
|
||||
return view
|
||||
end
|
||||
end
|
||||
end)
|
||||
--[[
|
||||
hook.Add("CalcViewModelView","momo_calcviewmodel",function(wep,vm,oldPos,oldAng,pos,ang)
|
||||
local ent = pk_pills.getMappedEnt(LocalPlayer())
|
||||
local ply = wep.Owner
|
||||
if (IsValid(ent) and ply:GetViewEntity()==ply and pk_pills.convars.cl_thirdperson:GetBool()) then
|
||||
return oldPos+oldAng:Forward()*-1000,ang
|
||||
end
|
||||
end)]]
|
||||
@@ -1,70 +0,0 @@
|
||||
--[[
|
||||
| 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 restricted
|
||||
|
||||
if SERVER then
|
||||
util.AddNetworkString("pk_pill_restricted")
|
||||
|
||||
-- rename old file
|
||||
if file.Exists("pill_config/restrictions.txt", "DATA") then
|
||||
file.Rename("pill_config/restrictions.txt", "pill_config/restricted.txt")
|
||||
end
|
||||
|
||||
-- load restrictions
|
||||
restricted = {}
|
||||
|
||||
for k, v in pairs(("\n"):Explode(file.Read("pill_config/restricted.txt") or "")) do
|
||||
restricted[v] = true
|
||||
end
|
||||
|
||||
pk_pills._restricted = restricted
|
||||
|
||||
concommand.Add("pk_pill_restrict", function(ply, cmd, args, str)
|
||||
if not ply:IsSuperAdmin() then return end
|
||||
local pill = args[1]
|
||||
local a = args[2]
|
||||
|
||||
if a == "on" then
|
||||
restricted[pill] = true
|
||||
elseif a == "off" then
|
||||
restricted[pill] = false
|
||||
end
|
||||
|
||||
local write_str = ""
|
||||
|
||||
for k, v in pairs(restricted) do
|
||||
if write_str ~= "" then
|
||||
write_str = write_str .. "\n"
|
||||
end
|
||||
|
||||
write_str = write_str .. k
|
||||
end
|
||||
|
||||
file.Write("pill_config/restricted.txt", write_str)
|
||||
net.Start("pk_pill_restricted")
|
||||
net.WriteTable(restricted)
|
||||
net.Broadcast()
|
||||
end)
|
||||
|
||||
hook.Add("PlayerInitialSpawn", "pk_pill_transmit_restricted", function(ply)
|
||||
net.Start("pk_pill_restricted")
|
||||
net.WriteTable(restricted)
|
||||
net.Send(ply)
|
||||
end)
|
||||
else
|
||||
pk_pills._restricted = {}
|
||||
|
||||
net.Receive("pk_pill_restricted", function(len, pl)
|
||||
restricted = net.ReadTable()
|
||||
pk_pills._restricted = restricted
|
||||
end)
|
||||
end
|
||||
@@ -1,206 +0,0 @@
|
||||
--[[
|
||||
| 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 npc_sides = {
|
||||
npc_advisor = "hl_combine",
|
||||
npc_alyx = "default",
|
||||
npc_antlion = "hl_antlion",
|
||||
npc_antlion_grub = "hl_antlion",
|
||||
npc_antlionguard = "hl_antlion",
|
||||
npc_barnacle = "wild",
|
||||
npc_antlion_worker = "hl_antlion",
|
||||
npc_barney = "default",
|
||||
npc_breen = "hl_combine",
|
||||
npc_citizen = "default",
|
||||
npc_clawscanner = "hl_combine",
|
||||
npc_combine_camera = "hl_combine",
|
||||
npc_combine_s = "hl_combine",
|
||||
npc_combinedropship = "hl_combine",
|
||||
npc_combinegunship = "hl_combine",
|
||||
npc_crow = "harmless",
|
||||
npc_cscanner = "hl_combine",
|
||||
npc_dog = "default",
|
||||
npc_eli = "default",
|
||||
npc_fastzombie = "hl_zombie",
|
||||
npc_fastzombie_torso = "hl_zombie",
|
||||
npc_fisherman = "default",
|
||||
npc_gman = "harmless",
|
||||
npc_headcrab = "hl_zombie",
|
||||
npc_headcrab_black = "hl_zombie",
|
||||
npc_headcrab_fast = "hl_zombie",
|
||||
npc_helicopter = "hl_combine",
|
||||
npc_hunter = "hl_combine",
|
||||
npc_ichthyosaur = "wild",
|
||||
npc_kleiner = "default",
|
||||
npc_magnusson = "default",
|
||||
npc_manhack = "hl_combine",
|
||||
npc_metropolice = "hl_combine",
|
||||
npc_monk = "default",
|
||||
npc_mossman = "default",
|
||||
npc_pigeon = "harmless",
|
||||
npc_poisonzombie = "hl_zombie",
|
||||
npc_rollermine = "hl_combine",
|
||||
npc_seagull = "harmless",
|
||||
npc_sniper = "hl_combine",
|
||||
npc_stalker = "hl_combine",
|
||||
npc_strider = "hl_combine",
|
||||
npc_turret_ceiling = "hl_combine",
|
||||
npc_turret_floor = "hl_combine",
|
||||
npc_turret_ground = "hl_combine",
|
||||
npc_vortigaunt = "default",
|
||||
npc_zombie = "hl_zombie",
|
||||
npc_zombie_torso = "hl_zombie",
|
||||
npc_zombine = "hl_zombie"
|
||||
}
|
||||
|
||||
local side_relationships = {
|
||||
default = {
|
||||
hl_combine = D_HT,
|
||||
hl_antlion = D_HT,
|
||||
hl_zombie = D_HT,
|
||||
hl_infiltrator = D_LI
|
||||
},
|
||||
hl_combine = {
|
||||
default = D_HT,
|
||||
hl_antlion = D_HT,
|
||||
hl_zombie = D_HT,
|
||||
hl_infiltrator = D_LI
|
||||
},
|
||||
hl_antlion = {
|
||||
default = D_HT,
|
||||
hl_combine = D_HT,
|
||||
hl_zombie = D_HT,
|
||||
hl_infiltrator = D_HT
|
||||
},
|
||||
hl_zombie = {
|
||||
default = D_HT,
|
||||
hl_combine = D_HT,
|
||||
hl_antlion = D_HT,
|
||||
hl_infiltrator = D_HT
|
||||
}
|
||||
}
|
||||
|
||||
local team_map = {}
|
||||
|
||||
--AI TEAMS
|
||||
function setAiTeam(ent, side)
|
||||
if ent:IsPlayer() and side == "default" then
|
||||
team_map[ent] = nil
|
||||
else
|
||||
team_map[ent] = side
|
||||
end
|
||||
|
||||
for _, npc in pairs(ents.FindByClass("npc_*")) do
|
||||
if npc == ent or not npc.AddEntityRelationship or not IsValid(npc) then continue end
|
||||
local otherSide = getAiTeam(npc)
|
||||
|
||||
--if otherSide==nil then continue end
|
||||
if side == otherSide or side == "harmless" then
|
||||
npc:AddEntityRelationship(ent, D_LI, 99)
|
||||
elseif side == "wild" then
|
||||
npc:AddEntityRelationship(ent, D_HT, 99)
|
||||
else
|
||||
local relationship = (side_relationships[otherSide] or {})[side]
|
||||
|
||||
if relationship then
|
||||
npc:AddEntityRelationship(ent, relationship, 99)
|
||||
end
|
||||
end
|
||||
|
||||
if ent:IsNPC() then
|
||||
if otherSide == side or otherSide == "harmless" then
|
||||
ent:AddEntityRelationship(npc, D_LI, 99)
|
||||
elseif side == "wild" then
|
||||
ent:AddEntityRelationship(npc, D_HT, 99)
|
||||
else
|
||||
local relationship = (side_relationships[side] or {})[otherSide]
|
||||
|
||||
if relationship then
|
||||
ent:AddEntityRelationship(npc, relationship, 99)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if ent:IsNPC() then
|
||||
for _, ply in pairs(player.GetAll()) do
|
||||
local otherSide = getAiTeam(ply)
|
||||
|
||||
if otherSide == side or otherSide == "harmless" then
|
||||
ent:AddEntityRelationship(ply, D_LI, 99)
|
||||
elseif side == "wild" then
|
||||
ent:AddEntityRelationship(ply, D_HT, 99)
|
||||
else
|
||||
local relationship = (side_relationships[side] or {})[otherSide]
|
||||
|
||||
if relationship then
|
||||
ent:AddEntityRelationship(ply, relationship, 99)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not ent:IsPlayer() and ent:GetTable() then
|
||||
ent:CallOnRemove("ClearAiTeam", function()
|
||||
team_map[ent] = nil
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function getAiTeam(ent)
|
||||
local side
|
||||
side = team_map[ent]
|
||||
if side then return side end
|
||||
side = npc_sides[ent:GetClass()]
|
||||
if side then return side end
|
||||
--if ent.formTable then side=ent.formTable.side end
|
||||
--if side then return side end
|
||||
if ent:IsPlayer() then return "default" end
|
||||
|
||||
return "harmless"
|
||||
end
|
||||
|
||||
hook.Add("OnEntityCreated", "pk_pill_npc_spawn", function(npc)
|
||||
if npc.AddEntityRelationship then
|
||||
local otherSide = getAiTeam(npc)
|
||||
if otherSide == nil then return end
|
||||
|
||||
for ent, side in pairs(team_map) do
|
||||
if not IsValid(ent) then continue end --This really shouldn't happen. But it does. ):
|
||||
|
||||
if side == otherSide or side == "harmless" then
|
||||
npc:AddEntityRelationship(ent, D_LI, 99)
|
||||
elseif side == "wild" then
|
||||
npc:AddEntityRelationship(ent, D_HT, 99)
|
||||
else
|
||||
local relationship = (side_relationships[otherSide] or {})[side]
|
||||
if relationship == nil then continue end
|
||||
npc:AddEntityRelationship(ent, relationship, 99)
|
||||
end
|
||||
|
||||
--TODO CHECK AGAINST ALL NPCS, NOT JUST ONES IN THIS LIST -- THIS MIGHT ACTUALLY BE RIGHT
|
||||
if ent:IsNPC() then
|
||||
if otherSide == side or otherSide == "harmless" then
|
||||
ent:AddEntityRelationship(npc, D_LI, 99)
|
||||
elseif side == "wild" then
|
||||
ent:AddEntityRelationship(npc, D_HT, 99)
|
||||
else
|
||||
local relationship = (side_relationships[side] or {})[otherSide]
|
||||
if relationship == nil then continue end
|
||||
ent:AddEntityRelationship(npc, relationship, 99)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("PlayerDisconnected", "pk_pill_clearplayerteam", function(ply)
|
||||
team_map[ply] = nil
|
||||
end)
|
||||
@@ -1,35 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
|
||||
--Speed modifications done by tf2 weapons, effects, etc.
|
||||
hook.Add("SetupMove", "momo_tf2_movemod", function(ply, mv, cmd)
|
||||
local speedmod = 1
|
||||
|
||||
--Check weapons
|
||||
for _, wep in pairs(ply:GetWeapons()) do
|
||||
if wep.momo_SpeedMod then
|
||||
local thismod = wep:momo_SpeedMod()
|
||||
|
||||
if thismod then
|
||||
speedmod = speedmod * thismod
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--Change the speed
|
||||
if speedmod ~= 1 then
|
||||
local basevel = mv:GetVelocity()
|
||||
basevel.x = basevel.x * speedmod
|
||||
basevel.y = basevel.y * speedmod
|
||||
mv:SetVelocity(basevel)
|
||||
end
|
||||
end)
|
||||
@@ -1,132 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
helpers = {}
|
||||
|
||||
function helpers.makeList(str, n1, n2)
|
||||
if not n2 then
|
||||
n2 = n1
|
||||
n1 = 1
|
||||
end
|
||||
|
||||
local lst = {}
|
||||
|
||||
for i = n1, n2 do
|
||||
table.insert(lst, string.Replace(str, "#", tostring(i)))
|
||||
end
|
||||
|
||||
return lst
|
||||
end
|
||||
|
||||
common = {}
|
||||
|
||||
if SERVER then
|
||||
function common.shoot(ply, ent, tbl)
|
||||
local aim = ent.formTable.aim
|
||||
if ent.formTable.canAim and not ent.formTable.canAim(ply, ent) then return end
|
||||
if aim.usesSecondaryEnt and not IsValid(ent:GetPillAimEnt()) then return end
|
||||
local aimEnt = aim.usesSecondaryEnt and ent:GetPillAimEnt() or (ent.formTable.type == "ply" and ent:GetPuppet()) or ent
|
||||
local start
|
||||
|
||||
if aim.attachment then
|
||||
start = aimEnt:GetAttachment(aimEnt:LookupAttachment(aim.attachment))
|
||||
elseif aim.offset then
|
||||
local a = ply:EyeAngles()
|
||||
a.p = 0
|
||||
|
||||
start = {
|
||||
Pos = ply:EyePos() + a:Forward() * aim.offset,
|
||||
Ang = ply:EyeAngles()
|
||||
}
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
local bullet = {}
|
||||
|
||||
-- PLZ FIX
|
||||
if aim.overrideStart then
|
||||
bullet.Src = ent:LocalToWorld(aim.overrideStart)
|
||||
else
|
||||
if not start then return end
|
||||
bullet.Src = start.Pos
|
||||
end
|
||||
|
||||
--debugoverlay.Sphere(bullet.Src,10,1, Color(0,0,255), true)
|
||||
--[[bullet.Src = start.Pos]]
|
||||
bullet.Attacker = ply
|
||||
|
||||
if aim.simple then
|
||||
bullet.Dir = ply:EyeAngles():Forward()
|
||||
else
|
||||
bullet.Dir = start.Ang:Forward()
|
||||
end
|
||||
|
||||
if tbl.spread then
|
||||
bullet.Spread = Vector(tbl.spread, tbl.spread, 0)
|
||||
end
|
||||
|
||||
bullet.Num = tbl.num
|
||||
bullet.Damage = tbl.damage
|
||||
bullet.Force = tbl.force
|
||||
bullet.Tracer = tbl.tracer and not aim.fixTracers and 1 or 0
|
||||
|
||||
if aim.fixTracers then
|
||||
bullet.Callback = function(_ply, tr, dmg)
|
||||
local ed = EffectData()
|
||||
ed:SetStart(tr.StartPos)
|
||||
ed:SetOrigin(tr.HitPos)
|
||||
ed:SetScale(5000)
|
||||
util.Effect(tbl.tracer, ed)
|
||||
end
|
||||
else
|
||||
bullet.TracerName = tbl.tracer
|
||||
end
|
||||
|
||||
--[[bullet.Callback=function(ply,tr,dmg)
|
||||
if tr.HitPos then
|
||||
debugoverlay.Sphere(tr.HitPos,50,5, Color(0,255,0), true)
|
||||
end
|
||||
end]]
|
||||
aimEnt:FireBullets(bullet)
|
||||
|
||||
--Animation
|
||||
if tbl.anim then
|
||||
ent:PillAnim(tbl.anim, true)
|
||||
end
|
||||
|
||||
--Sound
|
||||
ent:PillSound("shoot", true)
|
||||
end
|
||||
|
||||
function common.melee(ply, ent, tbl)
|
||||
if not ply:IsOnGround() then return end
|
||||
|
||||
if tbl.animCount then
|
||||
ent:PillAnim("melee" .. math.random(tbl.animCount), true)
|
||||
else
|
||||
ent:PillAnim("melee", true)
|
||||
end
|
||||
|
||||
ent:PillGesture("melee")
|
||||
ent:PillSound("melee")
|
||||
|
||||
timer.Simple(tbl.delay, function()
|
||||
if not IsValid(ent) then return end
|
||||
|
||||
if ply:TraceHullAttack(ply:EyePos(), ply:EyePos() + ply:EyeAngles():Forward() * tbl.range, Vector(-10, -10, -10), Vector(10, 10, 10), tbl.dmg, DMG_SLASH, 1, true) then
|
||||
ent:PillSound("melee_hit")
|
||||
else
|
||||
ent:PillSound("melee_miss")
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
@@ -1,201 +0,0 @@
|
||||
--[[
|
||||
| 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 voxPacks = {}
|
||||
|
||||
function registerVox(name, tbl)
|
||||
voxPacks[name] = tbl
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
concommand.Add("pk_pill_voxmenu", function(ply, cmd, args, str)
|
||||
if pk_pills.getMappedEnt(ply) and pk_pills.getMappedEnt(ply).formTable.voxSet then
|
||||
local voiceMenuSrc = [[
|
||||
<head>
|
||||
<style>
|
||||
body {-webkit-user-select: none; font-family: Arial;}
|
||||
h1 {margin: 10px 0; background-color: #CCF; border: 1px solid #00A; color: #00A; width: 150px; font-style:italic;}
|
||||
.close {background: red; border: 2px solid black; float: right;}
|
||||
.close:hover {background: #F44;}
|
||||
#input {height: 55px; background: white; border: 1px solid gray; overflow-x: auto; white-space: nowrap; font-size: 30px;}
|
||||
#picker {background: #CCC; border: 1px solid black; margin-top: 10px; overflow-y: auto; position: relative;}
|
||||
#picker>div {margin: 4px;cursor: pointer;}
|
||||
#cursor {display: inline-block; width: 0; height: 26px; border-left: 2px solid black; margin-top: 2px;}
|
||||
|
||||
#picker>div:hover {background-color: #FFC; border: 1px solid #AA0;}
|
||||
#selected {background-color: #CCF; border: 1px solid #00A;}
|
||||
|
||||
.highlight {color: red; font-weight: bold;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<button class="close" onclick="console.log('RUNLUA:SELF:Remove()')">X</button>
|
||||
<h1>PillVox</h1>
|
||||
<div id="input"></div>
|
||||
<div id="picker"></div>
|
||||
</body>
|
||||
<script>
|
||||
var picker = document.getElementById('picker')
|
||||
var input = document.getElementById('input')
|
||||
picker.style.height= (window.innerHeight-150)+"px"
|
||||
|
||||
var phrases = []
|
||||
|
||||
var txt=""
|
||||
var cPos=0
|
||||
|
||||
function htmlSafe(str) {
|
||||
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/ /g,' ')
|
||||
}
|
||||
|
||||
function render(renderpicker) {
|
||||
//search
|
||||
var begin = txt.substr(0,cPos)
|
||||
var end = txt.substr(cPos)
|
||||
|
||||
input.innerHTML=htmlSafe(begin)+"<div id='cursor'></div>"+htmlSafe(end)
|
||||
input.scrollLeft = input.scrollWidth
|
||||
|
||||
//picker
|
||||
if (renderpicker) {
|
||||
var out=[]
|
||||
if (txt=="") {
|
||||
for (var i in phrases) {
|
||||
out.push("<div data-phrase='"+phrases[i]+"' onclick='pick(this)'>"+phrases[i]+"</div>")
|
||||
}
|
||||
} else {
|
||||
var tosort=[]
|
||||
for (var i in phrases) {
|
||||
var phrase = phrases[i]
|
||||
|
||||
var fragments = txt.trim().split(' ')
|
||||
var score=0
|
||||
|
||||
var highlighted = phrase.replace(new RegExp(fragments.join("|"),"gi"), function(matched) {
|
||||
score+=matched.length
|
||||
return "<span class='highlight'>"+matched+"</span>"
|
||||
})
|
||||
score+=1/phrase.length
|
||||
|
||||
if (highlighted!=phrase) {
|
||||
tosort.push({html: ("<div data-phrase='"+phrase.replace(/'/g,"'")+"' onclick='pick(this)'>"+highlighted+"</div>"), score: score})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tosort.sort(function(a,b) {return b.score-a.score})
|
||||
for (j in tosort) {
|
||||
out.push(tosort[j].html)
|
||||
}
|
||||
}
|
||||
picker.innerHTML=out.join('')
|
||||
|
||||
var selectedElement = picker.childNodes[0]
|
||||
if (selectedElement) {
|
||||
selectedElement.setAttribute("id","selected")
|
||||
selected = selectedElement.dataset.phrase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function pick(e) {
|
||||
console.log('RUNLUA:RunConsoleCommand("pk_pill_vox","'+e.dataset.phrase+'")')
|
||||
console.log('RUNLUA:SELF:Remove()')
|
||||
}
|
||||
|
||||
function init(t) {
|
||||
for (k in t) {
|
||||
phrases.push(k)
|
||||
}
|
||||
phrases.sort()
|
||||
render(true)
|
||||
}
|
||||
|
||||
//cursor
|
||||
setInterval(function() {
|
||||
var cursor = document.getElementById('cursor')
|
||||
if (cursor.style.visibility=='visible')
|
||||
cursor.style.visibility='hidden'
|
||||
else
|
||||
cursor.style.visibility='visible'
|
||||
},400)
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
var key = event.keyCode
|
||||
|
||||
if (key>=65 && key<=90) {
|
||||
txt=txt.substr(0,cPos)+String.fromCharCode(key+32)+txt.substr(cPos)
|
||||
cPos++
|
||||
render(true)
|
||||
} else if (key>=48 && key<=57 || key==32) {
|
||||
txt=txt.substr(0,cPos)+String.fromCharCode(key)+txt.substr(cPos)
|
||||
cPos++
|
||||
render(true)
|
||||
} else if (key==8) {
|
||||
if (cPos>0) {
|
||||
txt=txt.substr(0,cPos-1)+txt.substr(cPos)
|
||||
cPos--
|
||||
}
|
||||
render(true)
|
||||
} else if (key==13) {
|
||||
var selectedElement = document.getElementById('selected')
|
||||
if (selectedElement) {
|
||||
pick(selectedElement)
|
||||
} else {
|
||||
console.log('RUNLUA:SELF:Remove()')
|
||||
}
|
||||
render()
|
||||
} else if (key==37) {
|
||||
if (cPos>0) {
|
||||
cPos--
|
||||
}
|
||||
render()
|
||||
} else if (key==39) {
|
||||
if (cPos<txt.length) {
|
||||
cPos++
|
||||
}
|
||||
render()
|
||||
} else if (key==38) {
|
||||
var selectedElement = document.getElementById('selected')
|
||||
if (selectedElement.previousSibling) {
|
||||
selectedElement.removeAttribute('id')
|
||||
selectedElement=selectedElement.previousSibling
|
||||
selectedElement.setAttribute("id","selected")
|
||||
picker.scrollTop = selectedElement.offsetTop-225
|
||||
}
|
||||
} else if (key==40) {
|
||||
var selectedElement = document.getElementById('selected')
|
||||
if (selectedElement.nextSibling) {
|
||||
selectedElement.removeAttribute('id')
|
||||
selectedElement=selectedElement.nextSibling
|
||||
selectedElement.setAttribute("id","selected")
|
||||
picker.scrollTop = selectedElement.offsetTop-225
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
]]
|
||||
local html = vgui.Create("DHTML", panel)
|
||||
html:SetPos(10, ScrH() / 6)
|
||||
html:SetSize(300, ScrH() * (2 / 3))
|
||||
html:SetAllowLua(true)
|
||||
html:SetHTML(voiceMenuSrc)
|
||||
html:RunJavascript("init(" .. util.TableToJSON(voxPacks[pk_pills.getMappedEnt(ply).formTable.voxSet]) .. ")")
|
||||
html:MakePopup()
|
||||
end
|
||||
end)
|
||||
else
|
||||
concommand.Add("pk_pill_vox", function(ply, cmd, args, str)
|
||||
if pk_pills.getMappedEnt(ply) and pk_pills.getMappedEnt(ply).formTable.voxSet then
|
||||
pk_pills.getMappedEnt(ply):EmitSound(voxPacks[pk_pills.getMappedEnt(ply).formTable.voxSet][args[1]])
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -1,132 +0,0 @@
|
||||
--[[
|
||||
| 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()
|
||||
SWEP.ViewModel = "models/weapons/c_arms_citizen.mdl"
|
||||
SWEP.WorldModel = "models/weapons/w_alyx_gun.mdl"
|
||||
SWEP.Primary.ClipSize = 30
|
||||
SWEP.Primary.DefaultClip = 30
|
||||
SWEP.Primary.Automatic = true
|
||||
SWEP.Primary.Ammo = "smg1"
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = true
|
||||
SWEP.PrintName = "Alyx's Gun"
|
||||
SWEP.Category = "Pill Pack Weapons"
|
||||
SWEP.Slot = 1
|
||||
|
||||
function SWEP:SetupDataTables()
|
||||
self:NetworkVar("Int", 0, "Mode")
|
||||
end
|
||||
|
||||
function SWEP:Initialize()
|
||||
self:SetHoldType("pistol")
|
||||
self:SetMode(0)
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
if (not self:CanPrimaryAttack()) then return end
|
||||
local spread = .01
|
||||
|
||||
if self:GetMode() == 0 then
|
||||
spread = .02
|
||||
elseif self:GetMode() == 1 then
|
||||
spread = .06
|
||||
end
|
||||
|
||||
local bullet = {}
|
||||
bullet.Num = 1
|
||||
bullet.Src = self.Owner:GetShootPos()
|
||||
bullet.Dir = self.Owner:GetAimVector()
|
||||
bullet.Spread = Vector(spread, spread, 0)
|
||||
bullet.Tracer = 1
|
||||
bullet.TracerName = "Tracer"
|
||||
bullet.Force = 5
|
||||
|
||||
if self:GetMode() == 0 then
|
||||
bullet.Damage = 10
|
||||
elseif self:GetMode() == 1 then
|
||||
bullet.Damage = 5
|
||||
else
|
||||
bullet.Damage = 50
|
||||
end
|
||||
|
||||
self:ShootEffects()
|
||||
self.Owner:FireBullets(bullet)
|
||||
|
||||
if SERVER then
|
||||
sound.Play("npc/sniper/echo1.wav", self:GetPos(), 100, 100, 1)
|
||||
|
||||
if self:GetMode() == 0 then
|
||||
sound.Play("weapons/pistol/pistol_fire2.wav", self:GetPos(), 100, 100, 1)
|
||||
elseif self:GetMode() == 1 then
|
||||
sound.Play("weapons/smg1/smg1_fireburst1.wav", self:GetPos(), 100, 100, 1)
|
||||
else
|
||||
sound.Play("weapons/357/357_fire2.wav", self:GetPos(), 100, 100, 1)
|
||||
end
|
||||
end
|
||||
|
||||
self:TakePrimaryAmmo(1)
|
||||
local delay = 1
|
||||
|
||||
if self:GetMode() == 0 then
|
||||
delay = .3
|
||||
elseif self:GetMode() == 1 then
|
||||
delay = .1
|
||||
end
|
||||
|
||||
self:SetNextPrimaryFire(CurTime() + delay)
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
if CLIENT then return end
|
||||
|
||||
if self:GetMode() < 2 then
|
||||
self:SetMode(self:GetMode() + 1)
|
||||
else
|
||||
self:SetMode(0)
|
||||
end
|
||||
|
||||
if self:GetMode() == 0 then
|
||||
self.Owner:ChatPrint("Pistol Mode")
|
||||
self:SetHoldType("pistol")
|
||||
self:PillAnim("weapon_pistol")
|
||||
elseif self:GetMode() == 1 then
|
||||
self.Owner:ChatPrint("SMG Mode")
|
||||
self:SetHoldType("smg")
|
||||
self:PillAnim("weapon_smg")
|
||||
elseif self:GetMode() == 2 then
|
||||
self.Owner:ChatPrint("Rifle Mode")
|
||||
self:SetHoldType("ar2")
|
||||
self:PillAnim("weapon_rifle")
|
||||
end
|
||||
|
||||
self.Owner:EmitSound("weapons/smg1/switch_single.wav")
|
||||
end
|
||||
|
||||
function SWEP:Reload()
|
||||
if self.ReloadingTime and CurTime() <= self.ReloadingTime then return end
|
||||
|
||||
if (self:Clip1() < self.Primary.ClipSize and self.Owner:GetAmmoCount(self.Primary.Ammo) > 0) then
|
||||
self:EmitSound("weapons/pistol/pistol_reload1.wav")
|
||||
self:DefaultReload(ACT_VM_RELOAD)
|
||||
self.ReloadingTime = CurTime() + 1
|
||||
self:SetNextPrimaryFire(CurTime() + 1)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:PillAnim(anim)
|
||||
if IsValid(self.pill_proxy) then
|
||||
self.pill_proxy:ResetSequence(self.pill_proxy:LookupSequence(anim))
|
||||
end
|
||||
end
|
||||