Now look for alliance and fix issue with overkill alawys being 0
This commit is contained in:
@@ -35,7 +35,7 @@ function(allstates, e, ...)
|
||||
if UnitIsPlayer("nameplate" .. i) then
|
||||
local name = UnitName("nameplate" .. i)
|
||||
local faction = UnitFactionGroup("nameplate" .. i)
|
||||
if faction and faction == "Horde" then
|
||||
if faction and faction == "Alliance" then
|
||||
aura_env.RegisterAlly(name)
|
||||
end
|
||||
end
|
||||
|
@@ -30,12 +30,18 @@ aura_env.CleanAlliance = function()
|
||||
end
|
||||
end
|
||||
aura_env.RegisterAlly = function(name)
|
||||
-- print("Spotted ally: " .. name)
|
||||
aura_env.alliance[name] = GetTime()
|
||||
end
|
||||
|
||||
local killSpamTime = 30
|
||||
local recentlyKilled = {}
|
||||
aura_env.RegisterKill = function(source, destination, spellName, overkill)
|
||||
if not overkill or overkill <= 0 then
|
||||
print("No overkill, 'death' not reported (probably not dead...)")
|
||||
return
|
||||
end
|
||||
|
||||
if recentlyKilled[source] and recentlyKilled[source] > GetTime() - killSpamTime then
|
||||
print("Death already reported")
|
||||
end
|
||||
@@ -44,10 +50,7 @@ aura_env.RegisterKill = function(source, destination, spellName, overkill)
|
||||
print("lol alliance died idiot")
|
||||
end
|
||||
|
||||
local msg = string.format("%s убил %s с помощью %s", source, destination, spellName)
|
||||
if overkill then
|
||||
msg = string.format("%s убил %s с помощью %s с переполнением %d", source, destination, spellName, overkill)
|
||||
end
|
||||
local msg = string.format("%s убил %s с помощью %s с переполнением %d", source, destination, spellName, overkill)
|
||||
for k, v in pairs(toNotify) do
|
||||
-- SendChatMessage(msg, "WHISPER", nil, v)
|
||||
table.insert(aura_env.whisperQueue, { to = v, msg = msg })
|
||||
|
Reference in New Issue
Block a user