Jump to content
Forgot your email address? ×
×
×
  • Create New...

Quest - Advanced Player Music


Recommended Posts

M2 Download Center

Hidden Content

    Give reaction to this post to see the hidden content.
( Internal )

Hello guys i will want to share something with your. Actually this quest public but i'll rewrite this quest i think it was a little perfect.

 

Quest : 

--[[
	
	* fileName 	  : musicPlayerSystem.quest
	* date	   	  : 15.03.2014
	* author   	  : HaveBeen
	* description : - 
	
]]--
quest musicPlayer begin
	state start begin
		function load()
			local data = {}
			data.MapNames = {
				-- MapIndex	   MapName
				[1] 		= "Shinsoo Kingdom",
				[21]	    = "Chunjo Kingdom",
				[41]	    = "Jinno Kingdom",
			}
			data.MapIndexs = {1,21,41}
			data.Notice = "%s enjoy the music begins. Music name : %s"
			data.Notice2 = "For all the kingdoms of music. Music name : %s"
			data.Options = {"Add music for one map","Add music for all map","Close"}
			return data
		end
		function is_admin()
			local gmList = {"HaveBeen"}
			if(table.getn(gmList) >= 1) then
				if(gmList[1] == pc.name) then
					return true
				else
					return false
				end
			else
				for i = 1,table.getn(gmList),1 do
					if(gmList[i] == pc.name) then
						return true
					else
						return false
					end
				end
			end
		end
		when letter with pc.is_gm() and musicPlayer.is_admin() begin
			send_letter("Music Player")
		end
		when button or info begin
			say_title("Music Player:")
			say("")
			---
			say("What do you want?")
			local data = musicPlayer.load()
			local s = select_table(data.Options)
			if(s >= table.getn(data.Options)) then
				return
			end
			say_title(string.format("%s : ",data.Options[s]))
			say("")
			---			
			if(s >= 1) then
				say("Select a map.")
				say("")
				local q = {}
				for i = 1,table.getn(data.MapIndexs),1 do
					table.insert(q,data.MapNames[data.MapIndexs[i]])
					table.insert(q,"Close")
				end
				local t = select_table(q)
				if(t >= table.getn(q)) then
					return
				end
				say_title(string.format("%s enjoy the music",q[t]))
				say("")
				---
				say("Please write music name..")
				say("")
				local music = input()
				if(music == "" or tostring(music) == nil) then
					return
				end
				say_title(string.format("%s enjoy the music",q[t]))
				say("")
				---
				say("Music is starting.. ")
				say("Thanks! ")
				add_bgm_info(data.MapIndexs[t],music,0.5)
				notice_all(string.format(data.Notice,q[t],music))
			elseif(s >= 2) then
				say("Please write music name..")
				say("")
				local music = input()
				if(music == "" or tostring(music) == nil) then
					return
				end
				say_title(string.format("%s enjoy the music",q[t]))
				say("")
				---
				say("Music is starting.. ")
				say("Thanks! ")
				i = 0
				repeat
					i = i + 1
					add_bgm_info(data.MapIndexs[i],music,0.5)
				until i == table.getn(data.MapIndexs)
				notice_all(string.format(data.Notice2,music))
			end
		end
	end
end

I hope you're like it.

 

Regards.

  • Love 4
  • Love 1

Plain logic saves lives.

Link to comment
  • 11 months later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


  • Read our Rules
  • Activity

    1. 1

      Halloween 2021 Ninja M V2

    2. 0

      Visual Studio 2010 Ultimate

    3. 1

      Reduce server memory usage

  • Recently Browsing

    • No registered users viewing this page.

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.