Here's a simple example of what I've come up with. It'll pop up with big text in the center of your screen whenever your healer's mana goes below 25%.
Copy/Paste this into
addon.bool.no and it'll make it into an addon for you.
Lua Code:
local WarningText=UIParent:CreateFontString(nil,"OVERLAY","BossEmoteNormalHuge");
WarningText:SetPoint("CENTER",0,128);
WarningText:SetTextColor(ColorMixin.GetRGB(PowerBarColor.MANA));
local EventFrame=CreateFrame("Frame");
EventFrame:RegisterEvent("UNIT_POWER_UPDATE");
EventFrame:RegisterEvent("UNIT_POWER_FREQUENT");
local Enum_PowerType_Mana=Enum.PowerType.Mana;
EventFrame:SetScript("OnEvent",function(self,event,unit,powertype)
if powertype=="MANA" and UnitInParty(unit) and UnitGroupRolesAssigned(unit)=="HEALER" then
local percent=UnitPower(unit,Enum_PowerType_Mana)*100/UnitPowerMax(unit,Enum_PowerType_Mana);
if percent<=25 then
WarningText:SetFormattedText("%s %s %.0f%%",UnitName(unit),MANA,percent);
else WarningText:SetText(nil); end
end
end);