Jump to content

Recommended Posts

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

  • Active Member
Spoiler

quest map_warp begin
	state start begin
		when 9012.click begin
			say_title("Teleportér: ")
			say("")
			say("Vítej! Pokud chceš poznat jiné části světa, jsi tady na správném")
			say("místě! Jsem totiž schopný tě přesunout téměř kamkoli, ale do")
			say("některých oblastí raději teleportuji jen ty schopnější. Ne všude")
			say("je totiž tak bezpečno, jako tady, a ne vždy je cesta zpět")
			say("jednoduchá. ")
			say("")
			say("Za přesun vybírám jen menší poplatek... ")
			say("")
			say(locale.teleporter2_say)
			say("")

			local main_set = select("Ano ","Ne ")
			if main_set == 2 then
				return
			end
			
			if pc.get_level() <= 10 then
				say_title("Teleportér: ")
				say("")
				say("Tobě to nedošlo? ")
				say("Mohl bys umřít, pokud nemáš vyšší level než 10. ")
				say("A umrtí mezi lidmi se nepřipouští. ")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				say("")
				return
			end

			local map = pc.get_map_index()
			local empire = pc.get_empire()
			local level = pc.get_level()
			local cost = math.floor(level / 5) * 1500

			if cost < 1000 then
				cost = 1000
			end
			say_size(340,400)
			say_title("Teleportér: ")
			say("")
			say("Kam tě mám přesunout? ")
			say_reward("Cena za přesun je "..(comma_value(cost)).." Yangů. ")
			
			if map == 1 or map == 3 or map == 21 or map == 23 or map == 41 or map == 43 then

				local sub_set = 0
				local show_txt = 0
				if pc.get_level() >= 10 then
					local Take_Menu_Opened = 1
					while(Take_Menu_Opened == 1) do
						if(show_txt==1) then
							say_size(340,400)
							say_title("Teleportér: ")
							say("")
							say("Kam tě mám přesunout? ")
							say_reward("Cena za přesun je "..(comma_value(cost)).." Yangů. ")
						end	
						
						if pc.get_empire() == 1 then
							sub_set = select("Yongan ", "Jayang ", "Údolí orků ", "Velká poušť ", "Ledová země ", "DALŠÍ OBLASTI ", "ZRUŠIT ")
							if sub_set == 7 then
								Take_Menu_Opened = 0 --- stops the loop if sub_set == 7
								notice("Teleportér: Tak zatím nashledanou.")
								return
							end
							if sub_set == 6 then
								say_size(340,400)
								say_title(mob_name(npc.get_race())..": ")
								say("")
								say("Kam tě mám přesunout? ")
								say_reward("Cena za přesun je "..(comma_value(cost)).." Yangů. ")
								sub_set = select("Ohnivá země ", "Temný chrám ", "Zelený les ", "PŘEDCHOZÍ OBLASTI ", "ZRUŠIT ")+6
								if sub_set == 11 then
									Take_Menu_Opened = 0
									notice("Teleportér: Tak zatím nashledanou. ")
								end
							end	
						end
						if pc.get_empire() == 2 then
							sub_set = select("Joan ", "Bokjung ", "Údolí orků ", "Velká poušť ", "Ledová země ", "DALŠÍ OBLASTI ", "ZRUŠIT ")
							if sub_set == 7 then
								Take_Menu_Opened = 0 --- stops the loop if sub_set == 7
								notice("Teleportér: Tak zatím nashledanou.")
								return
							end
							if sub_set == 6 then
								say_size(340,400)
								say_title(mob_name(npc.get_race())..": ")
								say("")
								say("Kam tě mám přesunout? ")
								say_reward("Cena za přesun je "..(comma_value(cost)).." Yangů. ")
								sub_set = select("Ohnivá země ", "Temný chrám ", "Zelený les ", "PŘEDCHOZÍ OBLASTI ", "ZRUŠIT ")+6
								if sub_set == 11 then
									Take_Menu_Opened = 0
									notice("Teleportér: Tak zatím nashledanou. ")
								end
							end						
						end
						if pc.get_empire() == 3 then
							sub_set = select("Pyungmoo ", "Bakra ", "Údolí orků ", "Velká poušť ", "Ledová země ", "DALŠÍ OBLASTI ", "ZRUŠIT ")
							if sub_set == 7 then
								Take_Menu_Opened = 0 --- stops the loop if sub_set == 7
								notice("Teleportér: Tak zatím nashledanou.")
								return
							end
							if sub_set == 6 then
								say_size(340,400)
								say_title(mob_name(npc.get_race())..": ")
								say("")
								say("Kam tě mám přesunout? ")
								say_reward("Cena za přesun je "..(comma_value(cost)).." Yangů. ")
								sub_set2 = select("Ohnivá země ", "Temný chrám ", "Zelený les ", "PŘEDCHOZÍ OBLASTI ", "DALŠÍ OBLASTI ", "ZRUŠIT ")
								if sub_set == 10 then
									sub_set = 0
								end								
								if sub_set == 12 then
									Take_Menu_Opened = 0
									notice("Teleportér: Tak zatím nashledanou. ")
								end
							end	
							if sub_set == 11 then
								say_size(340,400)
								say_title(mob_name(npc.get_race())..": ")
								say("")
								say("Kam tě mám přesunout? ")
								say_reward("Cena za přesun je "..(comma_value(cost)).." Yangů. ")
								sub_set = select("BLA ", "BLA ", "BLA ", "PŘEDCHOZÍ OBLASTI ", "ZRUŠIT ")						
								if sub_set == 22 then
									Take_Menu_Opened = 0
									notice("Teleportér: Tak zatím nashledanou. ")
								end
							end								
						end	
						
							if sub_set > 0 and sub_set < 12 then -- else go back to the while
								
								Take_Menu_Opened = 0
									-- PUT HERE THE WARP SECTION ASSUMING THAT :
									--[[
									if pc.get_empire() == 1 then
										sub_set == 
											1 then "Yongan "
											2 then "Jayang "
											3 then "Údolí orků "
											4 then "Velká poušť "
											5 then "Ledová země "
											6 then "Ohnivá země "
											7 then "Temný chrám "
											8 then "Zelený les "
											9 then "Hadí pole "
									elseif pc.get_empire() == 2 then
										sub_set == 
											1 then "Joan "
											2 then "Bokjung "
											3 then "Údolí orků "
											4 then "Velká poušť "
											5 then "Ledová země "
											6 then "Ohnivá země "
											7 then "Temný chrám "
											8 then "Zelený les "	
											9 then "Hadí pole "											
									elseif pc.get_empire() == 3 then
										sub_set == 
											1 then "Pyungmoo "
											2 then "Bakra "
											3 then "Údolí orků "
											4 then "Velká poušť "
											5 then "Ledová země "
											6 then "Ohnivá země "
											7 then "Temný chrám "
											8 then "Zelený les "
											9 then "Hadí pole "
											10 then "BLA "
											11 then "BLA "
											12 then "BLA "
									end
									]]--	
							if pc.gold < cost then
								say_title(mob_name(npc.get_race())..": ")
								say("")
								say("Bohužel, nemáš dostatek yangů.")
								say_reward("Cena za přesun je "..(comma_value(cost)).." Yangů.")
								return
								notice("Teleportér: Tak zatím nashledanou.")
							end

							pc.changegold(-cost)

							local warp = {
								--  prvni_mesta
							    {
								{ 474300, 954800 },
								{ 63800,  166400 },
								{ 959900, 269200 },
							    },
								--  druha_mesta
							    {
								{ 353100, 882900 },
								{ 145500, 240000 },
								{ 863900, 246000 },
							    },
							    -- 64 map_n_threeway
							    {
								{ 402100, 673900 },
								{ 270400, 739900 },
								{ 321300, 808000 },
							    },
							    -- 63 metin2_map_n_desert_01
							    {
								{ 217800, 627200 },
								{ 221900, 502700 },
								{ 344000, 502500 },
							    },
							    -- 61 map_n_snowm_01
							    {
								{ 434200, 290600 },
								{ 375200, 174900 },
								{ 491800, 173600 },
							    },
								-- 62 metin2_map_n_flame_01
								{
								{ 599400, 756300 },
								{ 597800, 622200 },
								{ 730700, 689800 },
								},
								-- temny_chram
							    {
								{ 553600, 143600 },
								{ 553600, 143600 },
								{ 553600, 143600 },
							    },
								-- 67 metin2_map_trent
							    {
								{ 288700, 5700 },
								{ 288700, 5700 },
								{ 288700, 5700 },
							    },
								-- 67 bla
							    {
								{ 288700, 5700 },
								{ 288700, 5700 },
								{ 288700, 5700 },
							    },
								-- 67 bla
							    {
								{ 288700, 5700 },
								{ 288700, 5700 },
								{ 288700, 5700 },
							    },
								-- 67 bla
							    {
								{ 288700, 5700 },
								{ 288700, 5700 },
								{ 288700, 5700 },
							    },								
							}
							pc.warp(warp[sub_set][empire][1], warp[sub_set][empire][2])

							return

						end --	if sub_set > 0 and sub_set < 12 then -- else go back to the while
						show_txt = 1
					end -- while
				end -- if pc.get_level() >= 10 then
			else --- map is not  map == 1 or map == 3 or map == 21 or map == 23 or map == 41 or map == 43 then
				local sub_set2 = 3

				if empire == 1 then    
					sub_set2 = select("Yongan","Jayang", locale.cancel)
				elseif  empire == 2 then  
					sub_set2 = select("Joan","Bokjung", locale.cancel)
				elseif  empire == 3 then 
					sub_set2 = select("Pyungmoo","Bakra", locale.cancel)
				end	

				if sub_set2 != 3 then
					if pc.gold < cost then
						say_title(mob_name(npc.get_race())..": ")
						say("")
						say("Bohužel, nemáš dostatek yangů.")
						say_reward("Cena za přesun je "..(comma_value(cost)).." Yangů.")
					else
						if sub_set2 == 1 then
							if empire == 1 then
								pc.warp(474300,954800)
							elseif empire == 2 then
								pc.warp(63800,166400)
							elseif empire == 3 then
								pc.warp(959900,269200)
							end	
						elseif sub_set2 == 2 then
							if empire == 1 then
								pc.warp(353100,882900)
							elseif empire == 2 then
								pc.warp(145500,240000)
							elseif empire == 3 then
								pc.warp(863900,246000)
							end	
						end
						pc.changegold(-cost)
					end
				end
			end --- map is not  map == 1 or map == 3 or map == 21 or map == 23 or map == 41 or map == 43 then
		end --end when
 	end -- and state
