Kain2030

Varus Helper - 1.9b.lua

Aug 9th, 2013
1,813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.01 KB | None | 0 0
  1. --[[
  2. Varus Helper v1.9b
  3. by Vadash
  4. with Kain fix
  5. ]]
  6. if myHero.charName ~= "Varus" then return end
  7. local hotkeyQ, hotkeyW, hotkeyE, hotkeyR = string.byte("Q"), string.byte("W"), string.byte("E"), string.byte("R")
  8.  
  9. --[[    Prediction  ]]--
  10. local qpos, epos, rpos = nil, nil, nil -- predicted positions
  11. local qhc, ehc, rhc = 0, 0, 0 -- hitchances
  12. local Q_RANGE, Q_SPEED, Q_DELAY, Q_WIDTH = 1600, 1850, 0, 60
  13. local E_RANGE, E_SPEED, E_DELAY, E_WIDTH = 925, 1500, 0.242, 100
  14. local R_RANGE, R_SPEED, R_DELAY, R_WIDTH = 1190, 1950, 0.25, 80
  15. local qp, ep, rp = nil, nil, nil
  16.  
  17. local CURRENT_ENEMY = nil
  18.  
  19. --[[    Q stuff ]]--
  20. local cast = false
  21. local tick = GetTickCount()
  22. local qChargeTime = 0
  23. local qTarget = nil
  24. local waitDelay = 2000
  25. local dynamicRange = 0
  26. local bBlowQ = false
  27. local OVERSHOOT_RANGE = 70
  28.  
  29. --[[    W debuffs   ]]--
  30. local poisonedtimets2 = 0
  31. local poisonedtimets3 = 0
  32. local poisonedtime2 = {}
  33. local poisonedtime3 = {}
  34. local enemyTable = GetEnemyHeroes()
  35. local N_ENEMYES = 0
  36. local lastBlightProc = {}
  37. local bPoisonUp = false
  38. local delayQE = 3000
  39.  
  40. --[[    R stuff ]]--
  41. local bBlowR = false
  42. local bAllowR = false
  43.  
  44. --[[    AA stuff and timers ]]--
  45. local poisonRecheckTimer = GetTickCount()
  46. local qFixTimer = GetTickCount()
  47. local rTimer = 0
  48. local drawTimer = 0
  49. local eTimer = GetTickCount()
  50.  
  51. local lastAttack = 0
  52. local AttackDelay = 0
  53.  
  54. --[[    Is abylity ready    ]]--
  55. local QREADY, EREADY, RREADY = false, false, false
  56.  
  57. function OnSendPacket(p)
  58.     local packet = Packet(p) --smartcast fix
  59.     if p.header == 0xE6 and cast then -- 2nd cast of channel spells packet2
  60.         p.pos = 5
  61.         spelltype = p:Decode1()
  62.         if spelltype == 0x80 then -- 0x80 == Q
  63.             p.pos = 1
  64.             p:Block()
  65.         end
  66.     end
  67.     if packet:get('name') == 'S_CAST' then
  68.         if packet:get('spellId') == _R and VConfig.autoult then
  69.             if not bAllowR then
  70.                 p.pos = 1
  71.                 packet:block()
  72.             else
  73.                 bAllowR = false
  74.             end
  75.         end
  76.     end
  77. end
  78.  
  79. function OnLoad()
  80.     PrintChat("<font color='#CCCCCC'> >> Varus Helper QWER 1.9 loaded. <<</font>")
  81.     PrintChat("DONT CHANGE KEYBINDS VIA SHIFT MENU! Edit in code (line#2).")
  82.     VConfig = scriptConfig("Varus Helper", "VarusHelper")
  83.     VConfig:addParam("blowQold", "Cast Q to enemy / mousepos", SCRIPT_PARAM_ONKEYDOWN, false, hotkeyQ)
  84.     VConfig:addParam("cancelQ", "Q/R emergency cancel", SCRIPT_PARAM_ONKEYDOWN, false, hotkeyW)
  85.     VConfig:addParam("EActive", "Cast E", SCRIPT_PARAM_ONKEYDOWN, false, hotkeyE)
  86.     VConfig:addParam("autoult", "Aim R automatically (u still need to press R)", SCRIPT_PARAM_ONOFF, true)
  87.     VConfig:addParam("tryPrioritizeQ", "Always use Q first to proc stacks", SCRIPT_PARAM_ONOFF, false)
  88.     VConfig:addParam("drawcirclesSelf", "Draw Circles - Self", SCRIPT_PARAM_ONOFF, false)
  89.     VConfig:addParam("drawcirclesEnemy", "Draw Circles - Enemy", SCRIPT_PARAM_ONOFF, false)
  90.     VConfig:addParam("arrangeTS", "Auto arrange priority (if dont work disable and double F9)", SCRIPT_PARAM_ONOFF, true)
  91.    
  92.     qp = TargetPredictionVIP(Q_RANGE, Q_SPEED, Q_DELAY, Q_WIDTH)
  93.     ep = TargetPredictionVIP(E_RANGE, E_SPEED, E_DELAY, E_WIDTH)
  94.     rp = TargetPredictionVIP(R_RANGE, R_SPEED, R_DELAY, R_WIDTH) -- updated from data files (100)
  95.    
  96.     N_ENEMYES = heroManager.iCount / 2
  97.     for i=1, N_ENEMYES do lastBlightProc[i] = 0 end
  98.     for i=1, N_ENEMYES do poisonedtime2[i] = 0 end
  99.     for i=1, N_ENEMYES do poisonedtime3[i] = 0 end
  100. end
  101.  
  102. local SortList = {
  103.     ["Ashe"]= 1,["Caitlyn"] = 1,["Corki"] = 1,["Draven"] = 1,["Ezreal"] = 1,["Graves"] = 1,["Jayce"] = 1,["KogMaw"] = 1,["MissFortune"] = 1,["Quinn"] = 1,["Sivir"] = 1,
  104.     ["Tristana"] = 1,["Twitch"] = 1,["Varus"] = 1,["Vayne"] = 1,
  105.  
  106.     ["Ahri"] = 2,["Annie"] = 2,["Akali"] = 2,["Anivia"] = 2,["Brand"] = 2,["Cassiopeia"] = 2,["Diana"] = 2,["Evelynn"] = 2,["FiddleSticks"] = 2,["Fizz"] = 2,["Gragas"] = 2,
  107.     ["Heimerdinger"] = 2,["Karthus"] = 2,["Kassadin"] = 2,["Katarina"] = 2,["Kayle"] = 2,["Kennen"] = 2,["Leblanc"] = 2,["Lissandra"] = 2,["Lux"] = 2,["Malzahar"] = 2,["Zed"] = 2,
  108.     ["Mordekaiser"] = 2,["Morgana"] = 2,["Nidalee"] = 2,["Orianna"] = 2,["Rumble"] = 2,["Ryze"] = 2,["Sion"] = 2,["Swain"] = 2,["Syndra"] = 2,["Teemo"] = 2,["TwistedFate"] = 2,
  109.     ["Veigar"] = 2,["Viktor"] = 2,["Vladimir"] = 2,["Xerath"] = 2,["Ziggs"] = 2,["Zyra"] = 2,["MasterYi"] = 2,["Shaco"] = 2,["Jayce"] = 2,["Pantheon"] = 2,["Urgot"] = 2,["Talon"] = 2,
  110.    
  111.     ["Alistar"] = 3,["Blitzcrank"] = 3,["Janna"] = 3,["Karma"] = 3,["Leona"] = 3,["Lulu"] = 3,["Nami"] = 3,["Nunu"] = 3,["Sona"] = 3,["Soraka"] = 3,["Taric"] = 3,["Thresh"] = 3,["Zilean"] = 3,
  112.  
  113.     ["Darius"] = 4,["Elise"] = 4,["Fiora"] = 4,["Gangplank"] = 4,["Garen"] = 4,["Irelia"] = 4,["JarvanIV"] = 4,["Jax"] = 4,["Khazix"] = 4,["LeeSin"] = 4,["Nautilus"] = 4,
  114.     ["Olaf"] = 4,["Poppy"] = 4,["Renekton"] = 4,["Rengar"] = 4,["Riven"] = 4,["Shyvana"] = 4,["Trundle"] = 4,["Tryndamere"] = 4,["Udyr"] = 4,["Vi"] = 4,["MonkeyKing"] = 4,
  115.     ["Aatrox"] = 4,["Nocturne"] = 4,["XinZhao"] = 4,
  116.  
  117.     ["Amumu"] = 5,["Chogath"] = 5,["DrMundo"] = 5,["Galio"] = 5,["Hecarim"] = 5,["Malphite"] = 5,["Maokai"] = 5,["Nasus"] = 5,["Rammus"] = 5,["Sejuani"] = 5,["Shen"] = 5,
  118.     ["Singed"] = 5,["Skarner"] = 5,["Volibear"] = 5,["Warwick"] = 5,["Yorick"] = 5,["Zac"] = 5
  119. }
  120.  
  121. local EnemySort = function(x,y)
  122.         local dmgx = myHero:CalcDamage(x, 100)
  123.         local dmgy = myHero:CalcDamage(y, 100)
  124.  
  125.         dmgx = dmgx/ (1 + (SortList[x.charName]/10) - 0.1)
  126.         dmgy = dmgy/ (1 + (SortList[y.charName]/10) - 0.1)
  127.  
  128.         local valuex = x.health/dmgx
  129.         local valuey = y.health/dmgy
  130.  
  131.         return valuex < valuey
  132.         end
  133.  
  134. local Sort = function(x,y)
  135.         return SortList[x.charName] < SortList[y.charName]
  136.         end
  137.  
  138. function findlowHpEnemy()
  139.     enemyTableLowHp = GetEnemyHeroes()
  140.  
  141.     for j=1, N_ENEMYES-1 do
  142.         for i=1, N_ENEMYES-1 do
  143.             if enemyTableLowHp[i].health > enemyTableLowHp[i+1].health then
  144.                 t = enemyTableLowHp[i]
  145.                 enemyTableLowHp[i] = enemyTableLowHp[i+1]
  146.                 enemyTableLowHp[i+1] = t
  147.             end
  148.         end
  149.     end
  150.    
  151.     for i, enemy in ipairs(enemyTableLowHp) do
  152.         if enemy and enemy.valid and enemy.team ~= myHero.team and not enemy.dead and enemy.visible then
  153.             t1, t2, qpos = qp:GetPrediction(enemy)
  154.             if qpos and GetDistance(qpos) < dynamicRange then
  155.                 return enemy
  156.             end
  157.         end
  158.     end
  159.     return nil
  160. end
  161.  
  162. function blowQ() -- cast Q to lowhp enemy or mousepos
  163.     closestEnemy = findlowHpEnemy()
  164.     if closestEnemy and ValidTarget(closestEnemy, 2000) then
  165.         t1, t2, qpos = qp:GetPrediction(closestEnemy)
  166.     else
  167.         qpos = nil
  168.     end
  169.     CastQ2FAST()
  170. end
  171.  
  172. function fixQ() -- cast Q to enemy or cancel
  173.     closestEnemy = findlowHpEnemy()
  174.     if closestEnemy and ValidTarget(closestEnemy, 1600) then
  175.         t1, t2, qpos = qp:GetPrediction(closestEnemy)
  176.         if qpos then
  177.             CastQ2FAST()
  178.         else
  179.             CastSpell(10)
  180.             cast = false
  181.         end
  182.     else
  183.         CastSpell(10)
  184.         cast = false
  185.     end
  186. end
  187.  
  188. function OnWndMsg(msg, key)
  189.     if key == hotkeyQ then
  190.         if msg == KEY_UP then
  191.             bBlowQ = true
  192.         else
  193.             bBlowQ = false
  194.         end
  195.     end
  196.     if key == hotkeyR and VConfig.autoult then
  197.         if msg == KEY_UP or msg == KEY_DOWN then
  198.             rTimer = GetTickCount()
  199.         end
  200.     end
  201. end
  202.  
  203. function OnTick()
  204.     table.sort(enemyTable, EnemySort)
  205.  
  206.     AttackDelay = (( 1000 * ( -0.435 + (0.625/0.658)) ) / (myHero.attackSpeed/(1/0.658)))
  207.    
  208.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  209.     EREADY = (myHero:CanUseSpell(_E) == READY)
  210.     RREADY = (myHero:CanUseSpell(_R) == READY) 
  211.  
  212.     if cast then
  213.         qChargeTime = math.max(0, GetTickCount()-tick)
  214.         qChargeTime = math.min(qChargeTime, 2000)
  215.     else
  216.         qChargeTime = 0
  217.     end
  218.     dynamicRange = 925 + (0.3375 * qChargeTime)
  219.     if qChargeTime < 300 then
  220.         dynamicRange = dynamicRange - OVERSHOOT_RANGE
  221.     end
  222.    
  223.     -- Q fix section
  224.     if GetTickCount() - qFixTimer > 99 then
  225.         qFixTimer = GetTickCount()
  226.         if cast and (qTarget and not ValidTarget(qTarget, 1600)) then --automat fix
  227.             closestEnemy = findlowHpEnemy()
  228.             if closestEnemy and GetDistance(closestEnemy) < 450 then
  229.                 fixQ()
  230.             end
  231.         end
  232.         if cast and bBlowQ then --cast Q to enemy or mousepos
  233.             blowQ()
  234.             bBlowQ = false
  235.         end
  236.         if cast and VConfig.cancelQ then --drop Q
  237.             CastSpell(10)
  238.             cast = false
  239.         elseif VConfig.cancelQ then
  240.             rTimer = 0
  241.         end
  242.     end
  243.    
  244.     --R
  245.     if not bBlowR and RREADY and GetTickCount() - rTimer < 5000 then
  246.         bBlowR = true
  247.     else
  248.         bBlowR = false
  249.     end
  250.     if bBlowR and not cast then
  251.         if RREADY then
  252.             koeff = 0.6
  253.             for i, enemy in ipairs(enemyTable) do
  254.                 if ValidTarget(enemy) then     
  255.                     rhc = rp:GetHitChance(enemy)
  256.                     rpos = rp:GetPrediction(enemy)
  257.                     if rpos and rhc > koeff and GetDistance(rpos) < R_RANGE then
  258.                         bAllowR = true
  259.                         CastSpell(_R, rpos.x, rpos.z)
  260.                         rTimer = 0
  261.                         return
  262.                     end
  263.                 end
  264.                 koeff = koeff + 0.3/N_ENEMYES              
  265.             end
  266.         end
  267.     end  
  268.    
  269.     --E
  270.     if VConfig.EActive and not cast and GetTickCount() - eTimer > 100 then
  271.         eTimer = GetTickCount()
  272.         -- if EREADY and not AutoCarry.CanAttack then
  273.         if EREADY then
  274.             bestHc = 0
  275.             bestPred = nil
  276.             for i, enemy in ipairs(enemyTable) do
  277.                 if ValidTarget(enemy) then
  278.                     epos = ep:GetPrediction(enemy)
  279.                     ehc = ep:GetHitChance(enemy)
  280.                     if epos and GetDistance(epos) < E_RANGE and ehc > 0.7 then
  281.                         bestHc = ehc
  282.                         bestPred = epos
  283.                     end
  284.                 end
  285.             end
  286.             if bestPred then
  287.                 CastSpell(_E, bestPred.x, bestPred.z)
  288.             end
  289.         end
  290.     end    
  291.    
  292.     -- poison buff recheck every 50-100 ms
  293.     if GetTickCount() - poisonRecheckTimer > 99 then
  294.         poisonRecheckTimer = GetTickCount()
  295.         -- update range
  296.         delayQE = 3*AttackDelay + 1000 
  297.         bPoisonUp = false
  298.         for i, enemy in ipairs(enemyTable) do -- scan enemyes for Q/E proc
  299.             if cast then bPoisonUp = true end
  300.             if ValidTarget(enemy, 1600) then
  301.                 if poisonedtime2[i] ~= 0 or poisonedtime3[i] ~= 0 then
  302.                     if not TargetHaveBuff("varuswdebuff", enemy) then
  303.                         poisonedtime2[i] = 0
  304.                         poisonedtime3[i] = 0
  305.                     else
  306.                         bPoisonUp = true
  307.                     end
  308.                 end
  309.             end
  310.         end
  311.     end
  312.    
  313.     if ((QREADY or EREADY) and bPoisonUp) then
  314.         bPoisonUp = false
  315.         for i, enemy in ipairs(enemyTable) do -- scan enemyes for Q/E proc
  316.             CURRENT_ENEMY = enemy
  317.             if ValidTarget(CURRENT_ENEMY, 1600) then
  318.                 QREADY = (myHero:CanUseSpell(_Q) == READY)
  319.                 EREADY = (myHero:CanUseSpell(_E) == READY)
  320.                 RREADY = (myHero:CanUseSpell(_R) == READY)
  321.                
  322.                 poisonedtimets2 = poisonedtime2[i]
  323.                 poisonedtimets3 = poisonedtime3[i]
  324.                
  325.                 qpos = qp:GetPrediction(CURRENT_ENEMY)
  326.                 qhc = qp:GetHitChance(CURRENT_ENEMY)
  327.                 epos = ep:GetPrediction(CURRENT_ENEMY)
  328.                 ehc = ep:GetHitChance(CURRENT_ENEMY)
  329.  
  330.                 --[[    Auto Proc   ]]--
  331.                 if not cast and ((not QREADY and EREADY) or (QREADY and EREADY and not VConfig.tryPrioritizeQ)) then -- E
  332.                     if epos and ehc > 0.7 and (GetTickCount() - lastBlightProc[i] > delayQE) and GetDistance(epos) < E_RANGE then
  333.                         if GetTickCount() - poisonedtimets3 < 12000 or (GetTickCount() - poisonedtimets2 < 5000 and GetDistance(epos) > E_RANGE / 2) then
  334.                             lastBlightProc[i] = GetTickCount()
  335.                             CastSpell(_E, epos.x, epos.z)
  336.                             return
  337.                         end
  338.                     end
  339.                 end
  340.                 if (QREADY and not EREADY) or (QREADY and EREADY and VConfig.tryPrioritizeQ) or (QREADY and EREADY and epos and GetDistance(epos) > E_RANGE) or (QREADY and cast) then -- Q
  341.                     if not cast and (GetDistance(CURRENT_ENEMY) < 1600 - 2*CURRENT_ENEMY.ms or GetDistance(CURRENT_ENEMY) < 900)
  342.                         and GetTickCount() - poisonedtimets3 < 12000
  343.                         and (GetTickCount() - lastBlightProc[i] > delayQE) then
  344.                         CastQ1()
  345.                         qTarget = CURRENT_ENEMY
  346.                         lastBlightProc[i] = GetTickCount()
  347.                         return
  348.                     end
  349.                     if cast and qpos and GetDistance(qpos) < dynamicRange and qTarget and CURRENT_ENEMY.networkID == qTarget.networkID and qhc > 0.6 and (GetTickCount()-tick > 300 or (GetDistance(qpos) < 800 and GetTickCount()-tick > 150)) then -- Q on 3 stacks end
  350.                         CastQ2()
  351.                         qTarget = nil
  352.                         lastBlightProc[i] = GetTickCount()
  353.                         return
  354.                     end            
  355.                 end
  356.             end
  357.         end
  358.     end
  359. end
  360.  
  361. function OnDraw()
  362.     if VConfig.drawcirclesSelf and not myHero.dead then
  363.         if myHero:CanUseSpell(_Q) == READY and not cast then DrawCircle(myHero.x, myHero.y, myHero.z, Q_RANGE, 0xFF0000) end
  364.         if myHero:CanUseSpell(_Q) == READY and cast then DrawCircle(myHero.x, myHero.y, myHero.z, dynamicRange, 0xFF0000) end
  365.     end
  366.    
  367.     if VConfig.drawcirclesEnemy and RREADY and GetTickCount() - rTimer < 5000 and GetTickCount() - drawTimer > 0 then
  368.         PrintFloatText(myHero, 6, "Auto R active! Press W to cancel")
  369.         drawTimer = GetTickCount() + 500
  370.     end
  371. end
  372.  
  373. function OnProcessSpell(unit, spell)
  374.     if unit.isMe and spell.name:find("Varus") and spell.name:find("Attack") then
  375.         lastAttack = GetTickCount()
  376.     end
  377. end
  378.  
  379. function OnCreateObj(object)
  380.     if object ~= nil and object.valid and object.name == "VarusQChannel.troy" and GetDistance(object) < 150 then
  381.         cast = true
  382.     end
  383.     if object ~= nil and object.valid and object.name == "VarusW_counter_01.troy" then
  384.         for i, enemy in ipairs(enemyTable) do
  385.             if enemy ~= nil and ValidTarget(enemy, 1000) and enemy.valid and enemy.visible and enemy.team ~= myHero.team and TargetHaveBuff("varuswdebuff", enemy) and GetDistance(enemy, object) < 150 then
  386.                 poisonedtime2[i] = 0
  387.                 poisonedtime3[i] = 0
  388.             end
  389.         end
  390.     end
  391.     if object ~= nil and object.valid and object.name == "VarusW_counter_02.troy" then
  392.         for i, enemy in ipairs(enemyTable) do
  393.             if enemy ~= nil and ValidTarget(enemy, 1000) and enemy.valid and enemy.visible and enemy.team ~= myHero.team and TargetHaveBuff("varuswdebuff", enemy) and GetDistance(enemy, object) < 150 then
  394.                 poisonedtime2[i] = GetTickCount()
  395.                 poisonedtime3[i] = 0
  396.             end
  397.         end
  398.     end
  399.     if object ~= nil and object.valid and object.name == "VarusW_counter_03.troy" then
  400.         for i, enemy in ipairs(enemyTable) do
  401.             if enemy ~= nil and ValidTarget(enemy, 1000) and enemy.valid and enemy.visible and enemy.team ~= myHero.team and TargetHaveBuff("varuswdebuff", enemy) and GetDistance(enemy, object) < 150 then
  402.                 poisonedtime2[i] = 0
  403.                 poisonedtime3[i] = GetTickCount()
  404.             end
  405.         end
  406.     end
  407. end
  408.  
  409. function OnDeleteObj(object)
  410.     if object ~= nil and object.valid and object.name == "VarusQChannel.troy" and GetDistance(object) < 300 then
  411.         cast = false
  412.         qTarget = nil
  413.     end
  414.     if object ~= nil and object.valid and (object.name == "VarusW_counter_02.troy") then
  415.         for i, enemy in ipairs(enemyTable) do
  416.             if enemy ~= nil and enemy.valid and enemy.visible and enemy.team ~= myHero.team and not TargetHaveBuff("varuswdebuff", enemy) and GetDistance(enemy, object) < 150 then
  417.                 poisonedtime2[i] = 0
  418.             end
  419.         end
  420.     end
  421.     if object ~= nil and object.valid and (object.name == "VarusW_counter_03.troy") then
  422.         for i, enemy in ipairs(enemyTable) do
  423.             if enemy ~= nil and enemy.valid and enemy.visible and enemy.team ~= myHero.team and not TargetHaveBuff("varuswdebuff", enemy) and GetDistance(enemy, object) < 150 then
  424.                 poisonedtime3[i] = 0
  425.             end
  426.         end
  427.     end
  428. end
  429.  
  430. function CastQ1() --start cast
  431.     if not cast and myHero:CanUseSpell(_Q) == READY then
  432.         if qpos then
  433.             CastSpell(_Q, qpos.x, qpos.z)
  434.         elseif CURRENT_ENEMY then
  435.             CastSpell(_Q, CURRENT_ENEMY.x, CURRENT_ENEMY.z)
  436.         else
  437.             CastSpell(_Q, mousePos.x, mousePos.z)
  438.         end
  439.         cast = true
  440.         tick = GetTickCount()
  441.     end
  442. end
  443.  
  444. function CastQ2() -- end cast
  445.     if qpos then
  446.         cast = false
  447.         pQ2 = CLoLPacket(0xE6)
  448.         pQ2:EncodeF(myHero.networkID)
  449.         pQ2:Encode1(128) --Q
  450.         pQ2:EncodeF(qpos.x)
  451.         pQ2:EncodeF(qpos.y)
  452.         pQ2:EncodeF(qpos.z)
  453.         pQ2.dwArg1 = 1
  454.         pQ2.dwArg2 = 0
  455.         SendPacket(pQ2)
  456.         tick = GetTickCount()
  457.     end
  458. end
  459.  
  460. function CastQ2FAST() -- end cast
  461.     if qpos and cast then
  462.         cast = false
  463.         pQ2 = CLoLPacket(0xE6)
  464.         pQ2:EncodeF(myHero.networkID)
  465.         pQ2:Encode1(128) --Q
  466.         pQ2:EncodeF(qpos.x)
  467.         pQ2:EncodeF(qpos.y)
  468.         pQ2:EncodeF(qpos.z)
  469.         pQ2.dwArg1 = 1
  470.         pQ2.dwArg2 = 0
  471.         SendPacket(pQ2)
  472.         tick = GetTickCount()
  473.     elseif cast then
  474.         cast = false
  475.         pQ2 = CLoLPacket(0xE6)
  476.         pQ2:EncodeF(myHero.networkID)
  477.         pQ2:Encode1(128) --Q
  478.         pQ2:EncodeF(mousePos.x)
  479.         pQ2:EncodeF(mousePos.y)
  480.         pQ2:EncodeF(mousePos.z)
  481.         pQ2.dwArg1 = 1
  482.         pQ2.dwArg2 = 0
  483.         SendPacket(pQ2)
  484.         tick = GetTickCount()  
  485.     end
  486. end
Advertisement
Add Comment
Please, Sign In to add comment