Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Udyr Helper 2.1 by HeX
- Big thanks to: jbman for giving me his unfinished Udyr code which i used as a base.
- Features:
- -Stun Cycle: E-> Stun all nearby enemies
- -Proc Combo: Q-> AA-> Q-> AA (Will wait for cooldown before using attacks)
- -Tiger Combo: Items-> E-> Q
- -Turtle Mode: Items-> E-> W
- -Phoenix Combo: Items-> E-> R
- -Auto ignite killable enemy ON/OFF option in ingame menu.
- -Item Support: Blade of the Ruined King, Bligewater Cutlass, Deathfire Grasp, Hextech Gunblade, Tiamat, Ravenous Hydra, Randuins Omen, Sword of the Divine.
- ]]
- if myHero.charName ~= "Udyr" then return end
- --[[--(Code)--]]--
- local ts
- local range = 600
- local stunTarget = nil
- --[[--(Stances)--]]--
- local qCast = 0
- local lastTigerStance = 0
- --[[--(Attacks)--]]--
- local lastBasicAttack = 0
- local swingDelay = 0.1
- local swing = 0
- --[[--(Waits)--]]--
- local nextTick = 0
- local waitDelay = 400
- local Tick = 0
- --[[--(Ready)--]]--
- local ignite = nil
- local QREADY, WREADY, EREADY, RREADY = false, false, false, false
- local BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, STDSlot = nil, nil, nil, nil, nil, nil, nil, nil
- local BRKREADY, DFGREADY, HXGREADY, BWCREADY, TMTREADY, RAHREADY, RNDREADY, STDREADY = false, false, false, false, false, false, false, false
- function OnLoad()
- --[[--(PrintChats)--]]--
- PrintChat("<font color='#CCCCCC'> >> Udyr Helper 2.0 loaded! <<</font>")
- PrintChat("<font color='#CCCCCC'> >> Press 0 to check hotkeys <<</font>")
- --[[--(Config)--]]--
- UHConfig = scriptConfig("Udyr Helper", "UdyrHelper")
- UHConfig:addParam("StunCycle", "Stun Cycle", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- UHConfig:addParam("ProcCombo", "Double Proc - Tiger", SCRIPT_PARAM_ONKEYDOWN, false, 71)
- UHConfig:addParam("TigerCombo", "Combo - Tiger", SCRIPT_PARAM_ONKEYDOWN, false, 90)
- UHConfig:addParam("TurtleCombo", "Combo - Turtle", SCRIPT_PARAM_ONKEYDOWN, false, 88)
- UHConfig:addParam("PhoenixCombo", "Combo - Phoenix", SCRIPT_PARAM_ONKEYDOWN, false, 67)
- UHConfig:addParam("Help", "Show Help", SCRIPT_PARAM_ONKEYDOWN, false, 48)
- UHConfig:addParam("autoignite", "Auto Ignite killable", SCRIPT_PARAM_ONOFF, true)
- UHConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, false)
- UHConfig:permaShow("StunCycle")
- UHConfig:permaShow("ProcCombo")
- UHConfig:permaShow("TigerCombo")
- UHConfig:permaShow("TurtleCombo")
- UHConfig:permaShow("PhoenixCombo")
- ts = TargetSelector(TARGET_LOW_HP, range, DAMAGE_MAGIC)
- ts.name = "Udyr"
- UHConfig:addTS(ts)
- Tick = os.clock()
- 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
- end
- function OnTick()
- ts:update()
- if UHConfig.Help then
- PrintHelp()
- end
- if swing == 1 and os.clock() > lastBasicAttack + 0.5 then
- swing = 0
- end
- --[[--(Ready)--]]--
- BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, STDSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3077), GetInventorySlotItem(3074), GetInventorySlotItem(3143), GetInventorySlotItem(3131)
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == 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)
- TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
- RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
- RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
- STDREADY = (STDSlot ~= nil and myHero:CanUseSpell(STDSlot) == READY)
- IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
- --[[--(Ignite)--]]--
- if UHConfig.autoignite then
- if IREADY then
- local ignitedmg = 0
- for i = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(i)
- if ValidTarget(enemyhero,600) then
- ignitedmg = 50 + 20 * myHero.level
- if enemyhero.health <= ignitedmg then
- CastSpell(ignite, enemyhero)
- end
- end
- end
- end
- end
- --[[--(Items)--]]--
- if ts.target ~= nil and (UHConfig.TigerCombo or UHConfig.PhoenixCombo or UHConfig.TurtleCombo) then
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- 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 STDREADY and GetDistance(ts.target) < 275 then CastSpell(STDSlot) end
- if TMTREADY and GetDistance(ts.target) < 275 then CastSpell(TMTSlot) end
- if RAHREADY and GetDistance(ts.target) < 275 then CastSpell(RAHSlot) end
- if RNDREADY and GetDistance(ts.target) < 275 then CastSpell(RNDSlot) end
- if GetDistance(ts.target) < range then
- myHero:Attack(ts.target)
- end
- end
- --------------------------------------------(Combos)-------------------------------------------
- --[[--(Proc Combo)--]]--
- QTimer = 6 + (6*myHero.cdr)
- if UHConfig.ProcCombo then
- if QREADY and qCast == 0 then
- CastSpell(_Q)
- end
- if ts.target ~= nil then
- if qCast == 1 and os.clock() - lastTigerStance > QTimer then
- if swing == 0 then
- myHero:Attack(ts.target)
- elseif swing == 1 then
- if QREADY and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_Q)
- swing = 0
- end
- end
- end
- end
- end
- --[[--(Stun Cycle)--]]--
- if UHConfig.StunCycle then
- stunTarget = findClosestEnemy()
- if stunTarget ~= nil and GetDistance(stunTarget) <= range then
- if EREADY and not Bear then
- CastSpell(_E)
- end
- if Bear then
- myHero:Attack(stunTarget)
- end
- end
- end
- --[[--(Tiger Combo)--]]--
- if UHConfig.TigerCombo and ts.target ~= nil then
- if EREADY and not QREADY and not (Bear or TargetHaveBuff("udyrbearstuncheck", ts.target)) then
- CastSpell(_E)
- swing = 0
- end
- if QREADY then
- CastSpell(_Q)
- swing = 0
- end
- end
- --[[--(Phoenix Combo)--]]--
- if UHConfig.PhoenixCombo and ts.target ~= nil then
- if EREADY and not (Bear or TargetHaveBuff("udyrbearstuncheck", ts.target)) then
- CastSpell(_E)
- swing = 0
- end
- if RREADY and not Phoenix and TargetHaveBuff("udyrbearstuncheck", ts.target) then
- CastSpell(_R)
- swing = 0
- end
- end
- --[[--(Turtle Combo)--]]--
- if UHConfig.TurtleCombo and ts.target ~= nil then
- if EREADY and not (Bear or TargetHaveBuff("udyrbearstuncheck", ts.target)) then
- CastSpell(_E)
- swing = 0
- end
- if WREADY and TargetHaveBuff("udyrbearstuncheck", ts.target) then
- CastSpell(_W)
- swing = 0
- end
- end
- end
- function OnDraw()
- if UHConfig.drawcircles then
- 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
- if stunTarget ~= nil and not stunTarget.dead and not myHero.dead then
- for j=0, 10 do DrawCircle(stunTarget.x,stunTarget.y,stunTarget.z, 80 +j*1.5, 0x7A24DB) end
- end
- if not myHero.dead then
- DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x00FF00)
- end
- end
- end
- function OnProcessSpell(unit, spell)
- if unit.isMe then
- if spell and spell.name:find("Attack") then
- swing = 1
- qCast = 0
- lastBasicAttack = os.clock()
- end
- if spell and spell.name:find("TigerStance") then
- Tiger = true
- Turtle = false
- Bear = false
- Phoenix = false
- qCast = 1
- lastTigerStance = os.clock()
- end
- if spell and spell.name:find("TurtleStance") then
- Tiger = false
- Turtle = true
- Bear = false
- Phoenix = false
- end
- if spell and spell.name:find("BearStance") then
- Tiger = false
- Turtle = false
- Bear = true
- Phoenix = false
- end
- if spell and spell.name:find("PhoenixStance") then
- Tiger = false
- Turtle = false
- Bear = false
- Phoenix = true
- end
- end
- end
- function PrintHelp()
- local tick = GetTickCount()
- if GetTickCount() > nextTick then
- PrintChat("<font color='#CCCCCC'> >> Udyr Hotkeys <<</font>")
- PrintChat(">> Spacebar - Stun Cycle")
- PrintChat(">> G - Double Tiger Procs")
- PrintChat(">> Z - Tiger Combo")
- PrintChat(">> X - Turtle Combo")
- PrintChat(">> C - Phoenix Combo")
- nextTick = GetTickCount() + waitDelay
- end
- end
- function findClosestEnemy()
- local closestEnemy = nil
- local currentEnemy = nil
- for i=1, heroManager.iCount do
- currentEnemy = heroManager:GetHero(i)
- if currentEnemy.team ~= myHero.team and not currentEnemy.dead and currentEnemy.visible and GetDistance(currentEnemy) < range and not TargetHaveBuff("udyrbearstuncheck", currentEnemy) then
- if closestEnemy == nil then
- closestEnemy = currentEnemy
- elseif GetDistance(currentEnemy) < GetDistance(closestEnemy) then
- closestEnemy = currentEnemy
- end
- end
- end
- return closestEnemy
- end
Advertisement
Add Comment
Please, Sign In to add comment