Implement whispering on detect and on kill in stinkydetector

This commit is contained in:
2024-10-05 01:19:49 +02:00
parent 3d864b26a8
commit b84eb896dd
2 changed files with 87 additions and 1 deletions

View File

@@ -10,10 +10,48 @@ WeakAurasSaved.Cyka.Stinkies = {
["Joule"] = true,
["Rattenfenger"] = true,
["Асталабиста"] = true,
["Srakonyh"] = false, -- Agreed to leave him alone until he kills someone again
["Залупотряс"] = false, -- Муркот: I understand if one of them killed the newbies. then you did everything right. they seem friendly but I also warned them not to hit the newbies
["Чмодвенк"] = false, -- Муркот: I understand if one of them killed the newbies. then you did everything right. they seem friendly but I also warned them not to hit the newbies
}
["Totleta"] = true,
}
local toNotify = {"Муркот", "Succpotato"}
-- local toNotify = { "Succpotato" }
aura_env.alliancettl = 120
aura_env.alliance = {}
aura_env.CleanAlliance = function()
for k, v in pairs(aura_env.alliance) do
if v < GetTime() - aura_env.alliancettl then
aura_env.alliance[k] = nil
end
end
end
aura_env.RegisterAlly = function(name)
aura_env.alliance[name] = GetTime()
end
local killSpamTime = 30
local recentlyKilled = {}
aura_env.RegisterKill = function(source, destination, spellName, overkill)
if recentlyKilled[source] and recentlyKilled[source] > GetTime() - killSpamTime then
print("Death already reported")
end
if not aura_env.alliance[source] then
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 с переполнением", source, destination, spellName)
end
for k, v in pairs(toNotify) do
SendChatMessage(msg, "WHISPER", nil, v)
end
recentlyKilled[source] = GetTime()
end
aura_env.stinkies = WeakAurasSaved.Cyka.Stinkies
aura_env.localStinkies = {}
@@ -23,6 +61,9 @@ aura_env.StinkyDetected = function(name)
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
GetTime() - 60 then
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
for k, v in pairs(toNotify) do
SendChatMessage(name .. " в Оргриммаре!", "WHISPER", nil, v)
end
end
aura_env.localStinkies[name] = GetTime()
end
@@ -53,4 +94,5 @@ for i = 1, numfriends do
end
end
--/run WeakAurasSaved.Cyka.Stinkies["Totleta"] = true
-- /dump WeakAurasSaved.Cyka.Stinkies