Thread: Stuf + Threat
View Single Post
06-10-11, 08:40 PM   #28
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Omoshiroi. In that case:

Code:
function(unit)
	local _, pToken = UnitPowerType(unit)
	local pCur, pMax = Power(unit), MaxPower(unit)
	if pMax > 0 then
		if pToken == "RAGE" or pToken == "RUNIC_POWER" then
			-- Warrior / Teddy Bear Druid / DK
			if pCur > 0 then 
				return "%d", pCur
			end
		elseif pToken == "ENERGY" then
			-- Rogue / Kitty Druid
			if pCur < pMax then
				return "%d", pCur
			end
		else
			-- Everything else
			local pPer = ceil(pCur / pMax)
			if pPer < 100 then
				return "%d", pPer
			end
		end
	end
end

Last edited by Nibelheim : 06-10-11 at 08:44 PM.
  Reply With Quote