16HeX16

Zyra Combo

Jun 13th, 2013
2,923
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.28 KB | None | 0 0
  1. -->>        Zyra Combo      <<--
  2. if myHero.charName ~= "Zyra" then return end
  3.  
  4. require "AoE_Skillshot_Position"
  5. local qRange, wRange, eRange, rRange, pRange = 825, 825, 1150, 700, 1450
  6.  
  7. function OnLoad()
  8.     --> Combo Menu
  9.     comboMenu()
  10.     --> Main Menu
  11.     mainMenu()
  12.     Prediction()
  13.     ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, eRange+50, DAMAGE_MAGIC)
  14.     ps = TargetSelector(TARGET_LOW_HP, 1450, DAMAGE_MAGIC)
  15.     ts.name = "Ability Target"
  16.     ZyraCombo:addTS(ts)
  17.     --> Ignite
  18.     igniteSlot = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") and SUMMONER_2) or nil)
  19. end
  20.  
  21. function OnTick()
  22.     Checks()
  23.     if ZyraCombo.scriptActive and ts.target then
  24.         itemTick()
  25.         if ZyraConfig.useR and RREADY then castR(ts.target) end
  26.         if ZyraConfig.useE and EREADY then castE(ts.target) end
  27.         if ZyraConfig.useW and WREADY then castW(ePred) end
  28.         if ZyraConfig.useQ and QREADY then castQ(ts.target) end
  29.         if ZyraConfig.useW and WREADY then castW(qPred) end
  30.     end
  31.     if ZyraCombo.Qharass and ts.target then
  32.         if QREADY then castQ(ts.target) end
  33.         if WREADY and QREADY and ZyraConfig.harassW then castW(qPred) end
  34.     end
  35.     if ZyraCombo.Eharass and ts.target then
  36.         if EREADY then castE(ts.target) end
  37.         if WREADY and EREADY and ZyraConfig.harassW then castW(ePred) end
  38.     end
  39.     if ZyraCombo.autoIgnite then autoIgnite() end
  40.     if ZyraCombo.bloomKS then bloomKS() end
  41.     if ZyraConfig.useP and ps.target then castP(ps.target) end
  42. end
  43.  
  44. function OnDraw()
  45.     if not myHero.dead then
  46.         if ZyraConfig.drawQ then
  47.             DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x00FFFF)
  48.         end
  49.         if ZyraConfig.drawR then
  50.             DrawCircle(myHero.x, myHero.y, myHero.z, rRange, 0x00FF00)
  51.         end
  52.     end
  53. end
  54.  
  55. --> Deadly Bloom Cast
  56. function castQ(target)
  57.     if qPred and GetDistance(qPred) <= qRange then
  58.         if VIP_USER then
  59.             if qp:GetHitChance(target) >= ZyraConfig.hitChance/100 then
  60.                 CastSpell(_Q, qPred.x, qPred.z)
  61.             end
  62.         else CastSpell(_Q, qPred.x, qPred.z) end
  63.     end
  64. end
  65.  
  66. --> Rampant Growth Cast
  67. function castW(pos)
  68.     if pos and GetDistance(pos) <= wRange then
  69.         CastSpell(_W, pos.x, pos.z)
  70.     end
  71. end
  72.  
  73. --> Grasping Roots
  74. function castE(target)
  75.     if ePred and GetDistance(ePred) <= eRange then
  76.         if VIP_USER then
  77.             if ep:GetHitChance(target) >= ZyraConfig.hitChance/100 then
  78.                 CastSpell(_E, ePred.x, ePred.z)
  79.             end
  80.         else CastSpell(_E, ePred.x, ePred.z) end
  81.     end
  82. end
  83.  
  84. function CountEnemies(point, range)
  85.     local ChampCount = 0
  86.     for j = 1, heroManager.iCount, 1 do
  87.         local enemyhero = heroManager:getHero(j)
  88.         if myHero.team ~= enemyhero.team and ValidTarget(enemyhero, rRange+150) then
  89.             if enemyhero and GetDistance(enemyhero, point) <= range then
  90.                 ChampCount = ChampCount + 1
  91.             end
  92.         end
  93.     end    
  94.     return ChampCount
  95. end
  96.  
  97. --> Stranglethorns Cast
  98. function castR(target)
  99.     if ZyraConfig.rMEC then
  100.         local ultPos = GetAoESpellPosition(500, target)
  101.         if ultPos and GetDistance(ultPos) <= rRange then
  102.             if CountEnemies(ultPos, 500) >= ZyraConfig.rEnemies then
  103.                 CastSpell(_R, ultPos.x, ultPos.z)
  104.             end
  105.         end
  106.     elseif GetDistance(target) <= rRange then
  107.         CastSpell(_R, target.x, target.z)
  108.     end
  109. end
  110.  
  111. --> Rise of Thorns Cast
  112. function castP(target)
  113.     if pPred and GetDistance(pPred) <= pRange then
  114.         if myHero:GetSpellData(_Q).name == myHero:GetSpellData(_W).name or myHero:GetSpellData(_W).name == myHero:GetSpellData(_E).name then
  115.             if VIP_USER then
  116.                 if pp:GetHitChance(target) >= ZyraConfig.hitChance/100 then
  117.                     CastSpell(_Q, pPred.x, pPred.z)
  118.                 end
  119.             else
  120.                 CastSpell(_Q, pPred.x, pPred.z)
  121.             end
  122.         end
  123.     end
  124. end
  125.  
  126. --> Deadly Bloom KS
  127. function bloomKS()
  128.     for i, enemy in ipairs(GetEnemyHeroes()) do
  129.         if enemy and not enemy.dead and enemy.health < getDmg("Q", enemy, myHero) then
  130.             castQ(enemy)
  131.         end
  132.     end
  133. end
  134.  
  135. --> Auto Ignite
  136. function autoIgnite()
  137.     for i, enemy in ipairs(GetEnemyHeroes()) do
  138.         if igniteSlot and enemy and GetDistance(enemy) <= 600 and enemy.health < getDmg("IGNITE", enemy, myHero) then
  139.             CastSpell(igniteSlot, enemy)
  140.         end
  141.     end
  142. end
  143.  
  144. function Prediction()
  145.     if VIP_USER then
  146.         pp = TargetPredictionVIP(pRange, 1875, 0.375, 60)
  147.         qp = TargetPredictionVIP(qRange, math.huge, 0.7, 85)
  148.         ep = TargetPredictionVIP(eRange, 1150, 250, 70)
  149.         PrintChat("<font color='#CCCCCC'> >> VIP - Zyra Combo loaded! <<</font>")
  150.     else
  151.         pp = TargetPrediction(pRange, 1.875, 375, 60)
  152.         qp = TargetPrediction(qRange, math.huge, 700)
  153.         ep = TargetPrediction(eRange, 1.15, 250)
  154.         PrintChat("<font color='#CCCCCC'> >> Basic - Zyra Combo loaded! <<</font>")
  155.     end
  156. end
  157.  
  158. --> Combo Menu
  159. function comboMenu()
  160.     ZyraCombo = scriptConfig("Zyra - Combo Menu", "ZyraComboMenu")
  161.     ZyraCombo:addParam("sep", "-- Combo Options --", SCRIPT_PARAM_INFO, "")
  162.     ZyraCombo:addParam("scriptActive", "Full Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  163.     ZyraCombo:addParam("Qharass", "Deadly Bloom Harass", SCRIPT_PARAM_ONKEYDOWN, false, 71)
  164.     ZyraCombo:addParam("Eharass", "Grasping Roots Harass", SCRIPT_PARAM_ONKEYDOWN, false, 84)
  165.     ZyraCombo:addParam("autoIgnite", "Auto Ignite Killable", SCRIPT_PARAM_ONOFF, true)
  166.     ZyraCombo:addParam("bloomKS", "Kill with Deadly Bloom", SCRIPT_PARAM_ONOFF, true)
  167. end
  168.  
  169. --> Main Menu
  170. function mainMenu()
  171.     ZyraConfig = scriptConfig("Zyra - Options Menu", "ZyraMainMenu")
  172.     ZyraConfig:addParam("sep1", "-- Spell Cast Options --", SCRIPT_PARAM_INFO, "")
  173.     ZyraConfig:addParam("useP", "Use Rise of Thorns", SCRIPT_PARAM_ONOFF, true)
  174.     ZyraConfig:addParam("useQ", "Use Deadly Bloom", SCRIPT_PARAM_ONOFF, true)
  175.     ZyraConfig:addParam("useW", "Use Rampant Growth", SCRIPT_PARAM_ONOFF, true)
  176.     ZyraConfig:addParam("useE", "Use Grasping Roots", SCRIPT_PARAM_ONOFF, true)
  177.     ZyraConfig:addParam("useR", "Use Stranglethorns", SCRIPT_PARAM_ONOFF, true)
  178.     ZyraConfig:addParam("sep2", "-- Cast Options --", SCRIPT_PARAM_INFO, "")
  179.     if VIP_USER then
  180.         ZyraConfig:addParam("hitChance", "Ability Hitchance", SCRIPT_PARAM_SLICE, 60, 0, 100, 0)
  181.     end
  182.     ZyraConfig:addParam("rEnemies", "Stranglethorns - Min Enemies",SCRIPT_PARAM_SLICE, 2, 1, 5, 0)
  183.     ZyraConfig:addParam("rMEC", "MEC - Stranglethorns", SCRIPT_PARAM_ONOFF, true)
  184.     ZyraConfig:addParam("harassW", "Harass - Use Rampant Growth", SCRIPT_PARAM_ONOFF, true)
  185.     ZyraConfig:addParam("sep3", "-- Draw Options --", SCRIPT_PARAM_INFO, "")
  186.     ZyraConfig:addParam("drawQ", "Draw - Deadly Bloom", SCRIPT_PARAM_ONOFF, false)
  187.     ZyraConfig:addParam("drawR", "Draw - Stranglethorns", SCRIPT_PARAM_ONOFF, false)
  188. end
  189.  
  190. --> Item Table
  191. local items =
  192.     {
  193.         {name = "Deathfire Grasp", menu = "DFG", id=3128, range = 750, reqTarget = true, slot = nil },
  194.         {name = "Hextech Gunblade", menu = "HGB", id=3146, range = 400, reqTarget = true, slot = nil },
  195.     }
  196.  
  197. --> Item Casts
  198. function itemTick(target)
  199.     for _,item in pairs(items) do
  200.         item.slot = GetInventorySlotItem(item.id)
  201.         if item.slot ~= nil then
  202.             if item.reqTarget and GetDistance(target) <= item.range then
  203.                 CastSpell(item.slot, target)
  204.             end
  205.         end
  206.     end
  207. end
  208.  
  209. --> Checks
  210. function Checks()
  211.     ts:update()
  212.     ps:update()
  213.     if ts.target then
  214.         qPred = qp:GetPrediction(ts.target)
  215.         ePred = ep:GetPrediction(ts.target)
  216.     end
  217.     if ps.target then pPred = pp:GetPrediction(ps.target) end
  218.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  219.     WREADY = (myHero:CanUseSpell(_W) == READY)
  220.     EREADY = (myHero:CanUseSpell(_E) == READY)
  221.     RREADY = (myHero:CanUseSpell(_R) == READY)
  222. end
Advertisement
Add Comment
Please, Sign In to add comment