Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function()
- if WeakAuras.IsOptionsOpen() then
- return "\n"..aura_env.icons[1].." "..UnitName("player").." - ".."100%".."\n"..aura_env.icons[2].." "..UnitName("player").." - ".."100%".."\n"..aura_env.icons[3].." "..UnitName("player").." - ".."100%".."\n"..aura_env.icons[4].." "..UnitName("player").." - ".."100%"
- else
- aura_env.time = aura_env.time or 0
- aura_env.result = aura_env.result or ""
- if GetTime() >= aura_env.time+0.1 then
- aura_env.GUID = {}
- aura_env.time = GetTime()
- aura_env.result = ""
- for i=1, 40 do
- if UnitExists("nameplate"..i) then
- local healthmax = UnitHealthMax("nameplate"..i)
- local health = UnitHealth("nameplate"..i)
- local name = UnitName("nameplate"..i)
- local icon = GetRaidTargetIndex("nameplate"..i)
- local percent = Round((health/healthmax)*100)
- local GUID = UnitGUID("nameplate"..i)
- aura_env.GUID[GUID] = true
- if not UnitIsUnit("boss1", "nameplate"..i) and UnitIsEnemy("player", "nameplate"..i) and healthmax >= 500000 then
- local color = "|cFFFFFFFF"
- local white = "|cFFFFFFFF"
- if percent >= 50 then
- color = "|cFFFF0000"
- elseif percent >= 25 then
- color = "|cFFFFA500"
- else
- color = "|cFF00FF00"
- end
- if icon then
- aura_env.result = aura_env.result..white.."\n"..aura_env.icons[icon]
- aura_env.result = aura_env.result..white.." "..name.." - "..color..percent.."%"
- else
- aura_env.result = aura_env.result..white.."\n "..name.." - "..color..percent.."%"
- end
- end
- end
- end
- for i=1, 20 do
- if UnitExists("raid"..i.."target") then
- local GUID = UnitGUID("raid"..i.."target")
- if not aura_env.GUID[GUID] then
- local healthmax = UnitHealthMax("raid"..i.."target")
- local health = UnitHealth("raid"..i.."target")
- local name = UnitName("raid"..i.."target")
- local icon = GetRaidTargetIndex("raid"..i.."target")
- local percent = Round((health/healthmax)*100)
- aura_env.GUID[GUID] = true
- if not UnitIsUnit("boss1", "raid"..i.."target") and UnitIsEnemy("player", "raid"..i.."target") and healthmax >= 500000 then
- local color = "|cFFFFFFFF"
- local white = "|cFFFFFFFF"
- if percent >= 50 then
- color = "|cFFFF0000"
- elseif percent >= 25 then
- color = "|cFFFFA500"
- else
- color = "|cFF00FF00"
- end
- if icon then
- aura_env.result = aura_env.result..white.."\n"..aura_env.icons[icon]
- aura_env.result = aura_env.result..white.." "..name.." - "..color..percent.."%"
- else
- aura_env.result = aura_env.result..white.."\n "..name.." - "..color..percent.."%"
- end
- end
- end
- end
- end
- end
- return aura_env.result
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement