Advertisement
H3stia

LeeSin

Dec 2nd, 2013
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 41.04 KB | None | 0 0
  1. --[[
  2.     I'M Leesin 0.2.8 by Klokje
  3.     ================================================================================
  4.  
  5.  
  6.     Change log:
  7.     0.1:
  8.         - Initial release
  9.         - Added basic functions
  10.        
  11.     0.1.1
  12.         - Small change insec combo
  13.  
  14.     0.1.2
  15.         - Ward Drawings
  16.         - Delay ward jump
  17.  
  18.     0.2
  19.         - Added R Collision Killes
  20.         - Delete ward jump <- added to other script
  21.         - Rewrite some code
  22.         - Added Minion and Jungle farm
  23.         - Fixed a bug with passive use
  24.         - Rewrote core
  25.         - require "ImLib"
  26.  
  27.     0.2.1
  28.         - fix some bugs
  29.         - improve herras??
  30.  
  31.     0.2.2
  32.         - Small change
  33.        
  34.     0.2.3
  35.         - bug on purple side
  36.     0.2.3b
  37.  
  38.     0.2.4
  39.         - With auto lib updater
  40.         - Change buff stuff
  41.        
  42.     0.2.6
  43.         - bug fix
  44.        
  45.     0.2.7
  46.         - new prediction information.
  47.        
  48.     0.2.8
  49.         - Fix baron bug
  50.     0.2.8a
  51.         - Lib update
  52. ]]
  53.  
  54. -- Library --------------------------------------------------------------------------
  55. if myHero.charName ~= "LeeSin" then return end
  56.  
  57.  
  58. function UpdateLib()
  59.  local URL = "https://bitbucket.org/Klokje/public-klokjes-bol-scripts/raw/master/Common/ImLib.lua"
  60.  local LIB_PATH = BOL_PATH.."Scripts\\Common\\ImLib.lua"
  61.  DownloadFile(URL, LIB_PATH, function()
  62.                 if FileExist(LIB_PATH) then
  63.                     PrintChat("<font color='#FF0000'> >> LIB IS UPDATED! PRESS F9 2 TIME PLZ! <<</font>")
  64.                 end
  65.                 end)
  66.  bNeedRestart = true
  67. end
  68.  
  69. if FileExist(SCRIPT_PATH..'Common/ImLib.lua') then require "ImLib" end
  70. if getLibversion == nil or getLibversion() < 0.24 then UpdateLib() return end
  71.  
  72. require "Prodiction"
  73. require "FastCollision"
  74.  
  75. -- Globals --------------------------------------------------------------------------
  76.  
  77.  
  78.  
  79. enemyHeroes = {}
  80.  
  81. qRange = 990
  82. qRangeSecond = 1300
  83. wRange = 700
  84. eRange = 350
  85. eRangeSecond = 600
  86. rRange = 375
  87.  
  88. passive = {stack = 0, endT = 0}
  89.  
  90. --Dashes
  91. dash = {
  92.     [_Q] = nil,
  93.     [_W] = nil
  94. }
  95.  
  96. eStack = {}
  97. extraDamage = {}
  98. visionList = {}
  99.  
  100. qTarget = nil
  101. ignite = nil
  102. flash = nil
  103.  
  104. local Prodict = ProdictManager.GetInstance()
  105. local ProdictQ, ProdictQCol
  106.  
  107.  
  108. -- Code -----------------------------------------------------------------------------
  109. function OnLoad()
  110.     PrintChat(" >> I'M Leesin 0.2.8 by Klokje")  
  111.  
  112.     OrbWalking.Instance("I'M Leesin")
  113.     Jumper.ability = _W
  114.  
  115.     ssLastHitting = LastHitting()
  116.  
  117.     ConfigBasic = scriptConfig("I'M Leesin: Basic Settings", "LeeSinBasic")    
  118.     ConfigBasic:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 84)
  119.     ConfigBasic:addParam("Insec", "Insec Combo", SCRIPT_PARAM_ONKEYDOWN, false, 67)
  120.     ConfigBasic:addParam("Insecflash", "Flash with insec", SCRIPT_PARAM_ONOFF, true)
  121.  
  122.     ConfigCombo = scriptConfig("I'M Leesin: Combo Settings", "LeeSinCombo")
  123.     ConfigCombo:addParam("combo", "Combo Key", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  124.     ConfigCombo:addParam("useQ", "Use Q ", SCRIPT_PARAM_ONOFF, true)
  125.     ConfigCombo:addParam("autoQ","Auto Second Q", SCRIPT_PARAM_ONOFF, true)
  126.     ConfigCombo:addParam("useW", "Use W", SCRIPT_PARAM_ONOFF, false)
  127.     ConfigCombo:addParam("autoW","Auto Second W", SCRIPT_PARAM_ONOFF, true)
  128.     ConfigCombo:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
  129.     ConfigCombo:addParam("autoE","Auto Second E", SCRIPT_PARAM_ONOFF, true)
  130.     ConfigCombo:addParam("useAA", "Use Auto Attacks", SCRIPT_PARAM_ONOFF, true)
  131.  
  132.     ConfigKillCombo = scriptConfig("I'M Leesin: Kill Combo Settings", "LeeSinKill")
  133.     ConfigKillCombo:addParam("useR", "Auto R on kill", SCRIPT_PARAM_ONOFF, true)
  134.     ConfigKillCombo:addParam("combokiller", "Combo Killer", SCRIPT_PARAM_ONOFF, true)
  135.     ConfigKillCombo:addParam("combo", "Kill without combo key", SCRIPT_PARAM_ONOFF, false)
  136.     ConfigKillCombo:addParam("rcollision", "R collision killer", SCRIPT_PARAM_ONOFF, true)
  137.     ConfigKillCombo:addParam("ward", "Use ward", SCRIPT_PARAM_ONOFF, true)
  138.  
  139.     ConfigFarm = scriptConfig("I'M Leesin: Farm", "farming")
  140.     ConfigFarm:addParam("Farm", "Farm Key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("A"))
  141.     ConfigFarm:addParam("jungle", "Jungle Creeps", SCRIPT_PARAM_ONOFF, true)
  142.     ConfigFarm:addParam("minions", "Minions", SCRIPT_PARAM_ONOFF, true)
  143.  
  144.     ConfigDraw = scriptConfig("I'M Leesin: Draw Settings", "LeeSinDraw")      
  145.     ConfigDraw:addParam("DrawQ", "Draw Q range", SCRIPT_PARAM_ONOFF, false)
  146.     ConfigDraw:addParam("DrawQColor", "Q Color", SCRIPT_PARAM_COLOR, {40, 0, 0, 100})
  147.     ConfigDraw:addParam("DrawW", "Draw W range", SCRIPT_PARAM_ONOFF, false)
  148.     ConfigDraw:addParam("DrawWColor", "W Color", SCRIPT_PARAM_COLOR, {40, 0, 20, 100})
  149.     ConfigDraw:addParam("DrawE", "Draw E range", SCRIPT_PARAM_ONOFF, false)
  150.     ConfigDraw:addParam("DrawEColor", "E Color", SCRIPT_PARAM_COLOR, {0, 20, 0, 100})
  151.     ConfigDraw:addParam("DrawR", "Draw R range", SCRIPT_PARAM_ONOFF, false)
  152.     ConfigDraw:addParam("DrawRColor", "R Color", SCRIPT_PARAM_COLOR, {0, 20, 40, 100})
  153.     ConfigDraw:addParam("DrawPassive", "Draw Passive Stack", SCRIPT_PARAM_ONOFF, true)
  154.     ConfigDraw:addParam("DrawPassiveColor", "Passive Color", SCRIPT_PARAM_COLOR, ColorARGB.Linen:ToTable())
  155.     ConfigDraw:addParam("DrawTarget", "Draw Target", SCRIPT_PARAM_ONOFF, true)
  156.     ConfigDraw:addParam("DrawTargetColor", "Target Color", SCRIPT_PARAM_COLOR, ColorARGB.DarkRed:ToTable())
  157.  
  158.     sp = Spells()
  159.  
  160.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  161.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  162.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then flash = SUMMONER_1
  163.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then flash = SUMMONER_2 end
  164.  
  165.  
  166.     ProdictQ = Prodict:AddProdictionObject(_Q, qRange, 1690, 0.250, 60, myHero, CastQQ)
  167.     ProdictQCol = FastCol(ProdictQ)
  168.  
  169. end
  170.  
  171. function OnTick()
  172.     enemyHeroes = Heroes({team = {TEAM_ENEMY}, range = 2000})
  173.     table.sort(enemyHeroes, EnemySort)
  174.  
  175.      local currentTarget = GetTarget()
  176.  
  177.     if currentTarget ~= nil and currentTarget.type == "obj_AI_Hero" and ValidTarget(currentTarget, 2000, true) then
  178.         selected = currentTarget
  179.     else
  180.         selected = nil
  181.     end
  182.  
  183.     if KillCombo() then return
  184.     elseif CollisionKiller() then return
  185.     elseif InSecCombo() then return
  186.     elseif Herras() then return
  187.     elseif Combo() then return
  188.     elseif AutoAll() then return
  189.     end
  190. end
  191.  
  192. function OnDraw()
  193.     if selected and ConfigDraw.DrawTarget then
  194.         DrawCircle(selected.x, selected.y, selected.z, 100, ColorARGB.FromTable(ConfigDraw.DrawTargetColor))
  195.         DrawCircle(selected.x, selected.y, selected.z, 99, ColorARGB.DarkBlue:ToARGB())
  196.     end
  197.  
  198.     if ConfigDraw.DrawQ and not myHero.dead then
  199.         if spell[_Q]:Ready()  == 1 then
  200.             DrawCircle(myHero.x, myHero.y, myHero.z, qRange+50, ColorARGB.FromTable(ConfigDraw.DrawQColor))
  201.         elseif spell[_Q]:Ready(2) == 1 then
  202.             DrawCircle(myHero.x, myHero.y, myHero.z, qRangeSecond+50, ColorARGB.FromTable(ConfigDraw.DrawQColor))
  203.         end
  204.     end
  205.  
  206.     if ConfigDraw.DrawW and not myHero.dead and spell[_W]:Ready()  == 1 then
  207.         DrawCircle(player.x, player.y, player.z, wRange, ColorARGB.FromTable(ConfigDraw.DrawWColor))
  208.     end
  209.  
  210.     if ConfigDraw.DrawE and not myHero.dead then
  211.         if spell[_E]:Ready()  == 1 then
  212.             DrawCircle(myHero.x, myHero.y, myHero.z, eRange, ColorARGB.FromTable(ConfigDraw.DrawEColor))
  213.         elseif spell[_E]:Ready(2)  == 1 then
  214.             DrawCircle(myHero.x, myHero.y, myHero.z, eRangeSecond, ColorARGB.FromTable(ConfigDraw.DrawEColor))
  215.         end
  216.     end
  217.  
  218.     if ConfigDraw.DrawR and not myHero.dead and spell[_R]:Ready()  == 1  then
  219.         DrawCircle(myHero.x, myHero.y, myHero.z, rRange, ColorARGB.FromTable(ConfigDraw.DrawRColor)) -- ColorARGB(0, 20, 40, 100):ToARGB() --ColorARGB.DarkRed:ToARGB()
  220.     end
  221.  
  222.     if  ConfigDraw.DrawPassive and not myHero.dead and passive.stack ~= 0 then
  223.         local pos = WorldToScreen(D3DXVECTOR3(myHero.x, myHero.y, myHero.z))
  224.         Message.DrawTextWithBorder(tostring(passive.stack), 50, pos.x- 15, pos.y - 100, ColorARGB.FromTable(ConfigDraw.DrawPassiveColor), ColorARGB.Black:ToARGB())
  225.     end
  226. end
  227.  
  228. function OnGainBuff(unit, buff)
  229.     if unit == nil or buff == nil or buff.name == nil then return end
  230.  
  231.     if unit.team ~= myHero.team and buff.name == "BlindMonkEOne"then
  232.         eStack[unit.networkID] = unit
  233.     end
  234.  
  235.     if unit.isMe and buff.name == "blindmonkpassive_cosmetic" then
  236.         passive.stack = buff.stack
  237.         passive.endT = buff.endT
  238.     end
  239.  
  240.     if buff.source and buff.source.isMe and buff.name:lower():find("blindmonkqone") then
  241.         qTarget = unit
  242.         if p == true then
  243.             QCast(_Q)
  244.             p = false
  245.         end
  246.     end
  247.  
  248.     if unit.isMe and buff.name == "blindmonkqtwodash" then
  249.         dash[_Q] = buff.source
  250.     end
  251.  
  252.     if unit.isMe and buff.name == "blindmonkwonedash" then
  253.         dash[_W] = buff.source
  254.     end
  255. end    
  256.  
  257. function OnUpdateBuff(unit, buff)
  258.      if unit.isMe and buff.name == "blindmonkpassive_cosmetic" then
  259.         passive.stack = buff.stack
  260.         passive.endT = buff.endT
  261.     end
  262. end
  263.  
  264. function OnLoseBuff(unit, buff)
  265.     if unit == nil or buff == nil or buff.name == nil then return end
  266.  
  267.     if unit.team ~= myHero.team and buff.name == "BlindMonkEOne" then
  268.         eStack[unit.networkID] = nil
  269.     end
  270.  
  271.     if unit.isMe and buff.name == "blindmonkpassive_cosmetic" then
  272.         passive.stack = 0
  273.         passive.endT = 0
  274.     end
  275.  
  276.     if unit.team ~= myHero.team and buff.name:lower():find("blindmonkqone") then
  277.         qTarget = nil
  278.     end
  279.  
  280.     if unit.isMe and buff.name == "blindmonkqtwodash" then
  281.        dash[_Q] = nil
  282.     end
  283.  
  284.     if unit.isMe and buff.name == "blindmonkwonedash" then
  285.         dash[_W] = nil
  286.     end
  287. end
  288.  
  289. function IsValid(target)
  290. if visionList[target.networkID] == nil then
  291.     return true
  292. elseif target.type == myHero.type and (GetGameTimer() - visionList[target.networkID] > 0.125) then
  293.   return true
  294.  else
  295.   return false
  296.  end
  297. end
  298. function OnLoseVision(unit)
  299.  if unit and unit.type == myHero.type and unit.team ~= myHero.team then
  300.   visionList[unit.networkID] = math.huge
  301.  end
  302. end
  303. function OnGainVision(unit)
  304.  if unit and unit.type == myHero.type and unit.team ~= myHero.team then
  305.   visionList[unit.networkID] = GetGameTimer()
  306.  end
  307. end
  308.  
  309.  
  310. -- Main Functions ----------------------------------------------------------------------
  311. function KillCombo()
  312.     if not ConfigKillCombo.combokiller then return false end
  313.  
  314.     OrbWalking.Enable(false)
  315.     if ConfigKillCombo.combo or ConfigCombo.combo then
  316.         if ComboHasQ() then OrbWalking.Enable(true) return true end
  317.         if ComboHasNoQ() then OrbWalking.Enable(true) return true end
  318.     end
  319.  
  320.     for i, target in ipairs(enemyHeroes) do
  321.         if ConfigKillCombo.useR then AutoR(target) end
  322.     end
  323.     OrbWalking.Enable(true)
  324.     return false
  325. end
  326.  
  327. function ComboHasQ()
  328.     if spell[_Q]:Ready(2) == 1 and qTarget~= nil and 30 <= myHero.mana then
  329.         local rDmg = getDmg("R", qTarget, player)
  330.         local qDmg = getDmg("Q", qTarget, player, 1)
  331.         local aDmg = getDmg("AD",qTarget, player)
  332.         local eDmg = getDmg("E", qTarget, player)
  333.         local onhitDmg = aDmg
  334.         local ignitedmg = 0
  335.  
  336.         if ignite ~= nil and myHero:CanUseSpell(ignite) == READY  then ignitedmg = getDmg("IGNITE", qTarget, player) end
  337.  
  338.         local reg = 0
  339.         local extra = 0
  340.             for i, damage in pairs(extraDamage) do
  341.                 if damage.time > GetGameTimer() then
  342.                     if qTarget.networkID == damage.dtarget then
  343.                     extra = extra + (math.floor((damage.dmg/5)*(damage.time - GetGameTimer())) - (damage.dmg/5))
  344.                     extra = extra - ((qTarget.hpRegen/5) * (6 - (damage.time - GetGameTimer())))
  345.                     end
  346.                 else
  347.                     table.remove(extraDamage, i)
  348.                     i = i - 1
  349.                 end
  350.             end
  351.  
  352.         local health = qTarget.health + (((qTarget.hpRegen/5) * 3) - extra) + 50
  353.         if health < 0 then health = math.huge end
  354.  
  355.         if GetDistance(qTarget) <= qRange then
  356.             if health <= QSecondDamage(0, qTarget) then  QCast(qTarget) return true
  357.             elseif ignitedmg > 0 and health <= QSecondDamage(0, qTarget) + ignitedmg and GetDistance(qTarget) <= 600 then
  358.                 CastSpell(ignite, qTarget)
  359.                 table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  360.                 CastSpell(_Q)
  361.                 return true
  362.             end
  363.         end
  364.  
  365.         if spell[_E]:Ready() == 1 and 80 <= myHero.mana then
  366.             if health<= eDmg +  QSecondDamage(eDmg, qTarget) and GetDistance(qTarget) <= eRange then
  367.                 spell[_E]:Cast()
  368.                 CastSpell(_Q)
  369.                 return true
  370.             elseif health<= eDmg +  QSecondDamage(0, qTarget) and GetDistance(qTarget) > eRange then
  371.                  CastSpell(_Q)
  372.                 return true
  373.             elseif ignitedmg > 0 and health<= eDmg +  QSecondDamage(eDmg, qTarget) + ignitedmg and GetDistance(qTarget) <= eRange then
  374.                 CastSpell(ignite, qTarget)
  375.                 table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  376.                 spell[_E]:Cast()
  377.                 CastSpell(_Q)
  378.                 return true
  379.             elseif ignitedmg > 0 and health<= eDmg +  QSecondDamage(0, qTarget) + ignitedmg and GetDistance(qTarget) > eRange then
  380.                 CastSpell(ignite, qTarget)
  381.                 table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  382.                 CastSpell(_Q)
  383.                 return true
  384.             end
  385.         end
  386.  
  387.         if spell[_R]:Ready() == 1 then
  388.             if health <= rDmg + QSecondDamage(rDmg, qTarget) and GetDistance(qTarget) <= rRange then
  389.                 spell[_R]:Cast(qTarget)
  390.                 QCast(qTarget)
  391.                  return true
  392.             elseif health<= rDmg + QSecondDamage(0, qTarget) and GetDistance(qTarget) > rRange then
  393.                 QCast(qTarget)
  394.                 return true
  395.             elseif ignitedmg > 0 and health<= rDmg + QSecondDamage(rDmg, qTarget) + ignitedmg and GetDistance(qTarget) <= rRange then
  396.                 CastSpell(ignite, qTarget)
  397.                 table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  398.                 spell[_R]:Cast(qTarget)
  399.                 QCast(qTarget)
  400.                 return true
  401.             elseif ignitedmg > 0 and health<= rDmg + QSecondDamage(0, qTarget) + ignitedmg and GetDistance(qTarget) > rRange and GetDistance(qTarget) <= 600 then
  402.                 CastSpell(ignite, qTarget)
  403.                 table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  404.                 QCast(qTarget)
  405.                 return true
  406.             end
  407.         end
  408.  
  409.         if spell[_E]:Ready() == 1 and spell[_R]:Ready() == 1 and 80 <= myHero.mana then
  410.             if health<= eDmg + rDmg + QSecondDamage(eDmg+rDmg, qTarget)  and GetDistance(qTarget) <= eRange then
  411.                 spell[_E]:Cast()
  412.                 spell[_R]:Cast(qTarget)
  413.                 QCast(qTarget)
  414.                 return true
  415.             elseif health<= eDmg +  QSecondDamage(rDmg, qTarget) + rDmg and GetDistance(qTarget) <= rRange then
  416.                 spell[_R]:Cast(qTarget)
  417.                 QCast(qTarget)
  418.                 return true
  419.             elseif health<= eDmg +  QSecondDamage(0, qTarget) + rDmg and GetDistance(qTarget) > rRange then
  420.                 QCast(qTarget)
  421.                 return true
  422.             elseif ignitedmg > 0 and health<= eDmg +  QSecondDamage(eDmg+rDmg, qTarget) + rDmg + ignitedmg and GetDistance(qTarget) <= eRange then
  423.                 CastSpell(ignite, qTarget)
  424.                 table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  425.                 spell[_E]:Cast()
  426.                 spell[_R]:Cast(qTarget)
  427.                 QCast(qTarget)
  428.                 return true
  429.             elseif ignitedmg > 0 and health<= eDmg +  QSecondDamage(rDmg, qTarget) + rDmg + ignitedmg and GetDistance(qTarget) <= rRange then
  430.                 CastSpell(ignite, qTarget)
  431.                 table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  432.                 spell[_R]:Cast(qTarget)
  433.                 QCast(qTarget)
  434.                 return true
  435.             elseif ignitedmg > 0 and health<= eDmg +  QSecondDamage(0, qTarget) + rDmg + ignitedmg and GetDistance(qTarget) > rRange and GetDistance(qTarget) <= 600 then
  436.                 CastSpell(ignite, qTarget)
  437.                 table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  438.                 QCast(qTarget)
  439.                 return true
  440.             end
  441.         end
  442.     end
  443. end
  444.  
  445. function ComboHasNoQ()
  446.     for i, target in ipairs(enemyHeroes) do
  447.  
  448.         if OrbWalking.CanAttack() then
  449.             local rDmg = getDmg("R", target, player)
  450.             local qDmg = getDmg("Q", target, player, 1)
  451.             local aDmg = getDmg("AD",target, player)
  452.             local eDmg = getDmg("E", target, player)
  453.  
  454.             local onhitDmg = aDmg
  455.             local ignitedmg = 0
  456.  
  457.             if ignite ~= nil and  myHero:CanUseSpell(ignite) == READY then ignitedmg = getDmg("IGNITE", target, player) end
  458.  
  459.             local reg = 0
  460.             local extra = 0
  461.             for i, damage in pairs(extraDamage) do
  462.                 if damage.time > GetGameTimer() then
  463.                     if target.networkID == damage.dtarget then
  464.                     extra = extra + (math.floor((damage.dmg/5)*(damage.time - GetGameTimer())) - (damage.dmg/5))
  465.                     extra = extra - ((target.hpRegen/5) * (1 - (damage.time - GetGameTimer())))
  466.                     end
  467.                 else
  468.                     table.remove(extraDamage, i)
  469.                     i = i - 1
  470.                 end
  471.             end
  472.  
  473.             local health = target.health + (((target.hpRegen/5) * 3) - extra) + 50
  474.             if health < 0 then health = math.huge end
  475.  
  476.             if spell[_E]:Ready() == 1 then
  477.                 if GetDistance(target) <= eRange then
  478.                     if health<= eDmg then spell[_E]:Cast() return true
  479.                     elseif ignitedmg > 0 and health <= eDmg + ignitedmg then spell[_E]:Cast() CastSpell(ignite, target) table.insert(extraDamage, {dmg = ignitedmg, dtarget = target, time = GetGameTimer() + 5}) return true end
  480.                 elseif spell[_W]:Ready() == 1 and GetDistance(target) <= 700 + eRange - 100 and (health<= eDmg or (ignitedmg > 0 and health <= eDmg + ignitedmg)) then
  481.                     local JCheck, obj = ComboJump(target,  eRange - 100)
  482.                     if JCheck and GetDistance(obj) < 700 then
  483.                         spell[_W]:Cast(obj)
  484.                         return
  485.                     end
  486.                 end
  487.             end
  488.  
  489.             if spell[_R]:Ready() == 1 then
  490.                 if GetDistance(target) < rRange then
  491.                     if health<= rDmg then spell[_R]:Cast(target) return true end
  492.                     if ignitedmg > 0 and health<= rDmg + ignitedmg then CastSpell(ignite, target) spell[_R]:Cast(target) table.insert(extraDamage, {dmg = ignitedmg, dtarget = target, time = GetGameTimer() + 5}) return true end
  493.                 elseif spell[_W]:Ready() == 1 and GetDistance(target) <= 700 + rRange - 100 and (health<= rDmg or (ignitedmg > 0 and health<= rDmg + ignitedmg)) then
  494.                     local JCheck, obj = ComboJump(target, rRange - 100)
  495.                     if JCheck and GetDistance(obj) < 700 then
  496.                         spell[_W]:Cast(obj)
  497.                         return
  498.                     end
  499.                 end
  500.             end
  501.  
  502.             if spell[_E]:Ready() == 1 and spell[_R]:Ready() == 1 then
  503.                 if GetDistance(target) <= eRange then
  504.                     if health<= eDmg + rDmg then spell[_E]:Cast() spell[_R]:Cast(target) return true
  505.                     elseif ignitedmg > 0 and health <= eDmg + rDmg + ignitedmg then CastSpell(ignite, target) spell[_E]:Cast() spell[_R]:Cast(target) table.insert(extraDamage, {dmg = ignitedmg, dtarget = target, time = GetGameTimer() + 5}) return true end
  506.                 elseif spell[_W]:Ready() == 1 and GetDistance(target) <= 700 + eRange - 100  and (health<= eDmg + rDmg or (ignitedmg > 0 and health <= eDmg + rDmg + ignitedmg)) then
  507.                     local JCheck, obj = ComboJump(target, eRange - 100)
  508.                     if JCheck and GetDistance(obj) < 700 then
  509.                         spell[_W]:Cast(obj)
  510.                         return
  511.                     end
  512.                 end
  513.             end
  514.  
  515.  
  516.             if spell[_Q]:Ready() == 1 then
  517.                 if health <= qDmg + ignitedmg and 50 <= myHero.mana then QCast(target) return true end
  518.                 if health <= qDmg + QSecondDamage(qDmg, target) + ignitedmg and 80 <= myHero.mana then QCast(target) return true end
  519.  
  520.                 if spell[_E]:Ready() == 1 then
  521.                     if health<= qDmg + eDmg + ignitedmg and 100 <= myHero.mana and GetDistance(target) < eRange then spell[_E]:Cast() QCast(target) return true end
  522.                     if health<= qDmg + eDmg + QSecondDamage(qDmg + eDmg, target) + ignitedmg and 130 <= myHero.mana and GetDistance(target) < eRange then spell[_E]:Cast() QCast(target) return true end
  523.                     if health<= qDmg + eDmg + QSecondDamage(qDmg, target) + ignitedmg and 130 <= myHero.mana and GetDistance(target) >= eRange then QCast(target) return true end
  524.                 end
  525.                 if spell[_R]:Ready() == 1 then
  526.                     if health<= qDmg + rDmg + ignitedmg and 50 <= myHero.mana and GetDistance(target) < rRange then QCast(target) return true end
  527.                     if health<= qDmg + rDmg + QSecondDamage(qDmg + rDmg, target) + ignitedmg and 80 <= myHero.mana and GetDistance(target) < rRange then QCast(target) return true end
  528.                     if health<= qDmg + rDmg + QSecondDamage(qDmg, target) + ignitedmg and 80 <= myHero.mana and GetDistance(target) < rRange then QCast(target) return true end
  529.                 end
  530.                 if  spell[_E]:Ready() == 1 and spell[_R]:Ready() == 1 then
  531.                     if health<= qDmg+eDmg+rDmg + QSecondDamage(qDmg+eDmg, target) + ignitedmg then  QCast(target) return true end
  532.                     if health<= qDmg+eDmg+rDmg + QSecondDamage(qDmg+rDmg, target) + ignitedmg then QCast(target) return true end
  533.                     if health<= qDmg+eDmg+rDmg + QSecondDamage(qDmg+eDmg+rDmg, target) + ignitedmg then  QCast(target) return true end
  534.                 end
  535.             end
  536.         end
  537.     end
  538.     return false
  539. end
  540.  
  541. function Combo()
  542.     AutoPassive()
  543. end
  544.  
  545. function InSecCombo()
  546.     if not ConfigBasic.Insec then return false end
  547.  
  548.     if myHero:GetSpellData(_R).level < 1 then Message.AddMassage("Error: R level to low.", ColorARGB.Red) return false end
  549.  
  550.     champs = Heroes({team = {TEAM_ENEMY}, range = 2000})
  551.     table.sort(champs, InsecSort)
  552.     local target
  553.     local flashtarget = nil
  554.  
  555.     if selected and selected.bTargetable and not selected.dead then
  556.         target = selected
  557.         flashtarget = selected
  558.     elseif #champs > 0 then
  559.         target = champs[1]
  560.     elseif target == nil then
  561.         Message.AddMassage("Error: No Enemy Around.", ColorARGB.Red)
  562.         return false
  563.     else
  564.         Message.AddMassage("Error: No Enemy Around.", ColorARGB.Red)
  565.         return false
  566.     end
  567.  
  568.     if spell[_R]:Ready() ~= 1 then Message.AddMassage("Error: R on Cooldown", ColorARGB.Red)  return false end
  569.     local wardPos = GetWardPosition(target)
  570.     if wardPos == nil then return false end
  571.  
  572.     if GetDistance(wardPos) < 200 then spell[_R]:Cast(target) return true end
  573.  
  574.     if spell[_Q]:Ready(2) == 1 and spell[_W]:Ready() == 1 and 80 <= myHero.mana and qTarget ~= nil and GetDistance(qTarget, wardPos) <= 600 and GetDistance(wardPos) > 600 then
  575.         if Jumper.GetWardSlot() ~= nil or (InsecFlash() and GetDistance(qTarget, wardPos) <= 400) then
  576.             CastSpell(_Q)
  577.             return true
  578.         end
  579.     end
  580.  
  581.     if spell[_Q]:Ready() == 1 and spell[_W]:Ready() == 1 and 130 <= myHero.mana and qTarget == nil and GetDistance(wardPos) > 600 then
  582.         QCast(target)
  583.     end
  584.  
  585.     if spell[_W]:Ready() == 1 and GetDistance(wardPos) <= 600 and 130 <= myHero.mana then
  586.         local jCheck, obj = CheckObject(wardPos, 200)
  587.         if jCheck then
  588.             if GetDistance(obj) <= 600 then
  589.                 spell[_W]:Cast(obj)
  590.                 return true
  591.             end
  592.         else
  593.             if Jumper.GetWardSlot() ~= nil then
  594.                 Jumper.PlaceWard(wardPos.x, wardPos.z)
  595.                 return true
  596.             end
  597.         end  
  598.     elseif InsecFlash() and GetDistance(wardPos) <= 400 and dash[_W] ~= nil then  
  599.         CastSpell(flash, wardPos.x, wardPos.z)
  600.         spell[_R]:Cast(target)
  601.     end
  602.  
  603. end
  604.  
  605. function InsecFlash()
  606.     return ConfigBasic.Insecflash and flash and myHero:CanUseSpell(flash) == READY
  607. end
  608.  
  609.  
  610. function CollisionKiller()
  611.     if not ConfigKillCombo.rcollision then return true end
  612.     for i, target in ipairs(enemyHeroes) do
  613.         if GetDistance(target) < 375 then
  614.             for i, unit in ipairs(enemyHeroes) do
  615.                 local rDmg = getDmg("R", target, player)
  616.                 if  unit.networkID ~= target.networkID and unit.health < rDmg and GetDistance(target,unit) < 700 then
  617.                     local QPrediction = TargetPredictionVIP(1000, 1250, 0.25, getHitBox(target), target)
  618.                     local pos, t, vec = QPrediction:GetPrediction(unit)
  619.                     if pos then
  620.                         local V = Vector(target) - Vector(myHero)
  621.                         local k = V:normalized()
  622.                         local P = V:perpendicular2():normalized()
  623.  
  624.                         local t,i,u = k:unpack()
  625.                         local x,y,z = P:unpack()
  626.                        
  627.                         local point1 = target.x + (x * (getHitBox(target))) + (t * 1000)
  628.                         local point2 = target.y + (y * (getHitBox(target))) + (i * 1000)
  629.                         local point3 = target.z + (z * (getHitBox(target))) + (u * 1000)
  630.  
  631.                         local point4 = target.x + (x *(getHitBox(target))) + (t * getHitBox(target))
  632.                         local point5 = target.y + (y *(getHitBox(target))) + (i * getHitBox(target))
  633.                         local point6 = target.z + (z * (getHitBox(target)))  + (u *getHitBox(target))
  634.  
  635.                         local lpoint1 = target.x - (x * (getHitBox(target))) + (t * 1000)
  636.                         local lpoint2 = target.y - (y * (getHitBox(target)))+ (i * 1000)
  637.                         local lpoint3 = target.z - (z * (getHitBox(target)))+ (u * 1000)
  638.  
  639.                         local lpoint4 = target.x - (x * (getHitBox(target))) + (t * getHitBox(target))
  640.                         local lpoint5 = target.y - (y * (getHitBox(target))) + (i * getHitBox(target))
  641.                         local lpoint6 = target.z - (z * (getHitBox(target))) + (u * getHitBox(target))
  642.  
  643.                         local c = WorldToScreen(D3DXVECTOR3(point1, point2, point3))
  644.                         local l = WorldToScreen(D3DXVECTOR3(point4, point5, point6))
  645.                         local cl = WorldToScreen(D3DXVECTOR3(lpoint1, lpoint2, lpoint3))
  646.                         local ll = WorldToScreen(D3DXVECTOR3(lpoint4, lpoint5, lpoint6))
  647.  
  648.                         local poly = Polygon(Point(c.x, c.y),  Point(l.x, l.y), Point(cl.x, cl.y),   Point(ll.x, ll.y))
  649.  
  650.                
  651.                         local b = WorldToScreen(D3DXVECTOR3(pos.x, unit.y, pos.z))
  652.                         local po = Point(b.x, b.y)
  653.                         if poly:contains(po) and GetDistance(target) < 550 then
  654.                             CastSpell(_R, target)
  655.                             return true
  656.                         end
  657.                     end
  658.                 end
  659.             end
  660.         end
  661.     end
  662.     return false
  663. end
  664.  
  665. function Herras()
  666.     if not ConfigBasic.Harass then return false end
  667.  
  668.     if spell[_Q]:Ready(2) == 1 and 80 <= myHero.mana and qTarget ~= nil then
  669.         if qTarget.type == myHero.type then
  670.             local jCheck, objs = CanJump(target)
  671.             if jCheck then
  672.                 CastSpell(_Q)
  673.                 return
  674.             end
  675.         end
  676.     end
  677.  
  678.     for i, target in ipairs(enemyHeroes) do
  679.         if spell[_Q]:Ready() == 1 and spell[_W]:Ready() == 1 and 120 <= myHero.mana and qTarget == nil then
  680.             local jCheck, obj = CanJump(target)
  681.             if jCheck then
  682.                 QCast(target)
  683.                 return
  684.             end
  685.         end
  686.  
  687.         if spell[_Q]:Ready(1) == 0 and spell[_Q]:IsCasted(2) and spell[_W]:Ready() == 1 and not dash[_Q] and GetDistance(target) < 150 then
  688.             local jCheck, objs = CanJump(target)
  689.             if jCheck then
  690.                  spell[_W]:Cast(objs)
  691.                  return
  692.             end
  693.         end
  694.     end
  695. end
  696.  
  697. function Farm()
  698.     if not ConfigFarm.Farm then ssLastHitting:Enable(false) return end
  699.  
  700.     if ConfigFarm.minions then  ssLastHitting:Enable(true)
  701.     else ssLastHitting:Enable(false) end
  702.  
  703.     if ConfigFarm.jungle then
  704.         jungle = Minions({team = {TEAM_NEUTRAL}, range = 450})
  705.         table.sort(jungle, function(x, y)
  706.             local aDmg = x:CalcDamage(myHero,x.totalDamage)
  707.             local bDmg = y:CalcDamage(myHero,y.totalDamage)
  708.             if aDmg == bDmg then return x.health < y.health end
  709.             return aDmg > bDmg
  710.          end)
  711.         for i, target in ipairs(jungle) do
  712.             if GetDistance(target) <= myHero.range + getHitBox(target) + 150 then
  713.                 if OrbWalking.Attack(target) then
  714.                     return true
  715.                 end
  716.  
  717.                 if spell[_E]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_W]:Ready() == 2 then return false end
  718.  
  719.                 if spell[_E]:Ready() == 1 and HaveNoStack() and GetDistance(target) < 350 + getHitBoxRadius(target) then
  720.                     spell[_E]:Cast()
  721.                     return true
  722.                 end
  723.  
  724.                 if spell[_E]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_W]:Ready() == 2 then return false end
  725.                 if AutoPassiveE() then return true end
  726.  
  727.  
  728.                 if spell[_E]:Ready(2) == 2 or spell[_Q]:Ready() == 2 then return false end
  729.                 if spell[_Q]:Ready() == 1 and passive.stack == 0 and GetDistance(target) > 100 then
  730.                     QCast(target)
  731.                     return true
  732.                 end
  733.  
  734.                 if spell[_Q]:Ready(2) == 1 and ((passive.stack == 0 or GetGameTimer() - spell[_Q].starttime > 3 - Delay()) or (qTarget and qTarget.health < QSecondDamage(0, qTarget))) then
  735.                     CastSpell(_Q)
  736.                     return true
  737.                 end  
  738.  
  739.                 if spell[_E]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_W]:Ready() == 2 then return false end
  740.  
  741.                 if spell[_W]:Ready() == 1 and passive.stack == 0 then
  742.                     spell[_W]:Cast(myHero)
  743.                     return true
  744.                 end
  745.  
  746.                 if spell[_W]:Ready(2) == 1 and (passive.stack == 0 or GetGameTimer() - spell[_W].starttime > 3 - Delay()) then
  747.                     spell[_W]:Cast()
  748.                     return true
  749.                 end
  750.             end
  751.         end
  752.     end
  753. end
  754.  
  755. -- Functions -------------------------------------------------------------------------
  756. function AutoAll()
  757.     if not ConfigCombo.combo and not ConfigFarm.Farm then OrbWalking.Enable(false) ssLastHitting:Enable(false) return end
  758.     OrbWalking.Enable(true)
  759.  
  760.     if ConfigCombo.combo then
  761.         ssLastHitting:Enable(false)
  762.         if selected and selected.bTargetable and not selected.dead then
  763.             if not IsValid(selected) then return false end
  764.             if ConfigCombo.useAA and GetDistance(selected) <= myHero.range + getHitBox(selected) + 50  and OrbWalking.Attack(selected) then
  765.                 return
  766.             end
  767.             if spell[_W]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_E]:Ready() == 2 then return end
  768.             if ConfigCombo.useE then AutoE(selected) end
  769.             if ConfigCombo.useW then AutoW(selected) end
  770.             if ConfigCombo.useQ then AutoQ(selected) end
  771.         else    
  772.             for i, target in ipairs(enemyHeroes) do
  773.                 if IsValid(target) then
  774.                     if ConfigCombo.useAA and GetDistance(target) <= myHero.range + getHitBox(target)+ 50  and OrbWalking.Attack(target) then
  775.                         return
  776.                     end
  777.                     if spell[_W]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_E]:Ready() == 2 then return end
  778.                     if ConfigCombo.useE then AutoE(target) end
  779.                     if ConfigCombo.useQ then AutoQ(target) end  
  780.                     if ConfigCombo.useW then AutoW(target) end
  781.                 end
  782.             end
  783.         end
  784.     else
  785.         Farm()
  786.     end
  787. end
  788.  
  789.  
  790. function AutoPassive()
  791.     if not ConfigCombo.combo then return end
  792.  
  793.     if spell[_W]:Ready(2) == 2 or spell[_Q]:Ready(2) == 2 or spell[_E]:Ready(2) == 2 then return end
  794.  
  795.     if ConfigCombo.autoE then AutoPassiveE() end
  796.     if ConfigCombo.autoW then AutoPassiveW() end
  797.     if ConfigCombo.autoQ then AutoPassiveQ() end
  798. end
  799.  
  800. function AutoPassiveQ()
  801.     if qTarget == nil or qTarget.type ~= "obj_AI_Hero" then return end
  802.  
  803.     if spell[_Q]:Ready(2) == 1 then
  804.         if HaveNoStack() or GetGameTimer() - spell[_Q].starttime > 3 - Delay() then
  805.             CastSpell(_Q)
  806.         elseif GetDistance(qTarget) > myHero.range + 250 + getHitBox(qTarget) then
  807.             CastSpell(_Q)
  808.         end
  809.     end      
  810. end
  811.  
  812. function AutoPassiveW()
  813.     if spell[_W]:Ready(2) == 1 and (HaveNoStack() or GetGameTimer() - spell[_W].starttime > 3 - Delay()) then
  814.         spell[_W]:Cast()
  815.     end        
  816. end
  817.  
  818. function AutoPassiveE()
  819.     if spell[_E]:Ready(2) == 1 and (HaveNoStack() or GetGameTimer() - spell[_E].starttime > 3 - Delay()) then
  820.         spell[_E]:Cast()
  821.     end        
  822.  
  823.     for i, unit in pairs(eStack) do
  824.         if unit and spell[_E]:Ready(2) == 1 and unit.valid and not unit.dead and unit.type == myHero.type and GetDistance(unit) > myHero.range + 100 + getHitBox(unit) then
  825.             spell[_E]:Cast()
  826.         end
  827.     end
  828.  
  829.     if spell[_E]:Ready() == 1 then
  830.         for i, unit in pairs(eStack) do
  831.             unit = nil
  832.         end
  833.     end
  834. end
  835.  
  836. function AutoE(target)
  837.     if spell[_E]:Ready() == 1 and GetDistance(target) < 300 + getHitBox(target) and GetDistance(target) > myHero.range + 100 + getHitBox(target) then
  838.         spell[_E]:Cast()
  839.     elseif spell[_E]:Ready() == 1 and HaveNoStack() and GetDistance(target) < 300 + getHitBoxRadius(target) then
  840.         spell[_E]:Cast()
  841.     end
  842. end
  843.  
  844. function AutoW(target)
  845.     if spell[_W]:Ready() == 1 and HaveNoStack() and GetDistance(target) < 250 + getHitBox(target) then
  846.         spell[_W]:Cast()
  847.     end
  848. end
  849.  
  850. function AutoQ(target)
  851.     if spell[_Q]:Ready() == 1 and (HaveNoStack() or GetDistance(target) >  myHero.range +  getHitBox(target)) then
  852.         QCast(target)
  853.     end
  854. end
  855.  
  856. function AutoR(target)
  857.     local ultDmg = getDmg("R",target,myHero)
  858.     if ultDmg>=target.health then
  859.         if myHero:CanUseSpell(_R) == READY and GetDistance(target)<=rRange then
  860.             spell[_R]:Cast(target)
  861.         end
  862.     end
  863. end
  864.  
  865. function HaveNoStack()
  866.     local canAttack = OrbWalking.CanAttack()
  867.     return passive.stack == 0 or (canAttack and GetGameTimer() > passive.endT - Delay()) or (canAttack and (passive.endT - Delay()) - GetGameTimer() < OrbWalking.WindUpTime()) or (not canAttack and (passive.endT-Delay()) < (OrbWalking.NextAttack() + OrbWalking.WindUpTime()))
  868. end
  869.  
  870. function Delay()
  871.     return GetLatency()/2000 + 0.08    
  872. end
  873.  
  874. function GetWardPosition(target)
  875.     local tempLocation = nil
  876.  
  877.     local Prediction = TargetPredictionVIP(2000, math.huge, 0.250)
  878.     local pos, t, vec = Prediction:GetPrediction(target)
  879.     if pos ~= nil and Prediction:GetHitChance(target) > 0.6 then
  880.  
  881.     else
  882.         pos = target
  883.     end
  884.         local allies = Heroes({team = {myHero.team}, range = 1200}) + Turrets({team = {myHero.team}})          --Turrets.GetObjects(ALLY, 1500, pos)
  885.         table.sort(allies, function(x,y) return GetDistance(x, pos) < GetDistance(y, pos) end)
  886.  
  887.         if #allies > 0 then
  888.             local unit = allies[1]
  889.             if allies[1].isMe then
  890.                 if #allies > 1 then
  891.                     unit = allies[2]
  892.                 else
  893.                     return nil
  894.                 end
  895.             end
  896.  
  897.             local x,y,z = (Vector(pos) - Vector(unit)):normalized():unpack()
  898.             local posX = pos.x + (x * 250)
  899.             local posY = pos.y + (y * 250)
  900.             local posZ = pos.z + (z * 250)
  901.             tempLocation = Vector(posX, posY, posZ)
  902.             return tempLocation
  903.         end
  904.     return nil
  905. end
  906.  
  907. function CheckObject(target, range)
  908.     local tempRange = range or 700
  909.     allys = Heroes({team = {myHero.team}, range = tempRange, source = target}) + Minions({team = {myHero.team}, range = tempRange, source = target}) --Heroes.GetObjects(ALLY, tempRange, target)
  910.     table.sort(allys, function(x,y) return GetDistance(x) < GetDistance(y) end)
  911.     for i, ally in ipairs(allys) do
  912.         if not ally.isMe then
  913.             return true, ally
  914.         end
  915.     end
  916.     return false, nil
  917. end
  918.  
  919. function CanJump(target, range)
  920.     local tempRange = range or 700
  921.     allys = Heroes({team = {myHero.team}, range = tempRange, source = target}) + Minions({team = {myHero.team}, range = tempRange, source = target})
  922.     table.sort(allys, function(x,y) return GetDistance(x) > GetDistance(y) end)
  923.     for i, ally in ipairs(allys) do
  924.         if not ally.isMe and GetDistance(ally, target) > 300 then
  925.             return true, ally
  926.         end
  927.     end
  928.     return false, nil
  929. end
  930.  
  931. function ComboJump(target, range)
  932.     local tempRange = 700
  933.     allys = Heroes({team = {myHero.team}, range = tempRange}) + Minions({team = {myHero.team}, range = tempRange})
  934.     table.sort(allys, function(x,y) return GetDistance(x, target) < GetDistance(y, target) end)
  935.     for i, ally in pairs(allys) do
  936.         if not ally.isMe and GetDistance(ally, target) < range then
  937.             return true, ally
  938.         end
  939.     end
  940.     return false, nil
  941. end
  942.  
  943. function BestDmgCombo(target, mana, dmg, tables, added)
  944.     local endtable = {}
  945.     for i, spells in ipairs(tables) do
  946.         local tempadded = table.copy(added)
  947.         local damage = dmg + spells.damage(target, target.health-dmg)
  948.         local m = mana - spells.mana
  949.  
  950.         if GetDistance(target, tables.range) <= spells.range then
  951.             local temptable = table.copy(tables)
  952.             if #temptable > 0 and target.health-1300 > damage and myHero.mana + m >= 0 then
  953.                 if temptable[i].afterRange ~= 0 then
  954.                     temptable.range = target
  955.                 end
  956.                 table.remove(temptable, i)
  957.                 table.insert(tempadded, spells)
  958.                 endtable = joinTables(endtable, BestDmgCombo(target, m, damage, temptable, tempadded))
  959.             end
  960.  
  961.             if target.health-1300 < damage and myHero.mana + m >= 0 then table.insert(endtable, {dmg = damage, table = tempadded}) end
  962.         end
  963.     end
  964.     return endtable
  965. end
  966.  
  967. function joinTables(t1, t2)
  968.         for k,v in ipairs(t2) do table.insert(t1, v) end return t1
  969. end
  970.  
  971. function QSecondDamage(dmg, target)
  972.     if dmg == nil then dmg = 0 end
  973.     local predHealth = target.health - dmg
  974.     local Qdmg = ((myHero:GetSpellData(_Q).level*30) + 20) + (myHero.addDamage*0.9) + (0.08*(target.maxHealth-predHealth))
  975.     return myHero:CalcDamage(target, Qdmg)
  976. end
  977.  
  978. --[[function CastQ(from, to)
  979.     if  myHero:GetSpellData(_Q).mana < myHero.mana then
  980.         local QPrediction = TargetPredictionVIP(qRange, myHero:GetSpellData(_Q).missileSpeed, 0.250, myHero:GetSpellData(_Q).lineWidth, from)
  981.        
  982.         local pos, t, vec = QPrediction:GetPrediction(to)
  983.         if pos == nil then pos = to end
  984.  
  985.         if pos ~= nil and GetDistance(pos, from)<=qRange and not collition:GetMinionCollision(pos, from) and QPrediction:GetHitChance(to) > ConfigBasic.Prediction/100 then
  986.             spell[_Q]:Cast(pos.x, pos.z)
  987.             return true
  988.         end
  989.     end
  990.     return false
  991. end
  992. ]]--
  993.  
  994. function getHitBoxRadius(target)
  995.     return GetDistance(target, target.minBBox)
  996. end
  997.  
  998. function CastQQ(unit, pos, spell)
  999.     if  myHero:GetSpellData(_Q).mana < myHero.mana then
  1000.         if GetDistance(pos) - getHitBoxRadius(unit)/2 < qRange then
  1001.             local willCollide = ProdictQCol:GetMinionCollision(pos)
  1002.             if not willCollide then
  1003.                 CastSpell(_Q, pos.x, pos.z)
  1004.             end
  1005.         end
  1006.     end
  1007. end
  1008.  
  1009. function QCast(target)
  1010.     if target ~= nil then
  1011.         ProdictQ:GetPredictionCallBack(target, CastQQ)
  1012.     end
  1013. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement