Hello,
I am playing a sound every time a player receives a buff but unfortunately this also occurs after each loading screen.
Since the player has +5 buffs after a loading screen the sound multiplies 5 times.
I would not like to play it after a loading screen.
Lua Code:
local playerGUID = UnitGUID("player")
local targetGUID = UnitGUID("target")
local bossGUID = UnitGUID("bossN")
local f = CreateFrame("Frame")
local bossGUID = UnitGUID("boss")
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
f:SetScript("OnEvent", function(self, event)
self:OnEvent(event, CombatLogGetCurrentEventInfo())
end)
function f:OnEvent(event, ...)
local timestamp, subevent, _, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags = ...
if subevent == "SPELL_AURA_APPLIED" and destGUID == playerGUID then
a.Sound(SoundPackValue("buff_on_self"))
end
end
Is there a possibility to detect if the buff is applied by a player or an other player as a spellcast?
Or creating a variable that would reset itself after a loading screen after 3 seconds would be better?
What would be a good way to approach this issue?