Thread: Stuf + Threat
View Single Post
Unread 06-10-11, 09:01 PM   #31
Nibelheim
local roygbi-
 
Nibelheim's Avatar
Featured
Join Date: Jan 2010
Posts: 1,592
Woops, my bad, I left some Pitbull code in my examples

Code:
function(unit)
	local pCur, pMax = UnitPower(unit), UnitPowerMax(unit)
	if pMax > 0 then
		local _, pToken = UnitPowerType(unit)
		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
Nibelheim is offline   Reply With Quote