View Single Post
12-09-12, 05:09 PM   #7
humfras
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 131
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
__________________
Author of VuhDo CursorCastBar OptiTaunt Poisoner RaidMobMarker

Last edited by humfras : 12-09-12 at 05:31 PM.
  Reply With Quote