Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. function()
  2. local health = UnitHealth("target")
  3. local time = GetTime()
  4. local oldhealth
  5. local helavah
  6.  
  7. if oldhealth ~= health then
  8. oldhealth = health
  9. if health == UnitHealthMax("target") then
  10. health0, time0, mhealth, mtime = nil
  11. return
  12. end
  13.  
  14. if not health0 then
  15. health0, time0 = health, time
  16. mhealth, mtime = health, time
  17. health0 = health0
  18. return
  19. end
  20.  
  21. mhealth = (mhealth + health) * .5
  22. mtime = (mtime + time) * .5
  23. helavah = UnitHealthMax("target") * .35
  24.  
  25. if mhealth >= health0 then
  26. health0, time0, mhealth, mtime =nil
  27. else
  28. time = (health-helavah) * (time0 - mtime) / (mhealth - health0)
  29. -- print(time)
  30. if(time<1) then
  31. REDS_WA_SOULREAP = false
  32. REDS_WA_SRTIME = math.floor(time + 0.5)
  33. elseif (time <= 6) then
  34. REDS_WA_SOULREAP = true
  35. REDS_WA_SRTIME = math.floor(time + 0.5)
  36. end
  37. return
  38. end
  39. end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement