FukDaPolice

FukDaZiggs 1.4

Apr 15th, 2015
5,167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.11 KB | None | 0 0
  1. if myHero.charName ~= 'Ziggs' then return end
  2.  
  3. assert(load(Base64Decode("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"), nil, "bt", _ENV))() ScriptStatus("QDGEKLKLLJK")
  4.  
  5. --Changelog 1.4 added Q min range for harass           updated for 5.8
  6. --               added logic for W full customizable
  7. --               added mana manager for harass  
  8. --               Added autointerrupt
  9. --               Improved combo a lot
  10. --               Added Auto ult              
  11.  
  12. require "SxOrbWalk"
  13. require "VPrediction"
  14.  
  15. local B = {range = 880, delay = 0.5, speed = 1650, width = 80,IsReady = function() return myHero:CanUseSpell(_Q) == READY end}
  16. local Q = {range = 1400, delay = 0.5, speed = 1750, width = 80,IsReady = function() return myHero:CanUseSpell(_Q) == READY end}
  17. local W = {range = 970, delay = 0.25, speed = 1800, width = 275,IsReady = function() return myHero:CanUseSpell(_W) == READY end}
  18. local E = {range = 900, delay = 0.8, speed = 2700, width = 235,IsReady = function() return myHero:CanUseSpell(_E) == READY end}
  19. local R = {range = 5300, delay = 1.014, speed = 1750, width = 525,IsReady = function() return myHero:CanUseSpell(_R) == READY end}
  20. local ignite = nil
  21. local iDmg = 0
  22. local target = nil
  23. local myTarget = nil
  24. local ts
  25. local ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, 1500, DAMAGE_MAGIC, true)
  26. local myTarget = nil
  27.  
  28.  
  29. local ToInterrupt = {}
  30. local InterruptList = {
  31.     { charName = "Caitlyn", spellName = "CaitlynAceintheHole"},
  32.     { charName = "FiddleSticks", spellName = "Crowstorm"},
  33.     { charName = "FiddleSticks", spellName = "DrainChannel"},
  34.     { charName = "Galio", spellName = "GalioIdolOfDurand"},
  35.     { charName = "Karthus", spellName = "FallenOne"},
  36.     { charName = "Katarina", spellName = "KatarinaR"},
  37.     { charName = "Lucian", spellName = "LucianR"},
  38.     { charName = "Malzahar", spellName = "AlZaharNetherGrasp"},
  39.     { charName = "MissFortune", spellName = "MissFortuneBulletTime"},
  40.     { charName = "Nunu", spellName = "AbsoluteZero"},                            
  41.     { charName = "Pantheon", spellName = "Pantheon_GrandSkyfall_Jump"},
  42.     { charName = "Shen", spellName = "ShenStandUnited"},
  43.     { charName = "Urgot", spellName = "UrgotSwap2"},
  44.     { charName = "Varus", spellName = "VarusQ"},
  45.     { charName = "Warwick", spellName = "InfiniteDuress"},
  46.     { charName = "Velkoz", spellName = "VelkozR"}
  47. }
  48.  
  49.  
  50. TextList = {"Poke", " Killable Ult!"}
  51. KillText = {}
  52. colorText = ARGB(255,255,204,0)
  53.  
  54.  
  55. function GetCustomTarget()
  56.     ts:update()
  57.     if _G.AutoCarry and ValidTarget(_G.AutoCarry.Crosshair:GetTarget()) then return _G.AutoCarry.Crosshair:GetTarget() end
  58.     if not _G.Reborn_Loaded then return ts.target end
  59.     return ts.target
  60. end
  61.  
  62. function OnLoad()
  63.     PrintChat("<font color=\"#00FF00\">Ziggs by Fukdapolice.</font>")
  64.     ultActive = false
  65.     IgniteCheck()
  66.     FLoadLib()
  67.     VP = VPrediction(true)  
  68.     _G.oldDrawCircle = rawget(_G, 'DrawCircle')
  69.     _G.DrawCircle = DrawCircle2
  70.     Minions = minionManager(MINION_ENEMY, Q.range, myHero, MINION_SORT_MAXHEALTH_ASC)
  71. end
  72.  
  73. function OnTick()
  74.     target = GetCustomTarget()
  75.     Checks()
  76.    
  77.     --if isSX then
  78.         --SxOrb:ForceTarget(target)
  79.     --end
  80.    
  81.    
  82. end
  83.  
  84. function OnDraw()
  85.     if HazMenu.Draw.drawq then
  86.         DrawCircle(myHero.x,myHero.y,myHero.z,1400,0xFFFF0000)
  87.     end
  88.     if HazMenu.Draw.draww then
  89.         DrawCircle(myHero.x,myHero.y,myHero.z,970,0xFFFF0000)
  90.     end
  91.        
  92.     if HazMenu.Draw.drawe then
  93.         DrawCircle(myHero.x,myHero.y,myHero.z,900,0xFFFF0000)
  94.     end
  95.     if HazMenu.Draw.drawr then
  96.         DrawCircle(myHero.x,myHero.y,myHero.z,5300,0xFFFF0000)
  97.     end
  98.     if HazMenu.Misc.killtext then
  99.         for i = 1, heroManager.iCount do
  100.             local target = heroManager:GetHero(i)
  101.             if ValidTarget(target) and target ~= nil then
  102.                 local barPos = WorldToScreen(D3DXVECTOR3(target.x, target.y, target.z))
  103.                 local PosX = barPos.x - 35
  104.                 local PosY = barPos.y - 10
  105.                
  106.                 DrawText(TextList[KillText[i]], 16, PosX, PosY, colorText)
  107.             end
  108.         end
  109.     end
  110. end
  111.  
  112.  
  113. function Checks()
  114.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  115.     BREADY = (myHero:CanUseSpell(_Q) == READY)
  116.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  117.     WREADY = (myHero:CanUseSpell(_W) == READY)
  118.     EREADY = (myHero:CanUseSpell(_E) == READY)
  119.     RREADY = (myHero:CanUseSpell(_R) == READY)
  120.     calcDmg()
  121.     LFCfunc()
  122.     if ValidTarget(target) then
  123.         if HazMenu.Misc.KS then KS(target) end
  124.         if HazMenu.Misc.KSR then KS(target) end
  125.         if HazMenu.Misc.Ignite then AutoIgnite(target) end
  126.     end
  127.     if target then
  128.         if HazMenu.Misc.SatchelIn and GetDistance(Target) <= Wrange then CastW(Target, 3) end
  129.         if HazMenu.Misc.SatchelOut and GetDistance(Target) <= Wrange then CastW(Target, 2) end
  130.        
  131.         if W.IsReady() and HazMenu.Combo.comboW and GetDistance(target) <= W.range then castW(target, HazMenu.Misc.SatchelDir) end
  132.     end
  133.     if HazMenu.Combo.AutoUlt then AutoUlt() end
  134.     if HazMenu.combokey then
  135.         Combo()
  136.     end
  137.    
  138.    if HazMenu.harasskey and myHero.mana / myHero.maxMana > HazMenu.Harass.Mana /100 then
  139.         Poke()
  140.    end
  141.    if HazMenu.farmkey then
  142.         Farm()
  143.    end
  144. end
  145.  
  146. function IgniteCheck()
  147.     if myHero:GetSpellData(SUMMONER_1).name:find("summonerdot") then
  148.         ignite = SUMMONER_1
  149.     elseif myHero:GetSpellData(SUMMONER_2).name:find("summonerdot") then
  150.         ignite = SUMMONER_2
  151.     end
  152. end
  153.  
  154. function FLoadLib()
  155.     FMenu()
  156. end
  157.  
  158. function FMenu()
  159.     HazMenu = scriptConfig("Ziggs", "Ziggs")
  160.         HazMenu:addParam("combokey", "Combo key(Space)", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  161.         HazMenu:addParam("harasskey", "Harass key(C)", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
  162.        
  163.     HazMenu:addTS(ts)
  164.        
  165.     HazMenu:addSubMenu("Combo", "Combo")
  166.         HazMenu.Combo:addParam("comboQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
  167.         HazMenu.Combo:addParam("comboW", "Use W", SCRIPT_PARAM_ONOFF, true)
  168.         HazMenu.Combo:addParam("comboE", "Use E", SCRIPT_PARAM_ONOFF, true)
  169.         HazMenu.Combo:addParam("comboR", "Use R", SCRIPT_PARAM_ONOFF, true)
  170.         HazMenu.Combo:addParam("minR", "Auto Ultimate if X enemies", SCRIPT_PARAM_SLICE, 3, 0, 5, 0)
  171.         HazMenu.Combo:addParam("AutoUlt", "Use AutoUlt ^", SCRIPT_PARAM_ONOFF, true)
  172.        
  173.     HazMenu:addSubMenu("Harass", "Harass")
  174.         HazMenu.Harass:addParam("harassQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
  175.         HazMenu.Harass:addParam("harassE", "Use E", SCRIPT_PARAM_ONOFF, true)
  176.         HazMenu.Harass:addParam("Mana", "Mana Manager %", SCRIPT_PARAM_SLICE, 50, 1, 100, 0)
  177.                
  178.     HazMenu:addSubMenu("Misc", "Misc")
  179.         HazMenu.Misc:addParam("KSR", "KillSteal with R", SCRIPT_PARAM_ONOFF, true)
  180.         HazMenu.Misc:addParam("KS", "KillSteal with Q", SCRIPT_PARAM_ONOFF, true)
  181.         HazMenu.Misc:addParam("Ignite", "Use Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  182.         HazMenu.Misc:addParam("killtext", "Draw if Killable with combo", SCRIPT_PARAM_ONOFF, true)
  183.         HazMenu.Misc:addParam("SatchelOut", "Satchel Toss Away", SCRIPT_PARAM_ONKEYDOWN, false, 46)
  184.         HazMenu.Misc:addParam("SatchelIn", "Satchel Toss To-You", SCRIPT_PARAM_ONKEYDOWN, false, 44)
  185.         HazMenu.Misc:addParam("SatchelDir", "Default Satchel Toss", SCRIPT_PARAM_LIST, 1, { "On Target", "ahead", "behind" })
  186.        
  187.     HazMenu:addSubMenu("Draw","Draw")
  188.       HazMenu.Draw:addParam("drawq", "Draw Q", SCRIPT_PARAM_ONOFF, true)
  189.       HazMenu.Draw:addParam("draww", "Draw W", SCRIPT_PARAM_ONOFF, true)
  190.       HazMenu.Draw:addParam("drawe", "Draw E", SCRIPT_PARAM_ONOFF, true)
  191.       HazMenu.Draw:addParam("drawr", "Draw R", SCRIPT_PARAM_ONOFF, true)
  192.    
  193.     HazMenu:addParam("Interrupt", "Satchel Interrupt", SCRIPT_PARAM_ONOFF, true)
  194.    
  195.     HazMenu:addSubMenu("LagFreeCircles", "LFC")
  196.       HazMenu.LFC:addParam("LagFree", "Activate Lag Free Circles", SCRIPT_PARAM_ONOFF, false)
  197.       HazMenu.LFC:addParam("CL", "Length before Snapping", SCRIPT_PARAM_SLICE, 350, 75, 2000, 0)
  198.       HazMenu.LFC:addParam("CLinfo", "Higher length = Lower FPS Drops", SCRIPT_PARAM_INFO, "")
  199.    
  200.     for i = 1, heroManager.iCount, 1 do
  201.         local enemy = heroManager:getHero(i)
  202.         if enemy.team ~= myHero.team then
  203.             for _, champ in pairs(InterruptList) do
  204.                 if enemy.charName == champ.charName then
  205.                     table.insert(ToInterrupt, champ.spellName)
  206.                 end
  207.             end
  208.         end
  209.     end
  210.    
  211.     if _G.Reborn_Loaded then
  212.     DelayAction(function()
  213.         PrintChat("<font color = \"#FFFFFF\">[Ziggs] </font><font color = \"#FF0000\">SAC Status:</font> <font color = \"#FFFFFF\">Successfully integrated.</font> </font>")
  214.         HazMenu:addParam("SACON","[Ziggs] SAC:R support is active.", 5, "")
  215.         isSAC = true
  216.     end, 10)
  217.     elseif not _G.Reborn_Loaded then
  218.         PrintChat("<font color = \"#FFFFFF\">[Ziggs] </font><font color = \"#FF0000\">Orbwalker not found:</font> <font color = \"#FFFFFF\">SxOrbWalk integrated.</font> </font>")
  219.         HazMenu:addSubMenu("Orbwalker", "SxOrb")
  220.         SxOrb:LoadToMenu(HazMenu.SxOrb)
  221.         isSX = true
  222.     end
  223.     HazMenu:permaShow("combokey")
  224.     HazMenu:permaShow("harasskey")
  225.    
  226. end
  227.  
  228. function KS(enemy)  
  229.     if Q.IsReady() and getDmg("Q", enemy, myHero) > enemy.health then
  230.         if GetDistance(enemy) <= Q.range and HazMenu.Misc.KS then
  231.             local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, Q.delay, Q.width, Q.range, Q.speed, myHero, true)
  232.             if HitChance >= 2 and GetDistance(CastPosition) <= Q.range and Q.IsReady() then
  233.                 CastSpell(_Q, CastPosition.x, CastPosition.z)
  234.             end
  235.         end
  236.     end
  237.     if R.IsReady() and getDmg("R", enemy, myHero) > enemy.health then
  238.         if GetDistance(enemy) <= R.range and HazMenu.Misc.KSR then
  239.             local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(target, R.delay, R.width, R.range, R.speed, myHero, false)
  240.             if MainTargetHitChance >= 2 and GetDistance(AOECastPosition) <= R.range and R.IsReady() then
  241.                 CastSpell(_R, AOECastPosition.x, AOECastPosition.z)
  242.             end
  243.         end
  244.     end
  245. end
  246.  
  247. function AutoIgnite(enemy)
  248.     iDmg = ((IREADY and getDmg("IGNITE", enemy, myHero)) or 0)
  249.     if enemy.health <= iDmg and GetDistance(enemy) <= 600 and ignite ~= nil
  250.         then
  251.             if IREADY then CastSpell(ignite, enemy) end
  252.     end
  253. end
  254.  
  255. function OnProcessSpell(unit, spell)
  256.     if HazMenu.Interrupt and Wready and #ToInterrupt > 0 then
  257.         for _, ability in pairs(ToInterrupt) do
  258.             if spell.name == ability and unit.team ~= myHero.team then
  259.                 if GetDistance(unit) <= Wrange then CastW(unit) end
  260.             end
  261.         end
  262.     end
  263.    
  264. end
  265.  
  266. function Combo()
  267.     if ValidTarget(target) then  
  268.         if E.IsReady() and HazMenu.Combo.comboE then
  269.             local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(target, E.delay, E.width, E.range, E.speed, myHero, false)
  270.             if MainTargetHitChance >= 2 and GetDistance(AOECastPosition) <= E.range and E.IsReady() then
  271.                 CastSpell(_E, AOECastPosition.x, AOECastPosition.z)
  272.             end
  273.         end
  274.                 if Q.IsReady() and HazMenu.Combo.comboQ then
  275.             local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, Q.delay, Q.width, Q.range, Q.speed, myHero, false)
  276.             if HitChance >= 2 and GetDistance(CastPosition) <= Q.range and Q.IsReady() then
  277.                 CastSpell(_Q, CastPosition.x, CastPosition.z)
  278.             end
  279.         end    
  280.         if W.IsReady() and HazMenu.Combo.comboW then       
  281.             castW(target, HazMenu.Misc.SatchelDir)
  282.         end
  283.         if R.IsReady() and HazMenu.Combo.comboR then
  284.             local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(target, R.delay, R.width, R.range, R.speed, myHero, false)
  285.             if MainTargetHitChance >= 2 and GetDistance(AOECastPosition) <= R.range and R.IsReady() then
  286.                 CastSpell(_R, AOECastPosition.x, AOECastPosition.z)
  287.             end
  288.         end
  289.     end
  290. end
  291.  
  292. function Poke()
  293.     if ValidTarget(target) then
  294.         if Q.IsReady() and HazMenu.Harass.harassQ then
  295.             local CastPosition, HitChance, CastPos = VP:GetLineCastPosition(target, B.delay, B.width, B.range, B.speed, myHero, false)
  296.             if HitChance >= 2 and GetDistance(CastPosition) <= B.range and Q.IsReady() then
  297.                 CastSpell(_Q, CastPosition.x, CastPosition.z)
  298.             end
  299.         end
  300.         if E.IsReady() and HazMenu.Harass.harassE then
  301.             local pos = (target + 30)
  302.             local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(target, E.delay, E.width, E.range, E.speed, myHero, false)
  303.             if MainTargetHitChance >= 2 and GetDistance(AOECastPosition) <= E.range and E.IsReady() then
  304.                 CastSpell(_E, AOECastPosition.x, AOECastPosition.z)
  305.             end
  306.         end
  307.     end
  308. end
  309.  
  310. function castW(enemy, direction)
  311.     if HazMenu.Combo.comboW and HazMenu.combokey then
  312.     local CastPosition, HitChance, Position = VP:GetCircularCastPosition(enemy, W.delay, W.width, W.range, W.speed, myHero, false)
  313.     if GetDistance(CastPosition) <= W.range then
  314.         if HitChance >= 2 then
  315.             if direction and direction == 3 then
  316.                 local CastBehind = CastPosition + Vector(CastPosition.x-myHero.x, 0, CastPosition.z-myHero.z):normalized()*100
  317.                 CastSpell(_W, CastBehind.x, CastBehind.z)
  318.             elseif direction and direction == 2 then
  319.                 local CastAhead = CastPosition + Vector(CastPosition.x-myHero.x, 0, CastPosition.z-myHero.z):normalized()
  320.                 CastSpell(_W, CastAhead.x, CastAhead.z)
  321.             else CastSpell(_W, CastPosition.x, CastPosition.z) end
  322.         end
  323.     end
  324.     end
  325. end
  326.  
  327. function calcDmg()
  328.     for i=1, heroManager.iCount do
  329.         local Target = heroManager:GetHero(i)
  330.         if ValidTarget(Target) and Target ~= nil then
  331.             qDmg = ((QREADY and getDmg("Q", Target, myHero)) or 0)
  332.             wDmg = ((WREADY and getDmg("W", Target, myHero)) or 0)
  333.             eDmg = ((EREADY and getDmg("E", Target, myHero)) or 0)
  334.             rDmg = ((RREADY and getDmg("R", Target, myHero)) or 0)
  335.             allDmg = (rDmg)
  336.            
  337.             if Target.health > allDmg then
  338.                 KillText[i] = 1
  339.             elseif Target.health <= allDmg then
  340.                 KillText[i] = 2
  341.             end
  342.         end
  343.     end
  344. end
  345.  
  346. function LFCfunc()
  347.     if not HazMenu.LFC.LagFree then _G.DrawCircle = _G.oldDrawCircle end
  348.     if HazMenu.LFC.LagFree then _G.DrawCircle = DrawCircle2 end
  349. end
  350.  
  351. -- Barasia, vadash, viseversa
  352.  
  353. function DrawCircleNextLvl(x, y, z, radius, width, color, chordlength)
  354.     radius = radius or 300
  355.     quality = math.max(8,round(180/math.deg((math.asin((chordlength/(2*radius)))))))
  356.     quality = 2 * math.pi / quality
  357.     radius = radius*.92
  358.     local points = {}
  359.     for theta = 0, 2 * math.pi + quality, quality do
  360.         local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta)))
  361.         points[#points + 1] = D3DXVECTOR2(c.x, c.y)
  362.     end
  363.     DrawLines2(points, width or 1, color or 4294967295)
  364. end
  365.  
  366. function round(num)
  367.     if num >= 0 then return math.floor(num+.5) else return math.ceil(num-.5) end
  368. end
  369.  
  370. function DrawCircle2(x, y, z, radius, color)
  371.     local vPos1 = Vector(x, y, z)
  372.     local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z)
  373.     local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius
  374.     local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z))
  375.     if OnScreen({ x = sPos.x, y = sPos.y }, { x = sPos.x, y = sPos.y }) then
  376.         DrawCircleNextLvl(x, y, z, radius, 1, color, HazMenu.LFC.CL)
  377.     end
  378. end
  379.  
  380. function AutoUlt()
  381.     for i, enemy in ipairs(GetEnemyHeroes()) do
  382.         if enemy ~= nil and GetDistance(enemy) < R.range then
  383.             if CountEnemies(R.range, enemy) >= HazMenu.Combo.minR then
  384.                
  385.                 if GetDistance(myHero, enemy) <= R.range and R.IsReady() then
  386.                   CastSpell(_R, enemy.x, enemy.z)
  387.                 end
  388.                
  389.             end
  390.         end
  391.     end
  392. end
  393.  
  394. function CountEnemies(range, unit)
  395.     local Enemies = 0
  396.     for _, enemy in ipairs(GetEnemyHeroes()) do
  397.         if ValidTarget(enemy) and GetDistance(enemy, unit) < (range or math.huge) then
  398.             Enemies = Enemies + 1
  399.         end
  400.     end
  401.    return Enemies
  402. end
Advertisement
Add Comment
Please, Sign In to add comment