Kain2030

Auto Carry Plugin - Ziggs Edition - v1.04

Jul 13th, 2013
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.32 KB | None | 0 0
  1. --[[
  2.  
  3.         Auto Carry Plugin - Ziggs Edition
  4.         Author: Kain
  5.         Version: 1.04
  6.         Copyright 2013
  7.  
  8.         Dependency: Sida's Auto Carry: Revamped
  9.  
  10.         How to install:
  11.             Make sure you already have AutoCarry installed.
  12.             Name the script EXACTLY "SidasAutoCarryPlugin - Ziggs.lua" without the quotes.
  13.             Place the plugin in BoL/Scripts/Common folder.
  14. --]]
  15.  
  16. if myHero.charName ~= "Ziggs" then return end
  17.  
  18. local Target
  19.  
  20. -- Prediction
  21. local QRange = 850
  22. local QMaxRange = 1400
  23. local WRange = 1000
  24. local ERange = 900
  25. local RRange = 5300
  26.  
  27. local QSpeed = 1.2
  28. local WSpeed = 1.5
  29. local ESpeed = 1.45
  30. local RSpeed = 1.5
  31.  
  32. local QWidth = 150
  33. local WWidth = 225
  34. local EWidth = 250
  35. local RWidth = 550
  36.  
  37. local SkillQ = {spellKey = _Q, range = QMaxRange, speed = QSpeed, delay = 0, width = QWidth, configName = "bouncingbomb", displayName = "Q (Bouncing Bomb)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = true }
  38. local SkillW = {spellKey = _W, range = WRange, speed = WSpeed, delay = 0, width = WWidth, configName = "satchelcharge", displayName = "W (Satchel Charge)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = false }
  39. local SkillE = {spellKey = _E, range = ERange, speed = ESpeed, delay = 0, width = EWidth, configName = "hexplosiveminefield", displayName = "E (Hexplosive Minefield)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = false }
  40. local SkillR = {spellKey = _R, range = RRange, speed = RSpeed, delay = 0, width = RWidth, configName = "megainfernobomb", displayName = "R (Mega Inferno Bomb)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = true }
  41.  
  42. AutoCarry.PluginMenu:addParam("ziggscombo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  43. AutoCarry.PluginMenu:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  44. AutoCarry.PluginMenu:addParam("ultimate", "Use Ultimate with Combo", SCRIPT_PARAM_ONOFF, true)
  45. AutoCarry.PluginMenu:addParam("killsteal", "Ultimate Mega Killsteal", SCRIPT_PARAM_ONOFF, true)
  46. AutoCarry.PluginMenu:addParam("drawkillableenemy", "Draw Killable Enemy", SCRIPT_PARAM_ONOFF, true)
  47. AutoCarry.PluginMenu:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
  48. AutoCarry.PluginMenu:addParam("drawprediction", "Draw Prediction", SCRIPT_PARAM_ONOFF, true)
  49. AutoCarry.PluginMenu:addParam("draw", "Draw range circles", SCRIPT_PARAM_ONOFF, true)
  50. AutoCarry.PluginMenu:addParam("drawult", "Draw Ult range circle", SCRIPT_PARAM_ONOFF, true)
  51.  
  52. local KeyQ = string.byte("Q")
  53. local KeyW = string.byte("W")
  54. local KeyE = string.byte("E")
  55. local KeyR = string.byte("R")
  56.  
  57. local tick = nil
  58. local doUlt = false
  59.  
  60. VIP_USER = false
  61.  
  62. -- Draw
  63. local waittxt = {}
  64. local calculationenemy = 1
  65. local floattext = {"Skills not available", "Able to fight", "Killable", "Murder him!"}
  66. local killable = {}
  67.  
  68. local ignite = nil
  69. local DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil
  70. local QReady, WReady, EReady, RReady, DFGReady, HXGReady, BWCReady, IReady = false, false, false, false, false, false, false, false
  71.  
  72. -- Main
  73. function PluginOnLoad()
  74.     AutoCarry.SkillsCrosshair.range = QMaxRange
  75.  
  76.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  77.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  78.     for i=1, heroManager.iCount do waittxt[i] = i*3 end
  79. end
  80.  
  81. function PluginOnTick()
  82.     Target = AutoCarry.GetAttackTarget()
  83.  
  84.     SpellCheck()
  85.  
  86.     if tick == nil or GetTickCount()-tick >= 200 then
  87.         tick = GetTickCount()
  88.         CalculateDamage()
  89.     end
  90.  
  91.     if AutoCarry.PluginMenu.combo or AutoCarry.PluginMenu.ziggscombo then
  92.         Combo()
  93.     end
  94.  
  95.     if AutoCarry.PluginMenu.harass then
  96.         Harass()
  97.     end
  98.  
  99.     if AutoCarry.PluginMenu.killsteal then
  100.         KillSteal()
  101.     end
  102. end
  103.  
  104. function OnAttacked()
  105.     -- AA > Q > AA
  106.     CastQ()
  107. end
  108.  
  109. function SpellCheck()
  110.     DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128),
  111.     GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057),
  112.     GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  113.  
  114.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  115.     WReady = (myHero:CanUseSpell(SkillW.spellKey) == READY)
  116.     EReady = (myHero:CanUseSpell(SkillE.spellKey) == READY)
  117.     RReady = (myHero:CanUseSpell(SkillR.spellKey) == READY)
  118.  
  119.     DFGReady = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  120.     HXGReady = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  121.     BWCReady = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  122.     IReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  123. end
  124.  
  125. -- Handle SBTW Skill Shots
  126.  
  127. function Combo()
  128.     CastSlots()
  129.     CastE()
  130.     CastQ()
  131.     CastW()
  132.     if AutoCarry.PluginMenu.ultimate and doUlt then
  133.         CastR()
  134.     end
  135. end
  136.  
  137. function CastSlots()
  138.     if Target ~= nil then
  139.         if GetDistance(Target) <= QMaxRange then
  140.             if DFGReady then CastSpell(DFGSlot, Target) end
  141.             if HXGReady then CastSpell(HXGSlot, Target) end
  142.             if BWCReady then CastSpell(BWCSlot, Target) end
  143.         end
  144.     end
  145. end
  146.  
  147. function Harass()
  148.     CastQ()
  149. end
  150.  
  151. function CastQ()
  152.     if Target ~= nil then
  153.         if QReady and ValidTarget(Target, QRange) then
  154.             AutoCarry.CastSkillshot(SkillQ, Target)
  155.         elseif QReady and ValidTarget(Target, QMaxRange) then
  156.             -- Full Bouncing Bomb three bounce range
  157.             local PredictedPos = AutoCarry.GetPrediction(SkillQ, Target)
  158.  
  159.             if PredictedPos and AutoCarry.IsValidHitChance(SkillQ, Target) then
  160.                 local MyPos = Vector(myHero.x, myHero.y, myHero.z)
  161.                 local EnemyPos = Vector(PredictedPos.x, PredictedPos.y, PredictedPos.z)
  162.                 local CastPos = MyPos - (MyPos - EnemyPos):normalized() * QRange
  163.                 if CastPos then CastSpell(SkillQ.spellKey, CastPos.x, CastPos.z) end
  164.             end
  165.         end
  166.     end
  167. end
  168.  
  169. function CastW()
  170.     if Target ~= nil and ValidTarget(Target, WRange) then
  171.         if WReady and GetDistance(Target) <= WRange then
  172.             AutoCarry.CastSkillshot(SkillW, Target)
  173.         end
  174.     end
  175. end
  176.  
  177. function CastE()
  178.     if Target ~= nil and ValidTarget(Target, ERange) then
  179.         if EReady and GetDistance(Target) <= ERange then
  180.             AutoCarry.CastSkillshot(SkillE, Target)
  181.         end
  182.     end
  183. end
  184.  
  185. function CastR()
  186.     if Target ~= nil and ValidTarget(enemy, RRange) then
  187.         if RReady and GetDistance(Target) <= RRange then
  188.             AutoCarry.CastSkillshot(SkillR, Target)
  189.         end
  190.     end
  191. end
  192.  
  193. function KillSteal()
  194.     for _, enemy in pairs(AutoCarry.EnemyTable) do
  195.         if ValidTarget(enemy, RRange) then
  196.             if enemy.health < getDmg("R", enemy, myHero) then
  197.                 AutoCarry.CastSkillshot(SkillR, enemy)
  198.             end
  199.         end
  200.     end
  201. end
  202.  
  203. -- Handle Manual Skill Shots
  204.  
  205. function PluginOnWndMsg(msg,key)
  206.     Target = AutoCarry.GetAttackTarget()
  207.     if Target ~= nil then
  208.         if msg == KEY_DOWN and key == KeyQ then CastQ() end
  209.         if msg == KEY_DOWN and key == KeyW then CastW() end
  210.         if msg == KEY_DOWN and key == KeyE then CastE() end
  211.         if msg == KEY_DOWN and key == KeyR then CastR() end
  212.     end
  213. end
  214.  
  215. -- Drawing
  216.  
  217. function PluginOnDraw()
  218.     if AutoCarry.PluginMenu.draw then
  219.         DrawCircle(myHero.x, myHero.y, myHero.z, AutoCarry.SkillsCrosshair.range, 0x19A712)
  220.  
  221.         if myHero:CanUseSpell(SkillQ.spellKey) then
  222.             DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0xFF0000)
  223.         end
  224.        
  225.         if myHero:CanUseSpell(SkillW.spellKey) then
  226.             DrawCircle(myHero.x, myHero.y, myHero.z, WRange, 0xFF0000)
  227.         end
  228.        
  229.         if myHero:CanUseSpell(SkillE.spellKey) then
  230.             DrawCircle(myHero.x, myHero.y, myHero.z, ERange, 0xFF0000)
  231.         end
  232.  
  233.         if AutoCarry.PluginMenu.drawult then
  234.             if myHero:CanUseSpell(SkillR.spellKey) then
  235.                 DrawCircle(myHero.x, myHero.y, myHero.z, RRange, 0xFF0000)
  236.             end
  237.         end
  238.  
  239.         Target = AutoCarry.GetAttackTarget()
  240.         if Target ~= nil then
  241.             for j=0, 10 do
  242.                 DrawCircle(Target.x, Target.y, Target.z, 40 + j*1.5, 0x00FF00)
  243.             end
  244.         end
  245.     end
  246.    
  247.     DrawKillable()
  248. end
  249.  
  250. function CalculateDamage()
  251.         if ValidTarget(Target) then
  252.                 local dfgdamage, hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage  = 0, 0, 0, 0, 0, 0, 0
  253.                 local pdamage = getDmg("P",Target,myHero)
  254.                 local qdamage = getDmg("Q",Target,myHero)
  255.                 local wdamage = getDmg("W",Target,myHero)
  256.                 local edamage = getDmg("E",Target,myHero)
  257.                 local rdamage = getDmg("R",Target,myHero)
  258.                 local hitdamage = getDmg("AD",Target,myHero)
  259.                 local dfgdamage = (DFGSlot and getDmg("DFG",Target,myHero) or 0)
  260.                 local hxgdamage = (HXGSlot and getDmg("HXG",Target,myHero) or 0)
  261.                 local bwcdamage = (BWCSlot and getDmg("BWC",Target,myHero) or 0)
  262.                 local ignitedamage = (ignite and getDmg("IGNITE",Target,myHero) or 0)
  263.                 local Sheendamage = (SheenSlot and getDmg("SHEEN",Target,myHero) or 0)
  264.                 local Trinitydamage = (TrinitySlot and getDmg("TRINITY",Target,myHero) or 0)
  265.                 local LichBanedamage = (LichBaneSlot and getDmg("LICHBANE",Target,myHero) or 0)
  266.                 local combo1 = hitdamage + qdamage + wdamage + edamage + rdamage + Sheendamage + Trinitydamage + LichBanedamage --0 cd
  267.                 local combo2 = hitdamage + Sheendamage + Trinitydamage + LichBanedamage
  268.                 local combo3 = hitdamage + Sheendamage + Trinitydamage + LichBanedamage
  269.                 local combo4 = 0
  270.                
  271.                 if QREADY then
  272.                         combo2 = combo2 + qdamage
  273.                         combo3 = combo3 + qdamage
  274.                         --combo4 = combo4 + qdamage
  275.                 end
  276.                 if WREADY then
  277.                         combo2 = combo2 + wdamage
  278.                         combo3 = combo3 + wdamage
  279.                 end
  280.                 if EREADY then
  281.                         combo2 = combo2 + edamage
  282.                         combo3 = combo3 + edamage
  283.                         --combo4 = combo4 + edamage
  284.                 end
  285.                 if RREADY then
  286.                         combo2 = combo2 + rdamage
  287.                         combo3 = combo3 + rdamage
  288.                         combo4 = combo4 + rdamage
  289.                 end
  290.                 if DFGREADY then        
  291.                         combo1 = combo1 + dfgdamage            
  292.                         combo2 = combo2 + dfgdamage
  293.                         combo3 = combo3 + dfgdamage
  294.                         --combo4 = combo4 + dfgdamage
  295.                 end
  296.                 if HXGREADY then              
  297.                         combo1 = combo1 + hxgdamage    
  298.                         combo2 = combo2 + hxgdamage
  299.                         combo3 = combo3 + hxgdamage
  300.                         --combo4 = combo4 + hxgdamage
  301.                 end
  302.                 if BWCREADY then
  303.                         combo1 = combo1 + bwcdamage
  304.                         combo2 = combo2 + bwcdamage
  305.                         combo3 = combo3 + bwcdamage
  306.                         combo4 = combo4 + bwcdamage
  307.                 end
  308.                 if IREADY then
  309.                         combo1 = combo1 + ignitedamage
  310.                         combo2 = combo2 + ignitedamage
  311.                         combo3 = combo3 + ignitedamage
  312.                 end
  313.                 if combo4 >= Target.health then killable[calculationenemy] = 4 doUlt = true
  314.                 elseif combo3 >= Target.health then killable[calculationenemy] = 3 doUlt = false
  315.                 elseif combo2 >= Target.health then killable[calculationenemy] = 2 doUlt = false
  316.                 elseif combo1 >= Target.health then killable[calculationenemy] = 1  doCombo = true doUlt = false
  317.                 else killable[calculationenemy] = 0 doCombo = false doUlt = false end
  318.         end
  319.         if calculationenemy == 1 then calculationenemy = heroManager.iCount
  320.         else calculationenemy = calculationenemy-1 end
  321. end
  322.  
  323. function DrawKillable()
  324.     if 1 == 2 and Target ~= nil and AutoCarry.PluginMenu.drawprediction then
  325.         if VIP_USER then
  326.             pred = TargetPredictionVIP(SkillQ.range, SkillQ.speed*1000, SkillQ.delay/1000, SkillQ.width)
  327.         elseif not VIP_USER then
  328.             pred = TargetPrediction(SkillQ.range, SkillQ.speed, SkillQ.delay, SkillQ.width)
  329.         end
  330.         predPos = pred:GetPrediction(Target)
  331.         DrawCircle(predPos.x, Target.y, predPos.z, 200, 0x0000FF)
  332.     end
  333.     for i=1, heroManager.iCount do
  334.         local enemydraw = heroManager:GetHero(i)
  335.         if ValidTarget(enemydraw) then
  336.             if AutoCarry.PluginMenu.drawkillableenemy then
  337.                 if killable[i] == 1 then
  338.                     for j=0, 20 do
  339.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  340.                     end
  341.                 elseif killable[i] == 2 then
  342.                     for j=0, 10 do
  343.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  344.                     end
  345.                 elseif killable[i] == 3 then
  346.                     for j=0, 10 do
  347.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  348.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  349.                     end
  350.                 elseif killable[i] == 4 then
  351.                     for j=0, 10 do
  352.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  353.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  354.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
  355.                     end
  356.                 end
  357.             end
  358.             if AutoCarry.PluginMenu.drawtext and waittxt[i] == 1 and killable[i] ~= 0 then
  359.                     PrintFloatText(enemydraw,0,floattext[killable[i]])
  360.             end
  361.         end
  362.         if waittxt[i] == 1 then waittxt[i] = 30
  363.         else waittxt[i] = waittxt[i]-1 end
  364.     end
  365. end
Advertisement
Add Comment
Please, Sign In to add comment