Guest User

Elise Combo

a guest
Apr 18th, 2013
4,663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.39 KB | None | 0 0
  1. if myHero.charName ~= "Elise" then return end
  2.  
  3. local qrange = 625
  4. local range = 650
  5. local wrange = 950
  6. local erange = 1075
  7. local watibefureHuman = 0
  8.  
  9. local QREADY, WREADY, EREADY, RREADY = false, false, false, false
  10. local HUMAN, SPIDER = false, false
  11. local qManaCost, wManaCost, eManaCost = 0, 0, 0
  12.  
  13. local ts = TargetSelector(TARGET_LOW_HP_PRIORITY, 1150, DAMAGE_MAGIC, true)
  14. local tp = TargetPrediction(erange, 1.3, 265)
  15.  
  16. function OnLoad()
  17.     ELConfig = scriptConfig("Elise Combo", "EliseCombo")
  18.     ELConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  19.     ELConfig:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 84)
  20.     ELConfig:addParam("usee", "Use SPIDER E", SCRIPT_PARAM_ONOFF, true)
  21.     ELConfig:addParam("StoH", "Can Spider to Human", SCRIPT_PARAM_ONOFF, true)
  22.    
  23.     ELConfig:permaShow("scriptActive")
  24.     ELConfig:permaShow("harass")
  25.    
  26.     ts.name = "Elise"
  27.     ELConfig:addTS(ts)
  28.    
  29.     PrintChat(" >> Elise Combo by HunteR")
  30. end
  31.  
  32. function OnTick()
  33.     if myHero.dead then
  34.         return
  35.     end
  36.    
  37.     ts:update()
  38.    
  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.    
  44.     if myHero:GetSpellData(_Q).name == "EliseHumanQ" then
  45.         HUMAN = true
  46.         SPIDER = false
  47.     else
  48.         HUMAN = false
  49.         SPIDER = true
  50.     end
  51.    
  52.     if ELConfig.scriptActive then combo("Combo") end
  53.     if ELConfig.harass then combo("harass") end
  54. end
  55.  
  56. function combo(typeC)
  57.     if ts.target ~= nil then
  58.         local distanceto = GetDistance(ts.target)
  59.    
  60.         if HUMAN then
  61.             local spellQ = myHero:GetSpellData(_Q)
  62.             local spellW = myHero:GetSpellData(_W)
  63.             local spellE = myHero:GetSpellData(_E)
  64.            
  65.             qManaCost = spellQ.mana
  66.             wManaCost = spellW.mana
  67.             eManaCost = spellE.mana
  68.            
  69.             local prediction = tp:GetPrediction(ts.target)
  70.            
  71.             if prediction ~= nil and GetDistance(prediction) < erange and EREADY then
  72.                 CastSpell(_E, prediction.x, prediction.z)
  73.                 return
  74.             end
  75.            
  76.             if not ts.target.canMove or typeC == "Combo" then
  77.                 if QREADY and distanceto < qrange then
  78.                     CastSpell(_Q, ts.target)
  79.                    
  80.                     local timeCooldown = math.ceil(os.clock() + spellQ.cd)
  81.                     if (timeCooldown > watibefureHuman) then watibefureHuman = timeCooldown end
  82.                    
  83.                     return
  84.                 end
  85.                 if WREADY and distanceto < wrange then
  86.                     CastSpell(_W, ts.target.x, ts.target.z)
  87.                    
  88.                     local timeCooldown = math.ceil(os.clock() + spellW.cd)
  89.                     if (timeCooldown > watibefureHuman) then watibefureHuman = timeCooldown end
  90.                    
  91.                     return
  92.                 end
  93.                
  94.                 if typeC == "Combo" and RREADY and distanceto <= 700 then
  95.                     CastSpell(_R)
  96.                 end
  97.             end
  98.         else
  99.             if QREADY and typeC == "Combo" then
  100.                 if distanceto < 475 then
  101.                     CastSpell(_Q, ts.target)
  102.                     if WREADY then CastSpell(_W) end
  103.                     return
  104.                 elseif distanceto < erange and EREADY and ELConfig.usee then
  105.                     local qdmg = getDmg("Q", ts.target, myHero)
  106.                     local addmg = getDmg("AD", ts.target, myHero)
  107.                    
  108.                     if (qdmg + (addmg * 2)) > ts.target.health then
  109.                         CastSpell(_E, ts.target)
  110.                         return
  111.                     end
  112.                 end
  113.             end
  114.            
  115.             if ((os.clock() >= watibefureHuman and ELConfig.StoH and not QREADY and distanceto < qrange and (qManaCost + eManaCost) <= myHero.mana) or typeC == "harass") and RREADY then
  116.                 CastSpell(_R)
  117.                 return
  118.             end
  119.         end
  120.        
  121.         if typeC == "Combo" then myHero:Attack(ts.target) end
  122.     end
  123. end
Advertisement
Add Comment
Please, Sign In to add comment