16HeX16

Irelia Helper 1.4

Mar 30th, 2013
1,462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.74 KB | None | 0 0
  1. --[[    Irelia Helper 1.4 by HeX ]]-- (killsteal and calculations fixed by vitouch)
  2.  
  3. if myHero.charName ~= "Irelia" then return end
  4. --[[    Ranges  ]]--
  5. local qRange = 650
  6. local eRange = 425
  7. local rRange = 1000
  8. --[[    Prediction  ]]--
  9. local travelDuration = 0
  10. local rSpeed = 1.7
  11. --[[    Farm    ]]--
  12. local nextTick = 0
  13. local waitDelay = 650
  14. --[[    Damage Calculation      ]]--
  15. local calculationenemy = 1
  16. local killable = {}
  17. --[[    Items   ]]--
  18. local ignite = nil
  19. local QREADY, WREADY, EREADY, RREADY  = false, false, false, false
  20. local SheenSlot, TrinitySlot, IcebornSlot = nil, nil, nil
  21. local BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot = nil, nil, nil, nil, nil, nil, nil
  22. local BRKREADY, DFGREADY, HXGREADY, BWCREADY, TMTREADY, RAHREADY, RNDREADY = false, false, false, false, false, false, false
  23.  
  24. function OnLoad()
  25.     lasthiten = 0
  26.     hitendelay = 6
  27.     hitendmg = 0
  28.     lastfloat = 0
  29.     floatdelay = 0
  30.     PrintChat("<font color='#CCCCCC'> >> Irelia Helper 1.4 loaded! <<</font>")
  31.     IHConfig = scriptConfig("Irelia Helper", "IreliaHelper")
  32.     IHConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  33.     IHConfig:addParam("autoStun", "Auto Stun", SCRIPT_PARAM_ONKEYTOGGLE, true, 90)
  34.     IHConfig:addParam("lasthit", "Last Hit", SCRIPT_PARAM_ONKEYDOWN, false, 65)
  35.     IHConfig:addParam("autoQ", "Auto Q killable", SCRIPT_PARAM_ONKEYTOGGLE, true, 88)
  36.     IHConfig:addParam("useR", "Use ultimate", SCRIPT_PARAM_ONOFF, true)
  37.     IHConfig:addParam("eStun", "Only use E to stun", SCRIPT_PARAM_ONOFF, false)
  38.     IHConfig:addParam("autoignite", "Ignite when Killable", SCRIPT_PARAM_ONOFF, true)
  39.     IHConfig:addParam("IFarm", "Farm with Q", SCRIPT_PARAM_ONOFF, false)
  40.     IHConfig:addParam("qBuffer", "Min Range to Q Farm",SCRIPT_PARAM_SLICE, 0, 0, 650, 1)
  41.     IHConfig:addParam("mousemoving", "Move to mouse", SCRIPT_PARAM_ONOFF, true)
  42.     IHConfig:addParam("drawcirclesSelf", "Draw Circles - Self", SCRIPT_PARAM_ONOFF, false)
  43.     IHConfig:addParam("drawcirclesEnemy", "Draw Circles - Enemy", SCRIPT_PARAM_ONOFF, false)
  44.     IHConfig:permaShow("scriptActive")
  45.     IHConfig:permaShow("autoStun")
  46.     ts = TargetSelector(TARGET_LOW_HP, qRange+50, DAMAGE_PHYSICAL)
  47.     ts.name = "Irelia"
  48.     IHConfig:addTS(ts)
  49.    
  50.     enemyMinions = minionManager(MINION_ENEMY, 650, player, MINION_SORT_HEALTH_ASC)
  51.    
  52.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  53.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  54.     end
  55. end
  56.  
  57. function OnProcessSpell(object,spell)
  58. local spellName = spell.name
  59. local P1 = spell.startPos
  60. local P2 = spell.endPos
  61.         if object.isMe then
  62.         --PrintChat("spell:"..spellName)
  63.                 if spellName == "IreliaHitenStyle" then
  64.                 lasthiten = os.clock()
  65.                 hitendmg = spell.level*15
  66. end
  67.         end
  68. end
  69. function OnTick()
  70.     ts:update()
  71.     DFGSlot, BRKSlot, HXGSlot, BWCSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144)
  72.     SheenSlot, TrinitySlot, IcebornSlot = GetInventorySlotItem(3025), GetInventorySlotItem(3057), GetInventorySlotItem(3078)
  73.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  74.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  75.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  76.     BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  77.     TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
  78.     RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
  79.     RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
  80.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  81.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  82.     WREADY = (myHero:CanUseSpell(_W) == READY)
  83.     EREADY = (myHero:CanUseSpell(_E) == READY)
  84.     RREADY = (myHero:CanUseSpell(_R) == READY)
  85.     if os.clock() > lasthiten + hitendelay then
  86.                 hitendmg = 0
  87.         end
  88.   if os.clock() > floatdelay + 2 then
  89.         lastfloat = 0
  90.     end
  91.     if ts.target ~= nil and not myHero.dead then
  92.         travelDuration = GetDistance(ts.target, myHero)/rSpeed
  93.     end
  94.     if ts.target ~= nil and RREADY and travelDuration ~= nil then
  95.         predic = GetPredictionPos(ts.target, travelDuration)
  96.     end
  97.    
  98.     --[[    Auto Ignite ]]--
  99.     if IHConfig.autoignite then    
  100.         if IREADY then
  101.             local ignitedmg = 0    
  102.             for i = 1, heroManager.iCount, 1 do
  103.                 local enemyhero = heroManager:getHero(i)
  104.                 if ValidTarget(enemyhero,600) then
  105.                     ignitedmg = 50 + 20 * myHero.level
  106.                     if enemyhero.health <= ignitedmg then
  107.                         CastSpell(ignite, enemyhero)
  108.                     end
  109.                 end
  110.             end
  111.         end
  112.     end
  113.     --[[    Auto Stun   ]]--
  114.     if ts.target ~= nil and IHConfig.autoStun then
  115.         if GetDistance(ts.target) < eRange and EREADY and ((myHero.health / myHero.maxHealth) < (ts.target.health / ts.target.maxHealth)) then
  116.             CastSpell(_E, ts.target)
  117.         end
  118.     end
  119.  
  120.     --[[    Basic Combo ]]--
  121.     if ts.target ~= nil and IHConfig.scriptActive then
  122.         --[[    Items   ]]--
  123.         if GetDistance(ts.target) < 550 then
  124.             if DFGREADY then CastSpell(DFGSlot, ts.target) end
  125.             if HXGREADY then CastSpell(HXGSlot, ts.target) end
  126.             if BWCREADY then CastSpell(BWCSlot, ts.target) end
  127.             if BRKREADY then CastSpell(BRKSlot, ts.target) end
  128.             if TMTREADY and GetDistance(ts.target) < 275 then CastSpell(TMTSlot) end
  129.             if RAHREADY and GetDistance(ts.target) < 275 then CastSpell(RAHSlot) end
  130.             if RNDREADY and GetDistance(ts.target) < 275 then CastSpell(RNDSlot) end
  131.         end
  132.         --[[    Abilities   ]]--
  133.         if WREADY and GetDistance(ts.target) <= qRange then
  134.             CastSpell(_W)
  135.         end
  136.         if QREADY and GetDistance(ts.target) <= qRange then
  137.             CastSpell(_Q, ts.target)
  138.         end
  139.         if EREADY and GetDistance(ts.target) < eRange and IHConfig.eStun and ((myHero.health / myHero.maxHealth) < (ts.target.health / ts.target.maxHealth)) then
  140.             CastSpell(_E, ts.target)
  141.             elseif EREADY and GetDistance(ts.target) <= eRange and not IHConfig.eStun then
  142.                 CastSpell(_E, ts.target)
  143.         end
  144.         if predic ~= nil and RREADY and IHConfig.useR then
  145.             if GetDistance(predic) <= rRange then
  146.                 CastSpell(_R, predic.x, predic.z)
  147.             end
  148.         end
  149.         if GetDistance(ts.target) <= 275 then
  150.             myHero:Attack(ts.target)
  151.         end
  152.     end
  153.    
  154.     --[[    Auto Q  ]]--
  155.     if IHConfig.autoQ then
  156.         for i=1, heroManager.iCount do
  157.             Target = heroManager:GetHero(i)
  158.             qDMG = getDmg("Q",Target,myHero)
  159.  
  160.             bDMG = (SheenSlot and getDmg("SHEEN",Target,myHero) or 0)+(TrinitySlot and getDmg("TRINITY",Target,myHero) or 0)+(IcebornSlot and getDmg("ICEBORN",Target,myHero) or 0)
  161.             if QREADY and Target ~= nil and Target.team ~= myHero.team and not Target.dead and Target.visible and GetDistance(Target) < qRange and Target.health < (qDMG+bDMG+hitendmg) then
  162.                 CastSpell(_Q, Target)
  163.             end
  164.         end
  165.     end
  166.     --[[    Last Hit    ]]--
  167.     enemyMinions:update()
  168.  
  169.     if IHConfig.lasthit then  
  170.         if IHConfig.mousemoving and GetTickCount() > nextTick then
  171.             myHero:MoveTo(mousePos.x, mousePos.z)
  172.         end
  173.    
  174.         for index, minion in pairs(enemyMinions.objects) do
  175.             local aDmg = getDmg("AD", minion, myHero)
  176.             local bDmg = (SheenSlot and getDmg("SHEEN",minion,myHero) or 0)+(TrinitySlot and getDmg("TRINITY",minion,myHero) or 0)+(IcebornSlot and getDmg("ICEBORN",minion,myHero) or 0)
  177.             local QDMG = getDmg("Q", minion, myHero)
  178.             if minion.health <= aDmg and GetDistance(minion) <= (myHero.range+75) and GetTickCount() > nextTick then
  179.                 myHero:Attack(minion)
  180.                 nextTick = GetTickCount() + waitDelay
  181.             elseif IHConfig.IFarm and QREADY and GetDistance(minion) <= qRange and GetDistance(minion) > IHConfig.qBuffer and minion.health <= (aDmg+QDMG+bDmg) then
  182.                 CastSpell(_Q, minion)
  183.             end
  184.         end
  185.     end
  186. end
  187.  
  188. function OnDraw()
  189.     if IHConfig.drawcirclesSelf and not myHero.dead then
  190.         DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x00FF00)
  191.     end
  192.     if ts.target ~= nil and IHConfig.drawcirclesEnemy then
  193.         for j=0, 10 do
  194.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  195.         end
  196.     end
  197.     for i=1, heroManager.iCount do
  198.         local enemydraw = heroManager:GetHero(i)
  199.         if ValidTarget(enemydraw) then
  200.             if IHConfig.drawcirclesEnemy then
  201.                 if killable[i] == 1 then
  202.                     for e=0, 15 do
  203.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0x0000FF)
  204.                     end
  205.                     elseif killable[i] == 2 then
  206.                     for e=0, 10 do
  207.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0xFF0000)
  208.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + e*1.5, 0xFF0000)
  209.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + e*1.5, 0xFF0000)
  210.                     end
  211.                 end
  212.             end
  213.         end
  214.     end
  215. end
  216.  
  217. --[[
  218. Explanation of the marks:
  219.     -Green circle: Marks the current target to which you will do the combo
  220.     -Blue circle: Killed with a combo, if all the skills were available
  221.     -3 Red circles: Killed using Items + 2 Attack + Q + E + R
  222. ]]
  223. function DmgCalculation()
  224.     local enemy = heroManager:GetHero(calculationenemy)
  225.     if ValidTarget(enemy) then
  226.         local ignitedamage, dfgdamage, hxgdamage, bwcdamage, brkdamage = 0, 0, 0, 0, 0
  227.         local qdamage = getDmg("Q",enemy,myHero)
  228.         local edamage = getDmg("E",enemy,myHero)
  229.         local rdamage =  getDmg("R", enemy, myHero,3)
  230.         local hitdamage = getDmg("AD", enemy, myHero)
  231.         local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  232.         local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  233.         local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  234.         local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  235.         local brkdamage = (BRKSlot and getDmg("RUINEDKING",enemy,myHero) or 0)
  236.         local tmtdamage = (TMTSlot and getDmg("TIAMAT",enemy,myHero) or 0)
  237.         local rahdamage = (RAHSlot and getDmg("HYDRA",enemy,myHero) or 0)
  238.         local combo1 = hitdamage*2 + qdamage + hitendmg*2 + edamage + rdamage
  239.         local combo2 = hitdamage*1
  240.         if QREADY then
  241.             combo2 = combo2 + qdamage
  242.         end
  243.         if EREADY then
  244.             combo2 = combo2 + edamage
  245.         end
  246.         if RREADY then
  247.             combo2 = combo2 + rdamage
  248.         end
  249.         if DFGREADY then
  250.             combo1 = combo1 + dfgdamage
  251.             combo2 = combo2 + dfgdamage
  252.         end
  253.         if HXGREADY then
  254.             combo1 = combo1 + hxgdamage
  255.             combo2 = combo2 + hxgdamage
  256.         end
  257.         if BWCREADY then
  258.             combo1 = combo1 + bwcdamage
  259.             combo2 = combo2 + bwcdamage
  260.         end
  261.         if BRKREADY then
  262.             combo1 = combo1 + brkdamage
  263.             combo2 = combo2 + brkdamage
  264.         end
  265.         if TMTREADY then
  266.             combo1 = combo1 + tmtdamage
  267.             combo2 = combo2 + tmtdamage
  268.         end
  269.         if RAHREADY then
  270.             combo1 = combo1 + rahdamage
  271.             combo2 = combo2 + rahdamage
  272.         end
  273.         if IREADY then
  274.             combo1 = combo1 + ignitedamage
  275.             combo2 = combo2 + ignitedamage
  276.         end
  277.         if combo2 >= enemy.health then killable[calculationenemy] = 2
  278.             elseif combo1 >= enemy.health then killable[calculationenemy] = 1
  279.             else killable[calculationenemy] = 0
  280.         end
  281.     end
  282.     if calculationenemy == 1 then calculationenemy = heroManager.iCount
  283.         else calculationenemy = calculationenemy-1
  284.     end
  285. end
Advertisement
Add Comment
Please, Sign In to add comment