Advertisement
Guest User

Dr.-Mundo-[SBTW]v0.16.lua

a guest
Feb 14th, 2013
2,816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.  
  3.         **SBTW** Dr. Mundo helper v0.15 (Made by xkjtx) Oh Billy!
  4.  
  5.         --**Pressing hot key will do the following:
  6.             -** 'Auto' Cast Q on target with prediction (WITHOUT MINION COLLISION - Make sure minions are not in the way)
  7.             -** 'Auto' Cast E when in eRange
  8.             -** 'Auto' AA'ing when in qbRange
  9.             -** 'Toggle' Cast W when in wRange and turn off when out of range(credits to jbman for fixing)
  10.             -** 'Toggle' Cast Ult(R) when health is at 15%(you can change this to what you like)
  11.             -** 'Hot-Key' Q Harass with prediction (default letter S for harass)
  12.  
  13. ]]
  14.  
  15. if myHero.charName ~= "DrMundo" then return end
  16.  
  17. local player = GetMyHero()
  18. local range = 125 -- Basic Attack Range
  19. local qRange = 1050 -- Q range
  20. local qbRange = 400 -- Auto Attack in this range (when holding hot-key you will start AA'ing)
  21. local eRange = 300 -- Turn on E when in this range
  22. local wRange = 325 -- Turn on W when target is in this range
  23. local wbRange = 355 -- Turn off W when target is out of this range
  24. local pRange = 100 -- for prediction circle
  25.  
  26. --Hotkeys
  27. local hotQEWkey = 32 -- Space bar
  28. local hotQharass = string.byte("S")
  29.  
  30. -- more locals
  31. local QREADY, EREADY, WREADY = false, false, false
  32. local wUsed = false
  33. local travelDuration, buffCount, predic = nil, nil, nil
  34. local ts = nil
  35. local delay = 300
  36. local speed = 1.975
  37. local HUNDRED = 100
  38. local healthPercentage = 20 -- Health percentage (20%) this is when Ult will activate
  39.  
  40.  
  41. function OnLoad()
  42.     PrintChat("Dr. Mundo Helper v0.15: (xkjtx) Oh Billy!")
  43.     DMConfig = scriptConfig("Dr. Mundo Q Helper 0.15", "drmundobo")
  44.     DMConfig:addParam("qActive", "Infected Cleaver", SCRIPT_PARAM_ONKEYDOWN, false, hotQEWkey) -- Space
  45.     DMConfig:addParam("qHarass", "Cleaver Harass", SCRIPT_PARAM_ONKEYDOWN, false, hotQharass) -- Letter 'S'
  46.     DMConfig:addParam("toggleW", "Turn W Casting On/Off", SCRIPT_PARAM_ONOFF, false) -- Off by default
  47.     DMConfig:addParam("autoUlt", "Use Ult When Low Health", SCRIPT_PARAM_ONOFF, true)
  48.     DMConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  49.     DMConfig:permaShow("qActive")
  50.     DMConfig:permaShow("qHarass")
  51.     DMConfig:permaShow("toggleW")
  52.     DMConfig:permaShow("autoUlt")
  53.     ts = TargetSelector(TARGET_LOW_HP,qRange,DAMAGE_PHYSICAL)
  54.     ts.name = "DrMundo"
  55.     DMConfig:addTS(ts)
  56.     wUsed = false
  57. end
  58.  
  59. function OnTick()
  60.     if myHero.dead then
  61.         return
  62.     end
  63.  
  64.     ts:update()
  65.    
  66.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  67.     EREADY = (myHero:CanUseSpell(_E) == READY)
  68.     WREADY = (myHero:CanUseSpell(_W) == READY)
  69.     RREADY = (player:CanUseSpell(_R) == READY)
  70.  
  71.     if DMConfig.autoUlt then
  72.         if not player.dead and ((player.health * HUNDRED ) / player.maxHealth) <= healthPercentage and RREADY then
  73.             CastSpell(_R)
  74.         end
  75.     end
  76.    
  77.     if ts.target ~= nil and not myHero.dead then
  78.         travelDuration = (delay + GetDistance(myHero, ts.target)/speed)
  79.         ts:SetPrediction(travelDuration)
  80.         predic = ts.nextPosition
  81.         if DMConfig.qActive then
  82.             if predic ~= nil and QREADY and GetDistance(predic) < qRange then
  83.                 CastSpell(_Q, predic.x, predic.z)
  84.             end
  85.             if GetDistance(ts.target) <= eRange and EREADY then
  86.                 CastSpell(_E)
  87.             end
  88.             if GetDistance(ts.target) < qbRange then
  89.                 myHero:Attack(ts.target)
  90.             end
  91.         end
  92.         if DMConfig.qHarass then
  93.             if predic ~= nil and QREADY and GetDistance(predic) < qRange then
  94.                 CastSpell(_Q, predic.x, predic.z)
  95.             end
  96.         end
  97.     end
  98.  
  99.     if DMConfig.toggleW and DMConfig.qActive and not myHero.dead then
  100.         --[[if ts.target == nil then
  101.             if wUsed and WREADY then
  102.                 CastSpell(_W)
  103.             end
  104.         elseif ts.target ~= nil then
  105.             if GetDistance(ts.target) <= wRange and wUsed == false and WREADY then
  106.                 CastSpell(_W)
  107.             elseif ts.target.dead or GetDistance(ts.target) > wbRange and wUsed and WREADY then
  108.                 CastSpell(_W)
  109.             end
  110.         end]] -- < Taken out because it was from my last code >
  111.         for i = 1, heroManager.iCount, 1 do
  112.             local hero = heroManager:getHero(i)
  113.             if not hero.dead and hero.visible == true and hero.team ~= myHero.team and myHero.health > (myHero.maxHealth*0.3) then -- will disable if myHero.health is lower than 30% of max health.
  114.                 if GetDistance(hero) < wRange then
  115.                     if wUsed == false then
  116.                         CastSpell(_W)
  117.                         wUsed = true
  118.                     end
  119.                 elseif GetDistance(hero) > wbRange and wUsed == true then
  120.                     CastSpell(_W)
  121.                     wUsed = false
  122.                 end
  123.             end
  124.         end
  125.     end
  126. end
  127.  
  128. --[[function OnProcessSpell(unit, spell)
  129.     if unit.isMe and wUsed == false and spell and spell.name:find("BurningAgony") then
  130.         wUsed = true
  131.     elseif unit.isMe and wUsed == true and spell and spell.name:find("BurningAgony") then
  132.         wUsed = false  
  133.     end
  134. end]]
  135.  
  136. function OnDraw()
  137.     if DMConfig.drawcircles and not myHero.dead then
  138.         DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x990099)
  139.         DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x003300)
  140.         DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x003300)
  141.         if ts.target ~= nil then
  142.             for j=0, 10 do
  143.                 DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  144.             end
  145.         end
  146.     end
  147.     if DMConfig.drawcircles and ts.target ~= nil and predic ~= nil and not myHero.dead then
  148.         DrawCircle(predic.x, predic.y, predic.z, pRange, 0x000099)
  149.     end
  150. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement