From db31b934ed8815974775756676538eb349a0d800 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sat, 5 Oct 2024 01:47:05 +0200 Subject: [PATCH] Now look for alliance and fix issue with overkill alawys being 0 --- FreshShit/StinkyDetector/event.lua | 2 +- FreshShit/StinkyDetector/init.lua | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/FreshShit/StinkyDetector/event.lua b/FreshShit/StinkyDetector/event.lua index 1fe4e3b..f89ebc7 100644 --- a/FreshShit/StinkyDetector/event.lua +++ b/FreshShit/StinkyDetector/event.lua @@ -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 diff --git a/FreshShit/StinkyDetector/init.lua b/FreshShit/StinkyDetector/init.lua index 6e4bd49..213d133 100644 --- a/FreshShit/StinkyDetector/init.lua +++ b/FreshShit/StinkyDetector/init.lua @@ -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 })