Advertisement
Kevinkev

Zyra (fixed)

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