Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tags.Events['Terenna:healthtext'] = 'UNIT_HEALTH_FREQUENT'
- tags.Methods['Terenna:healthtext'] = function(u)
- if UnitIsGhost('player') then
- return '|cffb40000Ghost'
- elseif UnitIsDead('player') then
- return '|cffb40000Dead'
- end
- local healthcurrent, healthmax = UnitHealth(u), UnitHealthMax(u)
- local r, g
- if healthcurrent < healthmax then
- r, g = 180, 0
- else
- r, g = 0, 180
- end
- if healthcurrent >= 1000000 then
- healthcurrent = format('%.1fm', healthcurrent/1000000)
- elseif healthcurrent >= 1000 then
- healthcurrent = format('%.0fk', healthcurrent/1000)
- end
- return format('|cff%02x%02x%02x%s', r, g, 0, healthcurrent)
- end
- tags.Events['Terenna:healthpercenttext'] = 'UNIT_HEALTH_FREQUENT'
- tags.Methods['Terenna:healthpercenttext'] = function(u)
- if UnitIsDead(u) or UnitIsGhost(u) then
- return
- end
- local r, g = 0, 180
- local healthcurrent, healthmax = UnitHealth(u), UnitHealthMax(u)
- if healthcurrent < healthmax then
- r, g = g, r
- end
- return format('|cff%02x%02x00%.0f%%', r, g, 100 * (healthcurrent / healthmax))
- end
- tags.Events['Terenna:powertext'] = 'UNIT_POWER_FREQUENT UNIT_DISPLAYPOWER'
- tags.Methods['Terenna:powertext'] = function(u)
- local powercurrent, powertype, pr, pg, pb
- powertype = select(2,UnitPowerType(u))
- powercurrent = UnitPower(u)
- if powertype and powercurrent > 0 then
- if powertype == 'MANA' then
- pr, pg, pb = 0, 100, 255
- if powercurrent >= 1000000 then
- powercurrent = format('%.1fm', powercurrent / 1000000)
- elseif powercurrent >= 1000 then
- powercurrent = format('%.0fk', powercurrent / 1000)
- end
- elseif powertype == 'FOCUS' then
- pr, pg, pb = 255, 128, 65
- elseif powertype == 'ENERGY' then
- pr, pg, pb = 255, 255, 0
- elseif powertype == 'RUNIC_POWER' then
- pr, pg, pb = 0, 209, 255
- else
- pr, pg, pb = 255, 0, 0
- end
- return format('|cff%02x%02x%02x%s', pr, pg, pb, powercurrent)
- else
- return
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement