Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "Utils"
- require 'vals_lib'
- require 'spell_damage'
- print=printtext
- printtext("\nZyra\n")
- printtext("\nBy Malbert\n")
- printtext("\nVersion 2.3\n")
- local target
- local target600
- local targetignite
- local Etimer=0
- local modcounter=0
- local Qdmg = 0
- local QTdmg = 0
- local Edmg = 0
- local ETdmg = 0
- local Rdmg = 0
- local RTdmg = 0
- local Wdmg = 0
- local WTdmg = 0
- local planting = false
- local timer0 = 0
- local timer1 = 0
- local Q,W,E,R = 'Q','W','E','R'
- KazyZyra = scriptConfig('Zyra Config', 'Zyraconfig')
- KazyZyra:addParam('combo', 'Burst Combo', SCRIPT_PARAM_ONKEYDOWN, false, 84)
- KazyZyra:addParam('ult', 'Ult in Combo', SCRIPT_PARAM_ONKEYTOGGLE, true, 55)
- KazyZyra:addParam('Killsteal', 'Killsteal', SCRIPT_PARAM_ONKEYTOGGLE, true, 55)
- KazyZyra:addParam("igniteks", "Ignite KillSteal", SCRIPT_PARAM_ONKEYTOGGLE, true, 119)
- function Run()
- target = GetWeakEnemy('MAGIC',1100)
- targetignite = GetWeakEnemy('TRUE',600)
- if KazyZyra.combo then Combo() end
- if KazyZyra.Killsteal then Killsteal() end
- if KazyZyra.igniteks then ignite() end
- GetCD()
- end
- function Combo()
- if target~=nil and QRDY == 1 and ERDY == 0 and GetD2(target)<800 then
- CastSpellXYZ("Q",target.x,target.y,target.z)
- end
- if GetMEC(1100, 700, target)~=nil and RRDY == 1 and KazyZyra.ult then
- CastSpellXYZ("R",target.x,0,target.z)
- end
- if target~=nil and ERDY == 1 and GetD2(target)<1100 then
- Sprediction(E,target,2,1100,22,myHero,0)
- end
- if target~=nil and WRDY == 1 and GetD2(target)<825 then
- CastSpellXYZ("W",target.x,target.y,target.z)
- end
- if target~=nil and QRDY == 1 and GetD2(target)<800 then
- CastSpellXYZ("Q",target.x,target.y,target.z)
- end
- end
- function OnCreateObj(obj)
- if target~=nil then
- if obj~=nil and ZyraConfig.combo then
- --printtext("\n1 " .. obj.charName .. "")
- 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) < 825 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",target.x,0,target.z)
- end
- if string.find(obj.charName,"zyra_Q_cas") and GetDistance(myHero, target) < 825 then
- if CanUseSpell('W')==1 then
- CastSpellXYZ("W",target.x,0,target.z)
- end
- end
- if string.find(obj.charName,"zyra_emote_death_sound") then
- planting = true
- timer1 = GetTickCount()
- end
- if (string.find(obj.charName,"Zyra_ult_cas_target_center") or (string.find(obj.charName,"seed") and not ZyraConfig.ult)) and GetDistance(myHero, target) < 800 then
- if GetMEC(550,800,target)~=nil then
- CastSpellXYZ("Q",GetMEC(550,800,target).x,GetMEC(550,800,target).y,GetMEC(550,800,target).z)
- else
- CastSpellXYZ("Q",target.x,target.y,target.z)
- end
- end
- end
- end
- end
- function Killsteal()
- if target~=nil then
- Qdmg = ((35+35*GetSpellLevel('Q')+myHero.ap*65/100)*QRDY)
- QTdmg = CalcMagicDamage(target,Qdmg)
- Edmg = ((25+35*GetSpellLevel('E')+myHero.ap*50/100)*ERDY)
- ETdmg = CalcMagicDamage(target,Edmg)
- Rdmg = ((95+85*GetSpellLevel('R')+myHero.ap*70/100)*RRDY)
- RTdmg = CalcMagicDamage(target,Rdmg)
- Wdmg = ((16.5+6.5*myHero.selflevel+myHero.ap*20/100)*WRDY)*4
- WTdmg = CalcMagicDamage(target,Wdmg)
- if target.health<QTdmg and GetD2(target)<800 then
- CastSpellXYZ("Q",target.x,target.y,target.z)
- end
- if target.health<ETdmg and GetD2(target)<1100 then
- Sprediction(E,target,2,1100,22,myHero,0)
- end
- if target.health<ETdmg+QTdmg and GetD2(target)<1100 and QRDY == 1 then
- Sprediction(E,target,2,1100,22,myHero,0)
- if GetD2(target)<800 then
- CastSpellXYZ("Q",target.x,target.y,target.z)
- end
- end
- if target.health<RTdmg+200 and GetMEC(1100, 700, target)~=nil then
- CastSpellXYZ("R",target.x,0,target.z)
- end
- if target.health<ETdmg+QTdmg+RTdmg and GetMEC(1100, 700, target)~=nil and QRDY == 1 and ERDY == 1 and RRDY == 1 then
- CastSpellXYZ("R",target.x,0,target.z)
- CastSpellXYZ(W,target.x,target.y,target.z)
- Sprediction(E,target,2,1100,22,myHero,0)
- CastSpellXYZ("Q",target.x,target.y,target.z)
- end
- end
- end
- function ignite()
- local damage = (myHero.selflevel*20)+50
- if targetignite ~= nil then
- if myHero.SummonerD == 'SummonerDot' then
- if targetignite.health < damage then
- CastSpellTarget('D',targetignite)
- end
- end
- if myHero.SummonerF == 'SummonerDot' then
- if targetignite.health < damage then
- CastSpellTarget('F',targetignite)
- end
- end
- end
- end
- function Sprediction(spell,unit,delay,range,speed,from,block,radius)
- local d1 = GetD2(unit)
- local x, y, z = GetFireahead(unit,5,0)
- local d2 = GetD2({x=x, y=y, z=z})
- local d3 = GetD2({x=x, y=y, z=z},unit)
- local angle = math.acos((d2*d2-d3*d3-d1*d1)/(-2*d3*d1)*2)
- local ms = unit.movespeed
- local speed=speed
- local from = from or Vector(myHero)
- local CastPosition = unit.x, unit.y, unit.z
- local Position = myHero.x,myHero.y,myHero.z
- local delay = delay or (GetDistance(from, unit) / speed)
- local velocity = (Position + (((speed * speed + speed) * ms) / 2) - CastPosition) * -1 / ms
- local targetposition = Position + (ms * velocity) + ((( ms * ms + ms) * delay/2) / 2)
- local FX,FY,FZ = unit.x, unit.y, unit.z
- if unit~= nil and targetposition<range and block == 0 then
- CastSpellXYZ(spell,FX,FY,FZ)
- elseif unit~= nil and targetposition<range and block == 1 and CreepBlock(GetFireahead(unit,delay,speed)) == 0 then
- CastSpellXYZ(spell,FX,FY,FZ)
- end
- end
- function GetD2(p1, p2)
- if p2 == nil then p2 = myHero end
- if (p1.z == nil or p2.z == nil) and p1.x~=nil and p1.y ~=nil and p2.x~=nil and p2.y~=nil then
- px=p1.x-p2.x
- py=p1.y-p2.y
- if px~=nil and py~=nil then
- px2=px*px
- py2=py*py
- if px2~=nil and py2~=nil then
- return math.sqrt(px2+py2)
- else
- return 99999
- end
- else
- return 99999
- end
- elseif p1.x~=nil and p1.z ~=nil and p2.x~=nil and p2.z~=nil then
- px=p1.x-p2.x
- pz=p1.z-p2.z
- if px~=nil and pz~=nil then
- px2=px*px
- pz2=pz*pz
- if px2~=nil and pz2~=nil then
- return math.sqrt(px2+pz2)
- else
- return 99999
- end
- else
- return 99999
- end
- else
- return 99999
- end
- end
- SetTimerCallback("Run")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement