16HeX16

Varus Helper 1.1 - Toggle

Mar 31st, 2013
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.01 KB | None | 0 0
  1. --[[    Varus Helper by HeX 1.1  - Toggled  ]]--
  2.  
  3. if myHero.charName ~= "Varus" then return end
  4.  
  5. --[[    Ranges  ]]--
  6. local qRange = 0
  7. local eRange = 925
  8. --[[    Attacks ]]--
  9. local ProcReady = false
  10. --[[    Prediction  ]]--
  11. local ep = TargetPrediction(925, 1.8, 150)
  12. --[[    Q Stuff ]]--
  13. local cast = false
  14. local tick = 0
  15. --[[    Items   ]]--
  16. local ignite = nil
  17. local QREADY, EREADY = false, false
  18.  
  19. function OnLoad()
  20.     PrintChat("<font color='#CCCCCC'> >> Varus Helper 1.1 loaded! <<</font>")
  21.     VHConfig = scriptConfig("Varus Helper", "VarusHelper")
  22.     VHConfig:addParam("scriptActive", "Auto Proc", SCRIPT_PARAM_ONKEYTOGGLE, true, 90)
  23.     VHConfig:addParam("autoignite", "Ignite when Killable", SCRIPT_PARAM_ONOFF, true)
  24.     VHConfig:addParam("drawcirclesSelf", "Draw Circles - Self", SCRIPT_PARAM_ONOFF, false)
  25.     VHConfig:addParam("drawcirclesEnemy", "Draw Circles - Enemy", SCRIPT_PARAM_ONOFF, false)
  26.     VHConfig:addParam("waitDelay", "Delay before Q(ms)",SCRIPT_PARAM_SLICE, 250, 0, 2000, 2)
  27.     VHConfig:permaShow("scriptActive")
  28.    
  29.     ts = TargetSelector(TARGET_LOW_HP, 1600, DAMAGE_MAGIC)
  30.     ts.name = "Varus"
  31.     VHConfig:addTS(ts)
  32.    
  33.     ProcReady = false
  34.    
  35.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  36.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  37.     end
  38. end
  39.  
  40. function OnTick()
  41.     ts:update()
  42.  
  43.     --[[    Prediction  ]]--
  44.     qRange = 925 + (0.3375*VHConfig.waitDelay)
  45.     qp = TargetPrediction(qRange, 1.9, 100)
  46.    
  47.     if ts.target ~= nil then
  48.         qPred = qp:GetPrediction(ts.target)
  49.         ePred = ep:GetPrediction(ts.target)
  50.     end
  51.    
  52.     --[[    Ready   ]]--
  53.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  54.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  55.     EREADY = (myHero:CanUseSpell(_E) == READY)
  56.    
  57.     --[[    Auto Ignite ]]--
  58.     if VHConfig.autoignite then    
  59.         if IREADY then
  60.             local ignitedmg = 0    
  61.             for i = 1, heroManager.iCount, 1 do
  62.                 local enemyhero = heroManager:getHero(i)
  63.                 if ValidTarget(enemyhero,600) then
  64.                     ignitedmg = 50 + 20 * myHero.level
  65.                     if enemyhero.health <= ignitedmg then
  66.                         CastSpell(ignite, enemyhero)
  67.                     end
  68.                 end
  69.             end
  70.         end
  71.     end
  72.  
  73.     --[[    Auto Proc   ]]--
  74.     if ts.target ~= nil and VHConfig.scriptActive then
  75.         --[[    Abilities   ]]--
  76.         if qPred ~= nil then
  77.             if QREADY and ProcReady == true and GetDistance(qPred) < qRange then
  78.                 QCast()
  79.             end
  80.         end
  81.         if ePred ~= nil then
  82.             if EREADY and GetDistance(ePred) < eRange and ProcReady == true and not QREADY and GetTickCount() > tick + (VHConfig.waitDelay+1000) then
  83.                 CastSpell(_E, ePred.x, ePred.z)
  84.             end
  85.         end
  86.     end
  87. end
  88.  
  89. function OnDraw()  
  90.     if VHConfig.drawcirclesSelf and not myHero.dead then
  91.         DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x00FF00)
  92.     end
  93.     if VHConfig.drawcirclesEnemy and ts.target ~= nil then
  94.         for j=0, 10 do
  95.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  96.         end
  97.     end
  98. end
  99.  
  100. --[[    Functions   ]]--
  101. function OnCreateObj(object)
  102.     if object ~= nil and object.name == "VarusW_counter_03.troy" and GetDistance(object, ts.target) <= 125 then
  103.         ProcReady = true
  104.     end
  105. end
  106.  
  107.  
  108. function OnDeleteObj(object)
  109.     if object ~= nil and object.name == "VarusW_counter_03.troy" then
  110.         ProcReady = false
  111.     end
  112. end
  113.  
  114. --[[    Q Function  ]]--
  115. function QCast()
  116.     if qPred ~= nil and not cast and GetTickCount() - tick > VHConfig.waitDelay then
  117.         CastSpell(_Q, qPred.x, qPred.z)
  118.         tick = GetTickCount()
  119.         cast = true
  120.     end
  121.     if qPred ~= nil and cast and GetTickCount() - tick > VHConfig.waitDelay then
  122.         pQ2 = CLoLPacket(0xE6)
  123.         pQ2:EncodeF(myHero.networkID)
  124.         pQ2:Encode1(128)
  125.         pQ2:EncodeF(qPred.x)
  126.         pQ2:EncodeF(qPred.y)
  127.         pQ2:EncodeF(qPred.z)
  128.         pQ2.dwArg1 = 1
  129.         pQ2.dwArg2 = 0
  130.         SendPacket(pQ2)
  131.         tick = GetTickCount()
  132.         cast = false
  133.     elseif cast and qPred == nil then
  134.         pQ2 = CLoLPacket(0xE6)
  135.         pQ2:EncodeF(myHero.networkID)
  136.         pQ2:Encode1(128)
  137.         pQ2:EncodeF(mousePos.x)
  138.         pQ2:EncodeF(mousePos.y)
  139.         pQ2:EncodeF(mousePos.z)
  140.         pQ2.dwArg1 = 1
  141.         pQ2.dwArg2 = 0
  142.         SendPacket(pQ2)
  143.         tick = GetTickCount()
  144.         cast = false       
  145.     end
  146. end
Advertisement
Add Comment
Please, Sign In to add comment