Code:
local announceParty=true
local cooldownNames = {
-- add cooldowns here, format is ["name"] = {r=r, g=g, b=b},
-- Priest
["Pain Suppression"] = {r=1,g=0.2,b=0.2,8}, -- this would be red, for example
["Power Word: Barrier"] = {r=1,g=0.2,b=0.2,10},
["Power Infusion"] = {r=0.2,g=1,b=0.2,15},
["Guardian Spirit"] = {r=1,g=0.2,b=0.2,10},
["Divine Hymn"] = {r=0.2,g=1,b=0.2,9},
["Hymn of Hope"] = {r=0.2,g=1,b=0.2,9},
["Dispersion"] = {r=1,g=0.2,b=0.2,6},
-- Paladin
["Hand of Sacrifice"] = {r=1,g=0.2,b=0.2,12},
["Divine Guardian"] = {r=1,g=0.2,b=0.2,6},
["Aura Mastery"] = {r=1,g=0.2,b=0.2,6},
["Guardian of Ancient Kings"] = {r=1,g=0.2,b=0.2,12},
["Divine Protection"] = {r=1,g=0.2,b=0.2,10},
["Ardent Defender"] = {r=1,g=0.2,b=0.2,10},
["Hand of Protection"] = {r=1,g=0.2,b=0.2,10},
["Lay on Hands"] = {r=0.2,g=1,b=0.2,0},
-- Druid
["Tree of Life"] = {r=0.2,g=1,b=0.2,25},
["Barkskin"] = {r=1,g=0.2,b=0.2,12},
["Survival Instincts"] = {r=1,g=0.2,b=0.2,12},
["Innervate"] = {r=0.2,g=1,b=0.2,10},
["Tranquility"] = {r=0.2,g=1,b=0.2,10},
["Frenzied Regeneration"] = {r=0.2,g=1,b=0.2,20},
-- Shaman
["Bloodlust"] = {r=0.2,g=0.2,b=1,40}, -- this would be blue
["Mana Tide Totem"] = {r=0.2,g=0.2,b=1,12},
["Tremor Totem"] = {r=0.2,g=0.2,b=1,6},
-- Warrior
["Shield Wall"] = {r=1,g=0.2,b=0.2,12},
["Shield Block"] = {r=1,g=0.2,b=0.2,10},
["Last Stand"] = {r=1,g=0.2,b=0.2,20},
["Rallying Cry"] = {r=0.2,g=0.2,b=1,10},
-- Mage
["Time Warp"] = {r=0.2,g=0.2,b=1,40},
["Ice Block"] = {r=1,g=0.2,b=0.2,10},
-- DK
["Anti-Magic Shell"] = {r=1,g=0.2,b=0.2,5},
["Bone Shield"] = {r=1,g=0.2,b=0.2,0},
["Icebound Fortitude"] = {r=1,g=0.2,b=0.2,12},
["Vampiric Blood"] = {r=1,g=0.2,b=0.2,10},
-- Rogue
["Evasion"] = {r=1,g=0.2,b=0.2,6},
["Cloak of Shadows"] = {r=1,g=0.2,b=0.2,5},
}
local a = CreateFrame("Frame")
a.scheduled = {}
local function Add(spellID, player, target, colTab, isFade)
local name, _, icon = GetSpellInfo(spellID)
RaidNotice_AddMessage(RaidWarningFrame, (isFade and "---" or "+++").." |T"..icon..":20|t "..player..": "..name..(target and (" -> "..target) or "")..(isFade and " ---" or " +++"), colTab)
if announceParty then
SendChatMessage((isFade and "---" or "+++").." "..player..": "..name..(target and (" -> "..target) or "")..(isFade and " ---" or " +++"), "PARTY")
end
if (not isFade) and (colTab[1] > 0) then
tinsert(a.scheduled,{timer=colTab[1],player=player,target=target,id=spellID,color=colTab})
a:Show()
end
end
a:Hide()
a:SetScript("OnUpdate",function(s,e)
local i=1
local d=s.scheduled[i]
while d do
d.timer = d.timer-e
if d.timer <= 0 then
Add(d.id, d.player, d.target, d.color, true)
tremove(s.scheduled,i)
else
i=i+1
end
d = s.scheduled[i]
end
if i == 1 then
s:Hide()
end
end)
a:SetScript("OnEvent",function(self,event,...)
local eType = select(2,...)
if (eType == "SPELL_CAST_SUCCESS") or (eType == "SPELL_CAST_START") then
local sID, sName = select(12,...)
if cooldownNames[sName] then
Add(sID, (select(5,...)), (select(9,...)), cooldownNames[sName])
end
end
end)
a:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
There you go. Also made it not announce timers that are zero twice.