ARC9_uplp_fesiug/lua/weapons/arc9_uplp-f_g36.lua

873 lines
27 KiB
Lua

AddCSLuaFile()
SWEP.Base = "arc9_uplp_base"
SWEP.Category = "ARC9 - Poly Arms"
SWEP.Spawnable = true
---- FUNDAMENTALS
SWEP.Slot = 2 -- Which slot the weapon is in; starts at 0
---- Name, Description, Class, Category and Trivia
SWEP.PrintName = ARC9:GetPhrase("uplp_weapon_g36_k")
SWEP.Description = ARC9:GetPhrase("uplp_weapon_g36_k_desc")
SWEP.Class = ARC9:GetPhrase("uplp_class_weapon_ar") -- In the Customization Menu
SWEP.SubCategory = ARC9:GetPhrase("uplp_category_weapon_ar") -- In the Spawnmenu
SWEP.Trivia = {
[ ARC9:GetPhrase( "uplp_realname" ) ] = ARC9:GetPhrase("uplp_weapon_g36_real"),
[ ARC9:GetPhrase( "uplp_manufacturer" ) ] = ARC9:GetPhrase( "uplp_weapon_g36_manufacturer" ),
[ ARC9:GetPhrase( "uplp_caliber" ) ] = ARC9:GetPhrase( "uplp_caliber_5.56x45mm"),
[ ARC9:GetPhrase( "uplp_mechanism" ) ] = string.format( ARC9:GetPhrase("uplp_mechanism_3" ),
ARC9:GetPhrase( "uplp_mechanism_shortstroke" ),
ARC9:GetPhrase( "uplp_mechanism_closedbolt" ),
ARC9:GetPhrase( "uplp_mechanism_rotatingbolt" ) ),
[ ARC9:GetPhrase( "uplp_country" ) ] = ARC9:GetPhrase( "uplp_country_usa" ),
[ ARC9:GetPhrase( "uplp_year" ) ] = string.format( ARC9:GetPhrase("uplp_year_present"), "1964" ),
}
SWEP.Credits = {
[ ARC9:GetPhrase( "uplp_lua" ) ] = "Fesiug, Moka, 8Z",
[ ARC9:GetPhrase( "uplp_assets" ) ] = "TastyTony",
[ ARC9:GetPhrase( "uplp_animations" ) ] = "Partexedd",
[ ARC9:GetPhrase( "uplp_sounds" ) ] = "rzen1th",
[ ARC9:GetPhrase( "uplp_general" ) ] = "Fesiug",
}
SWEP.StandardPresets = {
}
SWEP.DefaultBodygroups = "010111100"
---- Muzzle Effects, Shell Effects, Camera
SWEP.MuzzleParticle = "muzzleflash_3"
SWEP.MuzzleEffectQCA = 1
SWEP.TracerNum = 1
SWEP.TracerSize = 1
SWEP.ShellModel = "models/weapons/arc9/uplp/shells/shell_556.mdl"
SWEP.ShellScale = 1.5
SWEP.ShellPitch = 90
SWEP.CaseEffectQCA = 2
SWEP.CamQCA = 3
SWEP.CamOffsetAng = Angle(0, 0, 90)
---- View & Worldmodel
SWEP.ViewModel = "models/weapons/arc9/c_uplp-f_g36-8.mdl"
SWEP.WorldModel = "models/weapons/arc9/w_uplp_ar15.mdl"
SWEP.MirrorVMWM = true
SWEP.NoTPIKVMPos = true
-- SWEP.WorldModelMirror = "models/weapons/arc9/c_uplp_ar15.mdl"
SWEP.WorldModelOffset = {
Pos = Vector(-3.5, 3, -8),
Ang = Angle(0, 0, 180),
TPIKPos = Vector(-8.5, 2, -7),
TPIKAng = Angle(0, 0, 180),
Scale = 1
}
SWEP.ViewModelFOVBase = 70
SWEP.AnimShoot = ACT_HL2MP_GESTURE_RANGE_ATTACK_AR2
SWEP.AnimReload = ACT_HL2MP_GESTURE_RELOAD_MAGIC
---- Weapon Stats and Behaviour
-- Damage
SWEP.DamageMax = 25 -- Damage dealt point-blank
SWEP.DamageMin = 14 -- Damage dealt after maximum range
SWEP.DamageType = DMG_BULLET
SWEP.Penetration = 15 -- Units of wood that can be penetrated
SWEP.ImpactForce = 2 -- How much kick things will have when hit
-- Range
SWEP.RangeMin = 20 / ARC9.HUToM
SWEP.RangeMax = 60 / ARC9.HUToM
-- Physical Bullets
SWEP.PhysBulletMuzzleVelocity = 715 / ARC9.HUToM
SWEP.PhysBulletGravity = 1.5
SWEP.PhysBulletDrag = 1.5
-- Magazine Info
SWEP.Ammo = "smg1" -- What ammo type this gun uses.
SWEP.ChamberSize = 1
SWEP.ClipSize = 30
-- Recoil
SWEP.Recoil = 1
SWEP.RecoilUp = 1.2
SWEP.RecoilSide = 0.9
SWEP.RecoilRandomUp = 0.7
SWEP.RecoilRandomSide = 0.9
SWEP.RecoilRise = 0
SWEP.MaxRecoilBlowback = 0
SWEP.RecoilPunch = 0
SWEP.RecoilAutoControl = 1.9
SWEP.RecoilMultSights = 1
SWEP.RecoilMultCrouch = 0.75
-- Visual Recoil
SWEP.VisualRecoil = 0.5
SWEP.VisualRecoilMultSights = 1
SWEP.VisualRecoilCenter = Vector(2, 11, 2)
SWEP.VisualRecoilUp = 0.075 -- Vertical tilt
SWEP.VisualRecoilSide = 0.01 -- Horizontal tilt
SWEP.VisualRecoilRoll = -2.5 -- Roll tilt
SWEP.VisualRecoilPunch = 10 -- How far back visual recoil moves the gun
SWEP.VisualRecoilDampingConst = 80
SWEP.VisualRecoilSpringMagnitude = 0.44
SWEP.VisualRecoilPositionBumpUp = .25
SWEP.VisualRecoilMultHipFire = .35
SWEP.VisualRecoilUpHipFire = 2
SWEP.VisualRecoilSideHipFire = -0.1
SWEP.VisualRecoilRollHipFire = 20
SWEP.VisualRecoilPunchHipFire = 2
SWEP.VisualRecoilDampingConstHipFire = 45
SWEP.VisualRecoilPositionBumpUpHipFire = .5
-- Accuracy and Spread
SWEP.Spread = 0.008
SWEP.SpreadAddHipFire = 0.025
SWEP.SpreadAddRecoil = 0.012
SWEP.SpreadAddMove = 0.01
SWEP.SpreadAddMidAir = 0.05
SWEP.SpreadMultSights = 1
SWEP.SpreadMultMove = 1
SWEP.RecoilDissipationRate = 8
SWEP.RecoilResetTime = 0.03
SWEP.RecoilPerShot = 1 / 5
SWEP.RecoilMax = 1
SWEP.RecoilModifierCap = 1
-- Weapon handling
SWEP.Speed = 0.85 -- Walk speed multiplier
SWEP.SpeedMultSights = 0.7 -- When aiming
SWEP.SpeedMultShooting = 0.9
SWEP.AimDownSightsTime = 0.42 -- Time it takes to fully enter ADS
SWEP.SprintToFireTime = 0.42 -- Time it takes to fully enter sprint
SWEP.SwayAddSights = 0
SWEP.BarrelLength = (39 or 29) or (34 or 24) or (29 or 19)
-- Shooting and Firemodes
SWEP.RPM = 670 -- How fast gun shoot
SWEP.HeatCapacity = 180 -- For suppresors; how many shots for full heat With big silencer (Small silencers will make this number lower down to 70%)
SWEP.Num = 1 -- How many bullets shot at once
SWEP.Firemodes = {
{ Mode = -1, -- Full
PoseParam = 1 },
{ Mode = 1, -- Semi
RPM = 555,
PoseParam = 2 }
}
SWEP.ShootPitch = 90
SWEP.ShootVolume = 120
-- HoldType Info
SWEP.HoldType = "ar2"
SWEP.HoldTypeSprint = "passive"
SWEP.HoldTypeHolstered = nil
SWEP.HoldTypeSights = "smg"
SWEP.HoldTypeCustomize = "slam"
SWEP.HoldTypeNPC = nil
-- NPC Info
SWEP.NPCWeaponType = "weapon_ar2"
SWEP.NPCWeight = 60
-- Iron Sight and Sight Info
SWEP.IronSights = {
Pos = Vector(-3.05491, -3, 0.75966),
Ang = Angle(0, 0, 0),
Magnification = 1.15,
ViewModelFOV = 65,
}
SWEP.IronSightsHook = function(self) -- If any attachments equipped should alter Irons
local attached = self:GetElements()
if attached["uplp_ar15_rs_tall"] then
return {
Pos = Vector(-3.05491, -3, -0.17),
Ang = Angle(0, 0, 0),
Magnification = 1.15,
ViewModelFOV = 65,
}
elseif attached["uplp_ar15_rs_short"] then
return {
Pos = Vector(-3.05491, -3, -0.03),
Ang = Angle(0, 0, 0),
Magnification = 1.15,
ViewModelFOV = 65,
}
elseif attached["uplp_g36_receiver_sl8"] then
return {
Pos = Vector(-3.05491, -3, 0.05944),
Ang = Angle(0, 0, 0),
Magnification = 1.15,
ViewModelFOV = 65,
}
end
end
-- Customization Menu Info
SWEP.CustomizePos = Vector(14, 32.5, 5)
SWEP.CustomizeAng = Angle(90, 0, 0)
SWEP.CustomizeRotateAnchor = Vector(14, -4, -3)
SWEP.CustomizeSnapshotPos = Vector(0, 5, 0)
SWEP.CustomizeSnapshotFOV = 90
-- Dropped Magazine
SWEP.ShouldDropMag = true
SWEP.ShouldDropMagEmpty = true
SWEP.DropMagazineModel = "models/weapons/arc9/uplp/ar15_mag_stanag30.mdl"
SWEP.DropMagazineTime = 0.5
SWEP.DropMagazineQCA = 4
SWEP.DropMagazinePos = Vector(0, 1.75, -2.5)
SWEP.DropMagazineAng = Angle(90, 90, 90)
SWEP.DropMagazineVelocity = Vector(0, -15, 10)
---- Sounds
-- urbna!
local pathUT = "uplp_urban_temp/ar15/"
local pathREAL = "uplp_f/g36/"
local pathUTS = "uplp_urban_temp/scar/"
local pathUTA = "uplp_urban_temp/ak/"
local pathUTC = "uplp_urban_temp/common/"
SWEP.ShootSound = {
pathREAL .. "fire-01.ogg",
pathREAL .. "fire-02.ogg",
pathREAL .. "fire-03.ogg",
pathREAL .. "fire-04.ogg",
pathREAL .. "fire-05.ogg",
pathREAL .. "fire-06.ogg",
}
SWEP.ShootSoundSilenced = {
pathUT .. "fire-sup-01.ogg",
pathUT .. "fire-sup-02.ogg",
pathUT .. "fire-sup-03.ogg",
pathUT .. "fire-sup-04.ogg",
pathUT .. "fire-sup-05.ogg",
pathUT .. "fire-sup-06.ogg",
}
SWEP.ShootSoundSilencedIndoor = SWEP.ShootSoundSilenced
SWEP.DistantShootSound = {
pathUTC .. "556tails/fire-dist-556x45-rif-ext-01.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-ext-02.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-ext-03.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-ext-04.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-ext-05.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-ext-06.ogg",
}
SWEP.DistantShootSoundIndoor = {
pathUTC .. "556tails/fire-dist-556x45-rif-int-01.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-int-02.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-int-03.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-int-04.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-int-05.ogg",
pathUTC .. "556tails/fire-dist-556x45-rif-int-06.ogg",
}
SWEP.DistantShootSoundSilenced = {
pathUTC .. "generictails/sup-tail-01.ogg",
pathUTC .. "generictails/sup-tail-02.ogg",
pathUTC .. "generictails/sup-tail-03.ogg",
pathUTC .. "generictails/sup-tail-04.ogg",
pathUTC .. "generictails/sup-tail-05.ogg",
pathUTC .. "generictails/sup-tail-06.ogg",
pathUTC .. "generictails/sup-tail-07.ogg",
pathUTC .. "generictails/sup-tail-08.ogg",
pathUTC .. "generictails/sup-tail-09.ogg",
pathUTC .. "generictails/sup-tail-10.ogg"
}
SWEP.DistantShootSoundSilencedIndoor = {
pathUTC .. "generictails/fire-dist-int-pistol-light-01.ogg",
pathUTC .. "generictails/fire-dist-int-pistol-light-02.ogg",
pathUTC .. "generictails/fire-dist-int-pistol-light-03.ogg",
pathUTC .. "generictails/fire-dist-int-pistol-light-04.ogg",
pathUTC .. "generictails/fire-dist-int-pistol-light-05.ogg",
pathUTC .. "generictails/fire-dist-int-pistol-light-06.ogg",
}
SWEP.DropMagazineSounds = {
pathUTC .. "rifle_magdrop_1.ogg",
pathUTC .. "rifle_magdrop_2.ogg",
pathUTC .. "rifle_magdrop_3.ogg",
pathUTC .. "rifle_magdrop_4.ogg",
pathUTC .. "rifle_magdrop.ogg",
}
---- Animations
-- HideBones, BulletBones, etc.
SWEP.BulletBones = {
[1] = "bullet1",
[2] = "bullet2",
[3] = "bullet3",
}
-- SWEP.HideBones = {
-- "fakemag",
-- "fakerounds",
-- "bullet1",
-- "bullet2",
-- "bullet3",
-- "bullet4",
-- }
SWEP.ReloadHideBoneTables = {
[1] = {
"mag",
"bullet1",
"bullet2",
"bullet3",
},
}
local mechh = {
pathUT .. "mech-01.ogg",
pathUT .. "mech-02.ogg",
pathUT .. "mech-03.ogg",
pathUT .. "mech-04.ogg",
pathUT .. "mech-05.ogg",
pathUT .. "mech-06.ogg",
}
local thetoggle = {{
s = {
"arc9/toggles/flashlight_laser_toggle_off_01.ogg",
"arc9/toggles/flashlight_laser_toggle_off_02.ogg",
"arc9/toggles/flashlight_laser_toggle_off_03.ogg",
"arc9/toggles/flashlight_laser_toggle_on_01.ogg",
"arc9/toggles/flashlight_laser_toggle_on_02.ogg",
"arc9/toggles/flashlight_laser_toggle_on_03.ogg",
}, t = 0
}}
-- Animations
SWEP.Animations = {
["idle"] = {
Source = "idle",
IKTimeLine = { { t = 0, lhik = 1 } },
},
["ready"] = {
Source = "ready",
MinProgress = 0.75,
FireASAP = true,
EventTable = {
{ s = pathUTC .. "raise.ogg", t = 0 / 30, c = ca, v = 0.8 },
{ s = pathUTA .. "chback_308.ogg", t = 3 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "chpull.ogg", t = 4 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "chamber3.ogg", t = 10 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "grab-polymer.ogg", t = 18 / 30, c = ca, v = 0.3 },
{ s = pathUTC .. "cloth_3.ogg", t = 18 / 30, c = ca, v = 0.8 },
},
IKTimeLine = {
{ t = 0, lhik = 1 },
{ t = 0.15, lhik = 0 },
{ t = 0.5, lhik = 0 },
{ t = 0.8, lhik = 1 },
{ t = 1, lhik = 1 },
},
},
["draw"] = {
Source = "draw",
MinProgress = 0.6,
FireASAP = true,
EventTable = {
{ s = pathREAL .. "mw2.ogg", t = 0 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "magtap.ogg", t = 5 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "movement-05.ogg", t = 10 / 30, c = ca, v = 0.8 },
},
},
["holster"] = {
Source = "holster",
MinProgress = 0.5,
EventTable = {
{ s = pathUTC .. "rattle2.ogg", t = 0 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "selector.ogg", t = 1 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "mw2.ogg", t = 4 / 30, c = ca, v = 0.8 },
},
IKTimeLine = { { t = 0, lhik = 1 } },
},
["draw_quick"] = {
Source = "draw_quick",
MinProgress = 0.0025,
EventTable = {
{ s = pathREAL .. "mw2.ogg", t = 0 / 30, c = ca, v = 0.8 },
},
IKTimeLine = { { t = 0, lhik = 1 } },
},
["holster_quick"] = {
Source = "holster_quick",
MinProgress = 0.25,
EventTable = {
{ s = pathREAL .. "mw2.ogg", t = 0 / 30, c = ca, v = 0.8 },
},
IKTimeLine = { { t = 0, lhik = 1 } },
},
["draw_empty"] = {
Source = "draw",
MinProgress = 0.6,
FireASAP = true,
EventTable = {
{ s = pathUTC .. "raise.ogg", t = 0 / 30, c = ca, v = 0.8 },
},
},
["holster_empty"] = {
Source = "holster",
MinProgress = 0.4,
Mult = 0.8,
EventTable = {
{ s = pathUTC .. "rattle2.ogg", t = 0 / 30, c = ca, v = 0.8 },
},
IKTimeLine = { { t = 0, lhik = 1 } },
},
["fire"] = {
Source = "fire",
ShellEjectAt = 0.01,
IKTimeLine = { { t = 0, lhik = 1 } },
EventTable = { { s = mechh, t = 0 } },
},
["fire_empty"] = {
Source = "fire_empty",
ShellEjectAt = 0.01,
IKTimeLine = { { t = 0, lhik = 1 } },
EventTable = { { s = pathUT .. "mech_last.ogg", t = 0 } },
},
-- Reloads --
["reload"] = {
Source = "reload",
MinProgress = 0.8,
PeekProgress = 0.775,
RefillProgress = 0.6,
FireASAP = true,
Mult = 1.1,
EventTable = {
-- { s = pathUTA .. "reload_start.ogg", t = 0 / 30, v = 0.8 },
{ s = pathREAL .. "magout2.ogg", t = 0 / 30, c = ca, v = 0.8 },
{ s = pathUTS .. "struggle.ogg", t = 17 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "magin.ogg", t = 19 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_4.ogg", t = 25 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_4.ogg", t = 32 / 30 - 0.07, c = ca, v = 0.3 },
{hide = 0, t = 0},
{hide = 1, t = 0.33},
{hide = 0, t = 0.45}
},
IKTimeLine = {
{ t = 0, lhik = 1 },
{ t = 0.15, lhik = 0 },
{ t = 0.65, lhik = 0 },
{ t = 0.85, lhik = 1 },
{ t = 1, lhik = 1 },
},
},
["reload_empty"] = {
Source = "reload_empty",
MinProgress = 0.8,
PeekProgress = 0.775,
RefillProgress = 0.65,
FireASAP = true,
Mult = 1.1,
EventTable = {
-- { s = pathUTA .. "reload_start.ogg", t = 0 / 30, v = 0.8 },
{ s = pathREAL .. "magout2.ogg", t = 0 / 30, c = ca, v = 0.8 },
{ s = pathUTS .. "struggle.ogg", t = 17 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "magin.ogg", t = 19 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_1.ogg", t = 25 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "chpull2.ogg", t = 42 / 30, c = ca, v = 1 },
{ s = pathREAL .. "chamber3.ogg", t = 49 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_4.ogg", t = 54 / 30, c = ca, v = 0.3 },
{hide = 0, t = 0},
{hide = 1, t = 0.33},
{hide = 0, t = 0.45}
},
IKTimeLine = {
{ t = 0, lhik = 1 },
{ t = 0.15, lhik = 0 },
{ t = 0.65, lhik = 0 },
{ t = 0.85, lhik = 1 },
{ t = 1, lhik = 1 },
},
},
["reload_10"] = {
Source = "reload_10",
MinProgress = 0.8,
PeekProgress = 0.775,
RefillProgress = 0.6,
FireASAP = true,
Mult = 1.1,
EventTable = {
-- { s = pathUTA .. "reload_start.ogg", t = 0 / 30, v = 0.8 },
{ s = pathREAL .. "magout_10_1.ogg", t = 0 / 30, c = ca, v = 0.8 },
{ s = pathUTS .. "struggle.ogg", t = 17 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "magin.ogg", t = (22-8) / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_4.ogg", t = 25 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_4.ogg", t = 32 / 30, c = ca, v = 0.3 },
{hide = 0, t = 0},
{hide = 1, t = 0.33},
{hide = 0, t = 0.45}
},
IKTimeLine = {
{ t = 0, lhik = 1 },
{ t = 0.15, lhik = 0 },
{ t = 0.65, lhik = 0 },
{ t = 0.85, lhik = 1 },
{ t = 1, lhik = 1 },
},
},
["reload_empty_10"] = {
Source = "reload_empty_10",
MinProgress = 0.8,
PeekProgress = 0.775,
RefillProgress = 0.65,
FireASAP = true,
Mult = 1.1,
EventTable = {
-- { s = pathUTA .. "reload_start.ogg", t = 0 / 30, v = 0.8 },
{ s = pathREAL .. "magout_10_1.ogg", t = 0 / 30, c = ca, v = 0.8 },
{ s = pathUTS .. "struggle.ogg", t = 17 / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "magin.ogg", t = (22-8) / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_1.ogg", t = (25-8) / 30, c = ca, v = 0.8 },
{ s = pathREAL .. "chpull2.ogg", t = (42-8) / 30, c = ca, v = 1 },
{ s = pathREAL .. "chamber3.ogg", t = (49-8) / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_4.ogg", t = (54-8) / 30, c = ca, v = 0.3 },
{hide = 0, t = 0},
{hide = 1, t = 0.33},
{hide = 0, t = 0.45}
},
IKTimeLine = {
{ t = 0, lhik = 1 },
{ t = 0.15, lhik = 0 },
{ t = 0.65, lhik = 0 },
{ t = 0.85, lhik = 1 },
{ t = 1, lhik = 1 },
},
},
-- Inspecc --
["inspect"] = {
Source = "idle" or "inspect",
FireASAP = true,
MinProgress = 0.925,
Mult = 1.2,
EventTable = {
{ s = pathUTC .. "cloth_4.ogg", t = 0 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "movement-rifle-03.ogg", t = 5 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_2.ogg", t = 37 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "movement-rifle-04.ogg", t = 45 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "movement-rifle-02.ogg", t = 90 / 30, c = ca, v = 0.8 },
-- {hide = 1, t = 0},
},
IKTimeLine = {
{ t = 0, lhik = 1 },
{ t = 0.15, lhik = 0 },
{ t = 0.8, lhik = 0 },
{ t = 0.95, lhik = 1 },
{ t = 1, lhik = 1 },
},
},
["inspect_empty"] = {
Source = "idle" or "inspect_empty",
FireASAP = true,
MinProgress = 0.925,
Mult = 1.2,
EventTable = {
{ s = pathUTC .. "cloth_4.ogg", t = 0 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "movement-rifle-03.ogg", t = 5 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "cloth_2.ogg", t = 37 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "movement-rifle-04.ogg", t = 45 / 30, c = ca, v = 0.8 },
{ s = pathUTC .. "movement-rifle-02.ogg", t = 90 / 30, c = ca, v = 0.8 },
-- {hide = 1, t = 0},
},
IKTimeLine = {
{ t = 0, lhik = 1 },
{ t = 0.15, lhik = 0 },
{ t = 0.8, lhik = 0 },
{ t = 0.95, lhik = 1 },
{ t = 1, lhik = 1 },
},
},
-- Firemodee --
["firemode_1"] = {
Source = "idle" or "firemode_0",
EventTable = {
{ s = "uplp_urban_temp/ar15/selector-01.ogg", t = 0 },
}
},
["firemode_2"] = {
Source = "idle" or "firemode_1",
EventTable = {
{ s = "uplp_urban_temp/ar15/selector-06.ogg", t = 0 },
}
},
["firemode_1_empty"] = {
Source = "idle" or "firemode_0_empty",
EventTable = {
{ s = "uplp_urban_temp/ar15/selector-01.ogg", t = 0 },
}
},
["firemode_2_empty"] = {
Source = "idle" or "firemode_1_empty",
EventTable = {
{ s = "uplp_urban_temp/ar15/selector-06.ogg", t = 0 },
}
},
["toggle"] = {
Source = "modeswitch",
EventTable = thetoggle
},
["toggle_empty"] = {
Source = "modeswitch_empty",
EventTable = thetoggle
},
["switchsights"] = {
Source = "modeswitch",
EventTable = thetoggle
},
["switchsights_empty"] = {
Source = "modeswitch_empty",
EventTable = thetoggle
},
}
---- Attachments
SWEP.Hook_ModifyBodygroups = function(wep, data)
local eles = data.elements
local mdl = data.model
local BARREL_R = eles["uplp_g36_barrel_19"]
local BARREL_C = eles["uplp_g36_barrel_9"]
local BARREL_K = !BARREL_R and !BARREL_C
local BARREL_S = eles["uplp_g36_barrel_sl8"]
local muzzle = ((eles["muzzleattached"] or BARREL_S) and 3) or (BARREL_C and 0 or BARREL_K and 1 or BARREL_R and 2) or 1
local grip = ((eles["gripattached"] or eles["tacticalattached"]) and (BARREL_C and 0 or BARREL_K and 1 or BARREL_R and 2)) or 3
mdl:SetBodygroup( 5, muzzle )
mdl:SetBodygroup( 6, grip )
local optic = (eles["uplp_g36_optic_integrated"] and 2) or (eles["ironsattached"] and 1) or 0
if !eles["uplp_g36_optic_integrated"] and eles["uplp_g36_receiver_sl8"] then
optic = (eles["ironsattached"] or eles["opticattached"]) and 4 or 3
end
mdl:SetBodygroup( 2, optic )
--mdl:SetBodygroup( 1, eles["uplp_g36_stock_carbine"] and 1 or eles["uplp_g36_receiver_sl8"] and 2 or 0 )
end
SWEP.AttachmentElements = {
["uplp_g36_barrel_19"] = {
Bodygroups = {
{ 3, 2 }, { 4, 2 }, { 5, 2 }
},
AttPosMods = {
[1] = { Pos = Vector(0, 0.61485, 21.5) },
[4] = { Pos = Vector(-1.22, 0.55, 14.5) }
}
},
["uplp_g36_barrel_9"] = {
Bodygroups = {
{ 3, 0 }, { 4, 0 }, { 5, 0 }
},
AttPosMods = {
[1] = { Pos = Vector(0, 0.61485, 11.6) },
[3] = { Pos = Vector(0, 1.98, 8.2) },
[4] = { Pos = Vector(-1.22, 0.55, 9) }
}
},
["uplp_g36_barrel_sl8"] = { Bodygroups = { { 3, 3 }, { 4, 3 }, { 5, 3 } }, AttPosMods = { [1] = { Pos = Vector(0, 0.61485, 23.8) }, [7] = { Pos = Vector(0, -2.04, 14.8) } } },
["uplp_g36_stock_carbine"] = { Bodygroups = { { 1, 0 } } },
["uplp_g36_mag_10"] = { Bodygroups = { { 7, 1 } } },
["uplp_g36_receiver_sl8"] = { Bodygroups = { { 0, 1 }, { 1, 2 }, { 8, 1 } } },
["uplp_ar15_mag"] = { Bodygroups = { { 7, 2 } } },
}
local defatt = "arc9/def_att_icons/"
local defatt2 = "entities/uplp_attachements/def/"
SWEP.Attachments = {
{
PrintName = ARC9:GetPhrase("uplp_category_muzzle"),
Category = "uplp_muzzle",
Bone = "body",
Pos = Vector(0, 0.61485, 15.5),
Ang = Angle(90, 90, 180),
Icon_Offset = Vector(3, 0, 0),
InstalledElements = {"muzzleattached"},
},
{
PrintName = ARC9:GetPhrase("uplp_category_barrel"),
Category = "uplp_g36_barrel",
DefaultIcon = Material(defatt .. "barrel.png", "mips smooth"),
Bone = "body",
Pos = Vector(0, 0.61485, 5),
Ang = Angle(90, 90, 180),
ActiveElements = {"uplp_g36_barrel"},
},
{
PrintName = ARC9:GetPhrase("uplp_category_grip"),
Category = {"uplp_grip_vert", "uplp_grip_horiz", "uplp_grip_horiz_cclamp"},
DefaultIcon = Material(defatt2 .. "grip.png", "mips smooth"),
Bone = "body",
Pos = Vector(0, 1.98, 10),
Ang = Angle(90, 90, 180),
Icon_Offset = Vector(0, 0, -2),
InstalledElements = {"gripattached"},
},
{
PrintName = ARC9:GetPhrase("uplp_category_tactical"),
Category = "uplp_tac",
Bone = "body",
Pos = Vector(-1.22, 0.55, 12),
Ang = Angle(90, 90, -90),
Icon_Offset = Vector(0, 0, 1),
InstalledElements = {"tacticalattached"},
},
{
PrintName = ARC9:GetPhrase("uplp_category_sight_rear"),
Category = {"uplp_ar15_rs", "uplp_backup_optic"},
DefaultIcon = Material(defatt .. "rs.png", "mips smooth"),
Bone = "body",
Pos = Vector(0, -2.04, -4.2),
Ang = Angle(90, 90, 180),
ActiveElements = {"uplp_g36_rsinstalled"},
InstalledElements = {"ironsattached"},
ExcludeElements = {"uplp_g36_optic_integrated"},
},
{
PrintName = ARC9:GetPhrase("uplp_category_optic"),
Category = {"uplp_g36_optic", "uplp_optic_small", "uplp_optic_mid", "uplp_optic_big"},
DefaultIcon = Material(defatt .. "optic.png", "mips smooth"),
Bone = "body",
CorrectiveAng = Angle(0, 0, 0),
Pos = Vector(0, -2.04, -2),
Ang = Angle(90, 90, 180),
Icon_Offset = Vector(1, 0, 0),
InstalledElements = {"opticattached"},
},
{
PrintName = ARC9:GetPhrase("uplp_category_sight_front"),
Category = "uplp_ar15_fs",
DefaultIcon = Material(defatt .. "fs.png", "mips smooth"),
Bone = "body",
Pos = Vector(0, -2.04, 6.5),
Ang = Angle(90, 90, 180),
RequireElements = {"uplp_ar15_rs"},
},
{
PrintName = ARC9:GetPhrase("uplp_category_magazine"),
Category = {"uplp_ar15_556_mag", "uplp_g36_mag"},
DefaultIcon = Material(defatt2 .. "armag.png", "mips smooth"),
Bone = "mag",
Pos = Vector(0, -1.3, -1.4),
Ang = Angle(90, 90, 180),
Icon_Offset = Vector(1.5, 0, -3),
},
{
PrintName = ARC9:GetPhrase("uplp_category_stock"),
Category = "uplp_g36_stock",
DefaultIcon = Material(defatt2 .. "arstock.png", "mips smooth"),
Bone = "body",
Pos = Vector(0, 0.99, -8),
Ang = Angle(90, 90, 180),
ExcludeElements = {"uplp_g36_receiver_sl8"}
},
{
PrintName = ARC9:GetPhrase("uplp_category_receiver"),
Category = "uplp_g36_reciever",
DefaultIcon = Material(defatt2 .. "rec.png", "mips smooth"),
Bone = "body",
Pos = Vector(0, 1.5, -1),
Ang = Angle(90, 90, 180),
},
{
PrintName = ARC9:GetPhrase("uplp_category_backup"),
Category = "uplp_backup_optic_front",
Bone = "body",
Pos = Vector(0.045, -0.2, 11.5),
Ang = Angle(90, 90, 180),
RequireElements = {"uplp_backup_optic_is"},
Installed = "uplp_backup_optic_is_front",
Integral = "uplp_backup_optic_is_front",
Hidden = true,
},
-- Cosmetic shit
{
PrintName = ARC9:GetPhrase("uplp_category_charm"),
Category = "charm",
Bone = "body",
Pos = Vector(0.63, 1.84, 5.15),
Ang = Angle(90, 0, -90),
},
}
SWEP.HookP_NameChange = function(self, name)
local att = self:GetElements()
if att["uplp_g36_barrel_19"] then
name = ARC9:GetPhrase("uplp_weapon_g36")
elseif att["uplp_g36_barrel_9"] then
name = ARC9:GetPhrase("uplp_weapon_g36_c")
elseif att["uplp_g36_barrel_sl8"] then
name = ARC9:GetPhrase("uplp_weapon_g36_sl8")
end
return name
end
SWEP.HookP_DescriptionChange = function(self, name)
local att = self:GetElements()
if att["uplp_g36_barrel_19"] then
name = ARC9:GetPhrase("uplp_weapon_g36_desc")
elseif att["uplp_g36_barrel_9"] then
name = ARC9:GetPhrase("uplp_weapon_g36_c_desc")
elseif att["uplp_g36_barrel_sl8"] then
name = ARC9:GetPhrase("uplp_weapon_g36_sl8_desc")
end
return name
end