Commit 1da3f7e1 authored by JoyJ's avatar JoyJ

update jmz_func

parent 7725cdd2
......@@ -3477,6 +3477,7 @@ function J.MergeGroup(nList,...)
for a in arg do
table.insert(nList,a)
end
return nList
end
function J.Not(f)
......@@ -3659,6 +3660,10 @@ function J.DebugMessage(str,b)
end
end
function J.FindAoeLocationForLinearSkillFilter(u)
return not u:IsMagicImmune()
end
function J.FindAoeLocationForLinearSkill(data)
local range = data.range or 600
local radius = data.range or 200
......@@ -3667,22 +3672,33 @@ function J.FindAoeLocationForLinearSkill(data)
local onlyHero = data.onlyHero or true
local bot = GetBot()
local loc=data.loc or bot:GetLocation()
local enemyHeroes = bot:GetNearbyHeroes( range, true, BOT_MODE_NONE )
local creeps = bot:GetNearbyLaneCreeps( range + nRadius, true )
--AOE
local enemies = bot:GetNearbyHeroes( range, true, BOT_MODE_NONE )
local creeps = bot:GetNearbyLaneCreeps( range + radius, true )
local filter = data.filter or J.FindAoeLocationForLinearSkillFilter
enemies = J.FilterGroup(enemies, function(u)
return J.IsValidHero(u)
end)
creeps = J.FilterGroup(creeps, function(u)
return J.IsValid(u)
end)
if not onlyHero then
enemies = J.MergeGroup(enemies, creeps)
end
local most=0
local nAoeLoc
for i=1,36 do
local angle = 10 * i
local hitEnemy = J.FilterGroup(nEnemyHeroesInRange,function(u)
return J.IsValidHero(u) and not u:IsMagicImmune()
and J.PointInRectangle(u:GetLocation(),bot:GetLocation(),angle,nCastRange,nRadius)
end)
local hitEnemy = J.FilterGroup(enemies,filter)
if #hitEnemy>most then
most=#hitEnemy
nAoeLoc=J.GetVectorFromVectorToAngleWithDistance(bot:GetLocation(), angle, nCastRange - 100)
nAoeLoc=J.GetVectorFromVectorToAngleWithDistance(loc, angle, nCastRange)
end
end
return nAoeLoc
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment