samipote

OlafGrimor By Samipote

Apr 12th, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.00 KB | None | 0 0
  1. require "Utils"
  2. local target
  3. local targetE
  4. local targetIgnite
  5. local Q,W,E,R = 'Q','W','E','R'
  6. Olaf= scriptConfig('Olaf Grimor', 'Olafconfig')
  7. Olaf:addParam('Combo', 'Combo', SCRIPT_PARAM_ONKEYDOWN, false, 88)
  8. Olaf:addParam('ult', 'ult in combo', SCRIPT_PARAM_ONKEYTOGGLE, true, 90)
  9. Olaf:addParam('autoE', 'autoEHarrass', SCRIPT_PARAM_ONOFF, true)
  10. Olaf:addParam('autoQ', 'autoQHarrass', SCRIPT_PARAM_ONOFF, true)
  11. Olaf:addParam("Killsteal", "KillSteal", SCRIPT_PARAM_ONOFF, true)
  12.  
  13. function Main()
  14. GetCD()
  15. target = GetWeakEnemy('PHYS',1000)
  16. targetE = GetWeakEnemy('TRUE',325)
  17. if Olaf.autoQ then Qspell() end
  18. if Olaf.autoE then Espell() end
  19. if Olaf.Combo then Combo() end
  20. if Olaf.Killsteal then Killsteal() end
  21. end
  22. function Combo()
  23. if target~=nil then
  24. UseAllItems(target)
  25. if CanUseSpell("Q") then
  26. Qspell()
  27. end
  28. if GetDistance(myHero,target) < 600 then
  29. AttackTarget(target)
  30. end
  31. Espell()
  32. end
  33. end
  34. --Val make my day with that----
  35. function Qspell()
  36.         if target~=nil then
  37.                 XX,YY,ZZ = GetFireahead(target, 1.6, 16) -- predicted xyz-coordinates
  38.                 if GetDistance(target)<1000 then -- minimum distance
  39.                         EnemyPos = Vector(XX,YY,ZZ)
  40.                         HeroPos = Vector(myHero.x, myHero.y, myHero.z)
  41.                         QPos = HeroPos+(HeroPos-EnemyPos)*(-(GetDistance(target)+150)/GetDistance(HeroPos, EnemyPos)) -- obershoot by 150 units
  42.                         SpellXYZ(Q,QRDY,myHero,target,1000,QPos.x,QPos.z) --- if distance hero-enemy > 775 then just cast without overshoot
  43.                 end
  44.         end
  45. end
  46. function Espell()
  47. if targetE~=nil then
  48. CastSpellTarget("E",targetE)
  49. if Olaf.Combo and Olaf.ult then
  50. CastSpellTarget("R",myHero)
  51. end
  52. if Olaf.Combo then
  53. CastSpellTarget("W",myHero)
  54. end
  55. end
  56. end
  57. function Killsteal()
  58. if target~=nil then
  59. Qdmg = ((25+45*GetSpellLevel('Q')+myHero.addDamage)*CanUseSpell("Q"))
  60. Edmg = ((25+45*GetSpellLevel('E')+myHero.addDamage*40/100)*CanUseSpell("E"))
  61. local ignitedmg = (myHero.selflevel*20)+50
  62. Pourcentage = target.armor*myHero.armorPenPercent
  63. TrueMG = (target.armor-Pourcentage)-(myHero.armorPen)
  64. TrueHealth = target.health + TrueMG
  65. if TrueHealth<Qdmg and GetDistance(myHero,target)<1000 then
  66. Qspell()
  67. end
  68. if targetE~=nil and targetE.health<Edmg and GetDistance(myHero,targetE)<=325 then
  69. CastSpellTarget("E",targetE)
  70. end
  71. if ignitedmg > target.health and GetDistance(myHero,enemy) <= 600 then
  72. SummonerIgnite(target)
  73. end
  74. if TrueHealth<Qdmg+ignitedmg and GetDistance(myHero,target)<=600 then
  75. SummonerIgnite(target)
  76. Qspell()
  77. end
  78. if targetE~=nil and targetE.health<Edmg+ignitedmg and GetDistance(myHero,targetE)<=325 then
  79. SummonerIgnite(targetE)
  80. CastSpellTarget("E",targetE)
  81. end
  82. end
  83. end
  84. function SummonerIgnite(TargetIgnite)
  85.     local damage = (myHero.selflevel*20)+50
  86.     if TargetIgnite ~= nil then
  87.         if myHero.SummonerD == 'SummonerDot' then
  88.             CastSpellTarget('D',TargetIgnite)
  89.         end
  90.         if myHero.SummonerF == 'SummonerDot' then
  91.             CastSpellTarget('F',TargetIgnite)
  92.         end
  93.     end
  94. end
  95.  
  96. function SpellXYZ(spell,cd,a,b,range,x,z)
  97.     if a ~= nil and b ~= nil then
  98.         local y = 0
  99.         if (cd == 1 or cd) and x ~= nil and z ~= nil and GetDistance(a,b) < range then
  100.             CastSpellXYZ(spell,x,y,z)
  101.         end
  102.     end
  103. end
  104. function distXYZ(a1,a2,b1,b2)
  105.     if b1 == nil or b2 == nil then
  106.         b1 = myHero.x
  107.         b2 = myHero.z
  108.     end
  109.     if a2 ~= nil and b2 ~= nil and a1~=nil and b1~=nil then
  110.         a = (b1-a1)
  111.         b = (b2-a2)
  112.         if a~=nil and b~=nil then
  113.             a2=a*a
  114.             b2=b*b
  115.             if a2~=nil and b2~=nil then
  116.                 return math.sqrt(a2+b2)
  117.             else
  118.                 return 99999
  119.             end
  120.         else
  121.             return 99999
  122.         end
  123.     end
  124. end
  125. function GetCD()
  126.     if myHero.SpellTimeQ > 1 and GetSpellLevel('Q') > 0 then
  127.         QRDY = 1
  128.         else QRDY = 0
  129.     end
  130.     if myHero.SpellTimeW > 1 and GetSpellLevel('W') > 0 then
  131.         WRDY = 1
  132.         else WRDY = 0
  133.     end
  134.     if myHero.SpellTimeE > 1 and GetSpellLevel('E') > 0 then
  135.         ERDY = 1
  136.         else ERDY = 0
  137.     end
  138.     if myHero.SpellTimeR > 1 and GetSpellLevel('R') > 0 then
  139.         RRDY = 1
  140.     else RRDY = 0 end
  141. end
  142. SetTimerCallback('Main')
Advertisement
Add Comment
Please, Sign In to add comment