Guest User

Untitled

a guest
Oct 29th, 2012
2,777
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.07 KB | None | 0 0
  1. --[[
  2.     Ziggs  Combo 1.0 by WomboCombo
  3.        
  4.         It requires AllClass and Spell Damage Library
  5.  
  6.     -Full combo: items -> Q-> E -> R
  7.     -Supports Deathfire Grasp, Bilgewater Cutlass, Hextech Gunblade, Sheen, Trinity, Lich Bane and Ignite
  8.     -Informs where will use the combo / default off
  9.     -Mark killable target with a combo
  10.     -Target configuration
  11.     -Press shift to configure
  12. ]]
  13. if myHero.charName ~= "Ziggs" then return end
  14. require "AllClass"
  15. --[[            Code            ]]
  16. local range = 5300
  17. local range2 = 850
  18. local tick = nil
  19. local doCombo = false
  20. local doUlt = false
  21. -- Active
  22. -- draw
  23. local waittxt = {}
  24. local calculationenemy = 1
  25. local floattext = {"Skills are not available","Able to fight","Killable","Murder him!"}
  26. local killable = {}
  27. -- ts
  28. local ts
  29. --
  30. local ignite = nil
  31. local DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil
  32. local QREADY, WREADY, EREADY, RREADY, DFGREADY, HXGREADY, BWCREADY, IREADY = false, false, false, false, false, false, false, false
  33.  
  34. function OnLoad()
  35.     MCConfig = scriptConfig("Ziggs WomboCombo 1.0", "Ziggscombo")
  36.     MCConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  37.     MCConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  38.     MCConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
  39.     MCConfig:addParam("drawprediction", "Draw Prediction", SCRIPT_PARAM_ONOFF, false)
  40.     MCConfig:addParam("useUlt", "Use Ult", SCRIPT_PARAM_ONOFF, false)
  41.     MCConfig:permaShow("scriptActive")
  42.  
  43.     ts = TargetSelector(TARGET_LOW_HP,range,DAMAGE_MAGIC)
  44.     ts.name = "Ziggs"
  45.     MCConfig:addTS(ts)
  46.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  47.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  48.     for i=1, heroManager.iCount do waittxt[i] = i*3 end
  49. end
  50.  
  51. function OnTick()
  52.     ts:update()
  53.     Prediction__OnTick()
  54.     DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  55.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  56.     WREADY = (myHero:CanUseSpell(_W) == READY)
  57.     EREADY = (myHero:CanUseSpell(_E) == READY)
  58.     RREADY = (myHero:CanUseSpell(_R) == READY)
  59.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  60.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  61.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  62.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  63.     if tick == nil or GetTickCount()-tick >= 200 then
  64.         tick = GetTickCount()
  65.         MCDmgCalculation()
  66.     end
  67.         if MCConfig.scriptActive then
  68.             if ts.target then
  69.                 if DFGREADY then CastSpell(DFGSlot, ts.target) end
  70.                 if HXGREADY then CastSpell(HXGSlot, ts.target) end
  71.                 if BWCREADY then CastSpell(BWCSlot, ts.target) end
  72.                 if not MCConfig.manual then
  73.                     if QREADY and GetDistance(ts.nextPosition)<=850 then CastSpell(_Q, ts.target) end
  74.                     if doCombo == true then
  75.                     if EREADY and GetDistance(ts.nextPosition)<=900 then CastSpell(_E, ts.nextPosition.x, ts.nextPosition.z) end               
  76.               end
  77.           end
  78.       end
  79.     end
  80.     if ts.target ~= nil then
  81.     if doUlt == true then
  82.         if MCConfig.useUlt and RREADY and GetDistance(ts.nextPosition)<=5300 then CastSpell(_R, ts.target) end
  83.         end
  84.     end
  85. end
  86. function MCDmgCalculation()
  87.     local enemy = heroManager:GetHero(calculationenemy)
  88.     if ValidTarget(enemy) then
  89.         local dfgdamage, hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage  = 0, 0, 0, 0, 0, 0, 0
  90.         local pdamage = getDmg("P",enemy,myHero)
  91.         local qdamage = getDmg("Q",enemy,myHero)
  92.         local wdamage = getDmg("W",enemy,myHero)
  93.         local edamage = getDmg("E",enemy,myHero)
  94.         local rdamage = getDmg("R",enemy,myHero)
  95.         local hitdamage = getDmg("AD",enemy,myHero)
  96.         local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  97.         local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  98.         local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  99.         local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  100.         local Sheendamage = (SheenSlot and getDmg("SHEEN",enemy,myHero) or 0)
  101.         local Trinitydamage = (TrinitySlot and getDmg("TRINITY",enemy,myHero) or 0)
  102.         local LichBanedamage = (LichBaneSlot and getDmg("LICHBANE",enemy,myHero) or 0)
  103.         local combo1 = hitdamage + qdamage + wdamage + edamage + rdamage + Sheendamage + Trinitydamage + LichBanedamage --0 cd
  104.         local combo2 = hitdamage + Sheendamage + Trinitydamage + LichBanedamage
  105.         local combo3 = hitdamage + Sheendamage + Trinitydamage + LichBanedamage
  106.         local combo4 = 0
  107.        
  108.         if QREADY then
  109.             combo2 = combo2 + qdamage
  110.             combo3 = combo3 + qdamage
  111.             --combo4 = combo4 + qdamage
  112.         end
  113.         if WREADY then
  114.             combo2 = combo2 + wdamage
  115.             combo3 = combo3 + wdamage
  116.         end
  117.         if EREADY then
  118.             combo2 = combo2 + edamage
  119.             combo3 = combo3 + edamage
  120.             --combo4 = combo4 + edamage
  121.         end
  122.         if RREADY then
  123.             combo2 = combo2 + rdamage
  124.             combo3 = combo3 + rdamage
  125.             combo4 = combo4 + rdamage
  126.         end
  127.         if DFGREADY then        
  128.             combo1 = combo1 + dfgdamage            
  129.             combo2 = combo2 + dfgdamage
  130.             combo3 = combo3 + dfgdamage
  131.             --combo4 = combo4 + dfgdamage
  132.         end
  133.         if HXGREADY then              
  134.             combo1 = combo1 + hxgdamage    
  135.             combo2 = combo2 + hxgdamage
  136.             combo3 = combo3 + hxgdamage
  137.             --combo4 = combo4 + hxgdamage
  138.         end
  139.         if BWCREADY then
  140.             combo1 = combo1 + bwcdamage
  141.             combo2 = combo2 + bwcdamage
  142.             combo3 = combo3 + bwcdamage
  143.             combo4 = combo4 + bwcdamage
  144.         end
  145.         if IREADY then
  146.             combo1 = combo1 + ignitedamage
  147.             combo2 = combo2 + ignitedamage
  148.             combo3 = combo3 + ignitedamage
  149.         end
  150.         if combo4 >= enemy.health then killable[calculationenemy] = 4 doUlt = true
  151.         elseif combo3 >= enemy.health then killable[calculationenemy] = 3 doUlt = false
  152.         elseif combo2 >= enemy.health then killable[calculationenemy] = 2 doUlt = false
  153.         elseif combo1 >= enemy.health then killable[calculationenemy] = 1  doCombo = true doUlt = false
  154.         else killable[calculationenemy] = 0 doCombo = false doUlt = false end
  155.     end
  156.     if calculationenemy == 1 then calculationenemy = heroManager.iCount
  157.     else calculationenemy = calculationenemy-1 end
  158. end
  159.  
  160. function OnDraw()
  161.     if MCConfig.drawcircles and not myHero.dead then
  162.         DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x19A712)
  163.         DrawCircle(myHero.x, myHero.y, myHero.z, range2, 0x19A712)
  164.         if ts.target ~= nil then
  165.             for j=0, 10 do
  166.                 DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  167.             end
  168.         end
  169.     end
  170.     if ts.target ~= nil and MCConfig.drawprediction then
  171.         DrawCircle(ts.nextPosition.x, ts.target.y, ts.nextPosition.z, 200, 0x0000FF)
  172.     end
  173.     for i=1, heroManager.iCount do
  174.         local enemydraw = heroManager:GetHero(i)
  175.         if ValidTarget(enemydraw) then
  176.             if MCConfig.drawcircles then
  177.                 if killable[i] == 1 then
  178.                     for j=0, 20 do
  179.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  180.                     end
  181.                 elseif killable[i] == 2 then
  182.                     for j=0, 10 do
  183.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  184.                     end
  185.                 elseif killable[i] == 3 then
  186.                     for j=0, 10 do
  187.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  188.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  189.                     end
  190.                 elseif killable[i] == 4 then
  191.                     for j=0, 10 do
  192.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  193.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  194.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
  195.                     end
  196.                 end
  197.             end
  198.             if MCConfig.drawtext and waittxt[i] == 1 and killable[i] ~= 0 then
  199.                 PrintFloatText(enemydraw,0,floattext[killable[i]])
  200.             end
  201.         end
  202.         if waittxt[i] == 1 then waittxt[i] = 30
  203.         else waittxt[i] = waittxt[i]-1 end
  204.     end
  205.     SC__OnDraw()
  206. end
  207. function OnWndMsg(msg,key)
  208.     SC__OnWndMsg(msg,key)
  209. end
  210. function OnSendChat(msg)
  211.     TargetSelector__OnSendChat(msg)
  212.     ts:OnSendChat(msg, "pri")
  213. end
  214. PrintChat(" >> Ziggs WomboCombo 1.0 loaded!")
Advertisement
Add Comment
Please, Sign In to add comment