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.