16HeX16

Maokai Combo

Jun 1st, 2013
887
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.99 KB | None | 0 0
  1. -->>        Maokai      <<--
  2. -- Space - W -> Q
  3. -- G - E -> W -> Q -> R
  4. -- Z - E
  5.  
  6. if myHero.charName ~= "Maokai" then return end
  7.  
  8. local qRange = 600
  9. local wRange = 650
  10. local eRange = 1100
  11. local rRange = 650
  12. local QREADY, WREADY, EREADY = false, false, false
  13. local RNDSlot = nil
  14.  
  15. if VIP_USER then
  16.     ep = TargetPredictionVIP(eRange, 1750, 0.25, 175)
  17.     PrintChat("<font color='#CCCCCC'> >> Maokai Helper - VIP Prediction <<</font>")
  18. else
  19.     ep = TargetPrediction(eRange, 1.75, 250, 175)
  20.     PrintChat("<font color='#CCCCCC'> >> Maokai Helper - Basic Prediction <<</font>")
  21. end
  22.  
  23. function OnLoad()
  24.     MHConfig = scriptConfig("MaokaiCombo", "MaokaiCombo")
  25.     MHConfig:addParam("gankCombo", "Gank Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  26.     MHConfig:addParam("fullCombo", "Full Combo", SCRIPT_PARAM_ONKEYDOWN, false, 71)
  27.     MHConfig:addParam("eHarass", "E Harass", SCRIPT_PARAM_ONKEYDOWN, false, 90)
  28.     MHConfig:addParam("drawCircles", "Draw Ranges", SCRIPT_PARAM_ONOFF, false)
  29.     MHConfig:permaShow("gankCombo")
  30.     MHConfig:permaShow("fullCombo")
  31.    
  32.     ts = TargetSelector(TARGET_LOW_HP, 1200, DAMAGE_MAGIC)
  33.     ts.name = "Maokai"
  34.     MHConfig:addTS(ts)
  35. end
  36.  
  37. function OnTick()
  38.     ts:update()
  39.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  40.     WREADY = (myHero:CanUseSpell(_W) == READY)
  41.     EREADY = (myHero:CanUseSpell(_E) == READY)
  42.     RREADY = (myHero:CanUseSpell(_R) == READY)
  43.     RNDSlot = GetInventorySlotItem(3143)
  44.     if ts.target then
  45.         if MHConfig.gankCombo then -- W -> Q
  46.             gankCombo(ts.target)
  47.         end
  48.         if MHConfig.fullCombo then -- E -> W -> Q -> R
  49.             fullCombo(ts.target)
  50.         end
  51.         if MHConfig.eHarass then -- E
  52.             Harass(ts.target)
  53.         end
  54.     end
  55. end
  56.  
  57. function gankCombo(target)
  58.     if WREADY and GetDistance(target) <= wRange then
  59.         CastSpell(_W, target)
  60.     end
  61.     if RNDSlot ~= nil and CanUseSpell(RNDSlot) == READY and GetDistance(ts.target) <= 500 then
  62.         CastSpell(RNDSlot)
  63.     end
  64.     if QREADY and GetDistance(target) <= qRange then
  65.         CastSpell(_Q, target.x, target.z)
  66.     end
  67. end
  68.  
  69. function fullCombo(target)
  70.     local ePred = ep:GetPrediction(target)
  71.     if EREADY and ePred and GetDistance(ePred) < eRange then
  72.         if ep:GetHitChance(target) > 0.5 then
  73.             CastSpell(_E, ePred.x, ePred.z)
  74.         end
  75.     end
  76.     myHero:Attack(target)
  77.     if WREADY and GetDistance(target) <= wRange then
  78.         CastSpell(_W, target)
  79.     end
  80.     if RNDSlot ~= nil and CanUseSpell(RNDSlot) == READY and GetDistance(ts.target) <= 500 then
  81.         CastSpell(RNDSlot)
  82.     end
  83.     if RREADY and GetDistance(target) <= rRange then
  84.         if myHero:GetSpellData(_R).name ~= "maokaidrain3toggle" then
  85.             CastSpell(_R, target.x, target.z)
  86.         end
  87.     end
  88.     if QREADY and GetDistance(target) <= qRange then
  89.         CastSpell(_Q, target.x, target.z)
  90.     end
  91. end
  92.  
  93. function Harass(target)
  94.     local ePred = ep:GetPrediction(target)
  95.     if EREADY and ePred and GetDistance(ePred) < eRange then
  96.         if ep:GetHitChance(target) > 0.5 then
  97.             CastSpell(_E, ePred.x, ePred.z)
  98.         end
  99.     end
  100. end
  101.  
  102. function OnDraw()
  103.     if not myHero.dead and MHConfig.drawCircles then
  104.         DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0xCCFF33)
  105.     end
  106. end
Advertisement
Add Comment
Please, Sign In to add comment