I recently wrote this addon for TBC, which was fairly easy. To challenge myself, I tried to make it work for Vanilla as well.
Unfortunately it is not as smooth as the TBC version, as Vanilla's UNIT_AURA event does not work for anything but the player himself (it seems, at least) and the "combat log" does not get triggered when a spell is refreshed. If someone knows how to work around that, I'd very much welcome their input.
However, here is what it does: If you are using the default UnitFrames as shown in the screenshot, it will put timers over your enemy's debuffs and your friends buffs/debuffs, given you are in range when they are applied. You can target and de-target any enemy within range as often as you want and the timers will always be accurate. But please keep in mind, they are static values and not the ACTUAL timers pulled anywhere from the game. They will NOT always show the correct timer.
Download
Preview:
In combat
To edit spells into the code (current list is very small), open EnemyBuffFrames.lua with Notepad or an editor of your choice and find this list:
- Code: Select all
["Ice Block"] = 10,
["Blessing of Freedom"] = 14,
["Power Word: Shield"] = 30,
["Divine Shield"] = 12,
It should be self explanatory that you can add the name of another spell. Keep in mind, the names are case-sensitive, you need to write them EXACTLY like they are spellt in the client.
The addon supplies its OWN timers now.
You can change it to work with other UnitFrames by changing these two lines
- Code: Select all
local region=getglobal(firstToUpper(unitID).."FrameBuff"..i)
local region=getglobal(firstToUpper(unitID).."FrameDebuff"..i)
To whatever your frames buffs and debuffs are called. For example for Discord UnitFrames:
- Code: Select all
local region = getglobal("DUF_TargetFrame_Buffs_"..i)
local region = getglobal("DUF_TargetFrame_Debuffs_"..i)