Advertisement
Guest User

Hecarim-v1.2.1b.lua

a guest
Mar 29th, 2013
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.75 KB | None | 0 0
  1. --[[    Hecarim Helper 1.2.1b by HeX
  2.  
  3.             modded by xkjtx(added AAkite, useE, qSpam, and toggle ult)
  4.  
  5.             Ranges turn on when skill is ready and off when not ready(Correct ranges for circles in game)
  6.                 -- Spells will cast at a closer range so spells hit target everytime
  7.  
  8.             -- Also changed the combo a little to see if it helps some.. It helped me...
  9.  
  10. ]]--
  11.  
  12. if myHero.charName ~= "Hecarim" then return end
  13.  
  14. --[[    Ranges  ]]--
  15. local qRange = 345 -- lowered so Q hits everytime
  16. local wRange = 520 -- lowered so W hits everytime
  17. local rRange = 995 -- lowered so R hits everytime
  18. local rSpeed = 1.6
  19.  
  20. --[[    For AA code     ]]
  21. local lastBasicAttack = 0
  22. local startAttackSpeed = 0.625
  23. local swing = 0
  24. local nextTick = 0
  25. local waitDelay = 400
  26.  
  27. --[[    Items   ]]--
  28. local ignite, ghost = nil, nil
  29. local QREADY, WREADY, EREADY, RREADY  = false, false, false, false
  30. local DFGREADY, BRKREADY, HXGREADY, BWCREADY, SRRREADY, YGBREADY = false, false, false, false, false, false
  31. local DFGSlot, BRKSlot, HXGSlot, BWCSlot, SRRSlot, YGBSlot = nil, nil, nil, nil, nil, nil
  32.  
  33. function OnLoad()
  34.     --PrintChat("<font color='#CCCCCC'> >> Hecarim Helper 1.2.1b loaded! <<</font>")
  35.     HHConfig = scriptConfig("Hecarim Helper", "HecarimHelper")
  36.     HHConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32) -- Space
  37.     HHConfig:addParam("speedBurst", "Speed Burst", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("S")) -- S
  38.     HHConfig:addParam("qSpamm", "Spamms Q", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("Q")) -- S
  39.     HHConfig:addParam("AAkite", "Kiting", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("G")) -- Z -- Toggle on and it will move to mouse, then try to AA the target over and over again
  40.     HHConfig:addParam("useE", "Toggle Use E in Combo", SCRIPT_PARAM_ONKEYTOGGLE, true, string.byte("V")) -- V
  41.     HHConfig:addParam("useR", "Toggle Use Ultimate in Combo", SCRIPT_PARAM_ONKEYTOGGLE, true, string.byte("X")) -- X
  42.     HHConfig:addParam("autoignite", "Ignite when Killable", SCRIPT_PARAM_ONOFF, false) -- I have my own ignite
  43.     HHConfig:addParam("drawcirclesSelf", "Draw Circles - Self", SCRIPT_PARAM_ONOFF, true)
  44.     HHConfig:addParam("drawcirclesEnemy", "Draw Circles - Enemy", SCRIPT_PARAM_ONOFF, true)
  45.     HHConfig:permaShow("scriptActive")
  46.     HHConfig:permaShow("speedBurst")
  47.     HHConfig:permaShow("qSpamm")
  48.     HHConfig:permaShow("useE")
  49.     HHConfig:permaShow("useR")
  50.     HHConfig:permaShow("AAkite")
  51.     ts = TargetSelector(TARGET_LOW_HP, rRange+105, DAMAGE_MAGIC, true) -- So you can select target
  52.     ts.name = "Hecarim"
  53.     HHConfig:addTS(ts)
  54.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  55.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  56.     end
  57.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerHaste") then ghost = SUMMONER_1
  58.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerHaste") then ghost = SUMMONER_2
  59.     end
  60.     lastBasicAttack = os.clock()
  61. end
  62.  
  63. function OnProcessSpell(unit, spell)
  64.     if unit.isMe and (spell.name:find("Attack") ~= nil) then
  65.         swing = 1
  66.         lastBasicAttack = os.clock()
  67.     end
  68. end
  69.  
  70. function OnTick()
  71.     ts:update()
  72.     if myHero.dead then return end
  73.     -- Auto Kite code starts here
  74.     if ts.target ~= nil and HHConfig.AAkite and (not HHConfig.scriptActive or not HHConfig.qSpamm) then
  75.         local AttackDelay = 1/(myHero.attackSpeed*startAttackSpeed)
  76.         if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
  77.             swing = 0
  78.         end
  79.         --[[ Auto Attacks ]]--
  80.         local tick = GetTickCount()
  81.         if swing == 0 then
  82.             if GetDistance(ts.target) < rRange and GetTickCount() > nextTick then
  83.                 myHero:Attack(ts.target)
  84.                 nextTick = GetTickCount() + waitDelay
  85.                 if QREADY and GetDistance(ts.target) <= qRange then
  86.                     CastSpell(_Q)
  87.                 end
  88.             end
  89.         elseif swing == 1 and GetTickCount() > (nextTick + 100) then
  90.             myHero:MoveTo(mousePos.x, mousePos.z)
  91.         end
  92.     end
  93.     -- Auto Kite code ends here
  94.     if ts.target ~= nil then
  95.         travelDuration = (GetDistance(ts.target, myHero)/rSpeed)
  96.     end
  97.    
  98.     if ts.target ~= nil and RREADY and travelDuration ~= nil then
  99.         predic = GetPredictionPos(ts.target, travelDuration)
  100.     end
  101.    
  102.     if predic ~= nil and ts.target ~= nil then
  103.         TargetPos = Vector(predic.x, predic.y, predic.z)
  104.         MyPos = Vector(myHero.x, myHero.y, myHero.z)
  105.         UltPos = TargetPos + (TargetPos-MyPos)*((200/GetDistance(ts.target)))
  106.     end
  107.     DFGSlot, BRKSlot, HXGSlot, BWCSlot, SRRSlot, YGBSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3069), GetInventorySlotItem(3142)
  108.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  109.     BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  110.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  111.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  112.     SRRREADY = (SRRSlot ~= nil and myHero:CanUseSpell(SRRSlot) == READY)
  113.     YGBREADY = (YGBSlot ~= nil and myHero:CanUseSpell(YGBSlot) == READY)
  114.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  115.     GREADY = (ghost ~= nil and myHero:CanUseSpell(ghost) == READY)
  116.  
  117.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  118.     WREADY = (myHero:CanUseSpell(_W) == READY)
  119.     EREADY = (myHero:CanUseSpell(_E) == READY)
  120.     RREADY = (myHero:CanUseSpell(_R) == READY)
  121.    
  122.     --[[    Auto Ignite ]]--
  123.     if HHConfig.autoignite then    
  124.         if IREADY then
  125.             local ignitedmg = 0    
  126.             for i = 1, heroManager.iCount, 1 do
  127.                 local enemyhero = heroManager:getHero(i)
  128.                 if ValidTarget(enemyhero,600) then
  129.                     ignitedmg = 50 + 20 * myHero.level
  130.                     if enemyhero.health <= ignitedmg then
  131.                         CastSpell(ignite, enemyhero)
  132.                     end
  133.                 end
  134.             end
  135.         end
  136.     end
  137.    
  138.     --[[     Speed Burst    ]]--
  139.     if HHConfig.speedBurst then
  140.         if SRRREADY then CastSpell(SRRSlot) end
  141.         --if GREADY then CastSpell(ghost) end -- taken out because I like to use ghost on my own
  142.         if EREADY then CastSpell(_E) end
  143.         if YGBREADY then CastSpell(YGBSlot) end
  144.         myHero:MoveTo(mousePos.x, mousePos.z)
  145.     end
  146.  
  147.     --[[     Q-W Spamm  ]]--
  148.     if HHConfig.qSpamm and ts.target ~= nil then
  149.         if QREADY and GetDistance(ts.target) <= qRange then
  150.             CastSpell(_Q)
  151.         elseif WREADY and myHero:CanUseSpell(_Q) == COOLDOWN and GetDistance(ts.target) <= wRange then
  152.             CastSpell(_W)
  153.         end
  154.         if GetDistance(ts.target) <= wRange then
  155.             myHero:Attack(ts.target)
  156.         end
  157.     end
  158.    
  159.     --[[    Basic Combo ]]--
  160.     if HHConfig.scriptActive and ts.target ~= nil then
  161.         --[[    Items   ]]--
  162.         if (GetDistance(ts.target) > 475 and GetDistance(ts.target) < 750) then
  163.             if DFGREADY then CastSpell(DFGSlot, ts.target) end
  164.             if BRKREADY then CastSpell(BRKSlot, ts.target) end
  165.             if HXGREADY then CastSpell(HXGSlot, ts.target) end
  166.             if BWCREADY then CastSpell(BWCSlot, ts.target) end
  167.             if YGBREADY then CastSpell(YGBSlot) end
  168.         end
  169.         --[[    Abilities   ]]--
  170.         if QREADY and GetDistance(ts.target) <= qRange then
  171.             CastSpell(_Q)
  172.         end
  173.         if GetDistance(ts.target) <= wRange then
  174.             myHero:Attack(ts.target)
  175.         end
  176.         if WREADY and GetDistance(ts.target) <= wRange then
  177.             CastSpell(_W)
  178.         end
  179.         if HHConfig.useR and RREADY and UltPos ~= nil and GetDistance(predic) < rRange then
  180.             CastSpell(_R, UltPos.x, UltPos.z)
  181.         end
  182.         if HHConfig.useE and EREADY and GetDistance(ts.target) < wRange then
  183.             CastSpell(_E, ts.target.x, ts.target.z)
  184.         end
  185.     end
  186. end
  187.  
  188. function OnDraw()
  189.     if HHConfig.drawcirclesSelf and not myHero.dead then
  190.         if QREADY then
  191.             DrawCircle(myHero.x, myHero.y, myHero.z, qRange+5, 0x00CCFF)
  192.         end
  193.         if WREADY then
  194.             DrawCircle(myHero.x, myHero.y, myHero.z, wRange+5, 0x00FF00)
  195.         end
  196.         if RREADY then
  197.             DrawCircle(myHero.x, myHero.y, myHero.z, rRange+5, 0x9900CC)
  198.         end
  199.     end
  200.     if ts.target ~= nil and HHConfig.drawcirclesEnemy and not myHero.dead then
  201.         for j=0, 10 do
  202.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  203.         end
  204.     end
  205. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement