Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Orianna:FindBestLocationToQ(target)
- if self.BallHolder ~= nil and self.BallHolder.isValid then
- local points = {}
- local targets = {}
- local result = _G.Prediction.GetPrediction(target, self.q, self.BallHolder.position)
- if result.targetPosition and result.hitChance > 0 then
- table.insert(points, result.targetPosition)
- table.insert(targets, target)
- end
- for i, enemy in ipairs(ObjectManager:GetEnemyHeroes()) do
- if ValidTarget(enemy, self.q.range + 370) and enemy.networkID ~= target.networkID then
- result = _G.Prediction.GetPrediction(enemy, self.q, self.BallHolder.position)
- if result.targetPosition and result.hitChance > 0 then
- table.insert(points, result.targetPosition)
- table.insert(targets, enemy)
- end
- end
- end
- for o = 1, 5 do
- local MECa = MEC(points)
- local Circle = MECa:Compute()
- if Circle.radius <= 370 and #points >= 3 and myHero.spellbook:CanUseSpell(3) == 0 then
- return Circle.center, 3
- end
- if Circle.radius <= 240 and #points >= 2 and myHero.spellbook:CanUseSpell(1) == 0 then
- return Circle.center, 2
- end
- if #points == 1 then
- return Circle.center, 1
- elseif Circle.radius <= (self.q.radius + 50) and #points >= 1 then
- return Circle.center, 2
- end
- local Dist = -1
- local MyPoint = points[1]
- local index = 0
- for i=2, #points, 1 do
- if GetDistance(points[i], MyPoint) >= Dist then
- Dist = GetDistance(points[i], MyPoint)
- index = i
- end
- end
- if index > 0 then
- table.remove(points, index)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement