Thread Tools Display Modes
11-04-22, 12:03 AM   #1
DonnieDice
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 6
Play sound on Renown Rank up.

I'm trying to figure out how to play a soundfile when I rank up renown levels. Does anyone know how I would do this?

I found this.
https://github.com/Gethe/wow-ui-sour...umentation.lua

https://wowpedia.fandom.com/wiki/API...etRenownLevels

Does anyone know how I would make this work with Dragonflight?

Currently I'm using this code to play sound on reputation ranks, but it's not working with new renown ranks for dragonflight factions.

Code:
Event_Frame_B:SetScript("OnEvent",function()
	   for i=1,GetNumFactions() do
	       local _,_,newstanding,_,_,_,_,_,isheader,_,hasrep,_,_,faction=GetFactionInfo(i);
	       if faction and (not isheader or hasrep) and (newstanding or 0)>0 then-- Make sure we have the info we need and standing isn't UNKNOWN (0)
	           local oldstanding=TrackedFactions[faction];
	           if oldstanding and oldstanding<newstanding then-- Check if standing went up (allow same code to initialize tracking)
	                PlaySoundFile(569593);-- Play Level up Sound
	           end

	           TrackedFactions[faction]=newstanding;-- Update standing
	       end
	   end
end);

Edit/

I figured this one out. Turns out MAJOR_FACTION_RENOWN_LEVEL_CHANGED is a thing.

Last edited by DonnieDice : 05-23-23 at 12:05 AM.
  Reply With Quote
11-04-22, 08:59 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,931
I couldn't see it in the codeblock you posted but you need to register an event to track
https://wowpedia.fandom.com/wiki/MAJ..._LEVEL_CHANGED

This will give you some information on what happened
majorFactionID, newRenownLevel, oldRenownLevel

You can then play your sound and maybe a flashy visual if you want :chuckle:
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Play sound on Renown Rank up.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off