mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 05:43:46 +03:00
Upload
This commit is contained in:
166
lua/weapons/weapon_vj_annabelle_hl2/shared.lua
Normal file
166
lua/weapons/weapon_vj_annabelle_hl2/shared.lua
Normal file
@@ -0,0 +1,166 @@
|
||||
--[[
|
||||
| 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 = 1.5 -- 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 = {} -- 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_annabelle.mdl"
|
||||
SWEP.HoldType = "shotgun"
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
-- Primary Fire ---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SWEP.Primary.Damage = 12 -- 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 = 3 -- Force applied on the object the bullet hits
|
||||
SWEP.Primary.NumberOfShots = 7 -- How many shots per attack?
|
||||
SWEP.Primary.ClipSize = 2 -- Max amount of bullets per clip
|
||||
SWEP.Primary.Cone = 3 -- 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 = true -- Does it have a distant sound when the gun is shot?
|
||||
SWEP.Primary.DistantSound = {"Weapon_Shotgun.NPC_Single"}
|
||||
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 = 1.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}
|
||||
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_SHOTGUN_AGITATED}
|
||||
self.Owner.AnimTbl_Run = {ACT_RUN_RIFLE}
|
||||
self.Owner.AnimTbl_Walk = {ACT_WALK_RIFLE}
|
||||
end
|
||||
end
|
||||
if self.Owner.SquadName == "metrocop" then
|
||||
self.HoldType = "smg"
|
||||
self.Primary.Damage = 10
|
||||
self.Primary.ClipSize = 1
|
||||
self.Owner.WeaponSpread = 0
|
||||
if self.Owner.FollowingPlayer == false then
|
||||
self.Owner.AnimTbl_IdleStand = {ACT_IDLE}
|
||||
self.Owner.AnimTbl_Run = {ACT_RUN}
|
||||
self.Owner.AnimTbl_WeaponReload = {ACT_RELOAD_SMG1}
|
||||
self.Owner.AnimTbl_Walk = {ACT_WALK}
|
||||
end
|
||||
if self.Owner.FollowingPlayer == true then
|
||||
self.Owner.AnimTbl_IdleStand = {ACT_IDLE_SMG1}
|
||||
self.Owner.AnimTbl_Run = {ACT_RUN_RIFLE}
|
||||
self.Owner.AnimTbl_WeaponReload = {ACT_RELOAD_SMG1}
|
||||
self.Owner.AnimTbl_Walk = {ACT_WALK_RIFLE}
|
||||
end
|
||||
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"
|
||||
if self.Owner.FollowingPlayer == false then
|
||||
|
||||
self.Owner.AnimTbl_Run = {ACT_RUN}
|
||||
self.Owner.AnimTbl_IdleStand = {ACT_IDLE}
|
||||
self.Owner.AnimTbl_Walk = {ACT_IDLE}
|
||||
end
|
||||
if self.Owner.FollowingPlayer == true then
|
||||
self.Owner.AnimTbl_IdleStand = {ACT_IDLE_SMG1}
|
||||
self.Owner.AnimTbl_Run = {ACT_RUN_RIFLE}
|
||||
self.Owner.AnimTbl_Walk = {ACT_WALK_RIFLE}
|
||||
end
|
||||
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_empty.wav"),80,100)
|
||||
self.Weapon:SendWeaponAnim(ACT_SHOTGUN_PUMP)
|
||||
end
|
||||
end)
|
||||
end
|
||||
Reference in New Issue
Block a user