end |
|
function f:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, minievent, guidsource, source, sourceflags, ...) |
if (minievent == "SWING_DAMAGE" or minievent == "SPELL_DAMAGE" or minievent == "SPELL_PERIODIC_DAMAGE") and checksourceflags(sourceflags) then |
lastdamage = source |
end |
if minievent == "UNIT_DIED" and lastdamage then |
local playername = UnitName("player") |
if select(2,...) == playername then |
local nameexists = false |
local zonename = GetZoneText() |
local note = "Killed "..playername.." in "..zonename |
if DeathNoteDB.autoadd then |
for k,v in pairs(DeathNoteDB[realmName]) do |
if string.lower(v[1]) == string.lower(lastdamage) then |
v[2] = note |
nameexists = true |
if not IsBlacklistedZone() then |
if (minievent == "SWING_DAMAGE" or minievent == "SPELL_DAMAGE" or minievent == "SPELL_PERIODIC_DAMAGE") and checksourceflags(sourceflags) then |
lastdamage = source |
end |
if minievent == "UNIT_DIED" and lastdamage then |
local playername = UnitName("player") |
if select(2,...) == playername then |
local nameexists = false |
local zonename = GetZoneText() |
local note = "Killed "..playername.." in "..zonename |
if DeathNoteDB.autoadd then |
for k,v in pairs(DeathNoteDB[realmName]) do |
if string.lower(v[1]) == string.lower(lastdamage) then |
v[2] = note |
nameexists = true |
end |
end |
if not nameexists then |
print("DeathNote: "..lastdamage.." damaged you before you died. Adding in the list.") |
table.insert(DeathNoteDB[realmName],{lastdamage,note}) |
end |
end |
if not nameexists then |
print("DeathNote: "..lastdamage.." damaged you before you died. Adding in the list.") |
table.insert(DeathNoteDB[realmName],{lastdamage,note}) |
if DeathNoteDB.noteshare and GetNumPartyMembers() > 1 then |
SendAddonMessage("DEATHNOTE",lastdamage.."|"..note,"PARTY") |
end |
end |
if DeathNoteDB.noteshare and GetNumPartyMembers() > 1 then |
SendAddonMessage("DEATHNOTE",lastdamage.."|"..note,"PARTY") |
end |
lastdamage = nil |
end |
lastdamage = nil |
end |
end |
|