Download
(1Kb)
Download
Updated: 12-31-09 10:16 PM
Pictures
File Info
Updated:12-31-09 10:16 PM
Created:12-31-09 10:16 PM
Downloads:3,707
Favorites:31
MD5:

Damn Unit Sounds

Version: rsomething
by: Shadowed [More]

Quick addon that adds the default UI sounds for target/focus/pvp toggle back into the game if you are using a custom unit frame.

Optional Files (0)


Post A Reply Comment Options
Unread 07-24-18, 01:22 PM  
ObscureScience
A Deviate Faerie Dragon

Forum posts: 10
File comments: 81
Uploads: 0
Re: Functional sounds

Originally Posted by aTTari
Just remove the old code and copy paste this into the AddOn LUA file and it should work.
The only thing that's changed in the code is all the "PlaySound()" strings.
Instead of using the sound names it'll use the sound ID instead.
At least this works for me. No errors on my side.
Thanks, will try

Yep it worked.
Last edited by ObscureScience : 08-02-18 at 05:40 AM.
Report comment to moderator  
Reply With Quote
Unread 07-22-18, 04:44 PM  
aTTari
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Functional sounds

Just remove the old code and copy paste this into the AddOn LUA file and it should work.
The only thing that's changed in the code is all the "PlaySound()" strings.
Instead of using the sound names it'll use the sound ID instead.
At least this works for me. No errors on my side.
Lua Code:
  1. --[[
  2.     Shadow, Mal'Ganis (US)
  3. ]]
  4.  
  5. local Sounds = select(2, ...)
  6.  
  7. -- Focus sounds
  8. function Sounds:PLAYER_FOCUS_CHANGED()
  9.     if( UnitExists("focus") ) then
  10.         if( UnitIsEnemy("focus", "player") ) then
  11.             PlaySound(873)
  12.         elseif( UnitIsFriend("player", "focus") ) then
  13.             PlaySound(867)
  14.         else
  15.             PlaySound(871)
  16.         end
  17.     else
  18.         PlaySound(684)
  19.     end
  20. end
  21.  
  22. -- Target sounds
  23. function Sounds:PLAYER_TARGET_CHANGED()
  24.     if( UnitExists("target") ) then
  25.         if( UnitIsEnemy("target", "player") ) then
  26.             PlaySound(873)
  27.         elseif( UnitIsFriend("player", "target") ) then
  28.             PlaySound(867)
  29.         else
  30.             PlaySound(871)
  31.         end
  32.     else
  33.         PlaySound(684)
  34.     end
  35. end
  36.  
  37. -- PVP flag sounds
  38. local announcedPVP
  39. function Sounds:UNIT_FACTION(unit, ...)
  40.     if( unit ~= "player" ) then return end
  41.  
  42.     if( UnitIsPVPFreeForAll("player") or UnitIsPVP("player") ) then
  43.         if( not announcedPVP ) then
  44.             announcedPVP = true
  45.             PlaySound(4574)
  46.         end
  47.     else
  48.         announcedPVP = nil
  49.     end
  50. end
  51.  
  52.  
  53. local frame = CreateFrame("Frame")
  54. frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
  55. frame:RegisterEvent("PLAYER_TARGET_CHANGED")
  56. frame:RegisterEvent("UNIT_FACTION")
  57. frame:SetScript("OnEvent", function(self, event, ...)
  58.     Sounds[event](Sounds, ...)
  59. end)
Report comment to moderator  
Reply With Quote
Unread 07-20-18, 08:36 AM  
ObscureScience
A Deviate Faerie Dragon

Forum posts: 10
File comments: 81
Uploads: 0
Error in 8.0.1

Code:
2x DamnUnitSounds\DamnUnitSounds.lua:33: Usage: PlaySound(soundKitID, optional["SFX","Music","Ambience", "Dialog" or "Master"], [forceNoDuplicates, runFinishCallback])
[C]: in function `PlaySound'
DamnUnitSounds\DamnUnitSounds.lua:33: in function `?'
DamnUnitSounds\DamnUnitSounds.lua:58: in function <DamnUnitSounds\DamnUnitSounds.lua:57>

Locals:
InCombatSkipped
Code:
2x DamnUnitSounds\DamnUnitSounds.lua:26: Usage: PlaySound(soundKitID, optional["SFX","Music","Ambience", "Dialog" or "Master"], [forceNoDuplicates, runFinishCallback])
[C]: in function `PlaySound'
DamnUnitSounds\DamnUnitSounds.lua:26: in function `?'
DamnUnitSounds\DamnUnitSounds.lua:58: in function <DamnUnitSounds\DamnUnitSounds.lua:57>
[C]: in function `TargetUnit'
FrameXML\ChatFrame.lua:1365: in function `?'
FrameXML\ChatFrame.lua:4695: in function `ChatEdit_ParseText'
FrameXML\ChatFrame.lua:4383: in function `ChatEdit_SendText'
FrameXML\ChatFrame.lua:2874: in function <FrameXML\ChatFrame.lua:2867>
[C]: in function `RunMacroText'
FrameXML\SecureTemplates.lua:432: in function `handler'
FrameXML\SecureTemplates.lua:623: in function <FrameXML\SecureTemplates.lua:571>

Locals:
(*temporary) = "igCreatureAggroSelect"
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.