Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function()
- local health = UnitHealth("target")
- local time = GetTime()
- local oldhealth
- local helavah
- if oldhealth ~= health then
- oldhealth = health
- if health == UnitHealthMax("target") then
- health0, time0, mhealth, mtime = nil
- return
- end
- if not health0 then
- health0, time0 = health, time
- mhealth, mtime = health, time
- health0 = health0
- return
- end
- mhealth = (mhealth + health) * .5
- mtime = (mtime + time) * .5
- helavah = UnitHealthMax("target") * .35
- if mhealth >= health0 then
- health0, time0, mhealth, mtime =nil
- else
- time = (health-helavah) * (time0 - mtime) / (mhealth - health0)
- -- print(time)
- if(time<1) then
- REDS_WA_SOULREAP = false
- REDS_WA_SRTIME = math.floor(time + 0.5)
- elseif (time <= 6) then
- REDS_WA_SOULREAP = true
- REDS_WA_SRTIME = math.floor(time + 0.5)
- end
- return
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement