samipote

Mundo Test

Jun 5th, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. require 'Utils'
  2. require 'winapi'
  3. require 'vals_lib'
  4. local Q,W,E,R = 'Q','W','E','R'
  5. local startVector = Vector(myHero.x,myHero.y,myHero.z)
  6. local endVector = Vector(GetLastOrder())
  7. local directionVector = (endVector-startVector):normalized()
  8. local radius = 1
  9. local theta=0
  10. local tooLow = 15
  11. local Counter = {}
  12. local count = 10
  13. function main()
  14. GetCD()
  15. local percent = ((myHero.health / myHero.maxHealth)*100)   
  16. target = GetWeakEnemy('MAGIC',990)
  17. if target ~= nil then  
  18. if percent >= tooLow then
  19. castQ(target)
  20. end
  21. end
  22. end
  23. function castQ(target)
  24. if target ~= nil then
  25. local FX,FY,FZ = GetFireahead(target,2,0)
  26. Qdelay = 2
  27. Qspeed = 0
  28. radius = 50
  29. startVector = Vector(myHero.x,myHero.y,myHero.z)
  30. endVector = Vector(FX,FY,FZ)
  31. directionVector = (endVector-startVector):normalized()
  32. local theta = math.deg(math.atan(directionVector.z / directionVector.x))
  33. if distXYZ(target.x,target.z,FX,FZ)<((target.movespeed/1000)*(((Qdelay*100)+100)+(Qspeed*10)))/0.20 and directionVector.x < radius and directionVector.z <radius then
  34. table.insert(Counter, target)
  35. end
  36. if target==nil then
  37. for i,v in pairs(Counter) do Counter[i] = nil end
  38. end
  39. if #Counter~=0 and #Counter>count then SpellPred(Q,QRDY,myHero,target,1000,2,0,1,100)
  40. end
  41. end
  42. end
  43. SetTimerCallback('main')
Advertisement
Add Comment
Please, Sign In to add comment