Jump to content

Como es para que no se repita siempre?


Rafa23Alzira
 Share

Recommended Posts

Hola, tengo esta quest pero cada vez que alguien sale y entra, o cambia de mapa y eso se le vuelven a dar los items, como es para que solo sea una vez?

 

quest give_basic_weapon begin
	    state start begin
			    when login begin
					   say_title ( "Bienvenido" )
					   say_title ( "A Metin2Neocon" )
					   say ( "" )
					   pc . give_exp2 ( )
					   set_quest_state ( "levelup" , "run" )
					   pc . give_item2 ( "70042" , 1 )
					   pc . give_item2 ( "70007" , 1 )
					   pc . give_item2 ( "27003" , 200 )
					   pc . give_item2 ( "27003" , 200 )
					   pc . give_item2 ( "27003" , 200 )
					   pc . give_item2 ( "27006" , 200 )
					   pc . give_item2 ( "72701" , 1 )
   pc . give_item2 ( "71150" , 1 )
					   pc . give_item2 ( "50052" , 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   say_reward ( "" )
					   say_reward ( "" )
					   say_reward ( "Recibes 600 Pociones Rojas(G)." )
					   say_reward ( "Recibes 200 Pociones Azules(G)." )
					   say_reward ( "Recibes Caballo Armado" )
					   clear_letter ( )
					   set_state ( "__COMPLETE__" )
					   if pc . job == 0 then
					   pc . give_item2 ( "11209" , 1 )
					   pc . give_item2 ( "11219" , 1 )
					   pc . give_item2 ( "13007" , 1 )
					   pc . give_item2 ( "14007" , 1 )
					   pc . give_item2 ( "15007" , 1 )
					   pc . give_item2 ( "19" , 1 )
					   pc . give_item2 ( "3009" , 1 )
					   pc . give_item2 ( "12207" , 1 )
					   pc . give_item2 ( "16007" , 1 )
					   pc . give_item2 ( "17007" , 1 )
					   say_reward ( "Bienvenido a Metin2neocon" )
					   elseif pc . job == 1 then
					   pc . give_item2 ( "11409" , 1 )
					   pc . give_item2 ( "11419" , 1 )
					   pc . give_item2 ( "13007" , 1 )
					   pc . give_item2 ( "14007" , 1 )
					   pc . give_item2 ( "15007" , 1 )
					   pc . give_item2 ( "1009" , 1 )
					   pc . give_item2 ( "2009" , 1 )
					   pc . give_item2 ( "8009" , 200 )
					   pc . give_item2 ( "12347" , 1 )
					   pc . give_item2 ( "16007" , 1 )
					   pc . give_item2 ( "17007" , 1 )
					   say_reward ( "Bienvenido a Metin2neocon" )
					   elseif pc . job == 2 then
					   pc . give_item2 ( "11609" , 1 )
					   pc . give_item2 ( "11619" , 1 )
					   pc . give_item2 ( "13007" , 1 )
					   pc . give_item2 ( "14007" , 1 )
					   pc . give_item2 ( "15007" , 1 )
					   pc . give_item2 ( "19" , 1 )
					   pc . give_item2 ( "29" , 1 )
					   pc . give_item2 ( "12487" , 1 )
					   pc . give_item2 ( "16007" , 1 )
					   pc . give_item2 ( "17007" , 1 )
					   say_reward ( "Bienvenido a Metin2neocon" )
					   elseif pc . job == 3 then
					   pc . give_item2 ( "11809" , 1 )
					   pc . give_item2 ( "11819" , 1 )
					   pc . give_item2 ( "13007" , 1 )
					   pc . give_item2 ( "14007" , 1 )
					   pc . give_item2 ( "15007" , 1 )
					   pc . give_item2 ( "7009" , 1 )
					   pc . give_item2 ( "12627" , 1 )
					   pc . give_item2 ( "16007" , 1 )
					   pc . give_item2 ( "17007" , 1 )
					   say_reward ( "Bienvenido a Metin2neocon" )
				  end
			  end
		  end
		  state __COMPLETE__ begin
			    when enter begin
					    q.done()
			    end
		  end
end
Link to comment
Share on other sites

asi no se repite

horse . advance ( 1 )
										   horse . advance ( 1 )
										   horse . advance ( 1 )
										   horse . advance ( 1 )
										   horse . advance ( 1 )
										   horse . advance ( 1 )
										   horse . advance ( 1 )
										   horse . advance ( 1 )-- esto podes cambiarlo por
horse.set_level ("21")
			    horse.ride()

Asi queda mejor

 

quest give_basic_weapon begin
    state start begin
	    when login begin
			  notice_all(""..string . format ("%s",pc.name).." Bienvenido")
		    if pc.getqf("basic_weapon") == 0 then
			    pc.setqf("basic_weapon", 1)
			    if pc.job == 0 then
				    pc.give_item2(11209,1)
								   pc.give_item2(12209,1)
								   pc.give_item2(00019,1)
								   pc.give_item2(03009,1)
			    elseif pc.job == 1 then
								   pc.give_item2(11409,1)
								   pc.give_item2(12349,1)
								   pc.give_item2(01009,1)
								   pc.give_item2(02009,1)
								   pc.give_item2(08000,200)
			    elseif pc.job == 2 then
								   pc.give_item2(11609,1)
								   pc.give_item2(12489,1)
								   pc.give_item2(00019,1)
			    elseif pc.job == 3 then
								   pc.give_item2(11809,1)
								   pc.give_item2(12629,1)
								   pc.give_item2(05009,1)
								   pc.give_item2(07009,1)
			    else
			    say_title("Bienvenido a Mt2Infinity!")
			    say("Bienvenido a Mt2Inifnity!")
			    say("Para empezar, podras cazar")
			    say("perros salvajes y callejeros.")
			    say("Buena suerte!")
			    say_title("Has recibido:")
			    say_reward("Un equipamiento nivel +9")
			    say_reward("200 pociones rojas y azules.")
			    say_reward("100 pociones verdes y moradas")
			    end
			    if pc.countitem(item) == 0 and pc.weapon != item then
    horse.set_level ("21")
			    horse.ride()
				    pc.give_item2(50051,1)
				    pc.give_item2(13009,1)
				    pc.give_item2(14009,1)
				    pc.give_item2(15009,1)
				    pc.give_item2(16009,1)
				    pc.give_item2(17009,1)
				    pc.give_item2(27003,200)
				    pc.give_item2(27006,200)
				    pc.give_item2(27112,100)
				    pc.give_item2(27115,100)
                    pc.give_item2(50053,1)
			    end
		    end
	    end
    end
end
Link to comment
Share on other sites

Si quieres que no se repita debes cambiar el state al que has dejado vacío y has nombrado _COMPLETE_

Tan solo debes añadir

set_state("__COMPLETE__")
Al final de la primera parte de la quest.

Es decir, así sería:

quest give_basic_weapon begin
		state start begin
				when login begin
					   say_title ( "Bienvenido" )
					   say_title ( "A Metin2Neocon" )
					   say ( "" )
					   pc . give_exp2 ( )
					   pc . give_item2 ( "70042" , 1 )
					   pc . give_item2 ( "70007" , 1 )
					   pc . give_item2 ( "27003" , 200 )
					   pc . give_item2 ( "27003" , 200 )
					   pc . give_item2 ( "27003" , 200 )
					   pc . give_item2 ( "27006" , 200 )
					   pc . give_item2 ( "72701" , 1 )
   pc . give_item2 ( "71150" , 1 )
					   pc . give_item2 ( "50052" , 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   horse . advance ( 1 )
					   say_reward ( "" )
					   say_reward ( "" )
					   say_reward ( "Recibes 600 Pociones Rojas(G)." )
					   say_reward ( "Recibes 200 Pociones Azules(G)." )
					   say_reward ( "Recibes Caballo Armado" )
					   clear_letter ( )
					   if pc . job == 0 then
					   pc . give_item2 ( "11209" , 1 )
					   pc . give_item2 ( "11219" , 1 )
					   pc . give_item2 ( "13007" , 1 )
					   pc . give_item2 ( "14007" , 1 )
					   pc . give_item2 ( "15007" , 1 )
					   pc . give_item2 ( "19" , 1 )
					   pc . give_item2 ( "3009" , 1 )
					   pc . give_item2 ( "12207" , 1 )
					   pc . give_item2 ( "16007" , 1 )
					   pc . give_item2 ( "17007" , 1 )
					   say_reward ( "Bienvenido a Metin2neocon" )
					   elseif pc . job == 1 then
					   pc . give_item2 ( "11409" , 1 )
					   pc . give_item2 ( "11419" , 1 )
					   pc . give_item2 ( "13007" , 1 )
					   pc . give_item2 ( "14007" , 1 )
					   pc . give_item2 ( "15007" , 1 )
					   pc . give_item2 ( "1009" , 1 )
					   pc . give_item2 ( "2009" , 1 )
					   pc . give_item2 ( "8009" , 200 )
					   pc . give_item2 ( "12347" , 1 )
					   pc . give_item2 ( "16007" , 1 )
					   pc . give_item2 ( "17007" , 1 )
					   say_reward ( "Bienvenido a Metin2neocon" )
					   elseif pc . job == 2 then
					   pc . give_item2 ( "11609" , 1 )
					   pc . give_item2 ( "11619" , 1 )
					   pc . give_item2 ( "13007" , 1 )
					   pc . give_item2 ( "14007" , 1 )
					   pc . give_item2 ( "15007" , 1 )
					   pc . give_item2 ( "19" , 1 )
					   pc . give_item2 ( "29" , 1 )
					   pc . give_item2 ( "12487" , 1 )
					   pc . give_item2 ( "16007" , 1 )
					   pc . give_item2 ( "17007" , 1 )
					   say_reward ( "Bienvenido a Metin2neocon" )
					   elseif pc . job == 3 then
					   pc . give_item2 ( "11809" , 1 )
					   pc . give_item2 ( "11819" , 1 )
					   pc . give_item2 ( "13007" , 1 )
					   pc . give_item2 ( "14007" , 1 )
					   pc . give_item2 ( "15007" , 1 )
					   pc . give_item2 ( "7009" , 1 )
					   pc . give_item2 ( "12627" , 1 )
					   pc . give_item2 ( "16007" , 1 )
					   pc . give_item2 ( "17007" , 1 )
					   say_reward ( "Bienvenido a Metin2neocon" )
				  end
				  set_state("__COMPLETE__")
			  end
		  end
		  state __COMPLETE__ begin
		  end
end

Así debería funcionar.

PD: Te daba error porqué habías copiado un set_state de otra quest dónde dicho state no existe en esta quest.

Link to comment
Share on other sites

  • Dilong locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...