WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Chaman 60 maelstrom alert (https://www.wowinterface.com/forums/showthread.php?t=58733)

Yukka 05-12-21 05:43 PM

Chaman 60 maelstrom alert
 
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:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("UNIT_POWER_UPDATE")
  3.  
  4. local SoundPath = "Interface\\AddOns\\ComboWhore\\Sounds\\"
  5. local comboPoints = 0
  6. local SoundPlayed = false
  7.  
  8. f:SetScript("OnEvent", function(self, event, ...)
  9.     comboPoints = GetComboPoints("player", "target")
  10.     if(comboPoints == 5 and SoundPlayed == false) then
  11.         PlaySoundFile(SoundPath .. "FinishSound.ogg", "Master")
  12.         SoundPlayed = true
  13.     elseif(comboPoints <= 4) then
  14.         SoundPlayed = false
  15.     end
  16. end)


All times are GMT -6. The time now is 09:51 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI