function SplitShotLaunch( keys )
local caster = keys.caster
local caster_location = caster:GetAbsOrigin()
local ability = keys.ability
if caster:Attribute_GetIntValue("SplitAttacked", 0) ~= 1 then
local target_type = ability:GetAbilityTargetType()
local target_team = ability:GetAbilityTargetTeam()
local target_flags = ability:GetAbilityTargetFlags()
local attack_target = caster:GetAttackTarget()
local radius = ability:GetSpecialValueFor("range")
local max_targets = ability:GetSpecialValueFor("arrow_count")
local split_shot_targets = FindUnitsInRadius(caster:GetTeam(), caster_location, nil, radius, target_team, target_type, target_flags, FIND_CLOSEST, false)
caster:Attribute_SetIntValue("SplitAttacked", 1)
for _,v in pairs(split_shot_targets) do
if v ~= attack_target then
caster:AttackReady()
caster:PerformAttack(v, true, true, true, true, true, false, true)
end
if max_targets == 0 then break end
end
caster:Attribute_SetIntValue("SplitAttacked", 0)
end
end