Advertisement
FukDaPolice

FukDaGragas 1.5

Apr 24th, 2015
2,706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.76 KB | None | 0 0
  1.  
  2. --[[Gragas by FukDapolice 1.5]]
  3.  
  4.  
  5. if myHero.charName ~= 'Gragas' then return end
  6.  
  7. assert(load(Base64Decode("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"), nil, "bt", _ENV))() ScriptStatus("XKNLSSJSRJS")
  8.  
  9. --Changelog 1.00 release
  10. --Changelog 1.1 draws hp bar              
  11. --              fixed ult      
  12. --              reordered code
  13. --Changelog 1.3 Added HPred for R (experimental)  
  14. --CHANGELOG 1.4 fixed httf messing up with api  
  15. --Changelog 1.5 fixed bugs released open source                      
  16.  
  17. require "SxOrbWalk"
  18. require "VPrediction"
  19. require "HPrediction"
  20.  
  21. local Q = {range = 950, delay = 0.25, speed = 1100, width = 200,IsReady = function() return myHero:CanUseSpell(_Q) == READY end}
  22. local W = {range = 600, IsReady = function() return myHero:CanUseSpell(_W) == READY end}
  23. local E = {range = 650, delay = 0.25, speed = 1000, width = 100,IsReady = function() return myHero:CanUseSpell(_E) == READY end}
  24. local R = {range = 800, delay = 0.25, speed = 1300, width = 100,IsReady = function() return myHero:CanUseSpell(_R) == READY end}
  25. local ignite = nil
  26. local iDmg = 0
  27. local target = nil
  28. local myTarget = nil
  29. local ts
  30. local ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, 1500, DAMAGE_MAGIC, true)
  31. local myTarget = nil
  32. local Killable = false
  33. local HPred = HPrediction()
  34.  
  35. local ToInterrupt = {}
  36. local InterruptList = {
  37.     { charName = "Caitlyn", spellName = "CaitlynAceintheHole"},
  38.     { charName = "FiddleSticks", spellName = "Crowstorm"},
  39.     { charName = "FiddleSticks", spellName = "DrainChannel"},
  40.     { charName = "Galio", spellName = "GalioIdolOfDurand"},
  41.     { charName = "Karthus", spellName = "FallenOne"},
  42.     { charName = "Katarina", spellName = "KatarinaR"},
  43.     { charName = "Lucian", spellName = "LucianR"},
  44.     { charName = "Malzahar", spellName = "AlZaharNetherGrasp"},
  45.     { charName = "MissFortune", spellName = "MissFortuneBulletTime"},
  46.     { charName = "Nunu", spellName = "AbsoluteZero"},                            
  47.     { charName = "Pantheon", spellName = "Pantheon_GrandSkyfall_Jump"},
  48.     { charName = "Shen", spellName = "ShenStandUnited"},
  49.     { charName = "Urgot", spellName = "UrgotSwap2"},
  50.     { charName = "Varus", spellName = "VarusQ"},
  51.     { charName = "Warwick", spellName = "InfiniteDuress"},
  52.     { charName = "Velkoz", spellName = "VelkozR"}
  53. }
  54.  
  55.  
  56. TextList = {"", " Killable Ult!"}
  57. KillText = {}
  58. colorText = ARGB(255,255,204,0)
  59.  
  60.  
  61. function GetCustomTarget()
  62.     ts:update()
  63.     if _G.AutoCarry and ValidTarget(_G.AutoCarry.Crosshair:GetTarget()) then return _G.AutoCarry.Crosshair:GetTarget() end
  64.     if not _G.Reborn_Loaded then return ts.target end
  65.     return ts.target
  66. end
  67.  
  68. function OnLoad()
  69.     PrintChat("<font color=\"#00FF00\">Gragas by Fukdapolice.</font>")
  70.     ultActive = false
  71.     IgniteCheck()
  72.     FLoadLib()
  73.     VP = VPrediction(true)  
  74.     _G.oldDrawCircle = rawget(_G, 'DrawCircle')
  75.     _G.DrawCircle = DrawCircle2
  76.     Minions = minionManager(MINION_ENEMY, Q.range, myHero, MINION_SORT_MAXHEALTH_ASC)
  77.     JungleMinions = minionManager(MINION_JUNGLE, Q.range, myHero, MINION_SORT_MAXHEALTH_DEC)
  78.     HP_Q = HPSkillshot({collisionM = false, collisionH = false, delay = 0.25, range = 800, speed = 1100, type = "DelayLine", width = 200})
  79.     HP_E = HPSkillshot({collisionM = true, collisionH = true, delay = 0.25, range = 650, speed = 1000, type = "DelayLine", width = 100})
  80.     HP_R = HPSkillshot({collisionM = false, collisionH = false, delay = 0.25, range = 950, speed = 1300, type = "DelayLine", width = 100})
  81. end
  82.  
  83. function OnTick()
  84.     target = GetCustomTarget()
  85.     Checks()
  86.    
  87.     --if isSX then
  88.         --SxOrb:ForceTarget(target)
  89.     --end
  90.     if UltActive then
  91.         if CountEnemyHeroInRange(R.range) == 0 then
  92.             local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(target, R.delay, R.width, R.range, R.speed, myHero, false)
  93.             if MainTargetHitChance >= 2 and GetDistance(AOECastPosition) <= R.range and R.IsReady() then
  94.                   CastSpell(_R, AOECastPosition.x, AOECastPosition.z)
  95.             end
  96.         end
  97.     end
  98.     if HazMenu.Combo.AutoUlt then AutoUlt() end
  99. end
  100.  
  101. function OnDraw()
  102.     if HazMenu.Draw.drawq then
  103.         DrawCircle(myHero.x,myHero.y,myHero.z,950,0xFFFF0000)
  104.     end            
  105.     if HazMenu.Draw.drawe then
  106.         DrawCircle(myHero.x,myHero.y,myHero.z,650,0xFFFF0000)
  107.     end
  108.     if HazMenu.Draw.drawr then
  109.         DrawCircle(myHero.x,myHero.y,myHero.z,850,0xFFFF0000)
  110.     end
  111.     if  HazMenu.Draw.drawHP then
  112.             for i, enemy in ipairs(GetEnemyHeroes()) do
  113.                 if ValidTarget(enemy) then
  114.                    DrawIndicator(enemy)
  115.                 end
  116.             end
  117.     end    
  118.     if HazMenu.Misc.killtext then
  119.         for i = 1, heroManager.iCount do
  120.             local target = heroManager:GetHero(i)
  121.             if ValidTarget(target) and target ~= nil then
  122.                 local barPos = WorldToScreen(D3DXVECTOR3(target.x, target.y, target.z))
  123.                 local PosX = barPos.x - 35
  124.                 local PosY = barPos.y - 10
  125.                
  126.                 DrawText(TextList[KillText[i]], 16, PosX, PosY, colorText)
  127.             end
  128.         end
  129.     end
  130. end
  131.  
  132.  
  133. function Checks()
  134.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  135.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  136.     WREADY = (myHero:CanUseSpell(_W) == READY)
  137.     EREADY = (myHero:CanUseSpell(_E) == READY)
  138.     RREADY = (myHero:CanUseSpell(_R) == READY)
  139.     calcDmg()
  140.     LFCfunc()
  141.     if ValidTarget(target) then
  142.         if HazMenu.Misc.KS then KS(target) end
  143.         if HazMenu.Misc.KSR then KS(target) end
  144.         if HazMenu.Misc.Ignite then AutoIgnite(target) end
  145.     end
  146.     if target then
  147.         if HazMenu.Misc.UltIn and GetDistance(Target) <= Rrange then CastR(Target, 3) end
  148.         if HazMenu.Misc.UltOut and GetDistance(Target) <= Rrange then CastR(Target, 2) end
  149.        
  150.         if R.IsReady() and HazMenu.Combo.comboR and GetDistance(target) <= R.range then castR(target, HazMenu.Misc.UltDir) end
  151.     end
  152.    
  153.     if HazMenu.combokey then
  154.         Combo()
  155.     end
  156.    
  157.    if HazMenu.harasskey and myHero.mana / myHero.maxMana > HazMenu.Harass.Mana /100 then
  158.         Poke()
  159.    end
  160.    if HazMenu.farmkey and myHero.mana / myHero.maxMana > HazMenu.Farm.Mana /100 then
  161.         Farm()
  162.    end
  163. end
  164.  
  165. function IgniteCheck()
  166.     if myHero:GetSpellData(SUMMONER_1).name:find("summonerdot") then
  167.         ignite = SUMMONER_1
  168.     elseif myHero:GetSpellData(SUMMONER_2).name:find("summonerdot") then
  169.         ignite = SUMMONER_2
  170.     end
  171. end
  172.  
  173. function FLoadLib()
  174.     FMenu()
  175. end
  176.  
  177. function FMenu()
  178.     HazMenu = scriptConfig("Gragas", "Gragas")
  179.         HazMenu:addParam("combokey", "Combo key(Space)", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  180.         HazMenu:addParam("harasskey", "Harass key(C)", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
  181.         HazMenu:addParam("farmkey", "Farm key(V)", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("V"))
  182.    
  183.     HazMenu:addTS(ts)
  184.        
  185.     HazMenu:addSubMenu("Combo", "Combo")
  186.         HazMenu.Combo:addParam("comboQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
  187.         HazMenu.Combo:addParam("comboW", "Use W", SCRIPT_PARAM_ONOFF, true)
  188.         HazMenu.Combo:addParam("comboE", "Use E", SCRIPT_PARAM_ONOFF, true)
  189.         HazMenu.Combo:addParam("comboR", "Use R", SCRIPT_PARAM_ONOFF, true)
  190.         HazMenu.Combo:addParam("minR", "Auto Ultimate if X enemies", SCRIPT_PARAM_SLICE, 2, 0, 5, 0)
  191.         HazMenu.Combo:addParam("AutoUlt", "Use AutoUlt ^", SCRIPT_PARAM_ONOFF, false)
  192.        
  193.     HazMenu:addSubMenu("Harass", "Harass")
  194.         HazMenu.Harass:addParam("harassQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
  195.         HazMenu.Harass:addParam("harassW", "Use W", SCRIPT_PARAM_ONOFF, true)
  196.         HazMenu.Harass:addParam("harassE", "Use E", SCRIPT_PARAM_ONOFF, true)
  197.         HazMenu.Harass:addParam("Mana", "Mana Manager %", SCRIPT_PARAM_SLICE, 50, 1, 100, 0)
  198.    
  199.     HazMenu:addSubMenu("Farm", "Farm")
  200.         HazMenu.Farm:addParam("farmQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
  201.         HazMenu.Farm:addParam("farmW", "Use W", SCRIPT_PARAM_ONOFF, true)
  202.         HazMenu.Farm:addParam("farmE", "Use E", SCRIPT_PARAM_ONOFF, true)
  203.         HazMenu.Farm:addParam("Mana", "Mana Manager %", SCRIPT_PARAM_SLICE, 50, 1, 100, 0)
  204.    
  205.     HazMenu:addSubMenu("Misc", "Misc")
  206.         HazMenu.Misc:addParam("Pred", "Use HPred", SCRIPT_PARAM_ONOFF, true)
  207.         HazMenu.Misc:addParam("KSR", "KillSteal with R", SCRIPT_PARAM_ONOFF, true)
  208.         HazMenu.Misc:addParam("KS", "KillSteal with Q", SCRIPT_PARAM_ONOFF, true)
  209.         HazMenu.Misc:addParam("Ignite", "Use Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  210.         HazMenu.Misc:addParam("killtext", "Draw if Killable with combo", SCRIPT_PARAM_ONOFF, true)
  211.         HazMenu.Misc:addParam("UltOut", "Ult enemy Away", SCRIPT_PARAM_ONKEYDOWN, false, 46)
  212.         HazMenu.Misc:addParam("UltIn", "Ult enemy To-You", SCRIPT_PARAM_ONKEYDOWN, false, 44)
  213.         HazMenu.Misc:addParam("UltDir", "Default Ult direction", SCRIPT_PARAM_LIST, 1, { "On Target", "ahead", "behind" })
  214.        
  215.     HazMenu:addSubMenu("Draw","Draw")
  216.       HazMenu.Draw:addParam("drawq", "Draw Q", SCRIPT_PARAM_ONOFF, true)
  217.       HazMenu.Draw:addParam("drawe", "Draw E", SCRIPT_PARAM_ONOFF, true)
  218.       HazMenu.Draw:addParam("drawr", "Draw R", SCRIPT_PARAM_ONOFF, true)
  219.       HazMenu.Draw:addParam("drawHP", "Draw Dmg on HPBar", SCRIPT_PARAM_ONOFF, true)
  220.    
  221.     HazMenu:addParam("Interrupt", "Ult interrupt", SCRIPT_PARAM_ONOFF, true)
  222.    
  223.     HazMenu:addSubMenu("LagFreeCircles", "LFC")
  224.       HazMenu.LFC:addParam("LagFree", "Activate Lag Free Circles", SCRIPT_PARAM_ONOFF, false)
  225.       HazMenu.LFC:addParam("CL", "Length before Snapping", SCRIPT_PARAM_SLICE, 350, 75, 2000, 0)
  226.       HazMenu.LFC:addParam("CLinfo", "Higher length = Lower FPS Drops", SCRIPT_PARAM_INFO, "")
  227.    
  228.     for i = 1, heroManager.iCount, 1 do
  229.         local enemy = heroManager:getHero(i)
  230.         if enemy.team ~= myHero.team then
  231.             for _, champ in pairs(InterruptList) do
  232.                 if enemy.charName == champ.charName then
  233.                     table.insert(ToInterrupt, champ.spellName)
  234.                 end
  235.             end
  236.         end
  237.     end
  238.    
  239.     if _G.Reborn_Loaded then
  240.     DelayAction(function()
  241.         PrintChat("<font color = \"#FFFFFF\">[Gragas] </font><font color = \"#FF0000\">SAC Status:</font> <font color = \"#FFFFFF\">Successfully integrated.</font> </font>")
  242.         HazMenu:addParam("SACON","[Gragas] SAC:R support is active.", 5, "")
  243.         isSAC = true
  244.     end, 10)
  245.     elseif not _G.Reborn_Loaded then
  246.         PrintChat("<font color = \"#FFFFFF\">[Gragas] </font><font color = \"#FF0000\">Orbwalker not found:</font> <font color = \"#FFFFFF\">SxOrbWalk integrated.</font> </font>")
  247.         HazMenu:addSubMenu("Orbwalker", "SxOrb")
  248.         SxOrb:LoadToMenu(HazMenu.SxOrb)
  249.         isSX = true
  250.     end
  251.     HazMenu:permaShow("combokey")
  252.     HazMenu:permaShow("harasskey")
  253.     HazMenu:permaShow("farmkey")
  254. end
  255.  
  256. function KS(enemy)  
  257.     if Q.IsReady() and getDmg("Q", enemy, myHero) > enemy.health then
  258.         if GetDistance(enemy) <= Q.range and HazMenu.Misc.KS then
  259.             local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, Q.delay, Q.width, Q.range, Q.speed, myHero, false)
  260.             if HitChance >= 2 and GetDistance(CastPosition) <= Q.range and Q.IsReady() then
  261.                 CastSpell(_Q, CastPosition.x, CastPosition.z)
  262.             end
  263.         end
  264.     end
  265.     if R.IsReady() and (getDmg("R", enemy, myHero)- 15) > enemy.health then
  266.         if GetDistance(enemy) <= R.range and HazMenu.Misc.KSR then
  267.             local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(target, R.delay, R.width, R.range, R.speed, myHero, false)
  268.             if MainTargetHitChance >= 2 and GetDistance(AOECastPosition) <= R.range and R.IsReady() then
  269.                 CastSpell(_R, AOECastPosition.x, AOECastPosition.z)
  270.             end
  271.         end
  272.     end
  273. end
  274.  
  275. function AutoIgnite(enemy)
  276.     iDmg = ((IREADY and getDmg("IGNITE", enemy, myHero)) or 0)
  277.     if enemy.health <= iDmg and GetDistance(enemy) <= 600 and ignite ~= nil
  278.         then
  279.             if IREADY then CastSpell(ignite, enemy) end
  280.     end
  281. end
  282.  
  283. function OnProcessSpell(unit, spell)
  284.     if HazMenu.Interrupt and Rready and #ToInterrupt > 0 then
  285.         for _, ability in pairs(ToInterrupt) do
  286.             if spell.name == ability and unit.team ~= myHero.team then
  287.                 if GetDistance(unit) <= Rrange then CastR(unit) end
  288.             end
  289.         end
  290.     end
  291.    
  292. end
  293.  
  294. function Combo()
  295.     if ValidTarget(target) then
  296.         if R.IsReady() and HazMenu.Combo.comboR then
  297.             if HazMenu.Misc.Pred then
  298.             HPredR(target, HazMenu.Misc.UltDir)
  299.             elseif not HazMenu.Misc.Pred then          
  300.             castR(target, HazMenu.Misc.UltDir)
  301.             end
  302.         end
  303.         if W.IsReady() and HazMenu.Combo.comboW then
  304.             if GetDistance(target) <= W.range then
  305.                 CastSpell(_W)
  306.             end
  307.         end
  308.         if E.IsReady() and HazMenu.Combo.comboE then
  309.             if HazMenu.Misc.Pred then
  310.               HPredE()
  311.             elseif not HazMenu.Misc.Pred then
  312.             local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, E.delay, E.width, E.range, E.speed, myHero, true)
  313.                 if HitChance >= 2 and GetDistance(CastPosition) <= E.range and E.IsReady() then
  314.                    CastSpell(_E, CastPosition.x, CastPosition.z)
  315.                 end
  316.             end
  317.         end
  318.                 if Q.IsReady() and HazMenu.Combo.comboQ then
  319.                     if HazMenu.Misc.Pred then
  320.                      HPredQ()
  321.                     elseif not HazMenu.Misc.Pred then
  322.                     local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, Q.delay, Q.width, Q.range, Q.speed, myHero, false)
  323.                      if HitChance >= 2 and GetDistance(CastPosition) <= Q.range and Q.IsReady() then
  324.                        CastSpell(_Q, CastPosition.x, CastPosition.z)
  325.                     end
  326.                   end      
  327.                 end
  328.        
  329.      end
  330. end
  331.  
  332. function Poke()
  333.     if ValidTarget(target) then
  334.         if Q.IsReady() and HazMenu.Harass.harassQ then
  335.              if HazMenu.Misc.Pred then
  336.                      HPredQ()
  337.                     elseif not HazMenu.Misc.Pred then
  338.                     local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, Q.delay, Q.width, Q.range, Q.speed, myHero, false)
  339.                      if HitChance >= 2 and GetDistance(CastPosition) <= Q.range and Q.IsReady() then
  340.                        CastSpell(_Q, CastPosition.x, CastPosition.z)
  341.                     end
  342.                   end      
  343.         end
  344.         if W.IsReady() and HazMenu.Harass.harassW then
  345.             if GetDistance(target) <= W.range then
  346.                 CastSpell(_W)
  347.             end
  348.         end
  349.         if E.IsReady() and HazMenu.Harass.harassE then
  350.              if HazMenu.Misc.Pred then
  351.               HPredE()
  352.             elseif not HazMenu.Misc.Pred then
  353.             local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, E.delay, E.width, E.range, E.speed, myHero, true)
  354.                 if HitChance >= 2 and GetDistance(CastPosition) <= E.range and E.IsReady() then
  355.                    CastSpell(_E, CastPosition.x, CastPosition.z)
  356.                 end
  357.             end
  358.         end
  359.     end
  360. end
  361.  
  362. function Farm()
  363.     Minions:update()
  364.    
  365.     for i, Minion in pairs(Minions.objects) do
  366.         if Q.IsReady() and HazMenu.Farm.farmQ and getDmg("Q", Minion, myHero) > Minion.health then
  367.             CastSpell(_Q, Minion.x, Minion.z)
  368.         end
  369.        
  370.     end
  371.     JungleMinions:update()
  372.     for i, Minion in pairs(JungleMinions.objects) do
  373.         if  Q.IsReady() and HazMenu.Farm.farmQ then
  374.             CastSpell(_Q, Minion.x, Minion.z)
  375.         end
  376.         if  E.IsReady() and HazMenu.Farm.farmE then
  377.             CastSpell(_E, Minion.x, Minion.z)
  378.         end
  379.         if  W.IsReady() and HazMenu.Farm.farmW then
  380.             CastSpell(_W)
  381.         end
  382.     end
  383. end
  384.  
  385. function castR(enemy, direction)
  386.     if HazMenu.Combo.comboR and HazMenu.combokey then
  387.     local CastPosition, HitChance, Position = VP:GetCircularCastPosition(enemy, R.delay, R.width, R.range, R.speed, myHero, false)
  388.     if GetDistance(CastPosition) <= R.range then
  389.         if HitChance >= 2 then
  390.             if direction and direction == 3 then
  391.                 local CastBehind = CastPosition + Vector(CastPosition.x-myHero.x, 0, CastPosition.z-myHero.z):normalized()*100
  392.                 CastSpell(_R, CastBehind.x, CastBehind.z)
  393.             elseif direction and direction == 2 then
  394.                 local CastAhead = CastPosition + Vector(CastPosition.x-myHero.x, 0, CastPosition.z-myHero.z):normalized()
  395.                 CastSpell(_R, CastAhead.x, CastAhead.z)
  396.             else CastSpell(_R, CastPosition.x, CastPosition.z) end
  397.         end
  398.     end
  399.     end
  400. end
  401.  
  402. function HPredR(enemy, direction)
  403.     local unit = target
  404.     if HazMenu.Combo.comboR and HazMenu.combokey then
  405.     local RPos, RHitChance = HPred:GetPredict(HP_R, unit, myHero)
  406.     if GetDistance(target, myHero) <= R.range then
  407.         if RHitChance >= 1 then
  408.             if direction and direction == 3 then
  409.                 local CastBehind = RPos + Vector(RPos.x-myHero.x, 0, RPos.z-myHero.z):normalized()*100
  410.                 CastSpell(_R, CastBehind.x, CastBehind.z)
  411.             elseif direction and direction == 2 then
  412.                 local CastAhead = RPos + Vector(RPos.x-myHero.x, 0, RPos.z-myHero.z):normalized()
  413.                 CastSpell(_R, CastAhead.x, CastAhead.z)
  414.             else CastSpell(_R, RPos.x, RPos.z) end
  415.         end
  416.     end
  417.     end
  418. end
  419.  
  420.  
  421. function HPredQ(unit)
  422.     local unit = target
  423.     local QPos, QHitChance = HPred:GetPredict(HP_Q, unit, myHero)
  424.     if QHitChance >= 1 then
  425.         CastSpell(_Q, QPos.x, QPos.z)
  426.     end
  427.    
  428. end
  429.  
  430. function HPredE(unit)
  431.     local unit = target
  432.     local EPos, EHitChance = HPred:GetPredict(HP_E, unit, myHero)
  433.     if EHitChance >= 1 then
  434.         CastSpell(_E, EPos.x, EPos.z)
  435.     end
  436.    
  437. end
  438.  
  439. function calcDmg()
  440.     for i=1, heroManager.iCount do
  441.         local Target = heroManager:GetHero(i)
  442.         if ValidTarget(Target) and Target ~= nil then
  443.             qDmg = ((QREADY and getDmg("Q", Target, myHero)) or 0)
  444.             wDmg = ((WREADY and getDmg("W", Target, myHero)) or 0)
  445.             eDmg = ((EREADY and getDmg("E", Target, myHero)) or 0)
  446.             rDmg = ((RREADY and getDmg("R", Target, myHero)) or 0)
  447.             allDmg = (rDmg)
  448.            
  449.             if Target.health > allDmg then
  450.                 KillText[i] = 1
  451.             elseif Target.health <= allDmg then
  452.                 KillText[i] = 2
  453.             end
  454.         end
  455.     end
  456. end
  457.  
  458. function LFCfunc()
  459.     if not HazMenu.LFC.LagFree then _G.DrawCircle = _G.oldDrawCircle end
  460.     if HazMenu.LFC.LagFree then _G.DrawCircle = DrawCircle2 end
  461. end
  462.  
  463. -- Barasia, vadash, viseversa
  464.  
  465. function DrawCircleNextLvl(x, y, z, radius, width, color, chordlength)
  466.     radius = radius or 300
  467.     quality = math.max(8,round(180/math.deg((math.asin((chordlength/(2*radius)))))))
  468.     quality = 2 * math.pi / quality
  469.     radius = radius*.92
  470.     local points = {}
  471.     for theta = 0, 2 * math.pi + quality, quality do
  472.         local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta)))
  473.         points[#points + 1] = D3DXVECTOR2(c.x, c.y)
  474.     end
  475.     DrawLines2(points, width or 1, color or 4294967295)
  476. end
  477.  
  478. function round(num)
  479.     if num >= 0 then return math.floor(num+.5) else return math.ceil(num-.5) end
  480. end
  481.  
  482. function DrawCircle2(x, y, z, radius, color)
  483.     local vPos1 = Vector(x, y, z)
  484.     local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z)
  485.     local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius
  486.     local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z))
  487.     if OnScreen({ x = sPos.x, y = sPos.y }, { x = sPos.x, y = sPos.y }) then
  488.         DrawCircleNextLvl(x, y, z, radius, 1, color, HazMenu.LFC.CL)
  489.     end
  490. end
  491.  
  492. function AutoUlt()
  493.     for i, enemy in ipairs(GetEnemyHeroes()) do
  494.         if enemy ~= nil and GetDistance(enemy) < R.range and not ultActive then
  495.             if CountEnemies(R.range, enemy) >= HazMenu.Combo.minR then
  496.                 local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(target, R.delay, R.width, R.range, R.speed, myHero, false)
  497.                 if MainTargetHitChance >= 2 and GetDistance(AOECastPosition) <= R.range and R.IsReady() then
  498.                   CastSpell(_R, AOECastPosition.x, AOECastPosition.z)
  499.                 end
  500.                
  501.             end
  502.         end
  503.     end
  504. end
  505.  
  506. function CountEnemies(range, unit)
  507.     local Enemies = 0
  508.     for _, enemy in ipairs(GetEnemyHeroes()) do
  509.         if ValidTarget(enemy) and GetDistance(enemy, unit) < (range or math.huge) then
  510.             Enemies = Enemies + 1
  511.         end
  512.     end
  513.     return Enemies
  514. end
  515.  
  516.  
  517.  
  518. for i, enemy in ipairs(GetEnemyHeroes()) do
  519.     enemy.barData = {PercentageOffset = {x = 0, y = 0} }
  520. end
  521.  
  522. function GetEnemyHPBarPos(enemy)
  523.  
  524.     if not enemy.barData then
  525.         return
  526.     end
  527.  
  528.     local barPos = GetUnitHPBarPos(enemy)
  529.     local barPosOffset = GetUnitHPBarOffset(enemy)
  530.     local barOffset = Point(enemy.barData.PercentageOffset.x, enemy.barData.PercentageOffset.y)
  531.     local barPosPercentageOffset = Point(enemy.barData.PercentageOffset.x, enemy.barData.PercentageOffset.y)
  532.  
  533.     local BarPosOffsetX = 169
  534.     local BarPosOffsetY = 47
  535.     local CorrectionX = 16
  536.     local CorrectionY = 4
  537.  
  538.     barPos.x = barPos.x + (barPosOffset.x - 0.5 + barPosPercentageOffset.x) * BarPosOffsetX + CorrectionX
  539.     barPos.y = barPos.y + (barPosOffset.y - 0.5 + barPosPercentageOffset.y) * BarPosOffsetY + CorrectionY
  540.  
  541.     local StartPos = Point(barPos.x, barPos.y)
  542.     local EndPos = Point(barPos.x + 103, barPos.y)
  543.  
  544.     return Point(StartPos.x, StartPos.y), Point(EndPos.x, EndPos.y)
  545.  
  546. end
  547.  
  548.  
  549.  
  550. function DrawIndicator(enemy)
  551.     local Qdmg, Wdmg, Edmg, AAdmg = getDmg("Q", enemy, myHero), getDmg("W", enemy, myHero), getDmg("E", enemy, myHero), getDmg("AD", enemy, myHero)
  552.    
  553.     Qdmg = ((Q.IsReady and Qdmg) or 0)
  554.     Wdmg = ((W.IsReady and Wdmg) or 0)
  555.     Edmg = ((E.IsReady and Edmg) or 0)
  556.     Rdmg = ((R.IsReady and Rdmg) or 0)
  557.     AAdmg = ((Aadmg) or 0)
  558.  
  559.     local damage = Qdmg + Wdmg + Edmg + Rdmg
  560.  
  561.     local SPos, EPos = GetEnemyHPBarPos(enemy)
  562.  
  563.     if not SPos then return end
  564.  
  565.     local barwidth = EPos.x - SPos.x
  566.     local Position = SPos.x + math.max(0, (enemy.health - damage) / enemy.maxHealth) * barwidth
  567.  
  568.     DrawText("|", 16, math.floor(Position), math.floor(SPos.y + 8), ARGB(255,0,255,0))
  569.     DrawText("HP: "..math.floor(enemy.health - damage), 12, math.floor(SPos.x + 25), math.floor(SPos.y - 15), (enemy.health - damage) > 0 and ARGB(255, 0, 255, 0) or  ARGB(255, 255, 0, 0))
  570. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement