Initial Reupload

This commit is contained in:
Lucas Magnien
2019-05-28 09:16:53 +02:00
parent c7dea7beef
commit ded79721a1
368 changed files with 12298 additions and 2 deletions
@@ -0,0 +1 @@
include("shared.lua")
@@ -0,0 +1,24 @@
-- Credit to Awesome guy: D4UNKN0WNMAN :D
-- Had to place this entity for ph_kleiner maps. for purpose: Anti Exploiting.
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:Initialize()
local w = self.max.x - self.min.x
local l = self.max.y - self.min.y
local h = self.max.z - self.min.z
local min = Vector(0 - (w / 2), 0 - (l / 2), 0 - (h / 2))
local max = Vector(w / 2, l / 2, h / 2)
self:DrawShadow(false)
self:SetCollisionBounds(min, max)
self:SetSolid(SOLID_BBOX)
self:SetNoDraw(true)
self:SetCollisionGroup(COLLISION_GROUP_NONE)
self:SetMoveType(0)
self:SetTrigger(false)
end
@@ -0,0 +1,2 @@
ENT.Base = "base_anim"
ENT.Type = "anim"
@@ -0,0 +1,2 @@
-- Include needed files
include("shared.lua")
@@ -0,0 +1,214 @@
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
ENT.model = Model("models/props_idbs/phenhanced/devil.mdl")
function ENT:StartTeslaSpark()
timer.Create("DoTeslaSpark-"..self.Entity:EntIndex(),math.random(3,6),0,function()
self:ShowEffects(self.Entity, "StunstickImpact", self.Entity:GetPos(), self.Entity:GetPos())
end)
end
function ENT:StopTeslaSpark()
if timer.Exists("DoTeslaSpark-"..self.Entity:EntIndex()) then
timer.Remove("DoTeslaSpark-"..self.Entity:EntIndex())
end
end
function ENT:Initialize()
self.Entity:SetModel(self.model)
self.Entity:PhysicsInit(SOLID_BBOX)
self.Entity:SetMoveType(MOVETYPE_NONE)
self.Entity:SetSolid(SOLID_BBOX)
self.Entity:SetUseType(SIMPLE_USE)
self.health = 50
-- Spawn a Sprite, for an Effect.
self.Entity.Sprite = ents.Create("env_sprite")
self.Entity.Sprite:SetPos(self.Entity:GetPos())
self.Entity.Sprite:SetAngles(Angle(0,0,0))
self.Entity.Sprite:SetKeyValue("spawnflags","1")
self.Entity.Sprite:SetKeyValue("framerate","1")
self.Entity.Sprite:SetKeyValue("rendermode","5")
self.Entity.Sprite:SetKeyValue("rendercolor","255 "..tostring(math.random(1,180)).." "..tostring(math.random(1,20)))
self.Entity.Sprite:SetKeyValue("model","sprites/light_glow01.vmt")
self.Entity.Sprite:SetKeyValue("scale","0.4")
self.Entity.Sprite:Spawn()
self.Entity.Sprite:Activate()
self.Entity.Sprite:SetParent(self.Entity)
self:StartTeslaSpark()
end
function ENT:OnRemove()
self:StopTeslaSpark()
if IsValid(self.Entity.Sprite) then
self.Entity.Sprite:Remove()
end
end
ENT.sounds = {
"prop_idbs/huntep4_bc44_pickup.wav",
"prop_idbs/zavogant_pickup.wav"
}
--[[
Base Devil Balls Functions.
Please note that you might have to create a custom serverside lua with full of function list with list.Set into "DevilBallsAddition".
Example:
list.Set("DevilBallsAddition", "UniqueName", function(pl,ball)
-- code...
end)
Keep in note that UniqueName should be unique and different. Otherwise will cause some confusion with printVerbose!
]]
ENT.funclists = {
function(pl)
if !pl.ph_fastspeed then
if !pl._OriginalWSpeed then pl._OriginalWSpeed = pl:GetWalkSpeed() end
pl:ChatPrint("[Devil Crystal] You have super speed Power up!")
pl:SendLua("surface.PlaySound('prop_idbs/speedup.wav')")
pl:SetWalkSpeed( pl:GetWalkSpeed() + 100 )
pl.ph_fastspeed = true
pl.RevertWalk = timer.Simple(math.random(4,12),
function()
pl:ChatPrint("[Devil Crystal] super speed power up exhausted...")
pl:SendLua("surface.PlaySound('prop_idbs/generic_exhaust.wav')")
pl:SetWalkSpeed( pl._OriginalWSpeed )
pl.ph_fastspeed = false
end)
end
end,
function(pl)
local rand = math.random(10,50)
pl:SetHealth(pl:Health() + rand)
pl.ph_prop.health = pl.ph_prop.health + rand
pl:ChatPrint("[Devil Crystal] You got free +"..tostring(rand).." HP for your current Prop!")
end,
function(pl)
local rand
rand = math.random(20,60)
pl:SetArmor(pl:Armor() + rand)
pl:ChatPrint("[Devil Crystal] You gained armor points bonus : "..tostring(rand).."!")
end,
function(pl)
if !pl.ph_slowspeed then
if !pl._OriginalWSpeed then pl._OriginalWSpeed = pl:GetWalkSpeed() end
pl:ChatPrint("[Devil Crystal] Uh oh, you're slowing down!")
pl:SendLua("surface.PlaySound('prop_idbs/slowdown.wav')")
pl:SetWalkSpeed( pl:GetWalkSpeed() - 100 )
pl.ph_slowspeed = true
pl.RevertWalk = timer.Simple(math.random(4,12),
function()
pl:ChatPrint("[Devil Crystal] slow down power up exhausted...")
pl:SendLua("surface.PlaySound('prop_idbs/generic_exhaust.wav')")
pl:SetWalkSpeed( pl._OriginalWSpeed )
pl.ph_slowspeed = false
end)
end
end,
function(pl)
if table.Count(team.GetPlayers(TEAM_HUNTERS)) >= 3 then
pl:ChatPrint("[Devil Crystal] Hunters are frozen!")
pl:SendLua("surface.PlaySound('prop_idbs/surface_prop_froze_hunter.wav')")
for _,v in pairs(team.GetPlayers(TEAM_HUNTERS)) do
if v:Alive() then
v:Freeze(true)
v:EmitSound(Sound("prop_idbs/govarchz_pickup.wav"))
v:ChatPrint("[Devil Crystal] Oops, you are temporary frozen...!")
v.UnFrooze = timer.Simple(math.random(2,3),
function()
v:ChatPrint("[Devil Crystal] You are free now!")
v:EmitSound(Sound("prop_idbs/froze_done.wav"))
v:Freeze(false)
end)
end
end
else
pl:ChatPrint("[Devil Crystal] It seems there are no hunters available to Froze 'em. Let it Go~")
end
end,
function(pl)
if !pl.ph_cloacking then
pl:ChatPrint("[Devil Crystal] Cloaking...")
pl:SendLua("surface.PlaySound('prop_idbs/cloak.wav')")
pl.ph_prop:DrawShadow(false)
pl.ph_prop:SetMaterial("models/effects/vol_light001")
pl.ph_cloacking = true
pl.RevertMaterial = timer.Simple(math.random(5,15),
function()
pl:ChatPrint("[Devil Crystal] cloak power up exhausted...")
pl:SendLua("surface.PlaySound('prop_idbs/generic_exhaust.wav')")
pl.ph_prop:DrawShadow(true)
pl.ph_prop:SetMaterial("")
pl.ph_cloacking = false
end)
end
end
}
-- Don't Edit below unless you know what you're doing.
local function ResetEverything()
for _,v in pairs(player.GetAll()) do
if IsValid(v) && v:Alive() then
v.ph_cloacking = false
v.ph_slowspeed = false
v.ph_fastspeed = false
if v:Team() == TEAM_PROPS && v._OriginalWSpeed then v:SetWalkSpeed(v._OriginalWSpeed) end
if v:Team() == TEAM_PROPS && v.ph_prop:GetMaterial() then v.ph_prop:DrawShadow(true) v.ph_prop:SetMaterial("") end
if v:IsFrozen() then v:Freeze(false) end
end
end
end
hook.Add("PH_RoundEnd", "PHE.ForceResetDevilBall", ResetEverything)
function ENT:AddMoreLuckyEvents()
local t = list.Get("DevilBallsAddition")
if table.Count(t) > 0 then
for name,tab in pairs(t) do
printVerbose("[ Devil Ball :: Add Event ] Adding new Devil Balls events : "..name)
table.insert(self.funclists, tab)
end
else
printVerbose("[ Devil Ball :: Add Event ] There is no additional Devil Balls events detected, ignoring...")
end
end
ENT:AddMoreLuckyEvents()
function ENT:The_DevilDrop(pl)
if pl:Team() == TEAM_PROPS && pl:Alive() then
self.getfunction = table.Random(self.funclists)
self.getfunction(pl)
hook.Call("PH_OnDevilBallPickup", nil, pl)
end
end
function ENT:Use(activator)
if GAMEMODE:InRound() && IsValid(activator) && activator:IsPlayer() && activator:Alive() && activator:Team() == TEAM_PROPS then
self:The_DevilDrop(activator)
self:ShowEffects(self.Entity, "GlassImpact", self.Entity:GetPos(), self.Entity:GetPos())
self.Entity:EmitSound(Sound(table.Random(self.sounds)),60)
self.Entity:Remove()
end
end
function ENT:OnTakeDamage(dmg)
local hit = dmg:GetDamage()
self.health = self.health - hit
if self.health < 0 then
self.Entity:EmitSound(Sound("physics/glass/glass_cup_break"..math.random(1,2)..".wav"))
self:ShowEffects(self.Entity, "GlassImpact", self.Entity:GetPos(), self.Entity:GetPos())
self.Entity:Remove()
end
end
@@ -0,0 +1,24 @@
-- Entity information
ENT.Type = "anim"
ENT.Base = "base_anim"
function ENT:ShowEffects(ent, fx_name, v_start, v_origin)
local eData = EffectData()
eData:SetEntity(ent) -- parent
eData:SetStart(v_start)
eData:SetOrigin(v_origin) -- hit
eData:SetAttachment(1)
eData:SetMagnitude(15)
eData:SetScale(15)
eData:SetRadius(20)
util.Effect(fx_name, eData, true, true)
end
function ENT:Think()
-- make it rotate from client only.
if CLIENT then
self.Entity:SetAngles(self.Entity:GetAngles() + Angle(0,1,0))
end
end
@@ -0,0 +1,2 @@
-- Include needed files
include("shared.lua")
@@ -0,0 +1,249 @@
local balls = {}
-- no.
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
balls.model = {
"models/dav0r/hoverball.mdl",
"models/maxofs2d/hover_basic.mdl",
"models/maxofs2d/hover_classic.mdl",
"models/maxofs2d/hover_rings.mdl"
}
balls.bombswitch = 0
function ENT:Initialize()
self.Entity:SetModel(table.Random(balls.model))
self.Entity:PhysicsInit(SOLID_VPHYSICS)
self.Entity:SetMoveType(MOVETYPE_VPHYSICS)
self.Entity:SetSolid(SOLID_VPHYSICS)
self.Entity:SetUseType(SIMPLE_USE)
self.Uses = 0
local phys = self.Entity:GetPhysicsObject()
if IsValid(phys) then
phys:Wake()
phys:SetMass(24) --since barrel
end
self.health = 100
end
balls.sounds = {
"prop_idbs/bc_pickup.wav",
"prop_idbs/np_pickup.wav",
"prop_idbs/venta_pickup.wav",
"prop_idbs/biva_pickup.wav"
}
balls.randomtext = {
"Trolling is \'A\' Art",
"0 8 1 3 - 6 9 2 8",
"SHUT UP NURSE!!",
"A fish with a cone hat.",
"A blueberry wolfy hangs around. (if he was here)",
"He keep laughing whenever he saw a moving prop/hunter or found an excelent hiding spot.",
"\'He once used this gamemode, then never again. Or Perhaps someone broke it, lmao.\'",
"The blueberry wolfy tried to swim in lava while mining a diamond.",
"Uncharted: The Game within The Game.",
"Look, ma! I said look! I'm on top of the world... again!",
"He always, stays patiently over 400 years to make a changes.",
"John Freeman whose Gordon Freeman\'s Brother!",
"John Freeman looked underground and found WEPONS!",
"When you go to space, there is a hiding crystal inside a \'box\'.",
"It\'s so fancy! Even people in \'that\' house didn\'t notice that there are 5 buttons and some dorito!",
"WHERE\'S THE BLACKSMITH!?",
"What a shame.",
"I never asked for this.",
"Knowing these lucky balls will give you something good fills you with determination.",
"PILLS HERE!",
"The Power of Fluffy Boy shines within you!",
"Actually, this guy is \'wacky\'. He live in the castle and... he has a \'Spade-Liked\' head.",
"You go to the Field where you can find your Dreams and Hopes~",
"There are two games which has similar characters that can cause CHAOS.",
"She like eating chalks, A LOT.",
":3",
"You know, that time when GMod was used to be made for good animation video, YTPs, fads, etc...",
"Here's some text to occupy you.",
"Have you seen the NannerMan?",
"Although there are alot of missing textures, Just remember: \'Mitchell\' is useless guy and it\'s game too.", -- Pfftt, ok I'm done with HDTF.
"I once saw a man with green septic eyes.",
"I once saw a man with a pink mustache.",
"There was Obsidian and it had a Conflict.",
"We all just need a bit of Synergy in our lives.",
"The Presense is Watching you", -- todo is this correct for Terraria Eye of Chtulu Boss?
"sudo apt-get moo",
"\"Have you mooed today?\"",
"Someone could do well on the stage, we just need to find him.",
"You can \"Unite\" a \"Tower\" of people if you do it right.",
"Klace is a pink husky. So Pinky~",
"Major reference. Minor details.", -- This is 100% a reference! Think!
"*Notices* What's this? OwO",
"Lucky Ball: I luv u~! <3", -- LOL
"So much to do, so little time.", -- That was the rest of those fallen text additions - Nice!
"You don't realise that (nearly) all those were actually easter eggs? :P"
}
--[[
Base Lucky Balls Functions.
Please note that you might have to create a custom serverside lua with full of function list with list.Set into "LuckyBallsAddition".
Example:
list.Set("LuckyBallsAddition", "UniqueName", function(pl,ball)
-- code...
end)
Keep in note that UniqueName should be unique and different. Otherwise will cause some confusion with printVerbose!
]]
balls.funclists = {
function(pl)
pl:ChatPrint(table.Random(balls.randomtext))
end,
function(pl)
if not pl:HasWeapon("wlv_bren") then
pl:Give("wlv_bren")
pl:SelectWeapon("wlv_bren")
pl:ChatPrint("[Lucky Ball] You got a *special* weapon!")
else
pl:ChatPrint(table.Random(balls.randomtext))
end
end,
function(pl)
local rand = math.random(10,75)
pl:SetHealth(pl:Health() + rand)
pl:ChatPrint("[Lucky Ball] You got free +"..rand.." HP!")
end,
function(pl)
local rand = math.random(1,20)
pl:SetHealth(pl:Health() - rand)
pl:ChatPrint("[Lucky Ball] Aww Snap! Your health reduced by -"..rand.." HP, better luck next time!")
end,
function(pl)
pl:Give("item_battery")
pl:ChatPrint("[Lucky Ball] You obtained a free battery suit!")
end,
function(pl)
local rand
rand = math.random(15,100)
pl:SetArmor(pl:Armor() + rand)
pl:ChatPrint("[Lucky Ball] You gained armor points bonus : "..tostring(rand).."!")
end,
function(pl)
local ammo = {'Pistol', 'SMG1', '357', 'Buckshot'}
local rand
rand = math.random(8,45)
pl:GiveAmmo(rand, table.Random(ammo))
pl:ChatPrint("[Lucky Ball] You got a random ammo!")
end,
function(pl)
if not pl:HasWeapon("weapon_rpg") then
pl:Give("weapon_rpg")
pl:SelectWeapon("weapon_rpg")
pl:SetAmmo(2, "RPG_Round")
pl:ChatPrint("[Lucky Ball] You got a free RPG!")
else
pl:ChatPrint(table.Random(balls.randomtext))
end
end,
function(pl)
if not pl:HasWeapon("weapon_frag") then
pl:Give("weapon_frag")
pl:SelectWeapon("weapon_frag")
pl:ChatPrint("[Lucky Ball] You got a Frag Grenade for free!")
end
end,
function(pl)
for _, plph in pairs(player.GetAll()) do
if plph:SteamID() == "STEAM_0:0:63261691" then
pl:ChatPrint("[Lucky Ball] The blueberry wolf is actually => "..plph:Nick())
end
end
end,
function(pl)
if not pl:HasWeapon("weapon_bugbait") then
pl:Give("weapon_bugbait")
pl:ChatPrint("[Lucky Ball] You got Bugbait for free... which does nothing. (unless you have a pet antlion).")
else
pl:ChatPrint(table.Random(balls.randomtext))
end
end,
function(pl) -- Change hunter model to player mdl as a joke
if not (pl:GetModel() == "models/player.mdl") then
pl:ChatPrint("[Lucky Ball] I saw it once. The player.mdl will get its revenge one day. -D4")
pl:SetModel("models/player.mdl")
pl:SendLua("CL_GLIMPCAM = CurTime() + 3")
else
pl:ChatPrint(table.Random(balls.randomtext))
end
end,
function(pl) -- This is a fun little reference to staging
for _, plph in pairs(player.GetAll()) do
if plph:SteamID() == "STEAM_0:0:49332102" && plph:Alive() && plph:Team() == TEAM_HUNTERS then
pl:ChatPrint("[Lucky Ball] You put "..plph:Name().." on the stage.")
plph:SendLua("CL_GLIMPCAM = CurTime() + 10")
plph:SendLua("RunConsoleCommand(\"act\", \"dance\")")
plph:EmitSound("taunts/props/hardbass.wav", 100)
end
end
end,
function(pl)
local suicidebomb = ents.Create("combine_mine")
suicidebomb:SetPos(Vector(pl:GetPos()))
suicidebomb:SetAngles(Angle(0,0,0))
suicidebomb:Spawn()
suicidebomb:Activate()
suicidebomb:SetOwner(pl)
pl:ChatPrint("[Lucky Ball] You got a SUICIDE BOMB!")
if balls.bombswitch == 0 then
pl:EmitSound("taunts/ph_enhanced/dx_thebomb2.wav")
balls.bombswitch = 1
elseif balls.bombswitch == 1 then
pl:EmitSound("taunts/ph_enhanced/dx_thebomb.wav")
balls.bombswitch = 0
end
end
}
-- Don't Edit below unless you know what you're doing.
function balls:AddMoreLuckyEvents()
local t = list.Get("LuckyBallsAddition")
if table.Count(t) > 0 then
for name,tab in pairs(t) do
printVerbose("[ Lucky Ball :: Add Event ] Adding new Lucky Balls events : "..name)
table.insert(balls.funclists, tab)
end
else
printVerbose("[ Lucky Ball :: Add Event ] There is no additional Lucky Balls events detected, ignoring...")
end
end
balls:AddMoreLuckyEvents()
function balls:The_LuckyDrop(pl)
-- For hunter only.
if pl:Team() == TEAM_HUNTERS && pl:Alive() then
balls.getfunction = table.Random(balls.funclists)
balls.getfunction(pl)
hook.Call("PH_OnLuckyBallPickup", nil, pl)
end
end
function ENT:Use(activator)
if GAMEMODE:InRound() && activator:IsPlayer() && activator:Alive() && activator:Team() == TEAM_HUNTERS then
if self.Uses == 0 then
balls:The_LuckyDrop(activator)
self.Entity:EmitSound(Sound(table.Random(balls.sounds)))
self.Uses = 1
self.Entity:Remove()
else
self.Entity:Remove()
end
end
end
@@ -0,0 +1,3 @@
-- Entity information
ENT.Type = "anim"
ENT.Base = "base_anim"
@@ -0,0 +1,133 @@
AddCSLuaFile()
DEFINE_BASECLASS( "base_anim" )
ENT.PrintName = "Prop Entity"
ENT.Author = "Wolvindra-Vinzuerio"
ENT.Information = "A prop entity for Prop Hunt: Enhanced"
ENT.Category = ""
ENT.Editable = true
ENT.Spawnable = true
ENT.AdminOnly = false
ENT.RenderGroup = RENDERGROUP_BOTH
function ENT:SetupDataTables() end
function ENT:Initialize()
if SERVER then
self:SetModel("models/player/kleiner.mdl")
self:SetLagCompensated(true)
self:SetMoveType(MOVETYPE_NONE)
self.health = 100
else
end
end
if CLIENT then
function ENT:Draw()
self:DrawModel()
end
end
-- Prop Movement and Rotation (CLIENT)
function ENT:Think()
if CLIENT then
local pl = self:GetOwner()
if IsValid(pl) && pl:Alive() && pl == LocalPlayer() then
local me = LocalPlayer()
local pos = me:GetPos()
local ang = me:GetAngles()
local lockstate = pl:GetPlayerLockedRot()
if self:GetModel() == "models/player/kleiner.mdl" || self:GetModel() == player_manager.TranslatePlayerModel(GetConVar("cl_playermodel"):GetString()) then
self:SetPos(pos)
else
self:SetPos(pos - Vector(0, 0, self:OBBMins().z))
end
if !lockstate then self:SetAngles(Angle(0,ang.y,0)) end
end
end
end
if SERVER then
-- Transmit update
function ENT:UpdateTransmitState()
return TRANSMIT_ALWAYS
end
-- Main Function
function ENT:OnTakeDamage(dmg)
local pl = self:GetOwner()
local attacker = dmg:GetAttacker()
local inflictor = dmg:GetInflictor()
-- Health
if GAMEMODE:InRound() && IsValid(pl) && pl:Alive() && pl:IsPlayer() && attacker:IsPlayer() && dmg:GetDamage() > 0 then
if pl:Armor() >= 10 then
self.health = self.health - (math.Round(dmg:GetDamage()/2))
pl:SetArmor(pl:Armor() - 20)
else
self.health = self.health - dmg:GetDamage()
end
pl:SetHealth(self.health)
if self.health <= 0 then
pl:KillSilent()
pl:SetArmor(0)
if inflictor && inflictor == attacker && inflictor:IsPlayer() then
inflictor = inflictor:GetActiveWeapon()
if !inflictor || inflictor == NULL then inflictor = attacker end
end
net.Start( "PlayerKilledByPlayer" )
net.WriteEntity( pl )
net.WriteString( inflictor:GetClass() )
net.WriteEntity( attacker )
net.Broadcast()
MsgAll(attacker:Name() .. " found and killed " .. pl:Name() .. "\n")
if GetConVar("ph_freezecam"):GetBool() then
if pl:GetNWBool("InFreezeCam", false) then
pl:PrintMessage(HUD_PRINTCONSOLE, "!! WARNING: Something went wrong with the Freeze Camera, but it's still enabled!")
else
timer.Simple(0.5, function()
if !pl:GetNWBool("InFreezeCam", false) then
-- Play the good old Freeze Cam sound
net.Start("PlayFreezeCamSound")
net.Send(pl)
pl:SetNWEntity("PlayerKilledByPlayerEntity", attacker)
pl:SetNWBool("InFreezeCam", true)
pl:SpectateEntity( attacker )
pl:Spectate( OBS_MODE_FREEZECAM )
end
end)
timer.Simple(4.5, function()
if pl:GetNWBool("InFreezeCam", false) then
pl:SetNWBool("InFreezeCam", false)
pl:Spectate( OBS_MODE_CHASE )
pl:SpectateEntity( nil )
end
end)
end
end
attacker:AddFrags(1)
pl:AddDeaths(1)
attacker:SetHealth(math.Clamp(attacker:Health() + GetConVarNumber("ph_hunter_kill_bonus"), 1, 100))
hook.Call("PH_OnPropKilled", nil, pl, attacker)
pl:RemoveProp()
end
end
end
end
@@ -0,0 +1,290 @@
-- Code base: Credit to http://steamcommunity.com/id/INCONCEIVABLEINCONCEIVABLE .
-- Weapon base are now removed due of M9K's version differences.
-- Alternate version - Credits to: Blast da' Lizard - https://steamcommunity.com/id/blastdalizard
-- These code are now supports with 3 bases:
-- --> TFA
-- --> M9K
-- --> Sandbox/default
local function CheckConVar(cvar)
if cvar == nil then return false end
if cvar != nil then return true end
if IsValid(cvar) then return true end
return false
end
if CheckConVar(GetConVar("DebugM9K")) or (CheckConVar(GetConVar("sv_tfa_conv_m9konvert")) && GetConVar("sv_tfa_conv_m9konvert"):GetBool()) then -- check if M9K or TFA is Exists on server. otherwise will use from Default base instead.
SWEP.Gun = ("wlv_bren")
if (GetConVar(SWEP.Gun.."_allowed")) != nil then
if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then
SWEP.Base = "bobs_blacklisted"
SWEP.PrintName = SWEP.Gun
return
end
end
local icol = Color( 255, 255, 255, 255 )
if CLIENT then
killicon.Add( SWEP.Gun, "vgui/hud/"..SWEP.Gun, icol )
end
SWEP.Category = "Wolvin\'s PH Bonus Weapon"
SWEP.Author = "Wolvindra-Vinzuerio"
SWEP.Contact = "wolvindra.vinzuerio@gmail.com"
SWEP.Purpose = "Just aim and shot at those innocent props lol."
SWEP.Instructions = "Step 1: Acquire This Gun.\nStep 2: Shoot.\nStep 3: Profit." --> Brain 404: Not Found.
SWEP.MuzzleAttachment = "1"
SWEP.ShellEjectAttachment = "2"
SWEP.PrintName = "Bren MK II"
SWEP.Slot = 3
SWEP.SlotPos = 1
SWEP.DrawAmmo = true
SWEP.DrawWeaponInfoBox = true
SWEP.BounceWeaponIcon = false
SWEP.DrawCrosshair = true
SWEP.Weight = 10
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = true
SWEP.HoldType = "ar2"
SWEP.ViewModelFOV = 60
SWEP.ViewModelFlip = false
if GetConVar("ph_mkbren_use_new_mdl"):GetBool() then
SWEP.ViewModel = Model("models/weapons/c_mach_brenmk3.mdl")
SWEP.WorldModel = Model("models/weapons/w_mach_brenmk3.mdl")
-- this one is used for M9K. TFA may ignore this.
SWEP.ShowWorldModel = false
SWEP.UseHands = true
else
SWEP.ViewModel = Model("models/weapons/v_mkbren.mdl")
SWEP.WorldModel = Model("models/weapons/w_mkbren.mdl")
-- this one is used for M9K. TFA may ignore this.
SWEP.ShowWorldModel = true
SWEP.UseHands = false
end
SWEP.ShowWorldModel = true
SWEP.Base = "bobs_gun_base"
SWEP.Spawnable = false
SWEP.AdminSpawnable = false
SWEP.FiresUnderwater = false
if GetConVar("ph_mkbren_use_new_mdl"):GetBool() then
SWEP.Primary.Sound = Sound("brenmk3.single")
else
SWEP.Primary.Sound = Sound("BREN.Fire")
end
SWEP.Primary.RPM = 500
SWEP.Primary.ClipSize = 30
SWEP.Primary.DefaultClip = 90
SWEP.Primary.KickUp = 0.85
SWEP.Primary.KickDown = 0.6
SWEP.Primary.KickHorizontal = 0.5
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "ar2"
SWEP.Secondary.IronFOV = 55
SWEP.data = {}
SWEP.data.ironsights = 1
SWEP.Primary.NumShots = 1
SWEP.Primary.Damage = 10 -- 35 for PH is bit OP, but hopefully this already balance the game since this is a rare drop.
SWEP.Primary.Spread = .025
SWEP.Primary.IronAccuracy = .01
if GetConVar("ph_mkbren_use_new_mdl"):GetBool() then
SWEP.IronSightsPos = Vector(-3.383, -5.856, 2.49)
SWEP.IronSightsAng = Vector(-0.005, 0.009, 0)
SWEP.SightsPos = Vector(-3.383, -5.856, 2.49)
SWEP.SightsAng = Vector(-0.005, 0.009, 0)
SWEP.RunSightsPos = Vector(3, -1.609, -6.97)
SWEP.RunSightsAng = Vector(-7.739, 40.804, -30.251)
-- for M9K
SWEP.WElements = {
["W_MkBren1"] = { type = "Model", model = "models/weapons/w_mach_brenmk3.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(4.991, 0.171, -1.693), angle = Angle(0, -90.326, -6.628), size = Vector(0.899, 0.899, 0.899), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
-- for TFA
SWEP.Offset = {
Pos = {
Up = -2.1,
Right = 0,
Forward = 5.5
},
Ang = {
Up = 90,
Right = 178,
Forward = 176
},
Scale = 0.9
}
else
SWEP.IronSightsPos = Vector(-3.172, -7.12, 0.425)
SWEP.IronSightsAng = Vector(2.213, 0, 0)
SWEP.SightsPos = Vector(-3.172, -7.12, 0.425)
SWEP.SightsAng = Vector(2.213, 0, 0)
SWEP.RunSightsPos = Vector(6.369, -10.244, -3.689)
SWEP.RunSightsAng = Vector(6.446, 62.852, 0)
end
-- M9K Weapon properties
if GetConVar("M9KDefaultClip") == nil then
print("M9KDefaultClip is missing! You may have hit the lua limit!")
else
if GetConVar("M9KDefaultClip"):GetInt() != -1 then
SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("M9KDefaultClip"):GetInt()
end
end
if GetConVar("M9KUniqueSlots") != nil then
if not (GetConVar("M9KUniqueSlots"):GetBool()) then
SWEP.SlotPos = 3
end
end
else
-- Revert to default base, if server has no M9K.
if CLIENT then
killicon.Add( "wlv_bren", "vgui/hud/wlv_bren", Color(255,255,255,255) )
end
if SERVER then
printVerbose("[ Lucky Ball :: Bren MK ] Server has no default M9K Base, Reverting to normal sandbox base!")
end
SWEP.Category = "Wolvindra-Vinzuerio"
SWEP.PrintName = "BREN MK II"
SWEP.Author = "Wolvindra-Vinzuerio"
SWEP.Instructions = "Simply shoot at props."
SWEP.Spawnable = true
SWEP.AdminOnly = false
SWEP.Primary.ClipSize = 30
SWEP.Primary.DefaultClip = 90
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "AR2"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "None"
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Slot = 3
SWEP.SlotPos = 1
SWEP.Weight = 3
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = true
SWEP.ViewModelFOV = 60
SWEP.ViewModelFlip = false
if GetConVar("ph_mkbren_use_new_mdl"):GetBool() then
SWEP.ViewModel = Model("models/weapons/c_mach_brenmk3.mdl")
SWEP.WorldModel = Model("models/weapons/w_mkbren.mdl")
SWEP.UseHands = true
else
SWEP.ViewModel = Model("models/weapons/v_mkbren.mdl")
SWEP.WorldModel = Model("models/weapons/w_mkbren.mdl")
SWEP.UseHands = false
end
function SWEP:Initialize()
self:SetWeaponHoldType("ar2")
end
function SWEP:PrimaryAttack()
if (!self:CanPrimaryAttack()) then
return
end
local punch = {}
punch.x = math.random(-0.7,-0.2)
punch.y = math.random(0, 0.1)
punch.z = 0
if GetConVar("ph_mkbren_use_new_mdl"):GetBool() then
self.Weapon:EmitSound( Sound("brenmk3.single") )
else
self.Weapon:EmitSound( Sound("BREN.Fire") )
end
self:ShootBullet( 35, 1, 0.025)
self:TakePrimaryAmmo(1)
self.Owner:ViewPunch(Angle(punch.x, punch.y, punch.z))
self.Weapon:SetNextPrimaryFire(CurTime() + 0.12)
end
function SWEP:Deploy()
self:SetDeploySpeed(1)
end
end
-- Sound Override Tables for BREN.
-- BREN: Firing Sound
local FS = {}
if GetConVar("ph_mkbren_use_new_mdl"):GetBool() then
FS["brenmk3.single"] = "weapons/brenmk3/shoot.wav"
else
FS["BREN.Fire"] = "weapons/mkbren/bren_1.wav"
end
-- BREN: Reloading Sound
local RS = {}
if GetConVar("ph_mkbren_use_new_mdl"):GetBool() then
RS["brenmk3.draw"] = "weapons/brenmk3/draw.wav"
RS["brenmk3.cloth"] = "weapons/brenmk3/cloth.wav"
RS["brenmk3.boltback"] = "weapons/brenmk3/boltback.wav"
RS["brenmk3.boltforward"] = "weapons/brenmk3/boltforward.wav"
RS["brenmk3.magout"] = "weapons/brenmk3/magout.wav"
RS["brenmk3.magin"] = "weapons/brenmk3/magin.wav"
RS["brenmk3.magtap"] = "weapons/brenmk3/magtap.wav"
else
RS["BREN.MagOut"] = "weapons/mkbren/bren_magout.wav"
RS["BREN.MagIn"] = "weapons/mkbren/bren_magin.wav"
RS["BREN.BoltPull"] = "weapons/mkbren/bren_boltpull.wav"
RS["BREN.Draw"] = "weapons/mkbren/bren_draw.wav"
end
-- Assign to table.
local wepsnd = {}
wepsnd.fire = {
channel = CHAN_WEAPON,
volume = 1,
soundlevel = 120,
pitchstart = 100,
pitchend = 100
}
for k, v in pairs(FS) do
wepsnd.fire.name = k
wepsnd.fire.sound = v
sound.Add(wepsnd.fire)
end
wepsnd.weps = {
channel = CHAN_STATIC,
volume = 1,
soundlevel = 70,
pitchstart = 100,
pitchend = 100
}
for k, v in pairs(RS) do
wepsnd.weps.name = k
wepsnd.weps.sound = v
sound.Add(wepsnd.weps)
end