Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "Utils"
- require 'yprediction'
- require 'spell_shot'
- require 'spell_damage'
- local planting = false
- local Etimer=0
- local timer0 = 0
- local timer1 = 0
- local target
- local YP = YPrediction()
- local t0_attacking = 0
- local IgniteDmg = 0
- local haveIgnite = false
- local igniteKey
- local shotMe = false
- local Q = {range = 800, rangeSqr = math.pow(800, 2), width = 50, delay = 1.8, speed = 0, LastCastTime = 0}
- local E = {range = 1100, rangeSqr = math.pow(1050, 2), width = 70, delay = 1.25, speed = 0, LastCastTime = 0, ETA=math.huge}
- local W = {range = 825, rangeSqr = math.pow(850, 2), width = 0, delay = 0, speed = 0, LastCastTime = 0,}
- local R = {range = 700, rangeSqr = math.pow(700, 2), width = 500, delay = 2.5, speed = 0, LastCastTime = 0}
- local DontUseRTime = 0
- local UseRTime = 0
- ZyraHotkeys = scriptConfig("HotKeys Settings", "Samipote's Zyra")
- ZyraHotkeys:addParam("Combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("X"))
- ZyraHotkeys:addParam("Harass", "Harass!", SCRIPT_PARAM_ONKEYTOGGLE, true, string.byte("Z"))
- ZyraCombo = scriptConfig("Combo Settings", "Samipote's Zyra")
- ZyraCombo:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF,true)
- ZyraCombo:addParam("UseQW", "Use QW", SCRIPT_PARAM_ONOFF,true)
- ZyraCombo:addParam("UseE", "Use E", SCRIPT_PARAM_ONOFF,true)
- ZyraCombo:addParam("UseEW", "Use EW", SCRIPT_PARAM_ONOFF,true)
- ZyraCombo:addParam("UseR", "Use R", SCRIPT_PARAM_ONOFF,true)
- ZyraHarass = scriptConfig("Harass Settings", "Samipote's Zyra")
- ZyraHarass:addParam("UseQ", "Use Q", SCRIPT_PARAM_ONOFF,true)
- ZyraHarass:addParam("UseQW", "Use QW", SCRIPT_PARAM_ONOFF,true)
- ZyraHarass:addParam("UseE", "Use E", SCRIPT_PARAM_ONOFF,true)
- ZyraHarass:addParam("UseEW", "Use EW", SCRIPT_PARAM_ONOFF,true)
- ZyraHarass:addParam("ManaCheck", "ManaCheck", SCRIPT_PARAM_ONOFF,true)
- function OnTick()
- target = GetWeakEnemy('Magic',1050)
- if ZyraHotkeys.Combo and target then
- Combo()
- elseif ZyraHotkeys.Harass then
- Harass()
- end
- IgniteDmg = 50 + (20 * myHero.selflevel)
- if haveIgnite and GetDistance(target) <= 600 and IgniteDmg>target.health then
- CastSpellTarget(igniteKey, target)
- end
- end
- function Combo()
- UseSpells(ZyraCombo.UseQ, ZyraCombo.UseQW, ZyraCombo.UseE, ZyraCombo.UseEW, ZyraCombo.UseR, false)
- castE()
- end
- function Harass()
- if ZyraHarass.ManaCheck and 25 > (myHero.mana / myHero.maxMana) * 100 then return end
- UseSpells(ZyraHarass.UseQ, ZyraHarass.UseQW, ZyraHarass.UseE, ZyraHarass.UseEW, false)
- castE()
- end
- function OnProcessSpell(unit, spell)
- if unit.charName == myHero.charName then
- if spell.name == "ZyraQFissure" then
- Q.LastCastTime = os.clock()
- Q.LastPos = spell.endPos
- Q.seedcasted = false
- DelayAction(function() Q.seedcasted = true end, Q.delay)
- elseif spell.name == "ZyraSeed" then
- W.LastCastTime = os.clock()
- elseif spell.name == "ZyraGraspingRoots" then
- E.LastCastTime = os.clock()
- E.seedcasted = false
- DelayAction(function() E.seedcasted = true end, E.delay + (E.range / E.speed))
- elseif spell.name == "ZyraBrambleZone" then
- R.LastCastTime = os.clock()
- end
- end
- end
- local shot = SpellShotTarget(unit, spell, myHero)
- if shot ~= nil then
- spellShot = shot
- if spellShot.shot then
- shotMe = true
- target = unit
- end
- end
- function UseSpells(UseQ, UseQW, UseE, UseEW, UseR, RN)
- local Qtarget
- local Etarget
- Qtarget = GetWeakEnemy('MAGIC',Q.range + Q.width,'NEARMOUSE')
- Etarget = GetWeakEnemy('MAGIC',E.range,'NEARMOUSE')
- if Qtarget then
- Etarget = Qtarget
- end
- if UseQW then
- for i = 1, objManager:GetMaxHeroes(), 1 do
- local enemy = objManager:GetHero(i)
- local CastPosition, HitChance, Position = YP:GetPredictedPos(enemy, Q.delay,Q.speed, myHero, false)
- if CastPosition and CastPosition.z and HitChance >= 2 and (enemy ~= nil and enemy.team ~= myHero.team and enemy.visible == 1 and enemy.invulnerable == 0 and enemy.dead == 0) and GetDistance(enemy) <= W.range then
- local x, y, z = CastPosition.x, CastPosition.y, CastPosition.z
- CastSpellXYZ("Q", x, y, z)
- break
- end
- end
- end
- if UseEW then
- for i = 1, objManager:GetMaxHeroes(), 1 do
- local enemy = objManager:GetHero(i)
- if (enemy ~= nil and enemy.team ~= myHero.team and enemy.visible == 1 and enemy.invulnerable == 0 and enemy.dead == 0) and GetDistance(enemy) <= W.range then
- local CastPosition, HitChance, Position = YP:GetPredictedPos(enemy, E.delay, E.speed, myHero, false)
- if CastPosition and CastPosition.z and HitChance >= 2 and GetDistance(enemy) <= W.range then
- local x, y, z = CastPosition.x, CastPosition.y, CastPosition.z
- CastSpellXYZ("W", x, y, z)
- break
- end
- end
- end
- end
- if UseE and ERDY then
- castE()
- end
- if UseQ and QRDY and Qtarget then
- local CastPosition, HitChance, Position = YP:GetLineCastPosition(Qtarget, Q.delay, Q.width, Q.range, Q.speed, myHero, false)
- if CastPosition and HitChance>=1 then
- Q.LastPos = CastPosition
- CastSpellXYZ("Q",CastPosition.x, CastPosition.y, CastPosition.z)
- end
- end
- end
- if UseR then
- HaveIgnite()
- if Qtarget or Etarget then
- if Qtarget and ((GetDistanceSqr(Qtarget, myHero) < R.rangeSqr and not getDmg("Q",Qtarget,myHero))) then
- UseAllItems(Qtarget)
- if haveIgnite and GetDistanceSqr(Qtarget, myHero) < 600 * 600 then
- CastSpellTarget(igniteKey, Qtarget)
- end
- local mainCastPosition = YP:GetCircularAOECastPosition(Qtarget, R.delay,R.width, R.range, R.speed, myHero,false)
- if mainCastPosition and mainCastPosition.z then
- CastSpellXYZ("R",mainCastPosition.x, mainCastPosition.y, mainCastPosition.z)
- end
- end
- end
- end
- function castE()
- for i = 1, objManager:GetMaxHeroes(), 1 do
- local enemy = objManager:GetHero(i)
- if (enemy ~= nil and enemy.team ~= myHero.team and enemy.visible == 1 and enemy.invulnerable == 0 and enemy.dead == 0) and GetDistance(enemy) < W.range then
- local CastPosition, HitChance, Position = YP:GetLineCastPosition(enemy, E.delay, E.width, E.range, E.speed, myHero, false)
- if CastPosition then
- local x, y, z = CastPosition.x, CastPosition.y, CastPosition.z
- CastSpellXYZ("E", x, y, z)
- end
- end
- end
- end
- function OnCreateObj(obj)
- if target~=nil then
- if obj~=nil and ZyraHotkeys.Combo or ZyraHotkeys.Harass then
- if string.find(obj.charName,"Zyra_E_sequence_impact") and GetDistance(myHero, target) < 1100 and Etimer+5<os.clock() then
- Etimer=os.clock()
- elseif string.find(obj.charName,"Zyra_E_sequence_impact") and GetDistance(myHero, target) < W.range and Etimer+5>os.clock() then
- CastSpellXYZ("W",target.x,0,target.z)
- end
- if string.find(obj.charName,"Zyra_W_cas_02") and GetDistance(myHero, target) < 800 then
- CastSpellXYZ("Q",obj.x,0,obj.z)
- end
- if string.find(obj.charName,"zyra_Q_cas") and GetDistance(myHero, target) < W.range then
- if CanUseSpell('W')==1 then
- CastSpellXYZ("W",obj.x,0,obj.z)
- end
- end
- if (string.find(obj.charName,"Zyra_ult_cas_target_center") or (string.find(obj.charName,"seed") and not ZyraCombo.UseR)) and GetDistance(myHero, target) < 800 then
- if GetMEC(550,800,target)~=nil and target.dead == 0 then
- CastSpellXYZ("Q",GetMEC(550,800,target).x,GetMEC(550,800,target).y,GetMEC(550,800,target).z)
- elseif not ERDY and not QRDY and ZyraCombo.UseR then
- CastSpellXYZ("R",target.x,target.y,target.z)
- end
- end
- end
- end
- end
- function HaveIgnite()
- if myHero.SummonerD == "SummonerDot" then
- if myHero.SpellTimeD > 1 then
- haveIgnite = true
- igniteKey = 'D'
- else
- haveIgnite = false
- igniteKey = 'D'
- end
- elseif myHero.SummonerF == "SummonerDot" then
- if myHero.SpellTimeF > 1 then
- haveIgnite = true
- igniteKey = 'F'
- else
- haveIgnite = false
- igniteKey = 'F'
- end
- else
- haveIgnite = false
- igniteKey = nil
- end
- return haveIgnite, igniteKey
- end
- function GetCD()
- if myHero.SpellTimeQ > 1 and GetSpellLevel('Q') > 0 then
- QRDY = true
- else QRDY = false
- end
- if myHero.SpellTimeW > 1 and GetSpellLevel('W') > 0 then
- WRDY = true
- else WRDY = false
- end
- if myHero.SpellTimeE > 1 and GetSpellLevel('E') > 0 then
- ERDY = true
- else ERDY = false
- end
- if myHero.SpellTimeR > 1 and GetSpellLevel('R') > 0 then
- RRDY = true
- else RRDY = false end
- end
- function checkspells()
- if myHero.SpellTimeW > 1 and GetSpellLevel('W') > 0 then
- WRDY2 = 1
- else WRDY2 = 0
- end
- if myHero.SpellTimeE > 1 and GetSpellLevel('E') > 0 then
- ERDY2 = 1
- else ERDY2 = 0
- end
- if myHero.SpellTimeR > 1 and GetSpellLevel('R') > 0 then
- RRDY2 = 1
- else RRDY2 = 0 end
- end
- SetTimerCallback("OnTick")
Advertisement
Add Comment
Please, Sign In to add comment