-- Rope/Spider Woman-Style Grappling Hook
-- By JetBoom

function onInit() _SWEPSetSound(MyIndex, "single_shot", "") end
function onPrimaryAttack()
	_RunString("CreateGrapArrow("..Owner..")")
end
function onReload()
	_TraceLine(_PlayerGetShootPos(Owner), _PlayerGetShootAng(Owner), 4064, Owner)
	local ents = _EntitiesFindInSphere(_TraceEndPos(), 256)
	for i=1, table.getn(ents) do
		if _EntGetName(ents[i]) == "rope"..Owner then
			_RunString("RemoveGrapArrow("..ents[i]..")")
			break
		end
	end
end
function getWeaponSwapHands() return false end
function getWeaponFOV()	return 75 end
function getWeaponSlot() return 5 end
function getWeaponSlotPos() return 7 end
function getFiresUnderwater() return true end
function getReloadsSingly() return true end
function getDamage() return 1 end
function getPrimaryShotDelay() return 1.0 end
function getPrimaryIsAutomatic() return true end
function getBulletSpread() return vector3(0,0,0) end
function getNumShotsPrimary() return 1 end
function getViewKick() return vector3(0,0,0) end
function getViewKickRandom() return vector3(0,0,0) end
function getViewModel() return "models/weapons/v_crossbow.mdl" end
function getWorldModel() return "models/weapons/w_crossbow.mdl" end
function getClassName() return "weapon_grapplinghook" end
function getPrimaryAmmoType() return "none" end
function getSecondaryAmmoType() return "none" end
function getMaxClipPrimary() return 9999 end
function getMaxClipSecondary() return -1 end
function getDefClipPrimary() return 9999 end
function getDefClipSecondary() return -1 end
function getAnimPrefix() return "pistol" end
function getPrintName() return "Grappling Hook\nBy JetBoom" end
function getPrimaryScriptOverride() return 0 end
function getSecondaryScriptOverride() return 3 end
function getDeathIcon() return "d_crossbow" end
