Looking for someone who can build an addon for me.
I was thinking an addon that would change colors as your HP% went down
Ive made a working test using DIYCE and NTbuff but the check times are based on my movement. as a tank you want to keep the boss still so movement is bad
The HP% check could function like the threat check in VC threat Meter and could switch from CoolSuit
1 - When your not attacking < Your standard Agg
6 80% or higher (Green) < color set by user with wardrobe
7 60% or higher (Yellow)
8 30% or higher (Orange)
9 15% or higher (Red)
10 14% or Lower (purple)
Let me know if you are interested, otherwise Ill keep trying to make it.
Yohon
Since you already have working code for the color changes, all you really need is something to monitor your health. A frame's OnUpdate callback should do the trick. I can't guarantee that this will work however since some functions are blocked from use inside an OnUpdate callback so you'll just have to try it out.
The relevant code to create the frame and monitor your health would be something like this:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
local HPMonitor = CreateUIComponent("Frame", "HPMonitorFrame", "UIParent")
_G['HPMonitorFrame'] = nil -- remove extraneous global created by above call
HPMonitor.Frequency = 0.5 -- Time, in seconds, between health checks
HPMonitor.CurTime = 0
HPMonitor.PrevPctHP = 100
HPMonitor:SetScripts("OnUpdate", [=[ HPMonitor.UpdateHandler(elapsedTime) ]=])
function HPMonitor.UpdateHandler(elapsed)
local PctHP = UnitHealth("player")/UnitMaxHealth("player")
HPMonitor.CurTime = HPMonitor.CurTime + elapsed
if HPMonitor.CurTime >= HPMonitor.Frequency then
HPMonitor.CurTime = 0
if PctHP ~= HPMonitor.PrevPctHP then
DoColorChange(PctHP) -- This calls a function to do your changes, modify as needed
HPMonitor.PrevPctHP = PctHP
end
end
end
|
The above creates a frame that monitors your percentage of health and if it changes, calls a function called
DoColorChange with the current health percentage. You can then add that function to do the CoolSuit stuff you already have.
To turn the whole thing into a stand-alone add-on, see the
Creating Custom Functions guide.