Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "Utils"
- local target
- local targetE
- local targetIgnite
- local Q,W,E,R = 'Q','W','E','R'
- Olaf= scriptConfig('Olaf Grimor', 'Olafconfig')
- Olaf:addParam('Combo', 'Combo', SCRIPT_PARAM_ONKEYDOWN, false, 88)
- Olaf:addParam('ult', 'ult in combo', SCRIPT_PARAM_ONKEYTOGGLE, true, 90)
- Olaf:addParam('autoE', 'autoEHarrass', SCRIPT_PARAM_ONOFF, true)
- Olaf:addParam('autoQ', 'autoQHarrass', SCRIPT_PARAM_ONOFF, true)
- Olaf:addParam("Killsteal", "KillSteal", SCRIPT_PARAM_ONOFF, true)
- function Main()
- GetCD()
- target = GetWeakEnemy('PHYS',1000)
- targetE = GetWeakEnemy('TRUE',325)
- if Olaf.autoQ then Qspell() end
- if Olaf.autoE then Espell() end
- if Olaf.Combo then Combo() end
- if Olaf.Killsteal then Killsteal() end
- end
- function Combo()
- if target~=nil then
- UseAllItems(target)
- if CanUseSpell("Q") then
- Qspell()
- end
- if GetDistance(myHero,target) < 600 then
- AttackTarget(target)
- end
- Espell()
- end
- end
- --Val make my day with that----
- function Qspell()
- if target~=nil then
- XX,YY,ZZ = GetFireahead(target, 1.6, 16) -- predicted xyz-coordinates
- if GetDistance(target)<1000 then -- minimum distance
- EnemyPos = Vector(XX,YY,ZZ)
- HeroPos = Vector(myHero.x, myHero.y, myHero.z)
- QPos = HeroPos+(HeroPos-EnemyPos)*(-(GetDistance(target)+150)/GetDistance(HeroPos, EnemyPos)) -- obershoot by 150 units
- SpellXYZ(Q,QRDY,myHero,target,1000,QPos.x,QPos.z) --- if distance hero-enemy > 775 then just cast without overshoot
- end
- end
- end
- function Espell()
- if targetE~=nil then
- CastSpellTarget("E",targetE)
- if Olaf.Combo and Olaf.ult then
- CastSpellTarget("R",myHero)
- end
- if Olaf.Combo then
- CastSpellTarget("W",myHero)
- end
- end
- end
- function Killsteal()
- if target~=nil then
- Qdmg = ((25+45*GetSpellLevel('Q')+myHero.addDamage)*CanUseSpell("Q"))
- Edmg = ((25+45*GetSpellLevel('E')+myHero.addDamage*40/100)*CanUseSpell("E"))
- local ignitedmg = (myHero.selflevel*20)+50
- Pourcentage = target.armor*myHero.armorPenPercent
- TrueMG = (target.armor-Pourcentage)-(myHero.armorPen)
- TrueHealth = target.health + TrueMG
- if TrueHealth<Qdmg and GetDistance(myHero,target)<1000 then
- Qspell()
- end
- if targetE~=nil and targetE.health<Edmg and GetDistance(myHero,targetE)<=325 then
- CastSpellTarget("E",targetE)
- end
- if ignitedmg > target.health and GetDistance(myHero,enemy) <= 600 then
- SummonerIgnite(target)
- end
- if TrueHealth<Qdmg+ignitedmg and GetDistance(myHero,target)<=600 then
- SummonerIgnite(target)
- Qspell()
- end
- if targetE~=nil and targetE.health<Edmg+ignitedmg and GetDistance(myHero,targetE)<=325 then
- SummonerIgnite(targetE)
- CastSpellTarget("E",targetE)
- end
- end
- end
- function SummonerIgnite(TargetIgnite)
- local damage = (myHero.selflevel*20)+50
- if TargetIgnite ~= nil then
- if myHero.SummonerD == 'SummonerDot' then
- CastSpellTarget('D',TargetIgnite)
- end
- if myHero.SummonerF == 'SummonerDot' then
- CastSpellTarget('F',TargetIgnite)
- end
- end
- end
- function SpellXYZ(spell,cd,a,b,range,x,z)
- if a ~= nil and b ~= nil then
- local y = 0
- if (cd == 1 or cd) and x ~= nil and z ~= nil and GetDistance(a,b) < range then
- CastSpellXYZ(spell,x,y,z)
- end
- end
- end
- function distXYZ(a1,a2,b1,b2)
- if b1 == nil or b2 == nil then
- b1 = myHero.x
- b2 = myHero.z
- end
- if a2 ~= nil and b2 ~= nil and a1~=nil and b1~=nil then
- a = (b1-a1)
- b = (b2-a2)
- if a~=nil and b~=nil then
- a2=a*a
- b2=b*b
- if a2~=nil and b2~=nil then
- return math.sqrt(a2+b2)
- else
- return 99999
- end
- else
- return 99999
- end
- end
- end
- function GetCD()
- if myHero.SpellTimeQ > 1 and GetSpellLevel('Q') > 0 then
- QRDY = 1
- else QRDY = 0
- end
- if myHero.SpellTimeW > 1 and GetSpellLevel('W') > 0 then
- WRDY = 1
- else WRDY = 0
- end
- if myHero.SpellTimeE > 1 and GetSpellLevel('E') > 0 then
- ERDY = 1
- else ERDY = 0
- end
- if myHero.SpellTimeR > 1 and GetSpellLevel('R') > 0 then
- RRDY = 1
- else RRDY = 0 end
- end
- SetTimerCallback('Main')
Advertisement
Add Comment
Please, Sign In to add comment