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
- 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 delay, espeed = 250, 1.35
- 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 getDistance2(x1, z1, x2, z2)
- return math.sqrt(math.pow(x2 - x1, 2) + math.pow(z2 - z1, 2))
- 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 travelDuration = (delay + GetDistance(myHero, focusEnemy)/espeed)
- travelDuration = (delay + GetDistance(GetPredictionPos(focusEnemy, travelDuration))/espeed)
- travelDuration = (delay + GetDistance(GetPredictionPos(focusEnemy, travelDuration))/espeed)
- travelDuration = (delay + GetDistance(GetPredictionPos(focusEnemy, travelDuration))/espeed)
- local prediction = GetPredictionPos(focusEnemy, travelDuration)
- local spellW = myHero:GetSpellData(_W)
- if QREADY and prediction ~= nil then
- local dPredict = GetDistance(prediction)
- if EREADY then
- if (dPredict < eRange) then
- CastSpell(_Q, prediction.x, prediction.z)
- else
- local xQ = myHero.x + (eRange / dPredict) * (prediction.x - myHero.x)
- local zQ = myHero.z + (eRange / dPredict) * (prediction.z - myHero.z)
- CastSpell(_Q, xQ, zQ)
- end
- return
- elseif dPredict < qRange then
- CastSpell(_Q, prediction.x, prediction.z)
- return
- end
- end
- if EREADY and qCreated > os.clock() then
- if getDistance2(myHero.x, myHero.z, qX, qZ) < 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
- if not focusEnemy.canMove then
- wGetX = focusEnemy.x
- wGetZ = focusEnemy.z
- elseif prediction ~= nil then
- wGetX = prediction.x
- wGetZ = prediction.z
- end
- if wGetX ~= nill then
- CastSpell(_W, wGetX, wGetZ)
- return
- end
- 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] then
- CastSpell(_R, focusEnemy)
- 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