16HeX16

Varus Helper 1.1.1

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