WoWInterface SVN mikma

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /DeathNote
    from Rev 463 to Rev 464
    Reverse comparison

Rev 463 → Rev 464

DeathNote.lua
39,35 → 39,39
end
 
local lastdamage
local infight
 
function f:PLAYER_REGEN_ENABLED()
lastdamage = nil
end
 
function f:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, minievent, guidsource, source, sourceflags, ...)
if checksourceflags(sourceflags) then
if minievent == "SWING_DAMAGE" then
lastdamage = source
elseif minievent == "SPELL_DAMAGE" or minievent == "SPELL_PERIODIC_DAMAGE" then
lastdamage = source
elseif 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
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
if not nameexists then
print("DeathNote: "..lastdamage.." killed you. Adding in the list.")
table.insert(DeathNoteDB[realmName],{lastdamage,note})
end
end
if DeathNoteDB.noteshare and GetNumPartyMembers() > 1 then
SendAddonMessage("DEATHNOTE",lastdamage.."|"..note,"PARTY")
if not nameexists then
print("DeathNote: "..lastdamage.." killed you. Adding in the list.")
table.insert(DeathNoteDB[realmName],{lastdamage,note})
end
end
if DeathNoteDB.noteshare and GetNumPartyMembers() > 1 then
SendAddonMessage("DEATHNOTE",lastdamage.."|"..note,"PARTY")
end
end
lastdamage = nil
end
end