roach_

[1.1c] SidasAutoCarryPlugin - Pantheon

Oct 5th, 2013
604
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.1c
  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 or W+Q
  20.             Draw Combo Range
  21.             Draw Critical Hit on Target
  22.             Escape Artist(with Flash)
  23.  
  24.         History:
  25.             Version: 1.1c
  26.                 Added Chase Combo
  27.                 Fixed a bug where E was not casting
  28.                 Changed Plugin Menu
  29.                 Added a Mini-Menu
  30.                 Fixed "Draw Crit Text"
  31.        
  32.             Version: 1.1b
  33.                 Auto combo after Ultimate. (With a check!)
  34.                 Toggle for Auto Q Harass when in enemy range , with a mana check. (You will harass them until you'll have Mana for one last Combo)
  35.        
  36.             Version: 1.1a
  37.                 Optimised Escape Artist
  38.                 Optimised Killsteal(You can KS with Q+W)
  39.                 Fixed Ultimate Bugsplat(TESTED)
  40.                 Fixed Mixed Mode Harass
  41.                 Re-wrote majority of the Functions
  42.                 Hopefully fixed DCT(Draw Critical Text)
  43.                 Changed Circle's Color(Range Circle)
  44.                 Speeded-Up the Script(Some FPS Drops on Escape Artist and Ultimate)
  45.                
  46.             Version: 1.0d
  47.                 Fixed Escape Artist
  48.                 Fixed a problem with Flash, it was flashing before Stunning the enemy
  49.                 Optimised Escape Artist
  50.                 Fully removed Auto-Ignite
  51.                 Fixed all the Bugsplats (TESTED)
  52.                 Hopefully fixed Mixed Mode Harass
  53.                
  54.             Version: 1.0c
  55.                 Real fix for E.
  56.                 Fixed Killsteal.
  57.                 Hopefully fixed OnTick bugsplat.
  58.                 Removed Auto-Ignite, because it exists in SAC too.
  59.            
  60.             Version: 1.0b
  61.                 Temporarily fix for E.
  62.                 Fixed some bugsplats on draw.
  63.            
  64.             Version: 1.0a
  65.                 First release
  66. --]]
  67. if myHero.charName ~= "Pantheon" then return end
  68.  
  69. local Target
  70. local pEscapeHotkey = string.byte("T")
  71. local pChaseComboHotkey = string.byte("N")
  72.  
  73. -- Prediction
  74. local qwRange, eRange = 600, 300
  75.  
  76. local FlashSlot = nil
  77.  
  78. local SkillQ = {spellKey = _Q, range = cRange, speed = 2, delay = 0, width = 200, configName = "spearShot", displayName = "Q (Spear Shot)", enabled = true, skillShot = false, minions = false, reset = false, reqTarget = true }
  79. local SkillW = {spellKey = _W, range = cRange, speed = 2, delay = 0, width = 200, configName = "AoZ", displayName = "W (Aegis of Zeonia)", enabled = true, skillShot = false, minions = false, reset = false, reqTarget = true }
  80. local SkillE = {spellKey = _E, range = eRange, speed = 2, delay = 0, width = 200, configName = "heartseekerStrike", displayName = "E (Heartseeker Strike)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = true }
  81.  
  82. local QReady, WReady, EReady, RReady, FlashReady = false, false, false, false, false
  83.  
  84. function PluginOnLoad()
  85.     -- Params/PluginMenu
  86.     AutoCarry.PluginMenu:addParam("pPlugin", "[Pantheon Plugin Options]", SCRIPT_PARAM_INFO, "")
  87.     AutoCarry.PluginMenu:addParam("pCombo", "Use Combo With Auto Carry", SCRIPT_PARAM_ONOFF, true)
  88.     AutoCarry.PluginMenu:addParam("pChaseCombo", "Use Chase Combo", SCRIPT_PARAM_ONKEYDOWN, false, pChaseComboHotkey)
  89.     AutoCarry.PluginMenu:addParam("pHarass", "Harass with Mixed Mode", SCRIPT_PARAM_ONOFF, true)
  90.     AutoCarry.PluginMenu:addParam("pUltCombo", "Auto-Combo After Ultimate", SCRIPT_PARAM_ONOFF, false)
  91.     AutoCarry.PluginMenu:addParam("pKillsteal", "Killsteal with Q/W/W+Q", SCRIPT_PARAM_ONOFF, true)
  92.     AutoCarry.PluginMenu:addParam("pDCR", "Draw Combo Range", SCRIPT_PARAM_ONOFF, true)
  93.     AutoCarry.PluginMenu:addParam("pDCT", "Draw Crit Text", SCRIPT_PARAM_ONOFF, true)
  94.     AutoCarry.PluginMenu:addParam("pEscape", "Escape Artist", SCRIPT_PARAM_ONKEYDOWN, false, pEscapeHotkey)
  95.     AutoCarry.PluginMenu:addParam("pEscapeFlash", "Escape: Flash to Mouse", SCRIPT_PARAM_ONOFF, false)
  96.    
  97.     -- Params/Mini-Menu
  98.     AutoCarry.PluginMenu:permaShow("pCombo")
  99.     AutoCarry.PluginMenu:permaShow("pHarass")
  100.     AutoCarry.PluginMenu:permaShow("pUltCombo")
  101.     AutoCarry.PluginMenu:permaShow("pKillsteal")
  102.     AutoCarry.PluginMenu:permaShow("pEscape")
  103.    
  104.     -- Range
  105.     AutoCarry.SkillsCrosshair.range = qwRange
  106.    
  107.     lastAnimation = nil
  108. end
  109.  
  110.  
  111. function PluginOnTick()
  112.     -- Get Attack Target
  113.     Target = AutoCarry.GetAttackTarget()
  114.  
  115.     -- Check Spells
  116.     pSpellCheck()
  117.  
  118.     -- Check if myHero is using _E
  119.     if isChanneling("Spell3") then
  120.         AutoCarry.CanAttack = false
  121.         AutoCarry.CanMove = false
  122.     else
  123.         AutoCarry.CanAttack = true
  124.         AutoCarry.CanMove = true
  125.     end
  126.  
  127.     -- Combo, Harass, Killsteal, Escape Combo - Checks
  128.     if AutoCarry.PluginMenu.pCombo and AutoCarry.MainMenu.AutoCarry then pCombo() end
  129.     if AutoCarry.PluginMenu.pChaseCombo then pChaseCombo() end
  130.     if AutoCarry.PluginMenu.pHarass and AutoCarry.MainMenu.MixedMode then pHarass() end
  131.     if AutoCarry.PluginMenu.pUltCombo then pUltCombo() end
  132.     if AutoCarry.PluginMenu.pKillsteal then pKillsteal() end
  133.     if AutoCarry.PluginMenu.pEscape then pEscapeCombo() end
  134.    
  135.     -- Draw Critical Text
  136.     if not myHero.dead and AutoCarry.PluginMenu.pDCT then pDrawCritText() end
  137. end
  138.  
  139. function PluginOnDraw()
  140.     -- Draw Panth's Range = 600
  141.     if not myHero.dead and AutoCarry.PluginMenu.pDCR then
  142.         DrawCircle(myHero.x, myHero.y, myHero.z, qwRange, 0x00FF00)
  143.     end
  144. end
  145.  
  146. function PluginOnAnimation(unit, animationName)
  147.     -- Set lastAnimation = Last Animation used
  148.     if unit.isMe and lastAnimation ~= animationName then lastAnimation = animationName end
  149. end
  150.  
  151. -- Custom Functions
  152. function pCombo()
  153.     if ValidTarget(Target) then
  154.         if QReady and GetDistance(Target) < qwRange then
  155.             CastSpell(SkillQ.spellKey, Target)
  156.         end
  157.        
  158.         if WReady and GetDistance(Target) < qwRange then
  159.             CastSpell(SkillW.spellKey, Target)
  160.         end
  161.        
  162.         if EReady and GetDistance(Target) < eRange then
  163.             AutoCarry.CastSkillshot(SkillE, Target)
  164.         end
  165.     end
  166. end
  167.  
  168. function pHarass()
  169.     if ValidTarget(Target) then
  170.         if QReady and GetDistance(Target) < qwRange and (myHero.mana > (45+55+40+(GetSpellData(_E).level*5))) then
  171.             CastSpell(SkillQ.spellKey, Target)
  172.             myHero:Attack(Target)
  173.         end
  174.     end
  175. end
  176.  
  177. function pChaseCombo()
  178.     if ValidTarget(Target) then
  179.         if WReady and GetDistance(Target) < qwRange then
  180.             CastSpell(SkillW.spellKey, Target)
  181.         end
  182.        
  183.         if EReady and GetDistance(Target) < eRange and isChanneling("Spell2") then
  184.             AutoCarry.CastSkillshot(SkillE, Target)
  185.         end
  186.        
  187.         if QReady and GetDistance(Target) < qwRange and isChanneling("Spell3") then
  188.             CastSpell(SkillQ.spellKey, Target)
  189.         end
  190.     end
  191. end
  192.  
  193. function pUltCombo()
  194.     if isChanneling("Spell4") then pCombo() end
  195. end
  196.  
  197. function pKillsteal()
  198.     for _, enemy in pairs(AutoCarry.EnemyTable) do
  199.         if QReady and WReady then
  200.             if ValidTarget(enemy) and GetDistance(enemy) < qwRange and enemy.health < (getDmg("Q", enemy, myHero) + getDmg("W", enemy, myHero)) then
  201.                 CastSpell(SkillW.spellKey, enemy)
  202.                 if isChanneling("Spell2") then CastSpell(SkillQ.spellKey, enemy) end
  203.             end
  204.         elseif not QReady and WReady then
  205.             if ValidTarget(enemy) and GetDistance(enemy) < qwRange and enemy.health < getDmg("W", enemy, myHero) then
  206.                 CastSpell(SkillW.spellKey, enemy)
  207.             end
  208.         elseif QReady and not WReady then
  209.             if ValidTarget(enemy) and GetDistance(enemy) < qwRange and enemy.health < getDmg("Q", enemy, myHero) then
  210.                 CastSpell(SkillQ.spellKey, enemy)
  211.             end
  212.         end
  213.     end
  214. end
  215.  
  216. function pEscapeCombo()
  217.     if WReady and GetDistance(Target) < qwRange then
  218.         CastSpell(SkillW.spellKey, Target)
  219.         if AutoCarry.PluginMenu.pEscapeFlash and FlashReady and GetDistance(mousePos) > 300 and isChanneling("Spell2") then
  220.             CastSpell(FlashSlot, mousePos.x, mousePos.z)
  221.         end
  222.     end
  223.    
  224.     if AutoCarry.PluginMenu.pEscapeFlash then
  225.         myHero:MoveTo(mousePos.x, mousePos.z)
  226.     end
  227. end
  228.  
  229. function isChanneling(animationName)
  230.     if lastAnimation == animationName then
  231.         return true
  232.     else
  233.         return false
  234.     end
  235. end
  236.  
  237. function pSpellCheck()
  238.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then
  239.         FlashSlot = SUMMONER_1
  240.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then
  241.         FlashSlot = SUMMONER_2
  242.     end
  243.  
  244.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  245.     WReady = (myHero:CanUseSpell(SkillW.spellKey) == READY)
  246.     EReady = (myHero:CanUseSpell(SkillE.spellKey) == READY)
  247.     RReady = (myHero:CanUseSpell(_R) == READY)
  248.  
  249.     FlashReady = (FlashSlot ~= nil and myHero:CanUseSpell(FlashSlot) == READY)
  250. end
  251.  
  252. function pDrawCritText()
  253.     for _, enemy in pairs(AutoCarry.EnemyTable) do
  254.         if ValidTarget(enemy) then
  255.             if enemy.health <= enemy.maxHealth*0.15 then
  256.                 PrintFloatText(enemy, 10, "CRITICAL HIT!")
  257.             end
  258.         end
  259.     end
  260. end
Advertisement
Add Comment
Please, Sign In to add comment