Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- BouncingBlades 1.1 by eXtragoZ
- The script calculates if the skill used to an creep hit a champion
- The script can consume a lot of cpu
- Code of monitoring of creeps taken from Minion Marker
- Green circle on the creep: 1 bounce to hit him
- Blue circle on the creep: 2 bounces to hit him
- Light blue circle on the creep: 3 bounces to hit him
- Violet circle on the creep: 4 bounces to hit him
- press C to hit the enemy without moving (prioritizes number of bounces)
- ]]
- local player = GetMyHero()
- if player.charName == "Katarina" then
- --[[ Config ]]
- local BBHK=67 -- C
- local drawcircles = true
- --[[ Code ]]
- local range = 2000
- local qrange = 675
- local maxbouncerange = 400
- local distanceenemy = 500
- local distancemax = 500
- --
- local minionTable1, minionTable2, minionTable3, minionTable4 = {}, {}, {}, {}
- local objminionTable, objminionTable2 = {}, {}
- local minion = nil
- local minion2 = nil
- local minion3 = nil
- local minion4 = nil
- -- Active
- local BBActive = false
- local qcast = false
- --
- function OnTick()
- minionTable1, minionTable2, minionTable3, minionTable4 = {}, {}, {}, {}
- objminionTable2 = {}
- if not player.dead then
- for i,object in ipairs(objminionTable) do
- if object and object.team ~= player.team and object.type == "obj_AI_Minion" and object.dead == false and player:GetDistance(object) < range then
- table.insert(objminionTable2, object)
- end
- end
- for i,object in ipairs(objminionTable2) do
- distancemax = 500
- minion = nil
- for e,object2 in ipairs(objminionTable2) do
- if object.name ~= object2.name then
- distanceenemy = math.sqrt((object2.x-object.x)^2 + (object2.z-object.z)^2)
- if distancemax > distanceenemy and maxbouncerange > distanceenemy then
- distancemax = distanceenemy
- minion = object2
- end
- end
- end
- for e=1, heroManager.iCount do
- local enemy = heroManager:GetHero(e)
- if enemy.team ~= player.team and enemy.visible and enemy.dead == false and player:GetDistance(enemy) < range then
- distanceenemy = math.sqrt((enemy.x-object.x)^2 + (enemy.z-object.z)^2)
- if distancemax > distanceenemy and maxbouncerange > distanceenemy then
- distancemax = distanceenemy
- minion = enemy
- end
- end
- end
- if minion ~= nil then
- if minion.type == "obj_AI_Minion" then
- distancemax = 500
- minion2 = nil
- for h,object3 in ipairs(objminionTable2) do
- if object3.name ~= object.name and object3.name ~= minion.name then
- distanceenemy = math.sqrt((object3.x-minion.x)^2 + (object3.z-minion.z)^2)
- if distancemax > distanceenemy and maxbouncerange > distanceenemy then
- distancemax = distanceenemy
- minion2 = object3
- end
- end
- end
- for h=1, heroManager.iCount do
- local enemy = heroManager:GetHero(h)
- if enemy.team ~= player.team and enemy.visible and enemy.dead == false and player:GetDistance(enemy) < range then
- distanceenemy = math.sqrt((enemy.x-minion.x)^2 + (enemy.z-minion.z)^2)
- if distancemax > distanceenemy and maxbouncerange > distanceenemy then
- distancemax = distanceenemy
- minion2 = enemy
- end
- end
- end
- if minion2 ~= nil then
- if minion2.type == "obj_AI_Minion" then
- distancemax = 500
- minion3 = nil
- for k,object4 in ipairs(objminionTable2) do
- if object4.name ~= object.name and object4.name ~= minion.name and object4.name ~= minion2.name then
- distanceenemy = math.sqrt((object4.x-minion2.x)^2 + (object4.z-minion2.z)^2)
- if distancemax > distanceenemy and maxbouncerange > distanceenemy then
- distancemax = distanceenemy
- minion3 = object4
- end
- end
- end
- for k=1, heroManager.iCount do
- local enemy = heroManager:GetHero(k)
- if enemy.team ~= player.team and enemy.visible and enemy.dead == false and player:GetDistance(enemy) < range then
- distanceenemy = math.sqrt((enemy.x-minion2.x)^2 + (enemy.z-minion2.z)^2)
- if distancemax > distanceenemy and maxbouncerange > distanceenemy then
- distancemax = distanceenemy
- minion3 = enemy
- end
- end
- end
- if minion3 ~= nil then
- if minion3.type == "obj_AI_Minion" then
- distancemax = 500
- minion4 = nil
- for j,object5 in ipairs(objminionTable2) do
- if object5.name ~= object.name and object5.name ~= minion.name and object5.name ~= minion2.name and object5.name ~= minion3.name then
- distanceenemy = math.sqrt((object5.x-minion3.x)^2 + (object5.z-minion3.z)^2)
- if distancemax > distanceenemy and maxbouncerange > distanceenemy then
- distancemax = distanceenemy
- minion4 = object5
- end
- end
- end
- for j=1, heroManager.iCount do
- local enemy = heroManager:GetHero(j)
- if enemy.team ~= player.team and enemy.visible and enemy.dead == false and player:GetDistance(enemy) < range then
- distanceenemy = math.sqrt((enemy.x-minion3.x)^2 + (enemy.z-minion3.z)^2)
- if distancemax > distanceenemy and maxbouncerange > distanceenemy then
- distancemax = distanceenemy
- minion4 = enemy
- end
- end
- end
- if minion4 ~= nil then
- if minion4.type == "obj_AI_Minion" then
- else
- table.insert(minionTable4, object)
- end
- end
- else
- table.insert(minionTable3, object)
- end
- end
- else
- table.insert(minionTable2, object)
- end
- end
- else
- table.insert(minionTable1, object)
- end
- end
- end
- qcast = false
- if BBActive and player:CanUseSpell(_Q) == READY then
- for i=1, heroManager.iCount do
- local enemy = heroManager:GetHero(i)
- if enemy.team ~= player.team and enemy.visible and enemy.dead == false and player:GetDistance(enemy) < qrange and qcast == false then
- CastSpell(_Q, enemy)
- qcast = true
- end
- end
- if qcast == false then
- for i,object in ipairs(minionTable1) do
- if player:GetDistance(object) < qrange and qcast == false then
- CastSpell(_Q, object)
- qcast = true
- end
- end
- end
- if qcast == false then
- for i,object in ipairs(minionTable2) do
- if player:GetDistance(object) < qrange and qcast == false then
- CastSpell(_Q, object)
- qcast = true
- end
- end
- end
- if qcast == false then
- for i,object in ipairs(minionTable3) do
- if player:GetDistance(object) < qrange and qcast == false then
- CastSpell(_Q, object)
- qcast = true
- end
- end
- end
- if qcast == false then
- for i,object in ipairs(minionTable4) do
- if player:GetDistance(object) < qrange and qcast == false then
- CastSpell(_Q, object)
- qcast = true
- end
- end
- end
- end
- end
- end
- function OnDraw()
- if drawcircles and not player.dead then
- --DrawCircle(player.x, player.y, player.z, qrange, 0x19A712)
- for i, object in ipairs(minionTable1) do
- if object and object.dead == false then
- DrawCircle(object.x, object.y, object.z, 100, 0x19A712)
- end
- end
- for i, object in ipairs(minionTable2) do
- if object and object.dead == false then
- DrawCircle(object.x, object.y, object.z, 100, 0x0000FF)
- end
- end
- for i, object in ipairs(minionTable3) do
- if object and object.dead == false then
- DrawCircle(object.x, object.y, object.z, 100, 0xFFFFFF)
- end
- end
- for i, object in ipairs(minionTable4) do
- if object and object.dead == false then
- DrawCircle(object.x, object.y, object.z, 100, 0xFF00FF)
- end
- end
- end
- end
- function OnCreateObj(obj)
- if obj and obj.type == "obj_AI_Minion" then
- if (string.find(obj.name,"T200") or string.find(obj.name,"Red")) and player.team == TEAM_BLUE then
- table.insert(objminionTable, obj)
- elseif (string.find(obj.name,"T100") or string.find(obj.name,"Blue")) and player.team == TEAM_RED then
- table.insert(objminionTable, obj)
- end
- end
- end
- function OnDeleteObj(obj)
- for i,v in ipairs(objminionTable) do
- if string.find(obj.name, v.name) then
- table.remove(objminionTable,i)
- end
- end
- end
- function BBLoadMinions()
- local count = objManager.maxObjects
- for i=1, count do
- local object = objManager:getObject(i)
- if object and object.team ~= player.team and object.type == "obj_AI_Minion" and object.dead == false then
- table.insert(objminionTable, object)
- end
- end
- end
- function OnWndMsg(msg,key)
- if key == BBHK then
- BBActive = (msg == KEY_DOWN)
- end
- end
- function OnLoad()
- BBLoadMinions()
- end
- PrintChat(" >> BouncingBlades 1.1 loaded!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement