Guest User

iLux v1.1.1 - Penta Rainbows

a guest
Jun 5th, 2013
990
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.69 KB | None | 0 0
  1. --[[ iLux - Penta Rainbows by Apple ]]--
  2.  
  3. require "Collision"
  4.  
  5. if myHero.charName ~= "Lux" then return end
  6.  
  7. --[[ Config ]]--
  8.  
  9. local HK1 = string.byte("A")
  10. local HK2 = string.byte("T")
  11. local HK3 = string.byte("C")
  12. local HK4 = string.byte("X") -- Derp, not used but still here.
  13. local SafeBet = 20 -- %
  14. local AutoShieldPerc = 5
  15.  
  16. --[[ Constants ]]--
  17.  
  18. local AARange = 550
  19. local QRange = 1150
  20. local WRange = 1050
  21. local ERange = 1100
  22. local RRange = 3000
  23. local igniteRange = 600
  24. local defaultItemRange = 700
  25.  
  26. local QWidth = 40
  27. local QSpeed = 1200
  28. local ERadius = 275
  29. local ESpeed = 1300
  30. local RWidth = 250
  31. local RSpeed = 3000
  32.  
  33. --[[ Script Variables ]]--
  34.  
  35. local ts = TargetSelector(TARGET_LESS_CAST,QRange,DAMAGE_MAGIC,false)
  36. local tpQ = TargetPredictionVIP(QRange, QSpeed, 0.250, QWidth)
  37. local tpQCollision = Collision(QRange, QSpeed, 0.250, QWidth)
  38. local tpE = TargetPredictionVIP(ERange, ESpeed, 0.150, ERadius)
  39. local tpR = TargetPredictionVIP(RRange, RSpeed, 0.500, RWidth)
  40.  
  41. local igniteSlot = nil
  42. local EParticle = nil
  43. local QStatus = 0
  44. local TriggerEOnLand = false
  45. local TriggerEOnLandFarm = false
  46. local enemyMinions = {}
  47. local updateTextTimers = {}
  48. local pingTimer = {}
  49.  
  50. local items = {
  51.     ZHONYAS = {id = 3157, slot = nil, ready = false},
  52.     WOOGLETS = {id = 3090, slot = nil, ready = false},
  53.     itemsList = {
  54.         ["BRK"] = {id = 3153, slot = nil, ready = false, useOnKill = false},
  55.         ["EXEC"] = {id = 3123, slot = nil, ready = false, useOnKill = false},
  56.         ["YOGH"] = {id = 3142, slot = nil, ready = false, useOnKill = false},
  57.         ["RANO"] = {id = 3143, slot = nil, ready = false, useOnKill = false},
  58.         ["MARU"] = {id = 3042, slot = nil, ready = false, useOnKill = false},
  59.    
  60.         ["DFG"] = {id = 3128, slot = nil, ready = false, useOnKill = true},
  61.         ["HXG"] = {id = 3146, slot = nil, ready = false, useOnKill = true},
  62.         ["BWC"] = {id = 3144, slot = nil, ready = false, useOnKill = true},
  63.     },
  64.     passiveItemsList = {
  65.         ["LIANDRYS"] = {id = 3151, slot = nil},
  66.         ["BLACKFIRE"] = {id = 3188, slot = nil},
  67.     },
  68. }  
  69.  
  70. function OnLoad()
  71.     iLuxConfig = scriptConfig("iLux v1.1", "iLux")
  72.  
  73.     iLuxConfig:addParam("pewpew","PewPew!", SCRIPT_PARAM_ONKEYDOWN, false, HK1)
  74.     iLuxConfig:addParam("autoFarm", "Munching Minions", SCRIPT_PARAM_ONKEYDOWN, false, HK2)
  75.     iLuxConfig:addParam("harass", "Poke!", SCRIPT_PARAM_ONKEYDOWN, false, HK3)
  76.  
  77.     iLuxConfig:addParam("QWithSingleCollide", "Q With Single Minion Collision", SCRIPT_PARAM_ONOFF, false)
  78.     iLuxConfig:addParam("UseUlt", "Ultimate in Combo", SCRIPT_PARAM_ONOFF, true)
  79.     iLuxConfig:addParam("AutoTriggerE", "Auto Trigger E", SCRIPT_PARAM_ONOFF, true)
  80.     iLuxConfig:addParam("AutoTriggerEMin", "Min Enemies for E", SCRIPT_PARAM_SLICE, 1, 1, 5, 0)
  81.     iLuxConfig:addParam("AutoUlt", "Auto Ultimate", SCRIPT_PARAM_ONOFF, true)
  82.     iLuxConfig:addParam("AutoShield", "Auto Shield", SCRIPT_PARAM_ONOFF, true)
  83.     iLuxConfig:addParam("SmartSave", "Smart Save Items", SCRIPT_PARAM_ONOFF, true)
  84.     iLuxConfig:addParam("SafeBet", "Smart Save Health %", SCRIPT_PARAM_SLICE, SafeBet or 20, 1, 100, 0)
  85.     iLuxConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  86.     iLuxConfig:addParam("damageText", "Kill Text", SCRIPT_PARAM_ONOFF, true)
  87.     iLuxConfig:addParam("moveToMouse", "Move To Mouse During PewPew", SCRIPT_PARAM_ONOFF, false)
  88.  
  89.     iLuxConfig:permaShow("pewpew")
  90.     iLuxConfig:permaShow("harass")
  91.     iLuxConfig:permaShow("autoFarm")
  92.  
  93.     ts.name = "Lux"
  94.     iLuxConfig:addTS(ts)
  95.  
  96.     igniteSlot = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") and SUMMONER_2) or nil)
  97.     enemyMinions = minionManager(MINION_ENEMY, ERange, myHero, MINION_SORT_HEALTH_ASC)
  98. end
  99.  
  100. function OnTick()
  101.     ts:update()
  102.     enemyMinions:update()
  103.     updateItems()
  104.     if EParticle ~= nil and not EParticle.valid then EParticle = nil end
  105.     if myHero:CanUseSpell(_Q) == READY then QStatus = 0 end
  106.  
  107.     if not myHero.dead then
  108.         AutoIgnite()
  109.         AutoUlt()
  110.         if iLuxConfig.pewpew then
  111.             PewPew()
  112.             if iLuxConfig.moveToMouse then
  113.                 myHero:MoveTo(mousePos.x, mousePos.z)
  114.             end
  115.         end
  116.         if EParticle and (not iLuxConfig.pewpew or (TriggerEOnLand or TriggerEOnLandFarm)) or iLuxConfig.AutoTriggerE then
  117.             AutoTriggerE()
  118.         end
  119.         if iLuxConfig.autoFarm and not (iLuxConfig.pewpew or iLuxConfig.harass) then autoFarm() end
  120.         if iLuxConfig.harass then Poke() end
  121.         if iLuxConfig.damageText then damageText() end
  122.     end
  123. end
  124.  
  125. function PewPew()
  126.     if ValidTarget(ts.target) then
  127.         local QPos,_,_ = tpQ:GetPrediction(ts.target)
  128.         if QPos then
  129.             local willCollide, collideArray = tpQCollision:GetMinionCollision(myHero, QPos)
  130.             if willCollide and (iLuxConfig.QWithSingleCollide and #collideArray > 1 or not iLuxConfig.QWithSingleCollide) then
  131.                 QPos = nil
  132.             end
  133.         end
  134.         local EPos,_,_ = tpE:GetPrediction(ts.target)
  135.         if ts.target.canMove and myHero:CanUseSpell(_Q) == READY and QPos then
  136.             CastSpell(_Q, QPos.x, QPos.z)
  137.             QStatus = 1
  138.         elseif not ts.target.canMove then
  139.             local calcDmg = calculateDamage(ts.target, true, true)
  140.             local willCollide, collideArray = tpQCollision:GetMinionCollision(myHero, ts.target)
  141.             local QInvalid = willCollide and (iLuxConfig.QWithSingleCollide and #collideArray > 1 or not iLuxConfig.QWithSingleCollide)
  142.             if calcDmg.E > ts.target.health then
  143.                 if not EParticle then
  144.                     CastSpell(_E, ts.target.x, ts.target.z)
  145.                     TriggerEOnLand = true
  146.                     TriggerEOnLandFarm = false
  147.                 elseif GetDistance(EParticle, ts.target) < ERadius then
  148.                     CastSpell(_E)
  149.                 end
  150.             elseif not QInvalid and calcDmg.Q > ts.target.health then
  151.                 CastSpell(_Q, ts.target.x, ts.target.z)
  152.             elseif not QInvalid and calcDmg.Q + calcDmg.E > ts.target.health then
  153.                 CastSpell(_Q, ts.target.x, ts.target.z)
  154.                 if not EParticle then
  155.                     CastSpell(_E, ts.target.x, ts.target.z)
  156.                     TriggerEOnLand = true
  157.                     TriggerEOnLandFarm = false
  158.                 elseif GetDistance(EParticle, ts.target) < ERadius then
  159.                     CastSpell(_E)
  160.                 end
  161.             elseif not QInvalid and (calcDmg.DFG > 0 and 1.2 * (calcDmg.Q + calcDmg.E) or calcDmg.Q + calcDmg.E) + calcDmg.items + calcDmg.ignite > ts.target.health then
  162.                 for item, itemInfo in pairs(items.itemsList) do
  163.                     if itemInfo.ready then
  164.                         CastSpell(itemInfo.slot, ts.target)
  165.                     end
  166.                 end
  167.                 CastSpell(_Q, ts.target.x, ts.target.z)
  168.                 if not EParticle then
  169.                     CastSpell(_E, ts.target.x, ts.target.z)
  170.                     TriggerEOnLand = true
  171.                     TriggerEOnLandFarm = false
  172.                 elseif GetDistance(EParticle, ts.target) < ERadius then
  173.                     CastSpell(_E)
  174.                 end
  175.                 if igniteSlot then CastSpell(igniteSlot, ts.target) end
  176.             elseif iLuxConfig.UseUlt and (not QInvalid and calcDmg.total or calcDmg.total - calcDmg.Q) > ts.target.health then
  177.                 for item, itemInfo in pairs(items.itemsList) do
  178.                     if itemInfo.ready then
  179.                         CastSpell(itemInfo.slot, ts.target)
  180.                     end
  181.                 end
  182.                 if not QInvalid then CastSpell(_Q, ts.target.x, ts.target.z) end
  183.                 if not EParticle then
  184.                     CastSpell(_E, ts.target.x, ts.target.z)
  185.                     TriggerEOnLand = true
  186.                     TriggerEOnLandFarm = false
  187.                 elseif GetDistance(EParticle, ts.target) < ERadius then
  188.                     CastSpell(_E)
  189.                 end
  190.                 if igniteSlot then CastSpell(igniteSlot, ts.target) end
  191.                 CastSpell(_R, ts.target.x, ts.target.z)
  192.             else
  193.                 if not QInvalid then CastSpell(_Q, ts.target.x, ts.target.z) end
  194.                 if not EParticle then
  195.                     CastSpell(_E, ts.target.x, ts.target.z)
  196.                     TriggerEOnLand = true
  197.                     TriggerEOnLandFarm = false
  198.                 elseif GetDistance(EParticle, ts.target) < ERadius then
  199.                     CastSpell(_E)
  200.                 end
  201.             end
  202.         elseif myHero:CanUseSpell(_E) == READY and EPos and QStatus ~= 3 then
  203.             if not EParticle then
  204.                 CastSpell(_E, EPos.x, EPos.z)
  205.                 TriggerEOnLand = true
  206.                 TriggerEOnLandFarm = false
  207.             elseif GetDistance(EParticle, ts.target) < ERadius then
  208.                 CastSpell(_E)
  209.             end
  210.         end
  211.     end
  212. end
  213.  
  214. function Poke()
  215.     if myHero:CanUseSpell(_E) == READY and ValidTarget(ts.target) then
  216.         if not EParticle then
  217.             local EPos,_ = tpE:GetPrediction(ts.target)
  218.             if EPos then
  219.                 CastSpell(_E, EPos.x, EPos.z)
  220.                 TriggerEOnLand = true
  221.                 TriggerEOnLandFarm = false
  222.             end
  223.         elseif GetDistance(EParticle, ts.target) < ERadius then
  224.             CastSpell(_E)
  225.         end
  226.     end
  227. end
  228.  
  229. function autoFarm()
  230.     local killableMinions = {}
  231.     local killablePoints = {}
  232.     for i, minion in ipairs(enemyMinions.objects) do
  233.         if ValidTarget(minion) and (TargetHaveBuff("luxilluminatingfraulein", minion) and getDmg("P", minion, myHero) + getDmg("E", minion, myHero) or getDmg("E", minion, myHero)) > minion.health then
  234.             table.insert(killableMinions, minion)
  235.             table.insert(killablePoints, Vector(minion))
  236.         end
  237.     end
  238.     if not EParticle then
  239.         if #killableMinions >= 3 then
  240.             local spellPos = _CalcSpellPosForGroup(ERadius, ERange, killablePoints)
  241.             local PosMinionCount = 0
  242.             if spellPos ~= nil then
  243.                 for i, minion in ipairs(killableMinions) do
  244.                     if GetDistance(minion, spellPos.center) < ERadius then
  245.                         PosMinionCount = PosMinionCount + 1
  246.                         if PosMinionCount >= 3 then
  247.                             CastSpell(_E, spellPos.center.x, spellPos.center.z)
  248.                             TriggerEOnLand = false
  249.                             TriggerEOnLandFarm = true
  250.                             return
  251.                         end
  252.                     end
  253.                 end
  254.             end
  255.         end
  256.     else
  257.         local PosMinionCount = 0
  258.         for i, minion in ipairs(killableMinions) do
  259.             if GetDistance(minion, EParticle) < ERadius then
  260.                 PosMinionCount = PosMinionCount + 1
  261.                 if PosMinionCount >= 3 then
  262.                     CastSpell(_E)
  263.                     return
  264.                 end
  265.             end
  266.         end
  267.     end
  268.     for i, minion in ipairs(killableMinions) do
  269.         if ValidTarget(minion) and (TargetHaveBuff("luxilluminatingfraulein", minion) and getDmg("P", minion, myHero) + getDmg("AD", minion, myHero) * 1.1 or getDmg("AD", minion, myHero) * 1.1) > minion.health then
  270.             myHero:Attack(minion)
  271.             return
  272.         end
  273.     end
  274. end
  275.  
  276. function AutoUlt()
  277.     if myHero:CanUseSpell(_R) == READY then
  278.         for i, enemy in ipairs(GetEnemyHeroes()) do
  279.             if ValidTarget(enemy) and (TargetHaveBuff("luxilluminatingfraulein", minion) and getDmg("P", enemy, myHero) + getDmg("R", enemy, myHero) or getDmg("R", enemy, myHero)) > enemy.health then
  280.                 if pingTimer[enemy.charName] == nil or pingTimer[enemy.charName] < GetTickCount() - 5000 then
  281.                     PingSignal(PING_NORMAL, enemy.x, enemy.y, enemy.z, 2)
  282.                     pingTimer[enemy.charName] = GetTickCount()
  283.                 end
  284.                 if ValidTarget(enemy, RRange) and iLuxConfig.AutoUlt then
  285.                     local RPos = tpR:GetPrediction(enemy)
  286.                     if RPos then
  287.                         CastSpell(_R, RPos.x, RPos.z)
  288.                         return
  289.                     end
  290.                 end
  291.             end
  292.         end
  293.     end
  294. end
  295.  
  296. function AutoTriggerE()
  297.     if TriggerEOnLandFarm then
  298.         CastSpell(_E)
  299.         return
  300.     else
  301.         local count = 0
  302.         for i, enemy in ipairs(GetEnemyHeroes()) do
  303.             if ValidTarget(enemy) and GetDistance(enemy, EParticle) < ERadius then
  304.                 if TriggerEOnLand then
  305.                     CastSpell(_E)
  306.                     return
  307.                 else
  308.                     count = count + 1
  309.                     if count >= iLuxConfig.AutoTriggerEMin then
  310.                         CastSpell(_E)
  311.                         return
  312.                     end
  313.                 end
  314.             end
  315.         end
  316.     end
  317. end
  318.  
  319. function OnCreateObj(object)
  320.     if object.name:find("LuxLightstrike_tar") then
  321.         EParticle = object
  322.     end
  323.     if object.name:find("LuxLightBinding_tar") then
  324.         QStatus = 2
  325.     end
  326. end
  327.  
  328. function OnDeleteObj(object)
  329.     if object.name:find("LuxLightstrike_tar") or (EParticle and EParticle.rawHash == object.rawHash) then
  330.         EParticle = nil
  331.         TriggerEOnLand = false
  332.         TriggerEOnLandFarm = false
  333.     end
  334.     if object.name:find("LuxLightBinding_mis") then
  335.         QStatus = 2
  336.     end
  337. end
  338.  
  339. function updateItems()
  340.     for item, itemInfo in pairs(items.itemsList) do
  341.         itemInfo.slot = GetInventorySlotItem(itemInfo.id)      
  342.         itemInfo.ready = (itemInfo.slot and myHero:CanUseSpell(itemInfo.slot) == READY or false)
  343.     end
  344.     for item, itemInfo in pairs(items.passiveItemsList) do
  345.         itemInfo.slot = GetInventorySlotItem(itemInfo.id)
  346.     end
  347.     items["ZHONYAS"].slot = GetInventorySlotItem(items["ZHONYAS"].id)      
  348.     items["ZHONYAS"].ready = (items["ZHONYAS"].slot and myHero:CanUseSpell(items["ZHONYAS"].slot) == READY or false)
  349.     items["WOOGLETS"].slot = GetInventorySlotItem(items["WOOGLETS"].id)    
  350.     items["WOOGLETS"].ready = (items["WOOGLETS"].slot and myHero:CanUseSpell(items["WOOGLETS"].slot) == READY or false)
  351. end
  352.  
  353. function calculateDamage(enemy, checkRange, readyCheck)
  354.     local QPos,_,_ = tpQ:GetPrediction(enemy)
  355.     local EPos,_,_ = tpE:GetPrediction(enemy)
  356.     local returnDamage = {}
  357.     returnDamage.Qbase = (( (myHero:CanUseSpell(_Q) == READY or not readyCheck) and (QPos and GetDistance({x = QPos.x, z = QPos.z}) < QRange or not checkRange) and getDmg("Q", enemy, myHero)) or 0 )
  358.     --returnDamage.Wbase = (( (myHero:CanUseSpell(_W) == READY or not readyCheck) and (GetDistance(enemy) < WRange or not checkRange) and getDmg("W", enemy, myHero)) or 0 )
  359.     returnDamage.Ebase = (( (myHero:CanUseSpell(_E) == READY or not readyCheck) and (EPos and GetDistance({x = EPos.x, z = EPos.z}) < ERange or not checkRange) and getDmg("E", enemy, myHero)) or 0 )
  360.     returnDamage.Rbase = (( (myHero:CanUseSpell(_R) == READY or not readyCheck) and (GetDistance(enemy) < RRange or not checkRange) and getDmg("R", enemy, myHero)) or 0 )
  361.     returnDamage.DFG = (( (items.itemsList["DFG"].ready or (items.itemsList["DFG"].slot and not readyCheck)) and (GetDistance(enemy) < defaultItemRange or not checkRange) and getDmg("DFG", enemy, myHero)) or 0 )
  362.     returnDamage.HXG = (( (items.itemsList["HXG"].ready or (items.itemsList["HXG"].slot and not readyCheck)) and (GetDistance(enemy) < defaultItemRange or not checkRange) and getDmg("HXG", enemy, myHero)) or 0 )
  363.     returnDamage.BWC = (( (items.itemsList["BWC"].ready or (items.itemsList["BWC"].slot and not readyCheck)) and (GetDistance(enemy) < defaultItemRange or not checkRange) and getDmg("BWC", enemy, myHero)) or 0 )
  364.     returnDamage.LIANDRYS = (( items.passiveItemsList["LIANDRYS"].slot and getDmg("LIANDRYS", enemy, myHero)) or 0)
  365.     returnDamage.BLACKFIRE = (( items.passiveItemsList["BLACKFIRE"].slot and getDmg("BLACKFIRE", enemy, myHero)) or 0)
  366.     returnDamage.ignite = (( igniteSlot and (myHero:CanUseSpell(igniteSlot) == READY or not readyCheck) and (GetDistance(enemy) < igniteRange or not checkRange) and getDmg("IGNITE", enemy, myHero)) or 0)
  367.     returnDamage.passive = getDmg("P", enemy, myHero)
  368.  
  369.     returnDamage.onSpell = returnDamage.LIANDRYS + returnDamage.BLACKFIRE
  370.     returnDamage.Q = returnDamage.Qbase + returnDamage.onSpell
  371.     --returnDamage.W = returnDamage.Wbase + returnDamage.onSpell
  372.     returnDamage.E = returnDamage.Ebase + returnDamage.onSpell
  373.     returnDamage.R = returnDamage.Rbase + returnDamage.onSpell
  374.     returnDamage.QWE = returnDamage.Q --[[+ returnDamage.W]] + returnDamage.E + returnDamage.passive
  375.     returnDamage.QWER = returnDamage.QWE + returnDamage.R
  376.     returnDamage.items = returnDamage.DFG + returnDamage.HXG + returnDamage.BWC
  377.  
  378.     returnDamage.total = (returnDamage.DFG > 0 and 1.2 * returnDamage.QWER or returnDamage.QWER) + returnDamage.items + returnDamage.ignite
  379.  
  380.     return returnDamage
  381. end
  382.  
  383. function damageText()
  384.     local damageTextList = {"Poor Enemy", "Ultimate!", "Nuke!", "Risky"}
  385.     for i, enemy in ipairs(GetEnemyHeroes()) do
  386.         if ValidTarget(enemy) then
  387.             if updateTextTimers[enemy.charName] == nil then
  388.                 updateTextTimers[enemy.charName] = 30
  389.             elseif updateTextTimers[enemy.charName] > 1 then
  390.                 updateTextTimers[enemy.charName] = updateTextTimers[enemy.charName] - 1
  391.             elseif updateTextTimers[enemy.charName] == 1 then          
  392.                 local calcDmg = calculateDamage(enemy, false, true)
  393.                 local killMode = (calcDmg.QWE > enemy.health and 1) or (calcDmg.R > enemy.health and 2) or (calcDmg.QWER > enemy.health and 3) or (calcDmg.total > enemy.health and 4) or 0
  394.                 if killMode > 0 then PrintFloatText(enemy, 0, damageTextList[killMode]) end
  395.                 updateTextTimers[enemy.charName] = 30
  396.             end
  397.         end
  398.     end
  399. end
  400.  
  401. function OnDraw()
  402.     if not myHero.dead and iLuxConfig.drawcircles then
  403.         if myHero:CanUseSpell(_Q) == READY or myHero:CanUseSpell(_E) == READY then
  404.             DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0xFF80FF00)
  405.         end
  406.         if myHero:CanUseSpell(_R) == READY then
  407.             DrawCircle(myHero.x, myHero.y, myHero.z, RRange, 0xFF80FF00)
  408.         end
  409.  
  410.         if ValidTarget(ts.target) then
  411.             for i = 1, 10 do
  412.                 DrawCircle(ts.target.x, ts.target.y, ts.target.z, 90+i, 0xFFFF0000)
  413.             end
  414.         end
  415.  
  416.         for i, minion in ipairs(enemyMinions.objects) do
  417.             if minion and ValidTarget(minion, QRange) then
  418.                 if minion.health < getDmg("AD", minion, myHero) then
  419.                     for j = 1, 10 do
  420.                         DrawCircle(minion.x, minion.y, minion.z, 50+j, 0xFF80FF00)
  421.                     end
  422.                 elseif minion.health < getDmg("E", minion, myHero) then
  423.                     for j = 1, 10 do
  424.                         DrawCircle(minion.x, minion.y, minion.z, 50+j, 0xFFFF0000)
  425.                     end
  426.                 end
  427.             end
  428.         end
  429.     end
  430. end
  431.  
  432. function AutoIgnite()
  433.     if igniteSlot and myHero:CanUseSpell(igniteSlot) then
  434.         for i, enemy in ipairs(GetEnemyHeroes()) do
  435.             local igniteDmg = getDmg("IGNITE", enemy, myHero)
  436.             if ValidTarget(enemy, igniteRange) and enemy.health < igniteDmg then
  437.                 CastSpell(igniteSlot, enemy)
  438.             end
  439.         end
  440.     end
  441. end
  442.  
  443. function OnProcessSpell(object, spell)
  444.  
  445.     if object == nil or spell == nil or not object.valid then return end
  446.  
  447.     if ((items["WOOGLETS"].ready or items["ZHONYAS"].ready) and iLuxConfig.SmartSave) or (myHero:CanUseSpell(_W) == READY and iLuxConfig.AutoShield) then
  448.         if ValidTarget(object) and not myHero.dead and not (object.name:find("Minion_") or object.name:find("Odin")) then
  449.             if object.type == "obj_AI_Hero" then
  450.                 local spellType = getSpellType(object, spell.name)
  451.                 if spellType ~= nil then
  452.  
  453.                     -- Basic Attacks
  454.                     if spellType == "BAttack" or spellType == "CAttack" then
  455.                         local baseADmg = getDmg("AD", myHero, object)
  456.                         local onHitDmg = 0
  457.                             + ((GetInventoryHaveItem(3078, object) and getDmg("TRINITY", myHero, object)) or 0)
  458.                             + ((GetInventoryHaveItem(3186, object) and getDmg("KITAES", myHero, object)) or 0)
  459.                             + ((GetInventoryHaveItem(3087, object) and getDmg("STATIKK", myHero, object)) or 0)
  460.                             + ((GetInventoryHaveItem(3100, object) and getDmg("LICHBANE", myHero, object)) or 0)
  461.                             + ((GetInventoryHaveItem(3114, object) and getDmg("MALADY", myHero, object)) or 0)
  462.                             + ((GetInventoryHaveItem(3153, object) and getDmg("RUINEDKING", myHero, object)) or 0)
  463.                             + ((GetInventoryHaveItem(3042, object) and getDmg("MURAMANA", myHero, object)) or 0)
  464.                             + ((GetInventoryHaveItem(3091, object) and getDmg("WITSEND", myHero, object)) or 0)
  465.                             + ((GetInventoryHaveItem(3057, object) and getDmg("SHEEN", myHero, object)) or 0)
  466.                             + ((GetInventoryHaveItem(3025, object) and getDmg("ICEBORN", myHero, object)) or 0)
  467.                             + ((GetInventoryHaveItem(3184, object) and 80) or 0)
  468.                         local PhysDamage = (spellType == "BAttack" and (baseADmg + onHitDmg) * 1.07 + ((GetInventoryHaveItem(3209, object) and getDmg("SPIRITLIZARD", myHero, object)) or 0)) or (spellType == "CAttack" and (GetInventoryHaveItem(3031, object) and (baseADmg * 2.5 + onHitDmg) * 1.07 + ((GetInventoryHaveItem(3209, object) and getDmg("SPIRITLIZARD", myHero, object)) or 0)) or (baseADmg * 1.5 + onHitDmg) * 1.07 + ((GetInventoryHaveItem(3209, object) and getDmg("SPIRITLIZARD", myHero, object)) or 0))
  469.    
  470.                         if spell.endPos ~= nil and GetDistance(spell.endPos) < 50 then
  471.                             if myHero.health - PhysDamage < myHero.maxHealth * (iLuxConfig.SafeBet / 100) then
  472.                                 if items["WOOGLETS"].ready and iLuxConfig.SmartSave then
  473.                                     CastSpell(items["WOOGLETS"].slot)
  474.                                 elseif items["ZHONYAS"].ready and iLuxConfig.SmartSave then
  475.                                     CastSpell(items["ZHONYAS"].slot)
  476.                                 end
  477.                             elseif myHero:CanUseSpell(_W) == READY and iLuxConfig.AutoShield and PhysDamage / myHero.maxHealth > AutoShieldPerc / 100 then
  478.                                 local bestAlly = nil
  479.                                 for i, tempAlly in ipairs(GetAllyHeroes()) do
  480.                                     if GetDistance(tempAlly) < WRange then
  481.                                         if bestAlly == nil or bestAlly.health > tempAlly.health then
  482.                                             bestAlly = tempAlly
  483.                                         end
  484.                                     end
  485.                                 end
  486.                                 CastSpell(_W, bestAlly ~= nil and bestAlly.x or object.x, bestAlly ~= nil and bestAlly.z or object.z)
  487.                             end
  488.                         end
  489.  
  490.                     -- QWER Attacks
  491.                     elseif string.find("QWER", spellType) then
  492.                         local onHitSpellDmg = 0
  493.                             + ((GetInventoryHaveItem(3151, object) and getDmg("LIANDRYS", myHero, object)) or 0)
  494.                             + ((GetInventoryHaveItem(3042, object) and getDmg("MURAMANA",myHero, object)) or 0)
  495.                             + ((GetInventoryHaveItem(3188, object) and getDmg("BLACKFIRE", myHero, object)) or 0)
  496.                         local spellDamage = (getDmg(spellType, myHero, object) + onHitSpellDmg) * 1.07 + (GetInventoryHaveItem(3209) and getDmg("SPIRITLIZARD", myHero, object) or 0)
  497.                         local skillType, skillRadius, skillMaxDistance = skillData[object.charName][spellType]["type"], skillData[object.charName][spellType]["radius"], skillData[object.charName][spellType]["maxdistance"]
  498.                         if (skillType == 0 and checkhitaoe(object, spell.endPos, 80, myHero, 0)) or (skillType == 1 and checkhitlinepass(object, spell.endPos, skillRadius, skillMaxDistance, myHero, 50)) or (skillType == 2 and checkhitlinepoint(object, spell.endPos, skillRadius, myHero, 50)) or (skillType == 3 and checkhitaoe(object, spell.endPos, skillRadius, myHero, 50)) or (skillType == 4 and checkhitcone(object, spell.endPos, skillRadius, skillMaxDistance, myHero, 50)) or (skillType == 5 and checkhitwall(object, spell.endPos, skillRadius, skillMaxDistance, myHero, 50)) or (skillType == 6 and (checkhitlinepass(object, spell.endPos, skillRadius, skillMaxDistance, myHero, 50) or checkhitlinepass(object, Vector(object)*2-spell.endPos, skillRadius, skillMaxDistance, myHero, 50))) then
  499.                             if myHero.health - spellDamage < myHero.maxHealth * (iLuxConfig.SafeBet / 100) then
  500.                                 if items["WOOGLETS"].ready and iLuxConfig.SmartSave then
  501.                                     CastSpell(items["WOOGLETS"].slot)
  502.                                 elseif items["ZHONYAS"].ready and iLuxConfig.SmartSave then
  503.                                     CastSpell(items["ZHONYAS"].slot)
  504.                             elseif myHero:CanUseSpell(_W) == READY and iLuxConfig.AutoShield and spellDamage / myHero.maxHealth > AutoShieldPerc / 100 then
  505.                                 local bestAlly = nil
  506.                                 for i, tempAlly in ipairs(GetAllyHeroes()) do
  507.                                     if GetDistance(tempAlly) < WRange then
  508.                                         if bestAlly == nil or bestAlly.health > tempAlly.health then
  509.                                             bestAlly = tempAlly
  510.                                         end
  511.                                     end
  512.                                 end
  513.                                 CastSpell(_W, bestAlly ~= nil and bestAlly.x or object.x, bestAlly ~= nil and bestAlly.z or object.z)
  514.                                 end
  515.                             end
  516.                         end
  517.                     end
  518.                 end
  519.             end
  520.         end
  521.     end
  522. end
  523.  
  524. --[[ Changelog, so I can keep track of the shit I have edited. I forget it otherwise...
  525.  
  526. v1.0
  527. - Initial release
  528.  
  529. v1.1
  530. - Fixed ERadius
  531. - Fixed EParticle detection
  532. - DERP, I feel retarded reading through my own code again...
  533. - Added Q with a single minion in between.
  534. - Added move to mouse during PewPewPewPewPew
  535. - Tweaked Auto E Shit.
  536. - Increased Q Width
  537. - Fixed lack of collision detection when the target was snared. /facepalm
  538.  
  539. v1.1.1
  540. - Quick fix: igniteSlot check.a
  541.  
  542. ]]-- <INSERT_INCREDIBLE_FUCKING_RAINBOWS_UNICORN_HERE>
Advertisement
Add Comment
Please, Sign In to add comment