end --end quest

 

@WeedHex

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Premium

      

when 9012.click begin
            local map_data = {
                            { ['section_name'] = "Title", ['page_size'] = 2, ['window_size'] = 330, ['section_data'] = {
                                {['name']="Village 1 - Shinsu",['coord']={{474300,954800},{474300,954800},{474300,954800}},['price']=0,['min_level']=1},
                                {['name']="Village 1 - Chunj",['coord']={{63800,166400},{63800,166400},{63800,166400}},['price']=0,['min_level']=1}
                            },
                            { ['section_name'] = "Title2", ['page_size'] = 2, ['window_size'] = 330, ['section_data'] = {
                                {['name']="xxx",['coord']={{402100,673900},{270400,739900},{321300,808000}},['price']=10000,['min_level']=25},
                                {['name']="xxx",['coord']={{283500,807900},{283500,807900},{283500,807900}},['price']=120000,['min_level']=25}
     
                            },
            local section_menu = {}
            for i = 1, table.getn(map_data) do
                table.insert(section_menu, map_data[i].section_name)
            end
            table.insert(section_menu, "Exit")
            local race = npc.get_race()
            say("Where want to go?[ENTER]")
            local s = select_table(section_menu)
            if s == table.getn(section_menu) then
                return
            end

            local map_menu = {}
            local page_size = map_data[s].page_size
            local i = 1
            local final_index = 0
            while final_index < table.getn(map_data[s].section_data) do
                local current_page = {}
                final_index = i+page_size-1
                if final_index > table.getn(map_data[s].section_data) then
                    final_index = table.getn(map_data[s].section_data)
                end
                for j = i,final_index do
                    table.insert(current_page, map_data[s].section_data[j].name)
                end
                if final_index != table.getn(map_data[s].section_data) then
                    table.insert(current_page, "Avanti")
                end
                table.insert(current_page, "Exit")
                table.insert(map_menu, current_page)
                i = i+page_size
            end

            local window_size = map_data[s].window_size
            local page_counter = 1
            local sel
            repeat
                say_title(mob_name(race).." - Page "..page_counter)
                say("Chose Map:")
                say_size(350, window_size)
                sel = select_table(map_menu[page_counter])
                if sel == table.getn(map_menu[page_counter]) then
                    return
                elseif ((sel == table.getn(map_menu[page_counter])-1) and (page_counter != table.getn(map_menu))) then
                    page_counter = page_counter+1
                else
                    break
                end
            until false

            local selected_map = map_data[s].section_data[sel+page_size*(page_counter-1)]
            if ((pc.get_level() < selected_map.min_level) or (selected_map.max_level != nil and pc.get_level() > selected_map.max_level)) then
                say_title(mob_name(race))
                say("Level: "..selected_map.min_level..".")
                if selected_map.max_level != nil then
                    say("Level req. "..selected_map.max_level..".")
                end
                say("")
                return
            elseif pc.get_gold() < selected_map.price then
                say_title(mob_name(race))
                say("Pay")
                say("xx "..selected_map.price.." Yang.[ENTER]")
                return
            end
            local emp = pc.get_empire()
            pc.change_gold(-selected_map.price)
            pc.warp(selected_map.coord[emp][1], selected_map.coord[emp][2])
        end
    end
end
Link to comment
Share on other sites

  • 2 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.