Legend of Zelda Sound Addon
First time post here guys, I had a cool idea for an addon. If the Legend of Zelda shop music played whenever you entered into an inn or opened up to sell things to a vendor. I'm not a programmer but I suspect there might be away to do it with the inn. Creating an event of some sort that triggers the sound whenever your character goes into a rested state. As for vendoring items not sure. But if someone could possibly create this I would be extremely grateful and appreciative.
|
Legend of Zelda shop music
https://youtu.be/VLAekpsclQY Reference to the Legend of Zelda Shop Music. This would be amazing please so,Rome make my dream come true!!!!
|
The code involved is relatively easy. However, there are distribution issues with hosting copyrighted media. You would have to provide your own music or find it yourself.
|
Also, as far as I'm aware, there isn't an easy/straightforward way to tell whether you are in an inn or not, unless you want the shop music to constantly play while you are anywhere in a major city.
You get a ZONE_CHANGED event firing whenever you enter a new area, at which point you can check sub-zone text, but many inns don't have a separate sub-zone text in cities, so you can't differentiate inns from other parts of the city that way. I guess you'd have to get exact coordinate mappings for all inns within cities, and play the inn music only while you are inside those coordinates. For non-city inns, IsResting would probably be accurate enough. |
Quote:
Quote:
|
Quote:
Lua Code:
You might want to use PlayMusic and StopMusic function, but cannot 100% guarantee. |
Quote:
|
Quote:
This site would help you creating an addon. Type in your addon's name into AddOn folder name field. (Let's say PlayZeldaMusic) Copy and paste the following code into lua file field (This version will also play/stop music on vendor) Lua Code:
Press Create my AddOn and give me my files! button. You will get a zip file which contains two files called PlayZeldaMusic.toc and code.lua Un-zip it, place your sound file into that folder then open code.lua and change "path to your music" to your own. |
Quote:
-- This file is loaded from "ZeldaShop.toc" local f = CreateFrame("Frame") f:RegisterEvent("PLAYER_UPDATE_RESTING") f:RegisterEvent("MERCHANT_SHOW") f:RegisterEvent("MERCHANT_CLOSED") f:SetScript("OnEvent", function(self, event, ...) if event == "PLAYER_UPDATE_RESTING" then if IsResting() then PlayMusic("C:\Program Files (x86)\World of Warcraft\Interface\AddOns\ZeldaShop") else StopMusic() end elseif event == "MERCHANT_SHOW" then PlayMusic(C:\Program Files (x86)\World of Warcraft\Interface\AddOns\ZeldaShop) elseif event == "MERCHANT_CLOSED" then StopMusic() end end) I placed the Zeldashop.mp3 into the Addon folder and set the path to it. |
The path for PlayMusic is "interface/addons/ZeldaShop/YourSoundFile.mp3" (with forward slashes and the quotes) and assuming your addon is named "ZeldaShop".
You also need to entirely exit and restart the game to load any new files into it. |
Quote:
+ IIrc, the upper most folder of each addon is their own folders. So, if you have an addon called ZeldaShop and got a sound file called ZeldaShop.mp3 in that addon folder then it'd be something like this. Lua Code:
Seems, I'm wrong. Follow semlar's comment :p |
Quote:
Quote:
|
Quote:
Quote:
|
Quote:
Lua Code:
|
Quote:
2- Rested state only updates when you enter or leave the city (a.k.a. PLAYER_UPDATE_RESTING only fires then.) Checking for IsIndoors(), the script will see you aren't indoors once you enter the city and stop there. The music won't play while inside inns that are within cities. If you were inside a building while the script runs (tping back from an instance, or if the event fires at login), then it'll see you're indoors, and play the music constantly even after leaving. If there is an event that tells when you go indoors/outdoors, that would make it activate in buildings that aren't inns, so that's not reliable either. |
I never said it would be used in conjunction with the event, just that the function to determine whether you're inside a building exists.
There are other things you can use, like the minimap zoom update event, whatever it's called. |
Yes, but unless there's a way to differentiate between the interior of inns (the inn-teriors) from he interiors of other buildings, it wouldn't quite be enough for what OP wants to do. It'd just make the music play whenever they go indoors anywhere in a city.
I'd be interested in knowing if there is a reliable way of doing this without just whitelisting certain coordinate ranges, still. One could possibly rely on the user mousing over the sign over the entrance of an inn and reading tooltip text to recognize inns, or mousing over the innkeeper, but that's clunky and prone to errors. Not ideal. Alternatively, I guess one could choose to just disable it for main city inns :p but that seems like a shame, because it's a cool idea. (Also I guess a coordinates-based solution would need to be coupled with extra detection to make sure it doesn't trigger on flying over inn.) |
Quote:
|
All times are GMT -6. The time now is 12:32 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI