nextblast = 0

function onInit()
	_SWEPSetSound(MyIndex, "single_shot", "")
end

function Holster()
	nextblast = 0
end

function onThink()
	if nextblast > 0 and _CurTime() > nextblast + 1.5 then
		nextblast = 0
		_EntEmitSound(Owner, "weapons/shotgun/shotgun_dbl_fire.wav")
		for i=1, math.ceil(_swep.GetClipAmmo(MyIndex, 0)*0.5) do
			_TraceLine(_PlayerGetShootPos(Owner), vecAdd(_PlayerGetShootAng(Owner), vector3(math.random(-110, 110)*0.001, math.random(-110, 110)*0.001, math.random(-110, 110)*0.001)), 2000, Owner)
			if _TraceHitNonWorld() then
				local damage = getDamage()
				local tracedEntity = _TraceGetEnt()
				_RunString("_TraceAttack("..tracedEntity..", "..MyIndex..", "..Owner..", "..damage..", 'bullet')")
			end
			_EffectInit()
			_EffectSetEnt(Owner)
			_EffectSetOrigin(_TraceEndPos())
			_EffectSetStart(_PlayerGetShootPos(Owner))
			_EffectSetScale(10)
			_EffectSetMagnitude(3)
			_EffectSetRadius(90)
			_EffectDispatch("FadingLineTeam")
			if _TraceHit() then
				_MakeDecal(math.random(0,4))
			end
		end
		_SWEPUseAmmo(MyIndex, 0, _swep.GetClipAmmo(MyIndex, 0))
	end
end

function onPrimaryAttack()
	_EntEmitSoundEx(Owner, "weapons/usp/usp_unsil-1.wav", 1, math.random(400,550)*0.001)
	_SWEPUpdateVariables(MyIndex)
end

function onSecondaryAttack()
	nextblast = _CurTime()
	_EntEmitSoundEx(Owner, "weapons/cguard/charging.wav", 0.8, 0.65)
end

function onReload()
	return true
end

function getWeaponSwapHands() end
function getWeaponFOV() return 74 end
function getWeaponSlot() return 1 end
function getWeaponSlotPos() return 5 end
function getFiresUnderwater() return true end
function getReloadsSingly() return false end
function getDamage() return 13 end
function getPrimaryShotDelay() return 0.18 end
function getSecondaryShotDelay() return 6.0 end
function getPrimaryIsAutomatic() return false end
function getSecondaryIsAutomatic() return false end
function getPrimaryAmmoType() return "pistol" end
function getSecondaryAmmoType() return "pistol" end
function getMaxClipPrimary() return 24 end
function getMaxClipSecondary() return -1 end
function getDefClipPrimary() return 9999 end
function getDefClipSecondary() return -1 end
function getPrimaryScriptOverride() return 0 end
function getSecondaryScriptOverride() return 3 end
function getBulletSpread() return vector3(0.025, 0.025, 0.025) end
function getViewKick() return vector3(0, 0.0, 0.0) end
function getViewKickRandom() return vector3( 0.8, 0.8, 0.8 ) end
function getViewModel() return "models/weapons/v_pist_elite.mdl" end
function getWorldModel() return "models/weapons/w_pist_elite.mdl" end
function getClassName()	return "gunmaster_duals" end
function getAnimPrefix() return "pistol" end
function getPrintName() return "Dual Battle Axe\nMK2 Specials" end
function getDeathIcon() return "d_deagle" end