Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Auto Carry Plugin - Soraka: The Starchild
- Author: KRU3L420
- Version: See version variables below.
- Copyright 2014
- Dependency: Sida's Auto Carry: Reborn
- How to install:
- Make sure you already have AutoCarry installed.
- Name the script EXACTLY "SidasAutoCarryPlugin - Soraka.lua" without the quotes.
- Place the Plugin in BoL/Scripts/Common folder.
- Features:
- Harass with HotKey (Default A) - Also moves to cursor.
- Cast Q when enemy in range, with Auto Carry, and Mixed modes.
- Killsteal ability with Q+E. Casts Q+E when it can KILL the enemy.
- Used with Soraka Slack to Auto Q+E Team Members.(Will be added next release!) - http://botoflegends.com/forum/topic/1931-soraka-slack/
- Download:
- Version History:
- Version: 1.02
- Added: Auto-Q Enemy in Auto Carry, and Mixed modes.
- Added: HotKey to Harass with Q, also moves to cursor.
- Added: Kill Steal with Q+E
- Version: 1.01
- Removed: Damage Check for Astral Blessing(W)
- Version: 1.00
- Release
- --]]
- if myHero.charName ~= "Soraka" then return end
- local QReady, WReady, EReady, RReady, IGNITEReady, EXHAUSTReady = nil, nil, nil, nil, nil, nil
- local RangeQ, RangeW, RangeE = 530, 750, 725
- local IGNITESlot, EXHAUSTSlot = nil, nil
- local ts
- local allyTable
- local enemyTable
- local abilitySequence
- local qOff, wOff, eOff, rOff = 0,0,0,0
- local ToInterrupt = {}
- local InterruptList = {
- { charName = "Caitlyn", spellName = "CaitlynAceintheHole"},
- { charName = "FiddleSticks", spellName = "Crowstorm"},
- { charName = "FiddleSticks", spellName = "DrainChannel"},
- { charName = "Galio", spellName = "GalioIdolOfDurand"},
- { charName = "Karthus", spellName = "FallenOne"},
- { charName = "Katarina", spellName = "KatarinaR"},
- { charName = "Malzahar", spellName = "AlZaharNetherGrasp"},
- { charName = "MissFortune", spellName = "MissFortuneBulletTime"},
- { charName = "Nunu", spellName = "AbsoluteZero"},
- { charName = "Pantheon", spellName = "Pantheon_GrandSkyfall_Jump"},
- { charName = "Shen", spellName = "ShenStandUnited"},
- { charName = "Urgot", spellName = "UrgotSwap2"},
- { charName = "Varus", spellName = "VarusQ"},
- { charName = "Warwick", spellName = "InfiniteDuress"}
- }
- local priorityTable = {
- AP = {
- "Annie", "Ahri", "Akali", "Anivia", "Annie", "Brand", "Cassiopeia", "Diana", "Evelynn", "FiddleSticks", "Fizz", "Gragas", "Heimerdinger", "Karthus",
- "Kassadin", "Katarina", "Kayle", "Kennen", "Leblanc", "Lissandra", "Lux", "Malzahar", "Mordekaiser", "Morgana", "Nidalee", "Orianna",
- "Rumble", "Ryze", "Sion", "Swain", "Syndra", "Teemo", "TwistedFate", "Veigar", "Viktor", "Vladimir", "Xerath", "Ziggs", "Zyra", "MasterYi", "Yasuo",
- },
- Support = {
- "Alistar", "Blitzcrank", "Janna", "Karma", "Leona", "Lulu", "Nami", "Nunu", "Sona", "Soraka", "Taric", "Thresh", "Zilean",
- },
- Tank = {
- "Amumu", "Chogath", "DrMundo", "Galio", "Hecarim", "Malphite", "Maokai", "Nasus", "Rammus", "Sejuani", "Shen", "Singed", "Skarner", "Volibear",
- "Warwick", "Yorick", "Zac",
- },
- AD_Carry = {
- "Ashe", "Caitlyn", "Corki", "Draven", "Ezreal", "Graves", "Jayce", "KogMaw", "Lucian", "MissFortune", "Pantheon", "Quinn", "Shaco", "Sivir",
- "Talon", "Tristana", "Twitch", "Urgot", "Varus", "Vayne", "Zed", "Lucian", "Jinx", "Yasuo",
- },
- Bruiser = {
- "Aatrox", "Darius", "Elise", "Fiora", "Gangplank", "Garen", "Irelia", "JarvanIV", "Jax", "Khazix", "LeeSin", "Nautilus", "Nocturne", "Olaf", "Poppy",
- "Renekton", "Rengar", "Riven", "Shyvana", "Trundle", "Tryndamere", "Udyr", "Vi", "MonkeyKing", "XinZhao",
- },
- }
- function PluginOnLoad()
- AutoCarry.PluginMenu:addParam("combo", "Silence/Exhaust/Attack Target", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- AutoCarry.PluginMenu:addParam("interrupt", "Interrupt with E", SCRIPT_PARAM_ONOFF, true)
- AutoCarry.PluginMenu:addParam("printInterrupt", "Print Interrupts", SCRIPT_PARAM_ONOFF, true)
- AutoCarry.PluginMenu:addParam("autoIGN", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
- AutoCarry.PluginMenu:addParam("useQ", "Use Q to harass", SCRIPT_PARAM_ONOFF, true)
- AutoCarry.PluginMenu:addParam("useW", "Use W", SCRIPT_PARAM_ONOFF, true)
- AutoCarry.PluginMenu:addParam("useE", "Use E on ally", SCRIPT_PARAM_ONOFF, true)
- AutoCarry.PluginMenu:addParam("minEmana", "Min. E ally mana", SCRIPT_PARAM_SLICE, 50, 0, 100, 0)
- AutoCarry.PluginMenu:addParam("autoR", "Use R", SCRIPT_PARAM_ONOFF, true)
- AutoCarry.PluginMenu:addParam("minRhealth", "Min. R health limit", SCRIPT_PARAM_SLICE, 15, 0, 100, 0)
- AutoCarry.PluginMenu:permaShow("combo")
- ts = TargetSelector(TARGET_PRIORITY, RangeE, DAMAGE_MAGIC)
- ts.name = "Soraka"
- AutoCarry.PluginMenu:addTS(ts)
- IGNITESlot = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") and SUMMONER_2) or nil)
- EXHAUSTSlot = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerExhaust") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerExhaust") and SUMMONER_2) or nil)
- allyTable = GetAllyHeroes()
- table.insert(allyTable, myHero)
- enemyTable = GetEnemyHeroes()
- for _, enemy in pairs(enemyTable) do
- for _, champ in pairs(InterruptList) do
- if enemy.charName == champ.charName then
- table.insert(ToInterrupt, champ.spellName)
- end
- end
- end
- if heroManager.iCount < 10 then -- borrowed from Sidas Auto Carry
- PrintChat(" >> Too few champions to arrange priority")
- else
- arrangePrioritys()
- end
- -- Auto Level Skills
- local champ = player.charName
- if champ == "Soraka" then abilitySequence = { 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 4, 2, 3, 2, 3, 4, 2, 3, }
- else PrintChat(string.format(" >> AutoLevel disabled for %s", champ))
- end
- if abilitySequence and #abilitySequence == 18 then
- PrintChat(" >> Soraka Auto Leveler Activated")
- else
- PrintChat(" >> Error")
- OnTick = function() end
- return
- end
- end
- function PluginOnTick()
- 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
- if qL + wL + eL + rL < player.level then
- local spellSlot = { SPELL_1, SPELL_2, SPELL_3, SPELL_4, }
- local level = { 0, 0, 0, 0 }
- for i = 1, player.level, 1 do
- level[abilitySequence[i]] = level[abilitySequence[i]] + 1
- end
- for i, v in ipairs({ qL, wL, eL, rL }) do
- if v < level[i] then LevelSpell(spellSlot[i]) end
- end
- CDHandler()
- if AutoCarry.PluginMenu.autoIGN then AutoIgnite() end
- if AutoCarry.PluginMenu.autoR then CastR() end
- if AutoCarry.PluginMenu.useW then CastW() end
- if AutoCarry.PluginMenu.useQ then CastQ() end
- if AutoCarry.PluginMenu.useE and not AutoCarry.PluginMenu.combo then CastE() end
- if AutoCarry.PluginMenu.combo then Combo() end
- end
- end
- function CastR()
- if not RReady then return end
- for i=1, #allyTable do
- local Ally = allyTable[i]
- if Ally.health/Ally.maxHealth <= AutoCarry.PluginMenu.minRhealth/100 then
- CastSpell(_R)
- end
- end
- end
- function CastW()
- if not WReady then return end
- local HealAmount = myHero:GetSpellData(_W).level*70 + myHero.ap*0.45
- local LowestHealth = nil
- for i=1, #allyTable do
- local Ally = allyTable[i]
- if LowestHealth and LowestHealth.valid and Ally and Ally.valid then
- if Ally.health < LowestHealth.health and RangeW >= myHero:GetDistance(Ally) and (Ally.health + HealAmount) <= Ally.maxHealth then
- LowestHealth = Ally
- end
- else
- LowestHealth = Ally
- end
- end
- if LowestHealth and LowestHealth.valid and RangeW >= myHero:GetDistance(LowestHealth) and (LowestHealth.health + HealAmount) <= LowestHealth.maxHealth then
- CastSpell(_W, LowestHealth)
- end
- end
- function CastQ()
- if not QReady then return end
- for i=1, #enemyTable do
- local Enemy = enemyTable[i]
- if ValidTarget(Enemy, RangeQ) then
- CastSpell(_Q)
- end
- end
- end
- function CastE()
- if not EReady then return end
- local LowestMana = nil
- for i=1, #allyTable do
- local Ally = allyTable[i]
- if LowestMana and LowestMana.valid and Ally and Ally.valid then
- if Ally.mana < LowestMana.mana and RangeE >= myHero:GetDistance(Ally) and myHero.networkID ~= Ally.networkID then
- LowestMana = Ally
- end
- else
- LowestMana = Ally
- end
- end
- if LowestMana and LowestMana.valid and RangeE >= myHero:GetDistance(LowestMana) and LowestMana.mana/LowestMana.maxMana <= AutoCarry.PluginMenu.minEmana/100 then CastSpell(_E, LowestMana) end
- end
- function Combo()
- ts:update()
- if not ts.target then return end
- if ValidTarget(ts.target, RangeE) then
- if QReady then CastSpell(_Q) end
- if EReady then CastSpell(_E, ts.target) end
- if EXHAUSTReady and myHero:GetDistance(ts.target) <= 550 then CastSpell(EXHAUSTSlot, ts.target) end
- if (myHero.range + myHero:GetDistance(myHero.minBBox)) >= myHero:GetDistance(ts.target) then myHero:Attack(ts.target) end
- end
- end
- function OnProcessSpell(unit, spell)
- if #ToInterrupt > 0 and AutoCarry.PluginMenu.interrupt and EReady then
- for _, ability in pairs(ToInterrupt) do
- if spell.name == ability and unit.team ~= myHero.team then
- if RangeE >= myHero:GetDistance(unit) then
- CastSpell(_E, unit)
- if AutoCarry.PluginMenu.printInterrupt then print("Tried to interrupt " .. spell.name) end
- end
- end
- end
- end
- end
- function CDHandler()
- QReady = (myHero:CanUseSpell(_Q) == READY)
- WReady = (myHero:CanUseSpell(_W) == READY)
- EReady = (myHero:CanUseSpell(_E) == READY)
- RReady = (myHero:CanUseSpell(_R) == READY)
- IGNITEReady = (IGNITESlot ~= nil and myHero:CanUseSpell(IGNITESlot) == READY)
- EXHAUSTReady = (EXHAUSTSlot ~= nil and myHero:CanUseSpell(EXHAUSTSlot) == READY)
- end
- function AutoIgnite()
- if not IGNITEReady then return end
- for i=1, #enemyTable do
- local Enemy = enemyTable[i]
- if ValidTarget(Enemy, 600) then
- if getDmg("IGNITE", Enemy, myHero) >= Enemy.health then
- CastSpell(IGNITESlot, Enemy)
- end
- end
- end
- end
- function SetPriority(table, hero, priority)
- for i=1, #table, 1 do
- if hero.charName:find(table[i]) ~= nil then
- TS_SetHeroPriority(priority, hero.charName)
- end
- end
- end
- function arrangePrioritys()
- for i, enemy in ipairs(enemyTable) do
- SetPriority(priorityTable.AD_Carry, enemy, 1)
- SetPriority(priorityTable.AP, enemy, 2)
- SetPriority(priorityTable.Support, enemy, 3)
- SetPriority(priorityTable.Bruiser, enemy, 4)
- SetPriority(priorityTable.Tank, enemy, 5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement