16HeX16

Irelia - Plugin

Oct 18th, 2013
5,144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.29 KB | None | 0 0
  1. --[[    Items   ]]--
  2. local QREADY, WREADY, EREADY, RREADY  = false, false, false, false
  3. local SheenSlot, TrinitySlot, IcebornSlot = nil, nil, nil
  4.  
  5. function PluginOnLoad()
  6.     AutoCarry.SkillsCrosshair.range = 1300
  7.     --> Load
  8.     mainLoad()
  9.     --> Main Menu
  10.     mainMenu()
  11. end
  12.  
  13. function PluginOnTick()
  14.     Checks()
  15.    
  16.     --[[    Auto Stun   ]]--
  17.     if Target and Menu.autoStun then
  18.         if GetDistance(Target) < eRange and EREADY then
  19.             if (myHero.health / myHero.maxHealth) < (Target.health / Target.maxHealth) then
  20.                 CastSpell(_E, Target)
  21.             end
  22.         end
  23.     end
  24.  
  25.     --[[    Basic Combo ]]--
  26.     if Target and AutoCarry.MainMenu.AutoCarry then
  27.         if RNDREADY and GetDistance(Target) < 375 then CastSpell(RNDSlot) end
  28.         --[[    Abilities   ]]--
  29.         if QREADY and WREADY and GetDistance(Target) <= qRange then
  30.             CastSpell(_W)
  31.         elseif WREADY and GetDistance(Target) <= 300 then
  32.             CastSpell(_W)
  33.         end
  34.        
  35.         if QREADY and GetDistance(Target) <= qRange then
  36.             if not Menu.limitQ then
  37.                 CastSpell(_Q, Target)
  38.             elseif Menu.limitQ then
  39.                 if QREADY and Target.health < qDamage(Target) then CastSpell(_Q, Target) end
  40.             end
  41.         end
  42.        
  43.         if EREADY and GetDistance(Target) < eRange then
  44.             if Menu.eStun and (myHero.health / myHero.maxHealth) < (Target.health / Target.maxHealth) then
  45.                 CastSpell(_E, Target)
  46.             elseif not Menu.eStun then
  47.                 CastSpell(_E, Target)
  48.             end
  49.         end
  50.        
  51.         if RREADY and Menu.useR then CastR(Target) end
  52.     end
  53.  
  54.     --[[    Auto Q  ]]--
  55.     if Menu.autoQ and QREADY then
  56.         for i=1, heroManager.iCount do
  57.             champ = heroManager:GetHero(i)
  58.             if champ and champ.team ~= myHero.team and not champ.dead then
  59.                 if GetDistance(champ) <= qRange and champ.health < qDamage(champ) then
  60.                     CastSpell(_Q, champ)
  61.                 end
  62.             end
  63.         end
  64.     end
  65.    
  66.     --[[    Last Hit    ]]--
  67.     if QREADY and Menu.iFarm then
  68.         if AutoCarry.MainMenu.LastHit or AutoCarry.MainMenu.LaneClear then
  69.             for _, minion in pairs(farmMinions.objects) do
  70.                 if GetDistance(minion) <= qRange and GetDistance(minion) > Menu.qBuffer and minion.health < qDamage(minion) then
  71.                     CastSpell(_Q, minion)
  72.                 end
  73.             end
  74.             for _, jMinion in pairs(jungleMinions.objects) do
  75.                 if GetDistance(jMinion) <= qRange and GetDistance(jMinion) > Menu.qBuffer and jMinion.health < qDamage(jMinion) then
  76.                     CastSpell(_Q, jMinion)
  77.                 end
  78.             end
  79.         end
  80.     end
  81. end
  82.  
  83. function PluginOnDraw()
  84.     if Menu.drawQ and not myHero.dead then
  85.         DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x00FF00)
  86.     end
  87. end
  88.  
  89. function PluginOnProcessSpell(unit, spell)
  90.     if unit.isMe and spell.name == "IreliaHitenStyle" then
  91.         lasthiten = os.clock()
  92.         hitendmg = spell.level*15
  93.     end
  94. end
  95.  
  96. function qDamage(target)
  97.     local qDmg = getDmg("Q", target, myHero) + getDmg("AD", target, myHero)
  98.     local 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))-15
  99.     local totalQDmg = qDmg + bDmg + hitendmg
  100.     return totalQDmg
  101. end
  102.  
  103. function totalDamage(target)
  104.     return qDamage(target) + getDmg("R", target, myHero)*4
  105. end
  106.  
  107. function CastR(target)
  108.     local damagetoTarget = totalDamage(target)
  109.     if IsSACReborn and VIP_USER then
  110.         if not Menu.limitR then
  111.             SkillR:ForceCast(target)
  112.         elseif target.health < damagetoTarget then
  113.             SkillR:ForceCast(target)
  114.         end
  115.     else
  116.         if not Menu.limitR then
  117.             Cast(SkillR, target)
  118.         elseif target.health < damagetoTarget then
  119.             Cast(SkillR, target)
  120.         end
  121.     end
  122. end
  123.  
  124. function Checks()
  125.     farmMinions:update()
  126.     jungleMinions:update()
  127.     Target = AutoCarry.GetAttackTarget()
  128.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  129.     WREADY = (myHero:CanUseSpell(_W) == READY)
  130.     EREADY = (myHero:CanUseSpell(_E) == READY)
  131.     RREADY = (myHero:CanUseSpell(_R) == READY)
  132.     RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
  133.    
  134.     SheenSlot, TrinitySlot, IcebornSlot = GetInventorySlotItem(3025), GetInventorySlotItem(3057), GetInventorySlotItem(3078)
  135.     if os.clock() > lasthiten + hitendelay then hitendmg = 0 end
  136. end
  137.  
  138. function mainLoad()
  139.     if AutoCarry.Skills then IsSACReborn = true else IsSACReborn = false end
  140.    
  141.     lasthiten, hitendelay, hitendmg = 0, 6, 0
  142.     qRange, eRange, rRange = 650, 425, 1200
  143.    
  144.     if IsSACReborn and VIP_USER then
  145.         SkillR = AutoCarry.Skills:NewSkill(true, _R, rRange, "Transcendent Blades", AutoCarry.SPELL_LINEAR, 0, false, false, 1700, 250, 60, false)
  146.     else
  147.         SkillR = {spellKey = _R, range = rRange, speed = 1700, delay = 250, width = 60, minions = false}
  148.     end
  149.     RNDSlot, RNDREADY = nil, false
  150.     Menu = AutoCarry.PluginMenu
  151.     Cast = AutoCarry.CastSkillshot
  152.     farmMinions = minionManager(MINION_ENEMY, qRange+200, player)
  153.     jungleMinions = minionManager(MINION_JUNGLE, qRange+200, player)
  154. end
  155.  
  156. function mainMenu()
  157.     Menu:addParam("autoStun", "Auto Stun", SCRIPT_PARAM_ONOFF, true)
  158.     Menu:addParam("autoQ", "Auto Q killable", SCRIPT_PARAM_ONOFF, true)
  159.     Menu:addParam("limitQ", "Limit Q usage", SCRIPT_PARAM_ONOFF, false)
  160.     Menu:addParam("limitR", "Limit R usage", SCRIPT_PARAM_ONOFF, false)
  161.     Menu:addParam("useR", "Use ultimate", SCRIPT_PARAM_ONOFF, true)
  162.     Menu:addParam("eStun", "Only use E to stun", SCRIPT_PARAM_ONOFF, false)
  163.     Menu:addParam("iFarm", "Farm with Q", SCRIPT_PARAM_ONOFF, false)
  164.     Menu:addParam("qBuffer", "Min Range to Q Farm",SCRIPT_PARAM_SLICE, 0, 0, 650, 1)
  165.     Menu:addParam("drawQ", "Draw - Bladesurge", SCRIPT_PARAM_ONOFF, false)
  166. end
Advertisement
Add Comment
Please, Sign In to add comment