My suggestion / meine Empfehlung:
Code:
local frame = CreateFrame("Frame")
local events = {}
local incombat
local function checkerfunc()
if not UnitBuff("player", "Schlachtruf") and not UnitBuff("player", "Befehlsruf") then
SpellActivationOverlay_ShowOverlay(SpellActivationOverlayFrame, 6673, "INTERFACE\\ICONS\\Ability_Warrior_BattleShout.blp", "TOP", 1.1, 139, 65, 239, false, false)
else
SpellActivationOverlay_HideOverlays(SpellActivationOverlayFrame, 6673)
end
end
function events:PLAYER_REGEN_ENABLED(...)
incombat = false
SpellActivationOverlay_HideOverlays(SpellActivationOverlayFrame, 6673)
end
function events:PLAYER_REGEN_DISABLED(...)
incombat = true
checkerfunc()
end
function events:UNIT_AURA(unit)
if unit ~= "player" or not incombat then return end --only proceed if the player has an aura event
checkerfunc()
end
frame:SetScript("OnEvent", function(self, event, ...)
events[event](self, ...)
end)
for k, v in pairs(events) do
frame:RegisterEvent(k)
end