Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 11th, 2014  |  syntax: None  |  size: 10.54 KB  |  views: 66  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --[[
  2.  
  3.                         Auto Carry Plugin - Soraka: The Starchild
  4.                                 Author: KRU3L420
  5.                                 Version: See version variables below.
  6.                                 Copyright 2014
  7.  
  8.                         Dependency: Sida's Auto Carry: Reborn
  9.  
  10.                         How to install:
  11.                                 Make sure you already have AutoCarry installed.
  12.                                 Name the script EXACTLY "SidasAutoCarryPlugin - Soraka.lua" without the quotes.
  13.                                 Place the Plugin in BoL/Scripts/Common folder.
  14.  
  15.                         Features:
  16.                                 Harass with HotKey (Default A) - Also moves to cursor.
  17.                                 Cast Q when enemy in range, with Auto Carry, and Mixed modes.
  18.                                 Killsteal ability with Q+E. Casts Q+E when it can KILL the enemy.
  19.                                 Used with Soraka Slack to Auto Q+E Team Members.(Will be added next release!) - http://botoflegends.com/forum/topic/1931-soraka-slack/
  20.                                    
  21.                
  22.                         Download:
  23.                                 Version History:
  24.                                         Version: 1.02
  25.                                                 Added: Auto-Q Enemy in Auto Carry, and Mixed modes.
  26.                                                 Added: HotKey to Harass with Q, also moves to cursor.
  27.                                                 Added: Kill Steal with Q+E
  28.                                         Version: 1.01
  29.                                                 Removed: Damage Check for Astral Blessing(W)
  30.                                         Version: 1.00
  31.                         Release        
  32. --]]
  33.  
  34. if myHero.charName ~= "Soraka" then return end
  35.  
  36. local QReady, WReady, EReady, RReady, IGNITEReady, EXHAUSTReady = nil, nil, nil, nil, nil, nil
  37. local RangeQ, RangeW, RangeE = 530, 750, 725
  38. local IGNITESlot, EXHAUSTSlot = nil, nil
  39. local ts
  40. local allyTable
  41. local enemyTable
  42. local abilitySequence
  43. local qOff, wOff, eOff, rOff = 0,0,0,0
  44. local ToInterrupt = {}
  45. local InterruptList = {
  46.     { charName = "Caitlyn", spellName = "CaitlynAceintheHole"},
  47.     { charName = "FiddleSticks", spellName = "Crowstorm"},
  48.     { charName = "FiddleSticks", spellName = "DrainChannel"},
  49.     { charName = "Galio", spellName = "GalioIdolOfDurand"},
  50.     { charName = "Karthus", spellName = "FallenOne"},
  51.     { charName = "Katarina", spellName = "KatarinaR"},
  52.     { charName = "Malzahar", spellName = "AlZaharNetherGrasp"},
  53.     { charName = "MissFortune", spellName = "MissFortuneBulletTime"},
  54.     { charName = "Nunu", spellName = "AbsoluteZero"},
  55.     { charName = "Pantheon", spellName = "Pantheon_GrandSkyfall_Jump"},
  56.     { charName = "Shen", spellName = "ShenStandUnited"},
  57.     { charName = "Urgot", spellName = "UrgotSwap2"},
  58.     { charName = "Varus", spellName = "VarusQ"},
  59.     { charName = "Warwick", spellName = "InfiniteDuress"}
  60. }
  61. local priorityTable = {
  62.         AP = {
  63.                 "Annie", "Ahri", "Akali", "Anivia", "Annie", "Brand", "Cassiopeia", "Diana", "Evelynn", "FiddleSticks", "Fizz", "Gragas", "Heimerdinger", "Karthus",
  64.                 "Kassadin", "Katarina", "Kayle", "Kennen", "Leblanc", "Lissandra", "Lux", "Malzahar", "Mordekaiser", "Morgana", "Nidalee", "Orianna",
  65.                 "Rumble", "Ryze", "Sion", "Swain", "Syndra", "Teemo", "TwistedFate", "Veigar", "Viktor", "Vladimir", "Xerath", "Ziggs", "Zyra", "MasterYi", "Yasuo",
  66.         },
  67.         Support = {
  68.                 "Alistar", "Blitzcrank", "Janna", "Karma", "Leona", "Lulu", "Nami", "Nunu", "Sona", "Soraka", "Taric", "Thresh", "Zilean",
  69.         },
  70.  
  71.         Tank = {
  72.                 "Amumu", "Chogath", "DrMundo", "Galio", "Hecarim", "Malphite", "Maokai", "Nasus", "Rammus", "Sejuani", "Shen", "Singed", "Skarner", "Volibear",
  73.                 "Warwick", "Yorick", "Zac",
  74.         },
  75.  
  76.         AD_Carry = {
  77.                 "Ashe", "Caitlyn", "Corki", "Draven", "Ezreal", "Graves", "Jayce", "KogMaw", "Lucian", "MissFortune", "Pantheon", "Quinn", "Shaco", "Sivir",
  78.                 "Talon", "Tristana", "Twitch", "Urgot", "Varus", "Vayne", "Zed", "Lucian", "Jinx", "Yasuo",
  79.         },
  80.  
  81.         Bruiser = {
  82.                 "Aatrox", "Darius", "Elise", "Fiora", "Gangplank", "Garen", "Irelia", "JarvanIV", "Jax", "Khazix", "LeeSin", "Nautilus", "Nocturne", "Olaf", "Poppy",
  83.                 "Renekton", "Rengar", "Riven", "Shyvana", "Trundle", "Tryndamere", "Udyr", "Vi", "MonkeyKing", "XinZhao",
  84.         },
  85. }
  86.  
  87. function PluginOnLoad()
  88.         AutoCarry.PluginMenu:addParam("combo", "Silence/Exhaust/Attack Target", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  89.         AutoCarry.PluginMenu:addParam("interrupt", "Interrupt with E", SCRIPT_PARAM_ONOFF, true)
  90.         AutoCarry.PluginMenu:addParam("printInterrupt", "Print Interrupts", SCRIPT_PARAM_ONOFF, true)
  91.         AutoCarry.PluginMenu:addParam("autoIGN", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  92.         AutoCarry.PluginMenu:addParam("useQ", "Use Q to harass", SCRIPT_PARAM_ONOFF, true)
  93.         AutoCarry.PluginMenu:addParam("useW", "Use W", SCRIPT_PARAM_ONOFF, true)
  94.         AutoCarry.PluginMenu:addParam("useE", "Use E on ally", SCRIPT_PARAM_ONOFF, true)
  95.         AutoCarry.PluginMenu:addParam("minEmana", "Min. E ally mana", SCRIPT_PARAM_SLICE, 50, 0, 100, 0)
  96.         AutoCarry.PluginMenu:addParam("autoR", "Use R", SCRIPT_PARAM_ONOFF, true)
  97.         AutoCarry.PluginMenu:addParam("minRhealth", "Min. R health limit", SCRIPT_PARAM_SLICE, 15, 0, 100, 0)
  98.         AutoCarry.PluginMenu:permaShow("combo")
  99.  
  100.         ts = TargetSelector(TARGET_PRIORITY, RangeE, DAMAGE_MAGIC)
  101.         ts.name = "Soraka"
  102.         AutoCarry.PluginMenu:addTS(ts)
  103.  
  104.         IGNITESlot = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") and SUMMONER_2) or nil)
  105.         EXHAUSTSlot = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerExhaust") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerExhaust") and SUMMONER_2) or nil)
  106.        
  107.         allyTable = GetAllyHeroes()
  108.         table.insert(allyTable, myHero)
  109.  
  110.         enemyTable = GetEnemyHeroes()
  111.  
  112.         for _, enemy in pairs(enemyTable) do
  113.                 for _, champ in pairs(InterruptList) do
  114.                         if enemy.charName == champ.charName then
  115.                                 table.insert(ToInterrupt, champ.spellName)
  116.                         end
  117.                 end
  118.         end
  119.         if heroManager.iCount < 10 then -- borrowed from Sidas Auto Carry
  120.                 PrintChat(" >> Too few champions to arrange priority")
  121.         else
  122.                 arrangePrioritys()
  123.         end
  124. -- Auto Level Skills
  125.     local champ = player.charName
  126.     if champ == "Soraka" then       abilitySequence = { 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 4, 2, 3, 2, 3, 4, 2, 3, }
  127.     else PrintChat(string.format(" >> AutoLevel disabled for %s", champ))
  128.     end
  129.     if abilitySequence and #abilitySequence == 18 then
  130.         PrintChat(" >> Soraka Auto Leveler Activated")
  131.     else
  132.         PrintChat(" >> Error")
  133.         OnTick = function() end
  134.         return
  135.     end
  136. end
  137.  
  138. function PluginOnTick()
  139.     local qL, wL, eL, rL = player:GetSpellData(_Q).level + qOff, player:GetSpellData(_W).level + wOff, player:GetSpellData(_E).level + eOff, player:GetSpellData(_R).level + rOff
  140.     if qL + wL + eL + rL < player.level then
  141.         local spellSlot = { SPELL_1, SPELL_2, SPELL_3, SPELL_4, }
  142.         local level = { 0, 0, 0, 0 }
  143.         for i = 1, player.level, 1 do
  144.             level[abilitySequence[i]] = level[abilitySequence[i]] + 1
  145.         end
  146.         for i, v in ipairs({ qL, wL, eL, rL }) do
  147.             if v < level[i] then LevelSpell(spellSlot[i]) end
  148.         end
  149.         CDHandler()
  150.         if AutoCarry.PluginMenu.autoIGN then AutoIgnite() end
  151.         if AutoCarry.PluginMenu.autoR then CastR() end
  152.         if AutoCarry.PluginMenu.useW then CastW() end
  153.         if AutoCarry.PluginMenu.useQ then CastQ() end
  154.         if AutoCarry.PluginMenu.useE and not AutoCarry.PluginMenu.combo then CastE() end
  155.         if AutoCarry.PluginMenu.combo then Combo() end
  156.         end
  157. end
  158.  
  159. function CastR()
  160.         if not RReady then return end
  161.  
  162.         for i=1, #allyTable do
  163.                 local Ally = allyTable[i]
  164.  
  165.                 if Ally.health/Ally.maxHealth <= AutoCarry.PluginMenu.minRhealth/100 then
  166.                         CastSpell(_R)
  167.                 end
  168.         end
  169. end
  170.  
  171. function CastW()
  172.         if not WReady then return end
  173.  
  174.         local HealAmount = myHero:GetSpellData(_W).level*70 + myHero.ap*0.45
  175.         local LowestHealth = nil
  176.  
  177.         for i=1, #allyTable do
  178.                 local Ally = allyTable[i]
  179.  
  180.                 if LowestHealth and LowestHealth.valid and Ally and Ally.valid then
  181.                         if Ally.health < LowestHealth.health and RangeW >= myHero:GetDistance(Ally) and (Ally.health + HealAmount) <= Ally.maxHealth then
  182.                                 LowestHealth = Ally
  183.                         end
  184.                 else
  185.                         LowestHealth = Ally
  186.                 end
  187.         end
  188.  
  189.         if LowestHealth and LowestHealth.valid and RangeW >= myHero:GetDistance(LowestHealth) and (LowestHealth.health + HealAmount) <= LowestHealth.maxHealth then
  190.                 CastSpell(_W, LowestHealth)
  191.         end
  192. end
  193.  
  194. function CastQ()
  195.         if not QReady then return end
  196.  
  197.         for i=1, #enemyTable do
  198.                 local Enemy = enemyTable[i]
  199.  
  200.                 if ValidTarget(Enemy, RangeQ) then
  201.                         CastSpell(_Q)
  202.                 end
  203.         end
  204. end
  205.  
  206. function CastE()
  207.         if not EReady then return end
  208.  
  209.         local LowestMana = nil
  210.  
  211.         for i=1, #allyTable do
  212.                 local Ally = allyTable[i]
  213.  
  214.                 if LowestMana and LowestMana.valid and Ally and Ally.valid then
  215.                         if Ally.mana < LowestMana.mana and RangeE >= myHero:GetDistance(Ally) and myHero.networkID ~= Ally.networkID then
  216.                                 LowestMana = Ally
  217.                         end
  218.                 else
  219.                         LowestMana = Ally
  220.                 end
  221.         end
  222.  
  223.         if LowestMana and LowestMana.valid and RangeE >= myHero:GetDistance(LowestMana) and LowestMana.mana/LowestMana.maxMana <= AutoCarry.PluginMenu.minEmana/100 then CastSpell(_E, LowestMana) end
  224. end
  225.  
  226. function Combo()
  227.         ts:update()
  228.         if not ts.target then return end
  229.  
  230.         if ValidTarget(ts.target, RangeE) then
  231.                 if QReady then CastSpell(_Q) end
  232.                 if EReady then CastSpell(_E, ts.target) end
  233.                 if EXHAUSTReady and myHero:GetDistance(ts.target) <= 550 then CastSpell(EXHAUSTSlot, ts.target) end
  234.                 if (myHero.range + myHero:GetDistance(myHero.minBBox)) >= myHero:GetDistance(ts.target) then myHero:Attack(ts.target) end
  235.         end
  236. end
  237.  
  238. function OnProcessSpell(unit, spell)
  239.         if #ToInterrupt > 0 and AutoCarry.PluginMenu.interrupt and EReady then
  240.                 for _, ability in pairs(ToInterrupt) do
  241.                         if spell.name == ability and unit.team ~= myHero.team then
  242.                                 if RangeE >= myHero:GetDistance(unit) then
  243.                                         CastSpell(_E, unit)
  244.                                         if AutoCarry.PluginMenu.printInterrupt then print("Tried to interrupt " .. spell.name) end
  245.                                 end
  246.                         end
  247.                 end
  248.         end
  249. end
  250.  
  251. function CDHandler()
  252.         QReady = (myHero:CanUseSpell(_Q) == READY)
  253.         WReady = (myHero:CanUseSpell(_W) == READY)
  254.         EReady = (myHero:CanUseSpell(_E) == READY)
  255.         RReady = (myHero:CanUseSpell(_R) == READY)
  256.         IGNITEReady = (IGNITESlot ~= nil and myHero:CanUseSpell(IGNITESlot) == READY)
  257.         EXHAUSTReady = (EXHAUSTSlot ~= nil and myHero:CanUseSpell(EXHAUSTSlot) == READY)
  258. end
  259.  
  260. function AutoIgnite()
  261.         if not IGNITEReady then return end
  262.  
  263.         for i=1, #enemyTable do
  264.                 local Enemy = enemyTable[i]
  265.  
  266.                 if ValidTarget(Enemy, 600) then
  267.                         if getDmg("IGNITE", Enemy, myHero) >= Enemy.health then
  268.                                 CastSpell(IGNITESlot, Enemy)
  269.                         end
  270.                 end
  271.         end
  272. end
  273.  
  274. function SetPriority(table, hero, priority)
  275.         for i=1, #table, 1 do
  276.                 if hero.charName:find(table[i]) ~= nil then
  277.                         TS_SetHeroPriority(priority, hero.charName)
  278.                 end
  279.         end
  280. end
  281.  
  282. function arrangePrioritys()
  283.         for i, enemy in ipairs(enemyTable) do
  284.                 SetPriority(priorityTable.AD_Carry, enemy, 1)
  285.                 SetPriority(priorityTable.AP, enemy, 2)
  286.                 SetPriority(priorityTable.Support, enemy, 3)
  287.                 SetPriority(priorityTable.Bruiser, enemy, 4)
  288.                 SetPriority(priorityTable.Tank, enemy, 5)
  289.         end
  290. end