Advertisement
Guest User

Akali-burn-update-1.5a.lua

a guest
Mar 23rd, 2013
730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.41 KB | None | 0 0
  1.    --[[
  2.                     Akali Combo v1.5a by burn
  3.                     updated season 3 items
  4.                      --xkjtx added Harass and UseW in combo's--
  5.                     -Full combo: DFG -> Items -> Q -> R -> E
  6.                     -Supports Deathfire Grasp, Bilgewater Cutlass, Hextech Gunblade, Sheen, Trinity, Lich Bane and Ignite (damage calculation)
  7.                     -Mark killable target with a combo
  8.                     -Target configuration, Press shift to configure
  9.                     -Auto ignite killable enemy ON/OFF option in ingame menu
  10.                     -Improved New Energy managament in skills (multiples cases)
  11.                
  12.                     Explanation of the marks:
  13.      
  14.                     Green circle:  Marks the current target to which you will do the combo
  15.                     Blue circle:  Mark a target that can be killed with a combo, if all the skills were available
  16.                     Red circle:  Mark a target that can be killed using items + Passive x3 + 3 hits + Q(with mark) x2 + E x2 + R x3 + ignite
  17.                     2 Red circles:  Mark a target that can be killed using items + Passive x2 + 2 hits + Q(with mark) + Rx2 + E + ignite
  18.                     3 Red circles:  Mark a target that can be killed using items (without Sheen, Trinity and Lich Bane) + Q(with mark) + R + E + ignite
  19.                
  20.     ]]
  21.     if myHero.charName ~= "Akali" then return end  
  22.     --[[            Code            ]]
  23.     local range = 800
  24.         local qrange = 600
  25.         local erange = 300
  26.         local AArange = 550
  27.     local tick = nil
  28.     -- Active
  29.     local scriptActive = false
  30.         local QREADY, WREADY, EREADY, RREADY  = false, false, false, false
  31.     -- other
  32.         enemyhaveQ = false -- with this we can know if our Q hit the target for proc the mark, global variable
  33.         qInAir  = true -- with this we can know if our Q is in air traveling to our target, global variable
  34.         local QparticleDist = 70 --take valors between 10 and 100, if script dont proc the Q mark, try lowering or increasing this value, but at 70 should work fine
  35.     -- draw
  36.     local waittxt = {}
  37.     local floattext = {"Skills are not available","Able to fight","Killable","Murder NOW!"}
  38.     local killable = {}
  39.         local WeHaveEnergy = false
  40.     -- ts
  41.     local ts
  42.     --
  43.     local ignite = nil
  44.     local DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil
  45.      
  46.     function OnLoad()
  47.             PrintChat(">> Akali Combo v1.5a Oh Billy!")
  48.             if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  49.             elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  50.             else ignite = nil
  51.             end
  52.             AkaliConfig = scriptConfig("Akali Combo v1.5a", "Akalicombo")
  53.             AkaliConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  54.             AkaliConfig:addParam("harassActive", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("S"))
  55.             AkaliConfig:addParam("useW", "Toggle Use W in Combo's", SCRIPT_PARAM_ONKEYTOGGLE, true, string.byte("V")) -- V
  56.             AkaliConfig:addParam("drawcircles", "Draw Killable Enemy", SCRIPT_PARAM_ONOFF, true)
  57.             AkaliConfig:addParam("printtext", "Text on Killable Enemy", SCRIPT_PARAM_ONOFF, true)
  58.             AkaliConfig:addParam("drawrange", "Draw Self Range", SCRIPT_PARAM_ONOFF, true)
  59.             AkaliConfig:addParam("autoIgnite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  60.             AkaliConfig:permaShow("scriptActive")
  61.             AkaliConfig:permaShow("harassActive")
  62.             AkaliConfig:permaShow("useW")
  63.             ts = TargetSelector(TARGET_LOW_HP,range+50,DAMAGE_MAGIC)
  64.             ts.name = "Akali"
  65.             AkaliConfig:addTS(ts)
  66.             for i=1, heroManager.iCount do
  67.                 waittxt[i] = i
  68.             end
  69.     end
  70.     function OnTick()
  71.             ts:update()
  72.             DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  73.             IcebornSlot, LiandrysSlot, BlackfireSlot = GetInventorySlotItem(3025), GetInventorySlotItem(3151), GetInventorySlotItem(3188)
  74.                     if tick == nil or GetTickCount() - tick >= 100 then
  75.                     tick = GetTickCount()
  76.                     DmgCalculation()
  77.            end
  78.                     QREADY = (myHero:CanUseSpell(_Q) == READY)
  79.                     WREADY = (myHero:CanUseSpell(_W) == READY)
  80.                     EREADY = (myHero:CanUseSpell(_E) == READY)
  81.                     RREADY = (myHero:CanUseSpell(_R) == READY)
  82.                     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  83.                     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  84.                     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  85.                     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  86.            
  87.                     if AkaliConfig.harassActive and ts.target ~= nil then
  88.                         if AkaliConfig.useW and WREADY and GetDistance(ts.target) < AArange then
  89.                             CastSpell(_W, ts.target.x, ts.target.z)
  90.                         end -- W first
  91.                         if QREADY and GetDistance(ts.target) <= qrange then --Q
  92.                             CastSpell(_Q, ts.target)
  93.                             qInAir = true --Q cast to enemy, until hit enemy, Q is on air
  94.                         end
  95.                     end
  96.            
  97.           if AkaliConfig.scriptActive and ts.target ~= nil then
  98.                         if AkaliConfig.useW and WREADY and GetDistance(ts.target) < AArange then
  99.                             CastSpell(_W, ts.target.x, ts.target.z)
  100.                         end -- W first
  101.                         if DFGREADY then CastSpell(DFGSlot, ts.target) end --DFG
  102.                         if HXGREADY then CastSpell(HXGSlot, ts.target) end --HXG
  103.                         if BWCREADY then CastSpell(BWCSlot, ts.target) end --BWC       
  104.                         if QREADY and GetDistance(ts.target) <= qrange then --Q
  105.                             CastSpell(_Q, ts.target)
  106.                             qInAir = true --Q cast to enemy, until hit enemy, Q is on air
  107.                         end                                
  108.                         if (GetDistance(ts.target) <= 800 and (GetDistance(ts.target) > erange or (not QREADY and not EREADY)) and RREADY) then --R
  109.                             CastSpell(_R, ts.target)
  110.                         end
  111.                     --energy check managament:
  112.                         local SpellDataE = myHero:GetSpellData(_E)
  113.                         local totalCost = 60 + (60-5*SpellDataE.level) --totalcost of energy necessary to do a Q+E
  114.                         if myHero.mana >= totalCost then
  115.                             WeHaveEnergy = true
  116.                         else
  117.                             WeHaveEnergy = false
  118.                         end
  119.                         --energy managament on E spell:
  120.                         local edmg = getDmg("E",ts.target,myHero)
  121.                         if GetDistance(ts.target) <= erange and enemyhaveQ == true and WeHaveEnergy == true and EREADY then --case 1: we have energy to do Q+E, and enemy is marked with Q
  122.                             CastSpell(_E, ts.target)
  123.                             enemyhaveQ = false
  124.                         end
  125.                         if GetDistance(ts.target) <= erange and ts.target.health <= edmg and EREADY then --case 2: if we have/not have energy to do the Q+E and enemy have/not have q mark, BUT with a E we can kill the target, we cast E on enemy
  126.                             CastSpell(_E, ts.target)
  127.                             enemyhaveQ = false
  128.                         end
  129.                         if GetDistance(ts.target) <= erange and enemyhaveQ == true and myHero.mana <= 60 and EREADY then --case 3: we not have energy for do a Q+E, but with the mark proc we can do the Q again after 2-3 seconds (time depends on Q level restore and E level cost)
  130.                             CastSpell(_E, ts.target)
  131.                             enemyhaveQ = false
  132.                         end
  133.                         if GetDistance(ts.target) <= erange and qInAir == false and WeHaveEnergy == true and EREADY then --case 4: we not have a Q going to our target (ex: Q is in cooldown because 2 seconds ago last target was killed with our Q), and we have energy to do Q after E, we cast E
  134.                             CastSpell(_E, ts.target)
  135.                             enemyhaveQ = false
  136.                         end
  137.                         if GetDistance(ts.target) < AArange then myHero:Attack(ts.target) end --Autoatack enemy    
  138.           end  
  139.             if AkaliConfig.autoIgnite then
  140.                 local ignitedmg = 0    
  141.                 if IREADY then
  142.                     for j = 1, heroManager.iCount, 1 do
  143.                     local enemyhero = heroManager:getHero(j)
  144.                         if ValidTarget(enemyhero) then
  145.                             ignitedmg = 50 + 20 * myHero.level
  146.                             if enemyhero ~= nil and enemyhero.team ~= myHero.team and not enemyhero.dead and enemyhero.visible and GetDistance(enemyhero) < 600 and enemyhero.health <= ignitedmg then
  147.                                 CastSpell(ignite, enemyhero)
  148.                             end
  149.                         end
  150.                     end
  151.                 end        
  152.             end    
  153.     end
  154.      
  155.     function DmgCalculation()
  156.             for i=1, heroManager.iCount do
  157.                     local enemy = heroManager:GetHero(i)
  158.                     if ValidTarget(enemy) then
  159.                             local dfgdamage, hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage  = 0, 0, 0, 0, 0, 0, 0
  160.                             local pdamage = getDmg("P",enemy,myHero)
  161.                             local qdamage = getDmg("Q",enemy,myHero,3)
  162.                             local edamage = getDmg("E",enemy,myHero)
  163.                             local rdamage = getDmg("R",enemy,myHero)
  164.                             local hitdamage = getDmg("AD",enemy,myHero)
  165.                             local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  166.                             local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  167.                             local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  168.                             local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  169.                             local onhitdmg = (SheenSlot and getDmg("SHEEN",enemy,myHero) or 0)+(TrinitySlot and getDmg("TRINITY",enemy,myHero) or 0)+(LichBaneSlot and getDmg("LICHBANE",enemy,myHero) or 0)+(IcebornSlot and getDmg("ICEBORN",enemy,myHero) or 0)                         
  170.                             local onspelldamage = (LiandrysSlot and getDmg("LIANDRYS",enemy,myHero) or 0)+(BlackfireSlot and getDmg("BLACKFIRE",enemy,myHero) or 0)
  171.                             local combo1 = qdamage*2 + edamage*2 + rdamage*3 + onspelldamage  --0 cd
  172.                             local combo2 = onspelldamage
  173.                             local combo3 = onspelldamage
  174.                             local combo4 = onspelldamage
  175.                             if myHero:CanUseSpell(_Q) == READY then
  176.                                     combo2 = combo2 + qdamage*2
  177.                                     combo3 = combo3 + qdamage
  178.                                     combo4 = combo4 + qdamage
  179.                             end
  180.                             if myHero:CanUseSpell(_E) == READY then
  181.                                     combo2 = combo2 + edamage*2
  182.                                     combo3 = combo3 + edamage
  183.                                     combo4 = combo4 + edamage
  184.                             end
  185.                             if myHero:CanUseSpell(_R) ~= COOLDOWN and not myHero.dead then
  186.                                     combo2 = combo2 + rdamage*3
  187.                                     combo3 = combo3 + rdamage*2
  188.                                     combo4 = combo4 + rdamage
  189.                             end
  190.                             if HXGSlot ~= nil and  myHero:CanUseSpell(HXGSlot) == READY then              
  191.                                     combo1 = combo1 + hxgdamage    
  192.                                     combo2 = combo2 + hxgdamage
  193.                                     combo3 = combo3 + hxgdamage
  194.                                     combo4 = combo4 + hxgdamage
  195.                             end
  196.                             if BWCSlot ~= nil and  myHero:CanUseSpell(BWCSlot) == READY then
  197.                                     combo1 = combo1 + bwcdamage
  198.                                     combo2 = combo2 + bwcdamage
  199.                                     combo3 = combo3 + bwcdamage
  200.                                     combo4 = combo4 + bwcdamage
  201.                             end
  202.                             if DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY then        
  203.                                     combo1 = combo1*1.2 + dfgdamage            
  204.                                     combo2 = combo2*1.2 + dfgdamage
  205.                                     combo3 = combo3*1.2 + dfgdamage
  206.                                     combo4 = combo4*1.2 + dfgdamage
  207.                             end                        
  208.                             if ignite ~= nil and  myHero:CanUseSpell(ignite) == READY then
  209.                                     combo1 = combo1 + ignitedamage
  210.                                     combo2 = combo2 + ignitedamage
  211.                                     combo3 = combo3 + ignitedamage
  212.                                     combo4 = combo4 + ignitedamage
  213.                             end
  214.                             combo1 = combo1 + onhitdmg + hitdamage*3 + pdamage*3
  215.                             combo2 = combo2 + onhitdmg + hitdamage*3 + pdamage*3
  216.                             combo3 = combo3 + onhitdmg + hitdamage*2 + pdamage*2
  217.                             combo4 = combo4 + onhitdmg                         
  218.                             if combo4 >= enemy.health then
  219.                                     killable[i] = 4
  220.                             elseif combo3 >= enemy.health then
  221.                                     killable[i] = 3
  222.                             elseif combo2 >= enemy.health then
  223.                                     killable[i] = 2
  224.                             elseif combo1 >= enemy.health then
  225.                                     killable[i] = 1
  226.                             else
  227.                                     killable[i] = 0
  228.                             end    
  229.                     end
  230.             end
  231.     end
  232.      
  233.     function OnDraw()
  234.             if AkaliConfig.drawrange and not myHero.dead then
  235.                     DrawCircle(myHero.x, myHero.y, myHero.z, qrange, 0xc2743c)
  236.                     DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x25de69)
  237.                     if ts.target ~= nil then
  238.                             for j=0, 15 do
  239.                                     DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  240.                             end
  241.                     end
  242.             end
  243.             for i=1, heroManager.iCount do
  244.                     local enemydraw = heroManager:GetHero(i)
  245.                     if ValidTarget(enemydraw) then
  246.                             if AkaliConfig.drawcircles then
  247.                                     if killable[i] == 1 then
  248.                                             for j=0, 25 do
  249.                                                     DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  250.                                             end
  251.                                     elseif killable[i] == 2 then
  252.                                             for j=0, 15 do
  253.                                                     DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  254.                                             end
  255.                                     elseif killable[i] == 3 then
  256.                                             for j=0, 15 do
  257.                                                     DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  258.                                                     DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 120 + j*1.5, 0xFF0000)
  259.                                             end
  260.                                     elseif killable[i] == 4 then
  261.                                             for j=0, 15 do
  262.                                                     DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  263.                                                     DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 120 + j*1.5, 0xFF0000)
  264.                                                     DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 160 + j*1.5, 0xFF0000)
  265.                                             end
  266.                                     end
  267.                             end
  268.                             if AkaliConfig.printtext then
  269.                                     if waittxt[i] == 1 then
  270.                                             if killable[i] ~= 0 then
  271.                                                     PrintFloatText(enemydraw,0,floattext[killable[i]])
  272.                                             end
  273.                                             waittxt[i] = 20
  274.                                     else
  275.                                             waittxt[i] = waittxt[i]-1
  276.                                     end
  277.                             end
  278.                     end
  279.             end
  280.     end
  281.      
  282.     function OnCreateObj(obj)
  283.         if obj.name:find("akali_markOftheAssasin_marker_tar.troy") then --we get this particle if our Q hit something
  284.             qInAir = false --if Q hit something, then Q is not on the air
  285.             if obj and ts.target ~= nil and ts.target:GetDistance(obj) <= QparticleDist then
  286.             enemyhaveQ = true --Q hit target
  287.             end
  288.         end
  289.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement