Jump to content

Quest - Advanced Player Music


Aveline™

Recommended Posts

M2 Download Center

This is the hidden content, please
( 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.

  • Metin2 Dev 2
  • Good 1
  • Love 1
  • Love 5

Plain logic saves lives.

Link to comment
Share on other sites

  • 11 months later...
  • 1 month later...

Announcements



×
×
  • Create New...

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.