Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Olaf Combo by burn
- -Full combo: Items -> Q -> E -> W
- -Supports BRK, Bilgewater Cutlass, Hextech Gunblade, Sheen, Trinity, Lich Bane and Ignite & new items S3
- -Mark killable target with a combo
- -Target configuration, Press shift to configure
- -Auto ignite killable enemy ON/OFF option in ingame menu
- -Better Q prediction
- -Harass mode *
- -Autofarm *
- -Auto pick axe *
- Explanation of the marks:
- Green circle: Marks the current target to which you will do the combo
- Blue circle: Mark a target that can be killed with a combo, if all the skills were available
- Red circle: Mark a target that can be killed using; Items + 5 hits + Q x2 + E x2 + ignite
- 2 Red circles: Mark a target that can be killed using; Items + 2 hits + Q + E + ignite
- 3 Red circles: Mark a target that can be killed using; E + ignite
- ]]
- if myHero.charName ~= "Olaf" then return end
- --[[ Code ]]
- local thickness = 10 --For Draw Part (circles)
- local range = 1000 -- Q
- local rangeE = 325 -- E
- local tick = nil
- local Ehurt = false
- local mousemoving = true
- local nextTick = 0
- local lasthiton = true
- local unitScanTick = 0
- local scanAdditionalRange = 450
- local waitDelay = 300
- local units = {}
- pickingaxe = false
- axepos = nil
- -- better Q prediction
- local delay = 360
- local qspeed = 1.50
- local travelDuration = 600
- -- draw
- local waittxt = {}
- local calculationenemy = 1
- local floattext = {"Skills are not available","Able to fight","Killable","Murder him!"}
- local killable = {}
- -- ts
- local ts
- --
- local ignite = nil
- local BRKSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil
- local QREADY, WREADY, EREADY, RREADY, HXGREADY, BWCREADY, IREADY = false, false, false, false, false, false, false
- function OnLoad()
- PrintChat(">> Olaf Combo 1.1 loaded!")
- OlafConfig = scriptConfig("Olaf Combo 1.1", "Olafcombo")
- OlafConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- OlafConfig:addParam("harass", "Harass with Q", SCRIPT_PARAM_ONKEYDOWN, false, 88) --x
- OlafConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- OlafConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
- OlafConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
- OlafConfig:addParam("autopickAxe", "Auto Pick Axe", SCRIPT_PARAM_ONOFF, true)
- OlafConfig:addParam("autoFarm", "Auto Farm", SCRIPT_PARAM_ONKEYTOGGLE, false, 67) --c
- OlafConfig:permaShow("scriptActive")
- OlafConfig:permaShow("autoFarm")
- ts = TargetSelector(TARGET_LOW_HP,range,DAMAGE_PHYSICAL)
- ts.name = "Olaf"
- OlafConfig:addTS(ts)
- if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
- elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
- for i=1, heroManager.iCount do waittxt[i] = i*3 end
- end
- function OnTick()
- if myHero.dead then return end
- ts:update()
- if ts.target ~= nil then
- travelDuration = (delay + GetDistance(myHero, ts.target)/qspeed)
- end
- ts:SetPrediction(travelDuration)
- Prediction__OnTick()
- if ts.target ~= nil and myHero:CanUseSpell(_Q) == READY then predic = ts.nextPosition end
- BRKSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
- YomumusGhostbladeSlot = GetInventorySlotItem(3142)
- EXECSlot = GetInventorySlotItem(3123)
- RANOSlot = GetInventorySlotItem(3143)
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
- BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
- BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
- IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
- YomumusGhostbladeReady = (YomumusGhostbladeSlot ~= nil and myHero:CanUseSpell(YomumusGhostbladeSlot) == READY)
- EXECReady = (EXECSlot ~= nil and myHero:CanUseSpell(EXECSlot) == READY)
- RANOReady = (RANOSlot ~= nil and myHero:CanUseSpell(RANOSlot) == READY)
- if tick == nil or GetTickCount()-tick > 100 then
- tick = GetTickCount()
- OlafDmgCalculation()
- end
- if OlafConfig.harass and ts.target then
- if predic ~= nil and QREADY and GetDistance(ts.target) < range then
- CastSpell(_Q, predic.x, predic.z)
- end
- end
- if OlafConfig.scriptActive and ts.target then
- --check next olaf HP
- local SpellDataE = myHero:GetSpellData(_E)
- local hpCost = (40+24*SpellDataE.level) --cost of HP to cast our E
- if (myHero.health - hpCost) < 100 then
- Ehurt = true
- else
- Ehurt = false
- end
- -- end check
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if YomumusGhostbladeReady then CastSpell(YomumusGhostbladeSlot, ts.target) end
- if EXECReady then CastSpell(EXECSlot, ts.target) end
- if RANOReady then CastSpell(RANOSlot, ts.target) end
- if OlafConfig.autopickAxe and axepos and not QREADY and GetDistance(myHero, axepos) <= 365 then
- pickingaxe = true
- myHero:MoveTo(tonumber(axepos.x), tonumber(axepos.z))
- end
- if OlafConfig.autopickAxe and axepos and not QREADY and GetDistance(myHero, axepos) > 365 then
- pickingaxe = false
- end
- if QREADY then pickingaxe = false end
- if predic ~= nil and QREADY and GetDistance(ts.target) < range then
- CastSpell(_Q, predic.x, predic.z)
- end
- if EREADY and not Ehurt and GetDistance(ts.target) <= rangeE then CastSpell(_E, ts.target) end
- -- check if our E will kill our target, even if we will get less of 100hp
- local edmg = getDmg("E",ts.target,myHero)
- if EREADY and GetDistance(ts.target) <= rangeE and ts.target.health <= edmg then CastSpell(_E, ts.target) end
- -- end check
- if WREADY and GetDistance(ts.target) < 200 then CastSpell(_W) end
- if not pickingaxe then myHero:Attack(ts.target) end
- end
- if OlafConfig.autoFarm then
- if mousemoving and GetTickCount() > nextTick then
- player:MoveTo(mousePos.x, mousePos.z)
- end
- local tick = GetTickCount()
- if lasthiton then
- unitScanTick = tick
- for i = 1, objManager.maxObjects, 1 do
- local object = objManager:getObject(i)
- if object ~= nil and object.team ~= player.team and object.type == "obj_AI_Minion" and string.find(object.charName,"Minion") then
- if not object.dead and GetDistance(object,player) <= (player.range + scanAdditionalRange) then
- if units[object.name] == nil then
- units[object.name] = { obj = object, markTick = 0 }
- end
- else
- units[object.name] = nil
- end
- end
- end
- end
- for i, unit in pairs(units) do
- if unit.obj == nil or unit.obj.dead or GetDistance(player,unit.obj) > (player.range + scanAdditionalRange) then
- units[i] = nil
- else
- if unit.obj.health <= (myHero:CalcDamage(unit.obj,myHero.totalDamage)) then --
- if lasthiton and GetTickCount() > nextTick then
- player:Attack(unit.obj)
- nextTick = GetTickCount() + waitDelay
- return
- end
- end
- end
- end
- end
- if OlafConfig.autoignite then
- local ignitedmg = 0
- if IREADY then
- for j = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(j)
- if ValidTarget(enemyhero) then
- ignitedmg = 50 + 20 * myHero.level
- if enemyhero ~= nil and enemyhero.team ~= myHero.team and not enemyhero.dead and enemyhero.visible and GetDistance(enemyhero) <= 600 and enemyhero.health <= ignitedmg then
- CastSpell(ignite, enemyhero)
- end
- end
- end
- end
- end
- end
- function OlafDmgCalculation()
- local enemy = heroManager:GetHero(calculationenemy)
- if ValidTarget(enemy) then
- local hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage = 0, 0, 0, 0, 0, 0
- local qdamage = getDmg("Q",enemy,myHero)
- local edamage = getDmg("E",enemy,myHero)
- local hitdamage = getDmg("AD",enemy,myHero)
- local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
- local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
- local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
- local Sheendamage = (SheenSlot and getDmg("SHEEN",enemy,myHero) or 0)
- local Trinitydamage = (TrinitySlot and getDmg("TRINITY",enemy,myHero) or 0)
- local LichBanedamage = (LichBaneSlot and getDmg("LICHBANE",enemy,myHero) or 0)
- local combo1 = hitdamage*5 + qdamage*2 + edamage*2 + Sheendamage + Trinitydamage + LichBanedamage --0 cd
- local combo2 = hitdamage*5 + Sheendamage + Trinitydamage + LichBanedamage
- local combo3 = hitdamage*2 + Sheendamage + Trinitydamage + LichBanedamage
- local combo4 = 0
- if QREADY then
- combo2 = combo2 + qdamage*2
- combo3 = combo3 + qdamage
- end
- if EREADY then
- combo2 = combo2 + edamage*2
- combo3 = combo3 + edamage
- combo4 = combo4 + edamage
- end
- if HXGREADY then
- combo1 = combo1 + hxgdamage
- combo2 = combo2 + hxgdamage
- combo3 = combo3 + hxgdamage
- combo4 = combo4 + hxgdamage
- end
- if BWCREADY then
- combo1 = combo1 + bwcdamage
- combo2 = combo2 + bwcdamage
- combo3 = combo3 + bwcdamage
- combo4 = combo4 + bwcdamage
- end
- if IREADY then
- combo1 = combo1 + ignitedamage
- combo2 = combo2 + ignitedamage
- combo3 = combo3 + ignitedamage
- combo4 = combo4 + ignitedamage
- end
- if combo4 >= enemy.health then killable[calculationenemy] = 4
- elseif combo3 >= enemy.health then killable[calculationenemy] = 3
- elseif combo2 >= enemy.health then killable[calculationenemy] = 2
- elseif combo1 >= enemy.health then killable[calculationenemy] = 1
- else killable[calculationenemy] = 0 end
- end
- if calculationenemy == 1 then calculationenemy = heroManager.iCount
- else calculationenemy = calculationenemy-1 end
- end
- function OnDraw()
- if OlafConfig.drawcircles and not myHero.dead then
- DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x00CCFF)
- DrawCircle(myHero.x, myHero.y, myHero.z, rangeE, 0x9933CC)
- if ts.target ~= nil then
- for j=0, 10 do
- DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
- end
- end
- end
- for i=1, heroManager.iCount do
- local enemydraw = heroManager:GetHero(i)
- if ValidTarget(enemydraw) then
- if OlafConfig.drawcircles then
- if killable[i] == 1 then
- for j=0, thickness do
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
- end
- elseif killable[i] == 2 then
- for j=0, thickness do
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
- end
- elseif killable[i] == 3 then
- for j=0, thickness do
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
- end
- elseif killable[i] == 4 then
- for j=0, thickness do
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
- DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
- end
- end
- end
- if OlafConfig.drawtext and waittxt[i] == 1 and killable[i] ~= 0 then
- PrintFloatText(enemydraw,0,floattext[killable[i]])
- end
- end
- if waittxt[i] == 1 then waittxt[i] = 30
- else waittxt[i] = waittxt[i]-1 end
- end
- SC__OnDraw()
- end
- function OnWndMsg(msg,key)
- SC__OnWndMsg(msg,key)
- end
- function OnSendChat(msg)
- TargetSelector__OnSendChat(msg)
- ts:OnSendChat(msg, "pri")
- end
- function OnCreateObj(object)
- if myHero.dead then return end
- if object ~= nil and object.name ~= nil and object.name == "olaf_axe_totem_team_id_green.troy" and object.x ~= nil and object.z ~= nil then
- axepos = object
- end
- end
- function OnDeleteObj(object)
- if object ~= nil and object.name ~= nil and object.name == "olaf_axe_totem_team_id_green.troy" and object.x ~= nil and object.z ~= nil then
- axepos = nil
- pickingaxe = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement