16HeX16

Wukong Combo 1.41

Mar 30th, 2013
5,345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.30 KB | None | 0 0
  1. --[[
  2.     Wukong Combo 1.41 by HeX
  3.    
  4. Features:
  5.     -Basic Combo: Items-> E-> AA-> Q-> AA
  6.     -Full Combo(With Use Ulti in combo activated): Items-> E-> AA-> Q-> R
  7.     -Use ultimate in combo ON/OFF option in ingame menu.
  8.     -Auto Ignite in combo ON/OFF option in ingame menu.
  9.     -Item Support: Blade of the Ruined King, Bligewater Cutlass, Deathfire Grasp, Hextech Gunblade, Tiamat, Ravenous Hydra, Randuins Omen.
  10.    
  11. Explanation of the marks:
  12.     -Green circle: Marks the current target to which you will do the combo
  13.     -Blue circle: Killed with a combo, if all the skills were available
  14.     -Red circle: Killed using items + 2 Hits + Q + E + R + Ignite(if available)
  15.     -2 Red circles: Killed using items + 1 Hit + Q + E + Ignite(if available)
  16.     -3 Red circles: Killed using Q
  17. ]]
  18. if myHero.charName ~= "MonkeyKing" then return end
  19.  
  20. --[[   Buffers  ]]-- Change these based on personal preference.
  21. local ebuffer = 350 --Wont use E unless they are this far away. 350 by default.
  22. local qbuffer = 275 --Will use Q without attacking when they are this far away. 275 by default.
  23. --[[        Code        ]]--
  24. local range = 650
  25. local qrange = 300
  26. local AArange = 170
  27. local rrange = 300
  28. local ts
  29. local waittxt = {}
  30. local calculationenemy = 1
  31. local floattext = {"Skills are not available","Able to fight","Killable","Murder him!"}
  32. local killable = {}
  33. local lastBasicAttack = 0
  34. local swingDelay = 0.25
  35. local startAttackSpeed = 0.625
  36. local swing = 0
  37. local ignite = nil
  38. local BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot = nil, nil, nil, nil, nil, nil, nil
  39. local QREADY, WREADY, EREADY, RREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY, TMTREADY, RAHREADY, RNDREADY = false, false, false, false, false, false, false, false, false, false, false
  40.  
  41. function OnLoad()
  42.     PrintChat("<font color='#CCCCCC'> >> Wukong Combo 1.41 loaded! <<</font>")
  43.     WCConfig = scriptConfig("Wukong Combo", "wukongcombo")
  44.     WCConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  45.     WCConfig:addParam("drawcirclesSelf", "Draw Circles - Self", SCRIPT_PARAM_ONOFF, true)
  46.     WCConfig:addParam("drawcirclesEnemy", "Draw Circles - Enemy", SCRIPT_PARAM_ONOFF, true)
  47.     WCConfig:addParam("drawText", "Draw Text - Enemy", SCRIPT_PARAM_ONOFF, true)
  48.     WCConfig:addParam("useUlt", "Use Ultimate in Combo", SCRIPT_PARAM_ONKEYTOGGLE, false, 67)--C
  49.     WCConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  50.     WCConfig:permaShow("scriptActive")
  51.     WCConfig:permaShow("useUlt")
  52.     WCConfig:permaShow("autoignite")
  53.    
  54.     ts = TargetSelector(TARGET_LOW_HP, 800, DAMAGE_PHYSICAL)
  55.     ts.name = "Wukong"
  56.     WCConfig:addTS(ts)
  57.    
  58.     for i=1, heroManager.iCount do waittxt[i] = i*3 end
  59.    
  60.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  61.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  62. end
  63.  
  64. function OnProcessSpell(unit, spell)
  65.     if unit.isMe and (spell.name:find("Attack") ~= nil) then
  66.         swing = 1
  67.         lastBasicAttack = os.clock()
  68.     end
  69. end
  70.  
  71. function OnTick()
  72.     if myHero.dead then
  73.         return
  74.     end
  75.    
  76.     AttackDelay = 1/(myHero.attackSpeed*startAttackSpeed)
  77.     if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
  78.         swing = 0
  79.     end
  80.    
  81.     if tick == nil or GetTickCount()-tick>=100 then
  82.         tick = GetTickCount()
  83.         WCDmgCalculation()
  84.     end
  85.  
  86.     ts:update()
  87.    
  88.     BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3077), GetInventorySlotItem(3074),  GetInventorySlotItem(3143)
  89.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  90.     WREADY = (myHero:CanUseSpell(_W) == READY)
  91.     EREADY = (myHero:CanUseSpell(_E) == READY)
  92.     RREADY = (myHero:CanUseSpell(_R) == READY)
  93.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  94.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  95.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  96.     BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  97.     TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
  98.     RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
  99.     RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
  100.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  101.  
  102.     if WCConfig.autoignite then    
  103.         if IREADY then
  104.             local ignitedmg = 0    
  105.             for i = 1, heroManager.iCount, 1 do
  106.                 local enemyhero = heroManager:getHero(i)
  107.                 if ValidTarget(enemyhero,600) then
  108.                     ignitedmg = 50 + 20 * myHero.level
  109.                     if enemyhero.health <= ignitedmg then
  110.                         CastSpell(ignite, enemyhero)
  111.                     end
  112.                 end
  113.             end
  114.         end
  115.     end
  116.  
  117.     if WCConfig.scriptActive and ts.target ~= nil then
  118.         if DFGREADY then CastSpell(DFGSlot, ts.target) end
  119.         if HXGREADY then CastSpell(HXGSlot, ts.target) end
  120.         if BWCREADY then CastSpell(BWCSlot, ts.target) end
  121.         if BRKREADY then CastSpell(BRKSlot, ts.target) end
  122.         if TMTREADY and GetDistance(ts.target) < 275 then CastSpell(TMTSlot) end
  123.         if RAHREADY and GetDistance(ts.target) < 275 then CastSpell(RAHSlot) end
  124.         if RNDREADY and GetDistance(ts.target) < 275 then CastSpell(RNDSlot) end
  125.         local QDMG = getDmg("Q", ts.target, myHero)
  126.         local EDMG = getDmg("E", ts.target, myHero)
  127.         if swing == 0  then
  128.       if GetDistance(ts.target) < qrange then
  129.         myHero:Attack(ts.target)
  130.                 elseif QREADY and ts.target.health < QDMG then
  131.                     CastSpell(_Q)
  132.                     myHero:Attack(ts.target)
  133.                     swing = 0
  134.       end
  135.             if EREADY and GetDistance(ts.target) < range and GetDistance(ts.target) > ebuffer then  
  136.                 CastSpell(_E, ts.target)
  137.                 myHero:Attack(ts.target)
  138.                 if QREADY and WCConfig.useUlt and RREADY then
  139.                     CastSpell(_Q)
  140.                     myHero:Attack(ts.target)
  141.                     swing = 0
  142.                 end
  143.                 elseif EREADY and ts.target.health < EDMG then
  144.                     CastSpell(_E, ts.target)
  145.       end
  146.             if QREADY and GetDistance(ts.target) > qbuffer then
  147.                 if GetDistance(ts.target) < qrange then
  148.                     CastSpell(_Q)
  149.                     myHero:Attack(ts.target)
  150.                     swing = 0
  151.                 end
  152.             end
  153.             elseif swing == 1 then
  154.             if QREADY and os.clock() - lastBasicAttack > swingDelay and GetDistance(ts.target) < qrange then
  155.                 CastSpell(_Q)
  156.                 myHero:Attack(ts.target)
  157.                 swing = 0
  158.             end
  159.             if RREADY and WCConfig.useUlt and GetDistance(ts.target) < rrange then
  160.                 if not QREADY then
  161.                 CastSpell(_R)
  162.                 end
  163.             end
  164.         end
  165.     end
  166. end
  167.  
  168. function WCDmgCalculation()
  169.     local enemy = heroManager:GetHero(calculationenemy)
  170.     if ValidTarget(enemy) then
  171.         local ignitedamage, dfgdamage, hxgdamage, bwcdamage, brkdamage, tmtdamage, rahdamage = 0, 0, 0, 0, 0, 0, 0
  172.         local qdamage = getDmg("Q",enemy,myHero)
  173.         local edamage = getDmg("E",enemy,myHero)
  174.         local rdamage = getDmg("R",enemy,myHero,1)
  175.         local hitdamage = getDmg("AD",enemy,myHero)
  176.         local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  177.         local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  178.         local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  179.         local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  180.         local brkdamage = (BRKSlot and getDmg("RUINEDKING",enemy,myHero) or 0)
  181.         local tmtdamage = (TMTSlot and getDmg("TIAMAT",enemy,myHero) or 0)
  182.         local rahdamage = (RAHSlot and getDmg("HYDRA",enemy,myHero) or 0)
  183.         local combo1 = hitdamage*2 + qdamage + edamage + rdamage
  184.         local combo2 = hitdamage*2
  185.         local combo3 = hitdamage*1
  186.         local combo4 = 0
  187.     if QREADY then
  188.         combo2 = combo2 + qdamage
  189.         combo3 = combo3 + qdamage
  190.         combo4 = combo4 + qdamage
  191.         end
  192.     if EREADY then
  193.         combo2 = combo2 + edamage
  194.         combo3 = combo3 + edamage
  195.     end
  196.     if RREADY then
  197.         combo2 = combo2 + rdamage
  198.     end
  199.     if DFGREADY then
  200.         combo1 = combo1 + dfgdamage
  201.         combo2 = combo2 + dfgdamage
  202.         combo3 = combo3 + dfgdamage
  203.     end
  204.     if HXGREADY then
  205.         combo1 = combo1 + hxgdamage
  206.         combo2 = combo2 + hxgdamage
  207.         combo3 = combo3 + hxgdamage
  208.     end
  209.     if BWCREADY then
  210.         combo1 = combo1 + bwcdamage
  211.         combo2 = combo2 + bwcdamage
  212.         combo3 = combo3 + bwcdamage
  213.     end
  214.     if BRKREADY then
  215.         combo1 = combo1 + brkdamage
  216.         combo2 = combo2 + brkdamage
  217.         combo3 = combo3 + brkdamage
  218.     end
  219.     if TMTREADY then
  220.         combo1 = combo1 + tmtdamage
  221.         combo2 = combo2 + tmtdamage
  222.         combo3 = combo3 + tmtdamage
  223.     end
  224.     if RAHREADY then
  225.         combo1 = combo1 + rahdamage
  226.         combo2 = combo2 + rahdamage
  227.         combo3 = combo3 + rahdamage
  228.     end
  229.     if IREADY then
  230.         combo1 = combo1 + ignitedamage
  231.         combo2 = combo2 + ignitedamage
  232.         combo3 = combo3 + ignitedamage
  233.     end
  234.     if combo4 >= enemy.health then killable[calculationenemy] = 4
  235.         elseif combo3 >= enemy.health then killable[calculationenemy] = 3
  236.         elseif combo2 >= enemy.health then killable[calculationenemy] = 2
  237.         elseif combo1 >= enemy.health then killable[calculationenemy] = 1
  238.         else killable[calculationenemy] = 0 end
  239.     end
  240.         if calculationenemy == 1 then calculationenemy = heroManager.iCount
  241.             else calculationenemy = calculationenemy-1
  242.         end
  243. end
  244.  
  245. function OnDraw()
  246.     if WCConfig.drawcirclesSelf and not myHero.dead then
  247.         DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x19A712)
  248.     end
  249.    
  250.     if WCConfig.drawcirclesEnemy and ts.target ~= nil then
  251.         for j=0, 10 do
  252.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  253.         end
  254.     end
  255.     for i=1, heroManager.iCount do
  256.         local enemydraw = heroManager:GetHero(i)
  257.         if ValidTarget(enemydraw) then
  258.             if WCConfig.drawcirclesEnemy then
  259.                 if killable[i] == 1 then
  260.                     for e=0, 15 do
  261.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0x0000FF)
  262.                     end
  263.                     elseif killable[i] == 2 then
  264.                     for e=0, 10 do
  265.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0xFF0000)
  266.                     end
  267.                     elseif killable[i] == 3 then
  268.                     for e=0, 10 do
  269.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0xFF0000)
  270.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + e*1.5, 0xFF0000)
  271.                     end
  272.                     elseif killable[i] == 4 then
  273.                     for e=0, 10 do
  274.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + e*1.5, 0xFF0000)
  275.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + e*1.5, 0xFF0000)
  276.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + e*1.5, 0xFF0000)
  277.                     end
  278.                 end
  279.             end
  280.             if WCConfig.drawText and waittxt[i] == 1 and killable[i] ~= 0 then
  281.                 PrintFloatText(enemydraw,0,floattext[killable[i]])
  282.             end
  283.         end
  284.         if waittxt[i] == 1 then waittxt[i] = 30
  285.             else waittxt[i] = waittxt[i]-1
  286.         end
  287.     end
  288. end
Advertisement
Add Comment
Please, Sign In to add comment