Totem Target Warning
ist ein Addon welches einen Sound abspielt wenn man dabei ist ein Totem zu Heilen .
Totem Target Warning is an addon which plays a sound when you are reduced to heal a totem.
Code:
-- Change this to the sound file you want to play.
--local SOUND = "Sound\\Spells\\PVPWarningHorde.ogg"
--local SOUND = "Interface\\AddOns\\TotemTargetWarning\\Sound\\sound.ogg"
local SOUND = "Sound\\Spells\\PVPFlagTaken.wav"
-- Change this to the message you want to show.
local TEXT = "!!!! Totem im Target !!!!"
-- Change this to the word that appears in the names
-- of all totems in your language.
local TOTEM = "Totem"
local addon = CreateFrame( "Frame" )
addon:RegisterEvent( "UNIT_SPELLCAST_SENT" )
addon:SetScript( "OnEvent", function( self, event, unit, spell, _, target )
if unit == "player" and target:match( TOTEM ) then
PlaySoundFile(SOUND, "Master")
RaidNotice_AddMessage(RaidWarningFrame, TEXT, {r=1, g=1, b=1})
end
end )