mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
147 lines
6.9 KiB
Lua
147 lines
6.9 KiB
Lua
|
|
--[[
|
||
|
|
| 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 (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
|
||
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
SWEP.Base = "weapon_vj_base"
|
||
|
|
SWEP.PrintName = "SPAS-12"
|
||
|
|
SWEP.Author = "DrVrej"
|
||
|
|
SWEP.Contact = "http://steamcommunity.com/groups/vrejgaming"
|
||
|
|
SWEP.Purpose = "This weapon is made for Players and NPCs"
|
||
|
|
SWEP.Instructions = "Controls are like a regular weapon."
|
||
|
|
SWEP.Category = "VJ Base"
|
||
|
|
-- Client Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
if (CLIENT) then
|
||
|
|
SWEP.Slot = 3 -- Which weapon slot you want your SWEP to be in? (1 2 3 4 5 6)
|
||
|
|
SWEP.SlotPos = 4 -- Which part of that slot do you want the SWEP to be in? (1 2 3 4 5 6)
|
||
|
|
SWEP.UseHands = true
|
||
|
|
end
|
||
|
|
-- NPC Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
SWEP.NPC_NextPrimaryFire = 0.9 -- Next time it can use primary fire
|
||
|
|
SWEP.NPC_CustomSpread = 2.5 -- This is added on top of the custom spread that's set inside the SNPC! | Starting from 1: Closer to 0 = better accuracy, Farther than 1 = worse accuracy
|
||
|
|
SWEP.NPC_ExtraFireSound = {"vj_weapons/perform_shotgunpump.wav"} -- Plays an extra sound after it fires (Example: Bolt action sound)
|
||
|
|
-- Main Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
SWEP.ViewModel = "models/weapons/c_shotgun.mdl"
|
||
|
|
SWEP.WorldModel = "models/weapons/w_shotgun.mdl"
|
||
|
|
SWEP.HoldType = "shotgun"
|
||
|
|
SWEP.Spawnable = true
|
||
|
|
SWEP.AdminSpawnable = false
|
||
|
|
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
SWEP.Primary.Damage = 4 -- Damage
|
||
|
|
SWEP.Primary.PlayerDamage = "Double" -- Only applies for players | "Same" = Same as self.Primary.Damage, "Double" = Double the self.Primary.Damage OR put a number to be different from self.Primary.Damage
|
||
|
|
SWEP.Primary.Force = 1 -- Force applied on the object the bullet hits
|
||
|
|
SWEP.Primary.NumberOfShots = 7 -- How many shots per attack?
|
||
|
|
SWEP.Primary.ClipSize = 6 -- Max amount of bullets per clip
|
||
|
|
SWEP.Primary.Cone = 12 -- How accurate is the bullet? (Players)
|
||
|
|
SWEP.Primary.Delay = 0.8 -- Time until it can shoot again
|
||
|
|
SWEP.Primary.Automatic = false -- Is it automatic?
|
||
|
|
SWEP.Primary.Ammo = "Buckshot" -- Ammo type
|
||
|
|
SWEP.Primary.Sound = {"Weapon_Shotgun.Single"}
|
||
|
|
SWEP.Primary.HasDistantSound = false -- Does it have a distant sound when the gun is shot?
|
||
|
|
|
||
|
|
SWEP.Primary.DistantSoundVolume = 0.55 -- Distant sound volume
|
||
|
|
SWEP.PrimaryEffects_MuzzleAttachment = 1
|
||
|
|
SWEP.PrimaryEffects_ShellAttachment = 2
|
||
|
|
SWEP.PrimaryEffects_ShellType = "VJ_Weapon_ShotgunShell1"
|
||
|
|
-- Reload Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
SWEP.HasReloadSound = true -- Does it have a reload sound? Remember even if this is set to false, the animation sound will still play!
|
||
|
|
SWEP.ReloadSound = {"weapons/shotgun/shotgun_reload1.wav","weapons/shotgun/shotgun_reload2.wav","weapons/shotgun/shotgun_reload3.wav"}
|
||
|
|
SWEP.Reload_TimeUntilAmmoIsSet = 0.3 -- Time until ammo is set to the weapon
|
||
|
|
SWEP.Reload_TimeUntilFinished = 0.5 -- How much time until the player can play idle animation, shoot, etc.
|
||
|
|
-- Idle Settings ---------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
SWEP.HasIdleAnimation = true -- Does it have a idle animation?
|
||
|
|
SWEP.AnimTbl_Idle = {ACT_VM_IDLE}
|
||
|
|
SWEP.NextIdle_Deploy = 0.5 -- How much time until it plays the idle animation after the weapon gets deployed
|
||
|
|
SWEP.NextIdle_PrimaryAttack = 0.8 -- How much time until it plays the idle animation after attacking(Primary)
|
||
|
|
|
||
|
|
-- Custom
|
||
|
|
SWEP.FirstTimeShotShotgun = false
|
||
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
/*function SWEP:CustomOnNPC_ServerThink()
|
||
|
|
print("debeck")
|
||
|
|
if self.Owner:GetActivity() != ACT_RANGE_ATTACK1 then
|
||
|
|
print("Fuck")
|
||
|
|
self.FirstTimeShotShotgun = false
|
||
|
|
end
|
||
|
|
end*/
|
||
|
|
|
||
|
|
|
||
|
|
function SWEP:CustomOnThink()
|
||
|
|
|
||
|
|
if self.Owner.SquadName == "resistance" then
|
||
|
|
|
||
|
|
if self.Owner.FollowingPlayer == false then
|
||
|
|
self.Owner.AnimTbl_IdleStand = {ACT_IDLE_SHOTGUN_RELAXED}
|
||
|
|
self.Owner.AnimTbl_Run = {ACT_RUN_RIFLE_RELAXED}
|
||
|
|
|
||
|
|
self.Owner.AnimTbl_Walk = {ACT_WALK_RIFLE_RELAXED}
|
||
|
|
end
|
||
|
|
if self.Owner.FollowingPlayer == true then
|
||
|
|
self.Owner.AnimTbl_IdleStand = {ACT_IDLE_SHOTGUN_AGITATED}
|
||
|
|
self.Owner.AnimTbl_Run = {ACT_RUN_RPG}
|
||
|
|
self.Owner.AnimTbl_Walk = {ACT_WALK_RPG_RELAXED}
|
||
|
|
end
|
||
|
|
end
|
||
|
|
if self.Owner.SquadName == "metrocop" then
|
||
|
|
self.HoldType = "smg"
|
||
|
|
self.Owner.HoldType = "smg"
|
||
|
|
self.Primary.Damage = 10
|
||
|
|
self.Primary.ClipSize = 1
|
||
|
|
self.Owner.WeaponSpread = 0
|
||
|
|
|
||
|
|
end
|
||
|
|
if self.Owner.SquadName == "combine" then
|
||
|
|
|
||
|
|
if self.Owner.FollowingPlayer == false then
|
||
|
|
self.Owner.AnimTbl_IdleStand = {ACT_IDLE_SMG1}
|
||
|
|
self.Owner.AnimTbl_Run = {ACT_RUN_RIFLE}
|
||
|
|
|
||
|
|
self.Owner.AnimTbl_Walk = {ACT_WALK_RIFLE}
|
||
|
|
end
|
||
|
|
if self.Owner.FollowingPlayer == true then
|
||
|
|
self.Owner.AnimTbl_IdleStand = {ACT_IDLE_ANGRY_SHOTGUN}
|
||
|
|
self.Owner.AnimTbl_Run = {ACT_RUN_AIM_SHOTGUN}
|
||
|
|
self.Owner.AnimTbl_Walk = {ACT_WALK_AIM_SHOTGUN}
|
||
|
|
end
|
||
|
|
end
|
||
|
|
if self.Owner.SquadName == "combine_nova" then
|
||
|
|
|
||
|
|
if self.Owner.FollowingPlayer == false then
|
||
|
|
self.Owner.AnimTbl_IdleStand = {ACT_IDLE_SMG1}
|
||
|
|
self.Owner.AnimTbl_Run = {ACT_RUN_RIFLE}
|
||
|
|
|
||
|
|
self.Owner.AnimTbl_Walk = {ACT_IDLE_SMG1}
|
||
|
|
end
|
||
|
|
if self.Owner.FollowingPlayer == true then
|
||
|
|
self.Owner.AnimTbl_IdleStand = {ACT_IDLE_ANGRY_SHOTGUN}
|
||
|
|
self.Owner.AnimTbl_Run = {ACT_RUN_AIM_SHOTGUN}
|
||
|
|
self.Owner.AnimTbl_Walk = {ACT_WALK_AIM_SHOTGUN}
|
||
|
|
end
|
||
|
|
end
|
||
|
|
if self.Owner.SquadName == "metrocops" then
|
||
|
|
self.HoldType = "smg"
|
||
|
|
self.Owner.HoldType = "smg"
|
||
|
|
|
||
|
|
end
|
||
|
|
end
|
||
|
|
---------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
|
function SWEP:CustomOnPrimaryAttack_AfterShoot()
|
||
|
|
//if self.Owner:IsNPC() && (self.Owner.IsVJBaseSNPC) && self.FirstTimeShotShotgun == true /*&& self.Owner:GetActivity() != ACT_RANGE_ATTACK1*/ then
|
||
|
|
//self.FirstTimeShotShotgun = true
|
||
|
|
//self.Owner:VJ_ACT_PLAYACTIVITY(ACT_RANGE_ATTACK_SHOTGUN,false,0,true)
|
||
|
|
//end
|
||
|
|
//self.FirstTimeShotShotgun = true
|
||
|
|
timer.Simple(0.2,function()
|
||
|
|
if IsValid(self) && IsValid(self.Owner) && self.Owner:IsPlayer() then
|
||
|
|
self.Weapon:EmitSound(Sound("weapons/shotgun/shotgun_cock.wav"),80,100)
|
||
|
|
self.Weapon:SendWeaponAnim(ACT_SHOTGUN_PUMP)
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
end
|