View Single Post
01-09-10, 09:15 PM   #3
opismahname
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 23
Originally Posted by Akryn View Post
You are pretty close:

"UNIT_AURA_PLAYER_RIGHTEOUS FURY" is not an event. "UNIT_AURA" is, and that's all you should put there.

Therefore, in your OnEvent function, you need to check for...
1. Is this event firing for the player
2. If so, does the player currently have the aura.
3. If so, did the player not have it the last time I checked -- to prevent the addon from spamming every time you gain/loose an aura while that one is active.

The way to do #1 is to check the event's arg1, which is the unit the event fired for e.g.
Code:
if ... == "player" then
The way to do #2 is with UnitAura e.g.
Code:
UnitAura("player", "Righteous Fury")
The way to do #3 is to save the result of each check in a variable, and check it before announcing.
Thanks for answering!
Don't really know how to do this work but something like this?
Code:
local frame = CreateFrame("FRAME", "RFFrame");
frame:RegisterEvent("UNIT_AURA");
local function eventHandler(self, event, ...)
 print("Rigtheous Fury is now activated " .. event);
end
frame:SetScript("OnEvent *something here?*", eventHandler);
Or could you post how the entire code would be?
  Reply With Quote