Thread Tools Display Modes
12-31-23, 01:04 PM   #1
Rienwe
A Deviate Faerie Dragon
 
Rienwe's Avatar
Join Date: Nov 2023
Posts: 14
Unhappy 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


Last edited by Rienwe : 12-31-23 at 01:07 PM.
  Reply With Quote
12-31-23, 05:45 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-31-23 at 10:32 PM.
  Reply With Quote
12-31-23, 08:09 PM   #3
Rienwe
A Deviate Faerie Dragon
 
Rienwe's Avatar
Join Date: Nov 2023
Posts: 14
He singed once when I summoned it then nothing. I'm confused.
  Reply With Quote
12-31-23, 08:52 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-01-24 at 09:24 AM.
  Reply With Quote
01-01-24, 07:34 AM   #5
Rienwe
A Deviate Faerie Dragon
 
Rienwe's Avatar
Join Date: Nov 2023
Posts: 14
It works great! THANKS YOU SO MUCH!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Help Singing Sunflower sing again


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