WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Help Singing Sunflower sing again (https://www.wowinterface.com/forums/showthread.php?t=59747)

Rienwe 12-31-23 01:04 PM

Help Singing Sunflower sing again
 
Hi all, I'm so sad right now. The Singing Sunflower pet doesn't sing anymore...(1, 2). I really miss its happiness! Can someone please make an addon that plays the sounds of the Singing Flower when it is summoned? Just like before? Here are the sounds: https://www.wowhead.com/sound=23503/...ersong-channel


Fizzlemizz 12-31-23 05:45 PM

I heard it sing only today. Maybe the time between songs is just longer randoms.

If you (and just you) wanted to hear it more often you could use something like:
The min/max times can be set to whatever doesn't annoy you (8, 12 seconds is very short but you don't have to wait long to test.)

Lua Code:
  1. -- More music for Sunflower pet
  2. local minTime, maxTime = 8, 12 -- min/max times between songs in seconds
  3. local castID = 93823
  4. local guids = { -- add additional guids here
  5.     ["BattlePet-0-0000121FED47"] = true,
  6.     ["BattlePet-0-0000121FED42"] = true,
  7. }
  8. local soundIDs = {
  9.     567354,
  10.     567327,
  11.     567317,
  12.     567338,
  13.     567374,
  14.     567295,
  15. }
  16. local summoned
  17. local function SingFlowerSing()
  18.     local id = C_PetJournal.GetSummonedPetGUID()
  19.     if not guids[id] then
  20.         summoned = false
  21.         return
  22.     end
  23.     PlaySoundFile(soundIDs[random(1, #soundIDs)])      
  24.     C_Timer.After(random(minTime, maxTime), SingFlowerSing)
  25. end
  26. local f = CreateFrame("Frame")
  27. f:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player")
  28. f:RegisterUnitEvent("UNIT_LEVEL", "player")
  29. f:RegisterEvent("PLAYER_ENTERING_WORLD")
  30. f:SetScript("OnEvent", function(self, event, ...)
  31.     local unit, _, spellid = ...
  32.     if event == "UNIT_SPELLCAST_SUCCEEDED" and spellid == castID then
  33.         if not summoned then
  34.             summoned = true
  35.             C_Timer.After(random(minTime, maxTime), SingFlowerSing)
  36.         end
  37.     elseif event == "PLAYER_ENTERING_WORLD" or event == "UNIT_LEVEL" then
  38.         local id = C_PetJournal.GetSummonedPetGUID()
  39.         if guids[id] then
  40.             self:GetScript("OnEvent")(self, "UNIT_SPELLCAST_SUCCEEDED", "player", nil, castID)
  41.             self:UnregisterEvent("UNIT_LEVEL")
  42.         end
  43.         self:UnregisterEvent("PLAYER_ENTERING_WORLD")
  44.         if event == "UNIT_LEVEL" then
  45.             self:UnregisterEvent("UNIT_LEVEL")
  46.         end
  47.     end
  48. end)
Copy/paste the code to the website addon.bool.no to create download as an addon.

Rienwe 12-31-23 08:09 PM

He singed once when I summoned it then nothing. I'm confused.

Fizzlemizz 12-31-23 08:52 PM

Different guids for each Sunflower in your journal.

I have two so those are included in the updated code above (copy/paste and create a new addon to replace your current one). If you have more Sunflowers or one that is not one of these (there's usually a max. of 3 of any one type of pet...I think (not a pet person)), you will have to find/add it's guid.

With the flower that isn't singing properly summoned, you should be able to
Code:

/run print(C_PetJournal.GetSummonedPetGUID())
and copy that into a new entry in the guids table (insert a new line)
Code:

["xxxxxxxx"] = true,
where xxxxxxxx is the guid.

Copy one of the ones already there and you probably only have to change the last one or two numbers.

Rienwe 01-01-24 07:34 AM

It works great! THANKS YOU SO MUCH!


All times are GMT -6. The time now is 07:43 PM.

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