elseif minievent == "UNIT_DIED" and lastdamage then |
local playername = UnitName("player") |
if select(2,...) == playername then |
print("DeathNote: "..lastdamage.." killed you. Adding in the list.") |
local playerexists = false |
local playername = UnitName("player") |
local zonename = GetZoneText() |
local note = "Killed "..playername.." in "..zonename |
table.insert(DeathNoteDB[realmName],{lastdamage,note}) |
for k,v in pairs(DeathNoteDB[realmName]) do |
if v[1] == lastdamage then |
v[2] = note |
playerexists = true |
end |
end |
if not playerexists then |
print("DeathNote: "..lastdamage.." killed you. Adding in the list.") |
table.insert(DeathNoteDB[realmName],{lastdamage,note}) |
end |
if DeathNoteDB.noteshare and GetNumPartyMembers() > 1 then |
SendAddonMessage("DEATHNOTE",lastdamage.."|"..note,"PARTY") |
end |