roach_

[1.0c] SidasAutoCarryPlugin - Pantheon

Sep 26th, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.  
  3.         Auto Carry Plugin - Pantheon Edition
  4.         Author: Roach_
  5.         Version: 1.0c
  6.         Copyright 2013
  7.  
  8.         Dependency: Sida's Auto Carry: Revamped
  9.  
  10.         How to install:
  11.             Make sure you already have AutoCarry installed.
  12.             Name the script EXACTLY "SidasAutoCarryPlugin - Pantheon.lua" without the quotes.
  13.             Place the plugin in BoL/Scripts/Common folder.
  14.  
  15.         Features:
  16.             Combo with Autocarry
  17.             Fully supports E with movement/attack disable
  18.             Harass with Mixed Mode
  19.             Killsteal with Q/W
  20.             Draw Combo Range
  21.             Draw Critical Hit on Target
  22.             Escape Artist(with Flash)
  23.  
  24.         History:
  25.             Version: 1.0c
  26.                 Real fix for E.
  27.                 Fixed Killsteal.
  28.                 Hopefully fixed OnTick bugsplat.
  29.                 Removed Auto-Ignite, because it exists in SAC too.
  30.            
  31.             Version: 1.0b
  32.                 Temporarily fix for E.
  33.                 Fixed some bugsplats on draw.
  34.            
  35.             Version: 1.0a
  36.                 First release
  37. --]]
  38.  
  39. local target
  40.  
  41. function PluginOnLoad()
  42.     AutoCarry.PluginMenu:addParam("pCombo", "Use Combo With Auto Carry", SCRIPT_PARAM_ONOFF, true)
  43.     AutoCarry.PluginMenu:addParam("pHarass", "Harass with Mixed Mode", SCRIPT_PARAM_ONOFF, true)
  44.     AutoCarry.PluginMenu:addParam("pKillsteal", "Killsteal with Q/W", SCRIPT_PARAM_ONOFF, true)
  45.     AutoCarry.PluginMenu:addParam("pDCR", "Draw Combo Range", SCRIPT_PARAM_ONOFF, true)
  46.     AutoCarry.PluginMenu:addParam("pDCT", "Draw Crit Text", SCRIPT_PARAM_ONOFF, true)
  47.     AutoCarry.PluginMenu:addParam("pEscape", "Escape Artist", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
  48.     AutoCarry.PluginMenu:addParam("pEscapeFlash", "Escape: Flash to Mouse", SCRIPT_PARAM_ONOFF, false)
  49.    
  50.     AutoCarry.SkillsCrosshair.range = 600
  51.    
  52.     lastAnimation = "Run"
  53. end
  54.  
  55.  
  56. function PluginOnTick()
  57.     if isChanneling() then
  58.         AutoCarry.CanAttack = false
  59.         AutoCarry.CanMove = false
  60.     else
  61.         AutoCarry.CanAttack = true
  62.         AutoCarry.CanMove = true
  63.     end
  64.  
  65.     if AutoCarry.PluginMenu.pCombo and AutoCarry.MainMenu.AutoCarry then pCombo() end
  66.     if AutoCarry.PluginMenu.pHarass and AutoCarry.MainMenu.MixedMode then pHarass() end
  67.     if AutoCarry.PluginMenu.pKillsteal then pKillsteal() end
  68.     if AutoCarry.PluginMenu.pEscape then pEscapeCombo() end
  69.    
  70.     if not myHero.dead and AutoCarry.PluginMenu.pDCT then
  71.         for i=1, heroManager.iCount do
  72.             local enemydraw = heroManager:GetHero(i)
  73.            
  74.             if ValidTarget(enemydraw) then
  75.                 if(enemydraw.health/enemydraw.maxHealth*100 < 15) then
  76.                     PrintFloatText(Target, 0, "CRITICAL HIT")
  77.                 end
  78.             end
  79.         end
  80.     end
  81. end
  82.  
  83. function PluginOnDraw()
  84.     if not myHero.dead and AutoCarry.PluginMenu.pDCR then
  85.         DrawCircle(myHero.x, myHero.y, myHero.z, 600, 0x00FFFF)
  86.     end
  87. end
  88.  
  89. function PluginOnAnimation(unit, animationName)
  90.     if unit.isMe and lastAnimation ~= animationName then lastAnimation = animationName end
  91. end
  92.  
  93. --
  94.  
  95. function pCombo()
  96.     target = AutoCarry.GetAttackTarget()
  97.  
  98.     if ValidTarget(target) then
  99.         if myHero:CanUseSpell(_Q) == READY and GetDistance(target) < 600 then
  100.             CastSpell(_Q, target)
  101.         end
  102.        
  103.         if myHero:CanUseSpell(_W) == READY and GetDistance(target) < 600 then
  104.             CastSpell(_W, target)
  105.         end
  106.        
  107.         if myHero:CanUseSpell(_E) == READY and GetDistance(target) < 600 then
  108.             CastSpell(_E, target.x, target.z)
  109.         end
  110.     end
  111. end
  112.  
  113. function pHarass()
  114.     if ValidTarget(target) then
  115.         if myHero:CanUseSpell(_Q) == READY and myHero:CanUseSpell(_W) ~= READY and GetDistance(target) < 600 then
  116.             CastSpell(_Q, target)
  117.         elseif myHero:CanUseSpell(_W) == READY and myHero:CanUseSpell(_Q) ~= READY and GetDistance(target) < 600 then
  118.             CastSpell(_Q, target)
  119.         end
  120.     end
  121. end
  122.  
  123. function pKillsteal()
  124.     for _, enemy in pairs(AutoCarry.EnemyTable) do
  125.         if myHero:CanUseSpell(_Q) == READY then
  126.             if ValidTarget(enemy) and GetDistance(enemy) < 600 and enemy.health < getDmg("Q", enemy, myHero) then
  127.                 CastSpell(_Q, enemy)
  128.             end
  129.         end
  130.     end
  131. end
  132.  
  133. function pEscapeCombo()
  134.     local FlashSlot
  135.  
  136.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then
  137.         FlashSlot = SUMMONER_1
  138.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then
  139.         FlashSlot = SUMMONER_2
  140.     end
  141.    
  142.     --
  143.    
  144.     if myHero:CanUseSpell(_W) == READY then
  145.         CastSpell(_W, target)
  146.     end
  147.  
  148.     if AutoCarry.PluginMenu.pEscapeFlash and FlashSlot ~= nil and myHero:CanUseSpell(FlashSlot) == READY and GetDistance(mousePos) > 300 then
  149.         CastSpell(FlashSlot, mousePos.x, mousePos.z)
  150.     end
  151.  
  152.     if AutoCarry.PluginMenu.pEscapeFlash then
  153.         myHero:MoveTo(mousePos.x, mousePos.z)
  154.     end
  155. end
  156.  
  157. function isChanneling()
  158.     if lastAnimation == "Spell3" then
  159.         return true
  160.     else
  161.         return false
  162.     end
  163. end
Advertisement
Add Comment
Please, Sign In to add comment