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

help with a quest


Mr.Blue

Question

the idea is a map spawn a metin and he must destroy it before the time is done or he must retry after hour i found some problems hope some 1 helps me

 

quest test begin
	state start begin
		when login or level_up with pc.get_map_index() == 74 begin
			loop_timer("check_time", 1)
			set_state(kill)
		end
	end
		
	state kill begin
		when letter begin
			send_letter(" تجربة ")  
		end
		
		when button or info begin 
			if pc.getqf("time_retry") <= get_time() then
				local Blue = {{100, 22, 8001},{101, 22,8002},{102, 22, 8003},{103, 22,8011},{104, 22,8013},{105, 22,8024},{106, 22,8026},{107, 22,8027},{108, 22,8027},{109, 22,8027}}
				for i = 1,1 do
                if pc.level > Blue[i][1] then
					mob.spawn(Blue[i][3], pc.get_local_x()+5, pc.get_local_y()+5, 1)
					pc.setqf("limit_time", get_time()+60*5)
				end
			end
		end
		
		when Blue[i][3].kill begin
			local count = pc.getqf("state") + 1
			if count <= 1 then
				pc.setqf("state", count)
				q.set_counter(" يجب قتل ", 1 )
			end
			
			if count >= 1 pc.getqf("limit_time") == get_time() then
				say(" fail ")
				say(" اعد المحاولة بعد ساعة ")
				pc.setqf("time_retry", get_time()+60*60*1)
				
			elseif count == 1 and get_time() < pc.getqf("limit_time") then
				say (" mbrok exp ")
				pc.give_exp(Blue[i][2])
                clear_letter()
                set_state(__COMPLETE__)
			end
		end
	end

	state __COMPLETE__ begin
	end
end

  • Love 1
Link to comment

3 answers to this question

Recommended Posts

  • 0
  • Premium

at least u could ask me on skype u know

 

+ i dont know what u want with the time so i think this will work

 

quest test begin
    state start begin
        function get_table()
            if test.table_info == nil then
                test.table_info={
                    {100, 22, 8001},
                    {101, 22, 8002},
                    {102, 22, 8003},
                    {103, 22, 8011},
                    {104, 22, 8013},
                    {105, 22, 8024},
                    {106, 22, 8026},
                    {107, 22, 8027},
                    {108, 22, 8027},
                    {109, 22, 8027},
                }
            end
            return test.table_info
        end
    
        when login or levelup with pc.get_map_index() == 74 begin
            set_state(kill)
        end
    end

    state kill begin
        when letter begin
            send_letter(" تجربة ")  
        end

        when button or info begin
            local table = test.get_table()
            if pc.getqf("time_retry") <= get_time() then
                for i,v in ipairs(table) do
                    if pc.level > v[1] then
                        mob.spawn(v[3], pc.get_local_x()+5, pc.get_local_y()+5, 1)
                        pc.setqf("limit_time", get_time()+60*5)
                        pc.setqf("mob_vnum", v[3])
                    end
                end
            end
        end

        when kill with npc.get_race() == pc.getqf("mob_vnum") begin
            local count = pc.getqf("state") + 1
            local table = test.get_table()
            for i,v in ipairs(table) do
                if count <= 1 then
                    pc.setqf("state", count)
                    q.set_counter(" يجب قتل ", 1 )
                elseif count >= 1 and pc.getqf("limit_time") >= get_time() then
                    say(" fail ")
                    say(" اعد المحاولة بعد ساعة ")
                    pc.setqf("time_retry", get_time()+60*60*1)
                elseif count == 1 and get_time() < pc.getqf("limit_time") then
                    say(" mbrok exp ")
                    pc.give_exp(v[2])
                    clear_letter()
                    set_state(__COMPLETE__)
                end
            end
        end
    end
    state __COMPLETE__ begin
    end
end
  • Love 1

If you're going to do something, then do it right.

Link to comment
  • 0

 

at least u could ask me on skype u know

 

+ i dont know what u want with the time so i think this will work

quest test begin
    state start begin
        function get_table()
            if test.table_info == nil then
                test.table_info={
                    {100, 22, 8001},
                    {101, 22, 8002},
                    {102, 22, 8003},
                    {103, 22, 8011},
                    {104, 22, 8013},
                    {105, 22, 8024},
                    {106, 22, 8026},
                    {107, 22, 8027},
                    {108, 22, 8027},
                    {109, 22, 8027},
                }
            end
            return test.table_info
        end
    
        when login or levelup with pc.get_map_index() == 74 begin
            set_state(kill)
        end
    end

    state kill begin
        when letter begin
            send_letter(" تجربة ")  
        end

        when button or info begin
            local table = test.get_table()
            if pc.getqf("time_retry") <= get_time() then
                for i,v in ipairs(table) do
                    if pc.level > v[1] then
                        mob.spawn(v[3], pc.get_local_x()+5, pc.get_local_y()+5, 1)
                        pc.setqf("limit_time", get_time()+60*5)
                        pc.setqf("mob_vnum", v[3])
                    end
                end
            end
        end

        when kill with npc.get_race() == pc.getqf("mob_vnum") begin
            local count = pc.getqf("state") + 1
            local table = test.get_table()
            for i,v in ipairs(table) do
                if count <= 1 then
                    pc.setqf("state", count)
                    q.set_counter(" يجب قتل ", 1 )
                elseif count >= 1 and pc.getqf("limit_time") >= get_time() then
                    say(" fail ")
                    say(" اعد المحاولة بعد ساعة ")
                    pc.setqf("time_retry", get_time()+60*60*1)
                elseif count == 1 and get_time() < pc.getqf("limit_time") then
                    say(" mbrok exp ")
                    pc.give_exp(v[2])
                    clear_letter()
                    set_state(__COMPLETE__)
                end
            end
        end
    end
    state __COMPLETE__ begin
    end
end

u always in away mode ^^

thx <3

Link to comment

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. 7

      PHOENIX2 !OLDSCHOOL SERVER, PAYTOWIN REMOVED!

    2. 0

      special_item_group and chest apprentice

    3. 2

      Alternative Alternative Zodiac Suit - Ninja M

    4. 0

      character details negative bonus

    5. 0

      Questlib mysql_query function problem

  • 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.