ak77now

SidasAutoCarryPlugin - Irelia.lua

Oct 5th, 2015
774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.98 KB | None | 0 0
  1.  
  2. if myHero.charName ~= "Irelia" then return end
  3.  
  4.  
  5. --[[    VP   ]]--
  6. require 'VPrediction'
  7. local rRange, rDelay, rSpeed, rWidth = 1100, 0, 1600, 70
  8. local VP, ts = nil, nil
  9. --[[    VP   ]]--
  10.  
  11.  
  12. local Minions
  13.  
  14. function PluginOnLoad()
  15.  
  16. --[[    VP   ]]--
  17.     VP = VPrediction()
  18. --[[    VP   ]]--  
  19.  
  20.  
  21.     Minions = minionManager(MINION_ENEMY, 1250, player, MINION_SORT_HEALTH_ASC)
  22.     enemyMinions = minionManager(MINION_ENEMY, 650, myHero, MINION_SORT_HEALTH_ASC)
  23.     AutoCarry.SkillsCrosshair.range = 99999999999999999999999999   --1150
  24.     jungleMinions = minionManager(MINION_JUNGLE, 360, myHero, MINION_SORT_MAXHEALTH_DEC)
  25.     --> Main Load
  26.     mainLoad()
  27.     --> Main Menu
  28.     mainMenu()
  29. end
  30.  
  31. function PluginOnTick()
  32.  
  33.   jungleMinions:update()
  34.  
  35.  
  36. local   QREADY = (myHero:CanUseSpell(_Q) == READY)
  37. local   WREADY = (myHero:CanUseSpell(_W) == READY)
  38. local   EREADY = (myHero:CanUseSpell(_E) == READY)
  39. local   RREADY = (myHero:CanUseSpell(_R) == READY)
  40.  
  41.    
  42.     if Menu.useRKS then
  43.     RKS()
  44.     end
  45.    
  46.     enemyMinions:update()
  47.    
  48.     if Menu.farm then
  49.     AutoFarmQ()
  50.     end
  51.  
  52.  
  53.     if Menu.flee then
  54.     flee()
  55.     end
  56.  
  57.  
  58.  
  59. --升級大招--
  60. DodajUlti()
  61.  
  62.  
  63.     Checks()
  64.     if Target then
  65.        
  66.  
  67.     if Menu.sflee and GetDistance(Target) > 350then
  68.     flee()
  69.     end
  70.        
  71.  
  72.          if ((myHero.health / myHero.maxHealth) < 0.5) then
  73.             if RREADY and Menu.useR and GetDistance(Target) <= 600 then Cast(SkillQQ, Target) end
  74.          end
  75.        
  76.             if (AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.MixedMode) then
  77.             if  GetDistance(Target) <= 230 then      
  78.                 CastSpell(_W)          
  79.             end
  80.             end
  81.  
  82.    --[[        
  83.             if (AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.MixedMode) and Menu.Harass then
  84.                 if TargetHaveBuff("ireliahitenstylecharged", myHero) and QREADY and GetDistance(Target)<320 then
  85.                 DelayAction(function() qq() end, 5.5)
  86.                 end
  87.             end            
  88.     ]]--       
  89.            
  90.             if (AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.MixedMode) then
  91.                         if GetDistance(Target)<280 and EREADY and ((myHero.health / myHero.maxHealth) < (Target.health / Target.maxHealth)) then
  92.                         CastSpell(_E, Target)
  93.                         end
  94.             end            
  95.            
  96.        
  97.     end
  98.    
  99.     --[[    Auto Q  ]]--
  100.     if Menu.autoks then
  101.    
  102.     if myHero:GetSpellData(_W).level == 1 then
  103.     w=15
  104.     elseif myHero:GetSpellData(_W).level == 2 then
  105.     w=30
  106.     elseif myHero:GetSpellData(_W).level == 3 then
  107.     w=45
  108.     elseif myHero:GetSpellData(_W).level == 4 then
  109.     w=60
  110.     elseif myHero:GetSpellData(_W).level == 5 then
  111.     w=75   
  112.     end
  113.    
  114.         for i = 1, heroManager.iCount, 1 do
  115.             local enemy = heroManager:getHero(i)
  116.             if ValidTarget(enemy, qRange) then
  117.            
  118.             local dmgE = getDmg("E", enemy, myHero)
  119.             local dmgQ = getDmg("Q", enemy, myHero)+getDmg("AD",enemy,myHero)
  120.            
  121.  
  122.                 if enemy.health <= dmgQ and QREADY then
  123.                     CastSpell(_Q, enemy)
  124.                 end
  125.    
  126.                
  127.                 if myHero.level > 3 then
  128.                 if enemy.health <= dmgQ+w and QREADY and WREADY and GetDistance(Target)<600 then
  129.                     CastSpell(_W)
  130.                     CastSpell(_Q, enemy)
  131.                 end
  132.                 end    
  133.  
  134.                             if TargetHaveBuff("ireliahitenstylecharged", myHero) and QREADY and GetDistance(Target)<600 then
  135.                             if  enemy.health <= dmgQ+w then
  136.                                 CastSpell(_Q, enemy)
  137.                             end
  138.                             end            
  139.                
  140.                 if enemy.health <= dmgE and EREADY and GetDistance(Target)<300 then
  141.                     CastSpell(_E, enemy)
  142.                 end
  143.                        
  144.                    
  145.                
  146.             end
  147.         end
  148.     end
  149.  
  150. end
  151.  
  152. function qq()
  153.     Checks()
  154.     if Target then
  155.     if ((myHero.health / myHero.maxHealth) > (Target.health / Target.maxHealth) )  then
  156.     CastSpell(_Q, Target)
  157.     end
  158.     end
  159. end
  160.  
  161. function eEndPos(unit)
  162.     local endPos = Point(unit.x-myHero.x, unit.z-myHero.z)
  163.     abs = math.sqrt(endPos.x*endPos.x + endPos.y*endPos.y)
  164.     endPos2 = Point(myHero.x + (650*(endPos.x/abs)), myHero.z + (650*(endPos.y/abs)))
  165.     return endPos2
  166. end
  167.  
  168.  
  169.  
  170.  
  171. function RKS()
  172.  
  173. local   QREADY = (myHero:CanUseSpell(_Q) == READY)
  174. local   WREADY = (myHero:CanUseSpell(_W) == READY)
  175. local   EREADY = (myHero:CanUseSpell(_E) == READY)
  176. local   RREADY = (myHero:CanUseSpell(_R) == READY)
  177.  
  178.     if myHero:GetSpellData(_W).level == 1 then
  179.     w=15
  180.     elseif myHero:GetSpellData(_W).level == 2 then
  181.     w=30
  182.     elseif myHero:GetSpellData(_W).level == 3 then
  183.     w=45
  184.     elseif myHero:GetSpellData(_W).level == 4 then
  185.     w=60
  186.     elseif myHero:GetSpellData(_W).level == 5 then
  187.     w=75   
  188.     end
  189.  
  190.             for i = 1, heroManager.iCount, 1 do
  191.             local enemy = heroManager:getHero(i)
  192.             if ValidTarget(enemy, 1100) then
  193.            
  194.             local dmgR = getDmg("R", enemy, myHero)
  195.             local dmgQ = getDmg("Q", enemy, myHero)
  196.  
  197.               --單純R尾刀
  198.               if enemy.health <= dmgR*4 then    
  199.               if RREADY and GetDistance(enemy) <= 1100 then
  200.                     local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(enemy, rDelay, rWidth, rRange, rSpeed, myHero, false)
  201.                     if HitChance >= 2 then
  202.                         CastSpell(_R, CastPosition.x, CastPosition.z)
  203.                         return
  204.                     end
  205.               end
  206.               end
  207.              
  208.               --遠距離Q+R尾刀
  209.               if enemy.health <= dmgQ + dmgR*4 then    
  210.               if RREADY and QREADY and GetDistance(enemy) <= 650 then
  211.                     local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(enemy, rDelay, rWidth, rRange, rSpeed, myHero, false)
  212.                     if HitChance >= 2 then
  213.                         CastSpell(_R, CastPosition.x, CastPosition.z)
  214.                         return
  215.                     end
  216.               end
  217.               end
  218.                          
  219.              
  220.               --遠距離Q+R+W
  221.               if TargetHaveBuff("ireliahitenstylecharged", myHero) then
  222.               if enemy.health <= dmgQ + dmgR*4+w then    
  223.               if RREADY and QREADY and GetDistance(enemy) <= 650 then
  224.                     local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(enemy, rDelay, rWidth, rRange, rSpeed, myHero, false)
  225.                     if HitChance >= 2 then
  226.                         CastSpell(_R, CastPosition.x, CastPosition.z)
  227.                         return
  228.                     end
  229.               end
  230.               end
  231.               end
  232.  
  233.               --近距離R  --------------------------------------------------------------------------------
  234.               if enemy.health <= dmgR*6 then    
  235.               if RREADY and GetDistance(enemy) <= 320 then
  236.                     local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(enemy, rDelay, rWidth, rRange, rSpeed, myHero, false)
  237.                     if HitChance >= 2 then
  238.                         CastSpell(_R, CastPosition.x, CastPosition.z)
  239.                         return
  240.                     end
  241.               end
  242.               end            
  243.              
  244.               --近距離Q+R  --------------------------------------------------------------------------------
  245.               if enemy.health <= dmgQ + dmgR*6 then    
  246.               if RREADY and QREADY and GetDistance(enemy) <= 320 then
  247.                     local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(enemy, rDelay, rWidth, rRange, rSpeed, myHero, false)
  248.                     if HitChance >= 2 then
  249.                         CastSpell(_R, CastPosition.x, CastPosition.z)
  250.                         return
  251.                     end
  252.               end
  253.               end
  254.  
  255.              
  256.               --近距離Q+R+W ------------------------------------------------------------------
  257.               if TargetHaveBuff("ireliahitenstylecharged", myHero) then
  258.               if enemy.health <= dmgQ + dmgR*9+w then    
  259.               if RREADY and QREADY and GetDistance(enemy) <= 320 then
  260.                     local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(enemy, rDelay, rWidth, rRange, rSpeed, myHero, false)
  261.                     if HitChance >= 2 then
  262.                         CastSpell(_R, CastPosition.x, CastPosition.z)
  263.                         return
  264.                     end
  265.               end
  266.               end
  267.               end            
  268.            
  269.             end
  270.             end
  271.            
  272. end
  273.  
  274. function flee()
  275.         local MousePos = Vector(mousePos.x, mousePos.y, mousePos.z)
  276.         local Position = myHero + (Vector(MousePos) - myHero):normalized()*300
  277.         myHero:MoveTo(Position.x, Position.z)
  278.  
  279.  mPos = getNearestMinion(mousePos)
  280.     if mPos then
  281.  
  282.  
  283.     if myHero:GetSpellData(_W).level == 1 then
  284.     w=15
  285.     elseif myHero:GetSpellData(_W).level == 2 then
  286.     w=30
  287.     elseif myHero:GetSpellData(_W).level == 3 then
  288.     w=45
  289.     elseif myHero:GetSpellData(_W).level == 4 then
  290.     w=60
  291.     elseif myHero:GetSpellData(_W).level == 5 then
  292.     w=75   
  293.     end
  294.  
  295.     for index, minion in pairs(enemyMinions.objects) do
  296.     if  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero) and QREADY then
  297.         CastSpell(_Q,minion)  
  298.     end
  299.             if TargetHaveBuff("ireliahitenstylecharged", myHero) then
  300.             if  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero)+w then
  301.                 CastSpell(_Q, minion)
  302.                 return
  303.             end
  304.             end
  305.     end
  306.    
  307.  
  308.     end
  309. end
  310.  
  311.  
  312.  
  313. function getNearestMinion(unit)
  314.  
  315.     local closestMinion = nil
  316.     local nearestDistance = 0
  317.  
  318.             enemyMinions:update()
  319.  
  320.         for index, minion in pairs(enemyMinions.objects) do
  321.             if minion ~= nil and minion.valid and string.find(minion.name,"Minion_") == 1 and minion.team ~= player.team and minion.dead == false then
  322.                 if GetDistance(minion) <= 650 and  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero) then
  323.                     --PrintChat(GetDistance(eEndPos(minion), unit) .. "  -  ".. GetDistance(unit))
  324.                     if GetDistance(eEndPos(minion), unit) < GetDistance(unit) and nearestDistance < GetDistance(minion) then
  325.                         nearestDistance = GetDistance(minion)
  326.                         closestMinion = minion
  327.                     end
  328.                 end
  329.             if TargetHaveBuff("ireliahitenstylecharged", myHero) then
  330.             if  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero)+w then
  331.                     if GetDistance(eEndPos(minion), unit) < GetDistance(unit) and nearestDistance < GetDistance(minion) then
  332.                         nearestDistance = GetDistance(minion)
  333.                         closestMinion = minion
  334.                     end
  335.             end
  336.             end        
  337.                
  338.             end
  339.         end
  340.  
  341.     return closestMinion
  342. end
  343.  
  344.  
  345. function AutoFarmQ()
  346.     if myHero:GetSpellData(_W).level == 1 then
  347.     w=15
  348.     elseif myHero:GetSpellData(_W).level == 2 then
  349.     w=30
  350.     elseif myHero:GetSpellData(_W).level == 3 then
  351.     w=45
  352.     elseif myHero:GetSpellData(_W).level == 4 then
  353.     w=60
  354.     elseif myHero:GetSpellData(_W).level == 5 then
  355.     w=75   
  356.     end
  357.  
  358.  
  359.     if myHero:CanUseSpell(_Q) == READY then
  360.         for index, minion in pairs(enemyMinions.objects) do
  361.             if  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero) then
  362.                 CastSpell(_Q, minion)
  363.                 return
  364.             end
  365.            
  366.             if TargetHaveBuff("ireliahitenstylecharged", myHero) then
  367.             if  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero)+w then
  368.                 CastSpell(_Q, minion)
  369.                 return
  370.             end
  371.             end        
  372.         end
  373.     end
  374.    
  375.  
  376.     if myHero:CanUseSpell(_Q) == READY then
  377.         for index, minion in pairs(jungleMinions.objects) do
  378.             if  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero) and GetDistance(minion)< 600 then        
  379.                 CastSpell(_Q,minion)
  380.                 return
  381.             end
  382.         end
  383.     end
  384.    
  385.     if myHero:CanUseSpell(_Q) == READY then
  386.         for index, minion in pairs(jungleMinions.objects) do
  387.             if  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero)+w and GetDistance(minion)< 600 then
  388.             if TargetHaveBuff("ireliahitenstylecharged", myHero) then          
  389.                 CastSpell(_Q,minion)
  390.                 return
  391.             end
  392.             end
  393.         end
  394.     end    
  395.    
  396. end
  397.  
  398.  
  399.  
  400.  
  401. --[[    Parry   ]]--
  402. function PluginOnProcessSpell(unit, spell)
  403.     Target = AutoCarry.GetAttackTarget()
  404.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  405.     WREADY = (myHero:CanUseSpell(_W) == READY)
  406.     EREADY = (myHero:CanUseSpell(_E) == READY)
  407.     RREADY = (myHero:CanUseSpell(_R) == READY)
  408.  
  409.     if unit.isMe then
  410.         LastQ = os.clock()
  411.     end
  412.    
  413.     if AutoCarry.PluginMenu.autoParry and EREADY then
  414.         if unit and unit.type == myHero.type and spell.target == myHero then
  415.             for i=1, #Abilities do
  416.                 if (spell.name == Abilities[i] or spell.name:find(Abilities[i]) ~=
  417. nil) then
  418.                     if getDmg("AD", myHero, unit) >= (myHero.maxHealth*0.06) or
  419. getDmg("AD", myHero, unit) >= (myHero.health*0.04) and GetDistance(Target)<300 then
  420.                        
  421.                         if GetDistance(Target)<300 and EREADY and ((myHero.health / myHero.maxHealth) < (Target.health / Target.maxHealth)) then
  422.                         CastSpell(_E, Target)
  423.                         end
  424.                        
  425.                        
  426.                        
  427.                     end
  428.                 end
  429.             end
  430.         end
  431.     end
  432. end
  433.  
  434. Abilities = {
  435. "GarenSlash2", "SiphoningStrikeAttack", "LeonaShieldOfDaybreakAttack", "RenektonExecute",
  436. "ShyvanaDoubleAttackHit", "DariusNoxianTacticsONHAttack", "TalonNoxianDiplomacyAttack", "Parley", "MissFortuneRicochetShot", "RicochetAttack", "jaxrelentlessattack", "Attack"
  437. }
  438.  
  439.  
  440.  
  441.  
  442. function PluginOnDraw()
  443.     --> Ranges
  444.        if TargetHaveBuff("ireliahitenstylecharged", myHero) then
  445.         DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0xA0009E)
  446.        end
  447.  
  448.     DrawCircle(myHero.x, myHero.y, myHero.z, 650, 0x992D3D)
  449.     DrawCircle(myHero.x, myHero.y, myHero.z, 300, 0x992D3D)
  450.    
  451.     if myHero:GetSpellData(_W).level == 1 then
  452.     w=15
  453.     elseif myHero:GetSpellData(_W).level == 2 then
  454.     w=30
  455.     elseif myHero:GetSpellData(_W).level == 3 then
  456.     w=45
  457.     elseif myHero:GetSpellData(_W).level == 4 then
  458.     w=60
  459.     elseif myHero:GetSpellData(_W).level == 5 then
  460.     w=75   
  461.     end
  462.  
  463.  
  464.     if myHero:CanUseSpell(_Q) == READY then
  465.         for index, minion in pairs(enemyMinions.objects) do
  466.             if  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero) then
  467.                         for g = 0, 6 do
  468.                                 DrawCircle(minion.x, minion.y, minion.z,90 + g,255255255)
  469.                         end
  470.                 return
  471.             end
  472.            
  473.             if TargetHaveBuff("ireliahitenstylecharged", myHero) then
  474.             if  minion.health*1 <= getDmg("Q", minion, myHero)+getDmg("AD",minion,myHero)+w then
  475.                         for g = 0, 6 do
  476.                                 DrawCircle(minion.x, minion.y, minion.z,90 + g,255255255)
  477.                         end
  478.                 return
  479.             end
  480.             end    
  481.        -- DrawCircle(minion.x, minion.y, minion.z,80 + 255255255)  
  482.                
  483.         end
  484.     end
  485.  
  486.  
  487. end
  488.  
  489.  
  490. --> Main Load
  491. function mainLoad()
  492.    
  493.     qRange, wRange, rRange = 650, 900, 1100
  494.     QREADY, WREADY, RREADY = false, false, false
  495.     SkillQ = {spellKey = _Q, range = qRange, speed = 1.2, delay = 355, width = 75}
  496.     SkillQQ = {spellKey = _R, range = 1100, speed = 1.6, delay = 0, width = 75}
  497.     Cast = AutoCarry.CastSkillshot
  498.     Menu = AutoCarry.PluginMenu
  499.     Col = AutoCarry.GetCollision
  500. end
  501.  
  502. --> Main Menu
  503. function mainMenu()
  504.     AutoCarry.PluginMenu:addParam("autoParry", "Auto Parry", SCRIPT_PARAM_ONOFF, true)
  505.     Menu:addParam("Harass", "Use Q to Harass", SCRIPT_PARAM_ONOFF, true)
  506.     Menu:addParam("useRKS", "Use R to KS", SCRIPT_PARAM_ONOFF, true)
  507.     Menu:addParam("useR", "Use R", SCRIPT_PARAM_ONOFF, true)
  508.     Menu:addParam("autoks", "Auto Kill with Q", SCRIPT_PARAM_ONOFF, true)  
  509.     Menu:addParam("farm", "Q Farm", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("V"))
  510.     Menu:addParam("flee", "E to Flee", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("E"))
  511.     Menu:addParam("sflee", "Space to Flee", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  512.  
  513. end
  514.  
  515.  
  516.  
  517. --> Checks
  518. function Checks()
  519.     Target = AutoCarry.GetAttackTarget()
  520.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  521.     WREADY = (myHero:CanUseSpell(_W) == READY)
  522.     EREADY = (myHero:CanUseSpell(_E) == READY)
  523.     RREADY = (myHero:CanUseSpell(_R) == READY)
  524. end
  525.  
  526. --升級大招--
  527. function DodajUlti()
  528.  
  529.  
  530.     if myHero.level == 6 or myHero.level == 11 or myHero.level == 16 then
  531.       LevelSpell(_R)
  532.     end
  533.  
  534. end
Advertisement
Add Comment
Please, Sign In to add comment