Hi everyone, my lua knowledge is pretty poor so I request your help to make an addon that play a sound when my chaman has 60 maelstrom points so I know when to use some abilities without constantly watching at my bars (because when I watch my bars I dont see what's happening on the field and then take damages or die...). Thanks in advance.
I found the following code in the addon named "ComboWhore" (for rogues) if that can help create something.
Lua Code:
local f = CreateFrame("Frame")
f:RegisterEvent("UNIT_POWER_UPDATE")
local SoundPath = "Interface\\AddOns\\ComboWhore\\Sounds\\"
local comboPoints = 0
local SoundPlayed = false
f:SetScript("OnEvent", function(self, event, ...)
comboPoints = GetComboPoints("player", "target")
if(comboPoints == 5 and SoundPlayed == false) then
PlaySoundFile(SoundPath .. "FinishSound.ogg", "Master")
SoundPlayed = true
elseif(comboPoints <= 4) then
SoundPlayed = false
end
end)