Scroll down for a better implementation of this!
Hi all,
I've been lurking around here for a while but this is my first post so be gentle! Anyway, I've been hacking around with dbm-spelltimers a bit and think I've come up with something useful to others - so I thought I would share it. Got the idea from here.
This modification will only show cooldowns for a whitelist of players, so no spam from other members of your group/raid.
I added a whitelist to the top of SpellTimers.lua
Code:
local playerWhitelist = {"Síri", "Sìri", "Sìrí", "Sírì"}
and then modified the main handler for combat log events as follows:
Code:
-- first some exeptions (we don't want to see any skill around the world)
if settings.only_from_raid and not DBM:IsInRaid() then return end
if not settings.active_in_pvp and (select(2, IsInInstance()) == "pvp") then return end
local fromplayer = select(4, ...)
local toplayer = select(7, ...) -- Added by Florin Patan
local spellid = select(9, ...)
local spellname = select(10, ...)
-- now we filter if cast is from outside raidgrp (we don't want to see mass spam in Dalaran/...)
if settings.only_from_raid and DBM:GetRaidUnitId(fromplayer) == "none" then return end
for k,v in pairs(settings.spells) do
if v.spell == spellid and v.enabled == true then
local found = false
for j,whitelistPlayer in pairs(playerWhitelist) do
if (fromplayer == whitelistPlayer) then
found = true
end
end
if (not found) then
DEFAULT_CHAT_FRAME:AddMessage("Filtered spell "..spellname.."("..spellid..") from player: "..fromplayer)
return
else
DEFAULT_CHAT_FRAME:AddMessage("Passed spell "..spellname.."("..spellid..") from player: "..fromplayer)
end
local spellinfo, _, icon = GetSpellInfo(spellid)
local bartext = v.bartext:gsub("%%spell", spellinfo):gsub("%%player", fromplayer):gsub("%%target", toplayer) -- Changed by Florin Patan
SpellBars:CreateBar(v.cooldown, bartext, icon, nil, true)
if settings.showlocal then
local msg = L.Local_CastMessage:format(bartext)
if not lastmsg or lastmsg ~= msg then
DBM:AddMsg(msg)
lastmsg = msg
end
end
end
end
Those two DEFAULT_CHAT_FRAME:AddMessage are in there so you can check it is working, comment them out using -- if all is fine.

My plan is to modify this further to send the cooldown bars for different characters to different sets of cooldown bars. So, for example, you can have a set of cooldown bars for each character beside its unitframe.
Please let me know if you have any problems with this.
By the way, I'm rolling a new group on grim batol but don't have permission to post in the forum yet. So to all those there, looking forward to meeting you!
Connect With Us