/trunk
local GetNumRaidMembers = GetNumRaidMembers |
local GetNumPartyMembers = GetNumPartyMembers |
local InCombatLockdown = InCombatLockdown |
local GetSpellInfo = GetSpellInfo |
local UnitName = UnitName |
local addonVersion = GetAddOnMetadata("NightWatch", "Version") |
local dbVers = 8 |
skull = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_8:0|t", |
} |
-- Borrowed from SmartRes2 |
local resSpells = { |
[(GetSpellInfo(2006))] = true, -- Resurrection |
[(GetSpellInfo(2008))] = true, -- Ancestral Spirit |
[(GetSpellInfo(7328))] = true, -- Redemption |
[(GetSpellInfo(50769))] = true, -- Revive |
[(GetSpellInfo(20484))] = true, -- Rebirth |
[(GetSpellInfo(8342))] = true, -- Defibrillate (Goblin Jumper Cables) |
[(GetSpellInfo(22999))] = true, -- Defibrillate (Goblin Jumper Cables XL) |
[(GetSpellInfo(54732))] = true, -- Defibrillate (Gnomish Army Knife) |
} |
function addon:makeOptions() |
local opts = { |
name = "NightWatch " .. addonVersion, |
-- 0 1 2 3 4 5 6 7 8 9 10 11 12 |
-- _,timestamp, event, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellID, spellName, spellSchool, missType, ...) |
-- |
-- 0 1 2 3 4 5 6 7 8 9 10 |
local msg |
local whisperTarget |
local flag, source, target, spell |
local msg, whisperTarget |
function addon:combatLogEvent(_, _, flag, _, source, _, _, target, _, _, spell, ...) |
-- 0 1 2 3 4 5 6 7 8 9 10 |
if not db.spells[spell] then return end -- Spell not in database, quit |
flag = db.flagMap[flag] |
end |
if resSpells[spell] and not target then -- Fix for res spells' target not showing in combatlog. gg bliz. |
target = UnitName(source .. "target") |
end |
if target then |
if ws.whisperTarget then -- Whisper target |
if ws.msgFormat.whisperTarget then |
target = addon:formatMsg(nil, nil, target, nil, ws.msgFormat.chatTarget) |
end |
msg = addon:formatMsg(source, spell, target, flag, ws.msgFormat.chat) |
msg = addon:formatMsg(source, spell, target, flag, ws.msgFormat.chat) -- Format message |
for i = 1, #sink do |
if ws["output" .. i] then -- Send to output |
if ws["output" .. i] then -- Send message to output(s) |
if wantIconLinks[db.sinkStorage[i].sink20OutputSink] then |
msg = addon:mkIconLinks(msg) |
end |