Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Follow while combo:
- 0 for Dont Follow
- 1 for Follow the mouse
- ]]
- if myHero.charName ~= "Syndra" then return end
- require 'AoESkillshotPosition'
- local qRange = 800
- local wRange = 925
- local eRange = 650
- local rRange = 675
- local enemyMinions = {}
- local ultDmg = {90, 135, 180}
- local wWait, nextdelay, balls, qX, qZ, qCreated = 0, 0, 0, 0, 0, 0
- local DFGSlot = nil
- local qDelay = 600
- local QREADY, WREADY, EREADY, RREADY, DFGREADY = false, false, false, false, false
- function OnLoad()
- HConfig = scriptConfig("Syndra Combo", "SyndraCombo")
- HConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- HConfig:addParam("stun", "Stun", SCRIPT_PARAM_ONKEYDOWN, false, 84)
- HConfig:addParam("following", "Follow while combo", SCRIPT_PARAM_SLICE, 0, 0, 1)
- for i=1, heroManager.iCount do
- local enemy = heroManager:GetHero(i)
- if enemy.team ~= myHero.team then
- HConfig:addParam("ult"..enemy.charName, "Ult and DFG on "..enemy.charName, SCRIPT_PARAM_ONOFF, true)
- end
- end
- HConfig:permaShow("stun")
- HConfig:permaShow("scriptActive")
- enemyMinions = minionManager(MINION_ENEMY, wRange, myHero, MINION_SORT_HEALTH_DES)
- PrintChat(" >> Syndra Combo by HunteR")
- end
- function getEnemyMinion()
- for i, minion in pairs(enemyMinions.objects) do
- if minion ~= nil and minion.valid then
- return minion
- end
- end
- return nil
- end
- function getBall()
- local ret = nil
- if GetTickCount() > nextdelay then
- balls = 0
- for i = 1, objManager.maxObjects do
- local object = objManager:getObject(i)
- if object then
- if GetDistance(object) < rRange and string.find(string.lower(object.name), "darksphere") and string.find(string.lower(object.name), "_idle") then
- balls = balls + 1
- if ret == nil then ret = object end
- end
- end
- end
- if ret == nil then ret = "none" end
- nextdelay = GetTickCount() + 100
- end
- return ret
- end
- function OnTick()
- if myHero.dead then
- return
- end
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- DFGSlot = GetInventorySlotItem(3128)
- DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
- local spellR = myHero:GetSpellData(_R)
- if spellR.level == 3 then rRange = 750 end
- if HConfig.scriptActive then combo("Combo") end
- if HConfig.stun then combo("Stun") end
- end
- function OnProcessSpell(unit, spell)
- if unit.name == myHero.name then
- if spell.name == "SyndraQ" then
- qCreated = os.clock() + 1
- qX, qZ = spell.endPos.x, spell.endPos.z
- end
- end
- end
- function combo(typeC)
- local focusEnemy = nil
- local minimumHit = -1
- local lowPriority = false
- local stunEnemy = nil
- local minimumDistance = -1
- for i=1, heroManager.iCount do
- local target = heroManager:GetHero(i)
- if ValidTarget(target, 1000) then
- local dmg = getDmg("Q", target, myHero)
- local hits = (target.health / dmg)
- if minimumHit == -1 or (hits < minimumHit and HConfig["ult"..target.charName]) or hits <= 1.05 or (not lowPriority and minimumHit > 1.05) then
- focusEnemy = target
- minimumHit = hits
- lowPriority = HConfig["ult"..target.charName]
- end
- local distancetoStun = GetDistance(target)
- if minimumDistance == -1 or distancetoStun < minimumDistance then
- stunEnemy = target
- minimumDistance = distancetoStun
- end
- end
- end
- if focusEnemy ~= nil or (stunEnemy ~= nil and typeC == "Stun") then
- if typeC == "Stun" then
- focusEnemy = stunEnemy
- end
- local spellW = myHero:GetSpellData(_W)
- if QREADY then
- local Qprediction = GetPredictionPos(focusEnemy, qDelay)
- local dPredict = GetDistance(Qprediction)
- local qHit = false
- if EREADY then
- if (dPredict < eRange) then
- qHit = true
- else
- local xQ = myHero.x + (eRange / dPredict) * (Qprediction.x - myHero.x)
- local zQ = myHero.z + (eRange / dPredict) * (Qprediction.z - myHero.z)
- CastSpell(_Q, xQ, zQ)
- return
- end
- elseif dPredict < qRange then
- qHit = true
- end
- if qHit then
- local spellPos = GetAoESpellPosition(175, focusEnemy, qDelay)
- CastSpell(_Q, spellPos.x, spellPos.z)
- return
- end
- end
- if EREADY and qCreated > os.clock() then
- local obj2 = {}
- obj2.x = qX
- obj2.z = qZ
- if GetDistance(myHero, obj2) < eRange then
- CastSpell(_E, qX, qZ)
- wWait = GetTickCount() + 700
- return
- else
- myHero:MoveTo(qX, qZ)
- return
- end
- end
- if typeC == "Combo" then
- if DFGREADY and GetDistance(focusEnemy) < 750 and HConfig["ult"..focusEnemy.charName] then
- CastSpell(DFGSlot, focusEnemy)
- return
- end
- if WREADY and GetTickCount() > wWait then
- local wGetX, wGetZ = nil, nil
- if spellW.name == "SyndraW" and not EREADY then
- enemyMinions:update()
- local minion = getEnemyMinion()
- if minion ~= nil then wGetX, wGetZ = minion.x, minion.z end
- if wGetX == nil then
- local ball = getBall()
- if ball == nil then return end
- if ball ~= "none" then wGetX, wGetZ = ball.x, ball.z end
- end
- if wGetX ~= nil then
- CastSpell(_W, wGetX, wGetZ)
- wWait = GetTickCount() + 300
- return
- end
- elseif spellW.name ~= "SyndraW" then
- local spellPos = GetAoESpellPosition(200, focusEnemy, 800)
- CastSpell(_W, spellPos.x, spellPos.z)
- end
- end
- local AlwaysUltimate = true
- if CountEnemyHeroInRange(1000) > 3 then
- if getDmg("Q", focusEnemy, myHero) >= focusEnemy.health then
- AlwaysUltimate = false
- end
- end
- if RREADY and GetDistance(focusEnemy) < rRange and HConfig["ult"..focusEnemy.charName] and AlwaysUltimate then
- if getBall() ~= nil then
- local ballsAll = 3 + balls
- local spellR = myHero:GetSpellData(_R)
- local RdmgAll = myHero:CalcMagicDamage(focusEnemy, ((ultDmg[spellR.level] * ballsAll) + (ballsAll * 0.2 * myHero.ap)))
- local percentDmg = RdmgAll / focusEnemy.health
- if percentDmg > 1 and (percentDmg < 5 or (myHero.health / myHero.maxHealth) < 0.25) then
- CastSpell(_R, focusEnemy)
- return
- end
- end
- end
- end
- end
- if HConfig.following == 1 and typeC == "Combo" then
- myHero:MoveTo(mousePos.x, mousePos.z)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment