Jump to content

Defender metin


Dilong

Mensajes recomendados

Lo hice mientras estaba aburrido, pueden usar cualquier mapa para la quest, pero tendran que cambiar las coordenadas y el map index

Spoiler

quest defender_metin begin
state start begin
function activar()
	local mov = game.set_event_flag("movimiento_m2",1)
	local metin_spawn = mob.spawn(8021,140,136,1), mob.spawn(8020,122,145,1), mob.spawn(8022,109,115,1)
	local reinos = game.set_event_flag("roca_jinno",0), game.set_event_flag("roca_shinsoo",0), game.set_event_flag("roca_chunjo",0), game.set_event_flag("block",1)
	end
	function desactivar2()
		local cerrar_evento = kill_all_in_map(200), warp_all_to_village(200, 10), game.set_event_flag("evento",0), game.set_event_flag("entrada_off",0), game.set_event_flag("block",0), game.set_event_flag("movimiento_m2",0)
		local logins = game.set_event_flag("player_count",0), game.set_event_flag("login_counter",0)
		local reinos = game.set_event_flag("roca_jinno",0), game.set_event_flag("roca_shinsoo",0), game.set_event_flag("roca_chunjo",0)
	end
	when 9003.chat."GM evento metin" with pc.is_gm() begin
	say("texto")
	local evento = select("activar","cancelar")
	if evento == 1 then
		if game.get_event_flag("evento")== 1 then
			say("El evento ya esta activo")
			return end
	say("Escribe la cantidad de logins en el mapa")
	say("el maximo es 200")
	local count2 = tonumber(input())
	if count2 < 1 then
	say("No puedes escribir este numero")
	return end
	if count2 > 200 then
	say("Lo maximo que puedes escribir es 200")
	return end
	game.set_event_flag("player_count", count2)
		game.set_event_flag("evento",1)
		notice_all("Evento defender metin2 activado")
		notice_all("El maximo de jugadores que pueden entrar en el mapa es: "..count2.." ")
		return
end
end
when 9003.chat."entrada evento defender metin2" with game.get_event_flag("evento")== 1 begin
say("texto")
local entrada = select("si","no")
if entrada == 1 then
	if game.get_event_flag("entrada_off")== 1 then
		say("La entrada esta cerrada")
		return end
		if pc.get_map_index()== 200 then
			say("Ya estas en el mapa")
			return end
			if game.get_event_flag("login_counter") == game.get_event_flag("player_count") then
				say("Ya se alcanzo el limite de jugadores")
				return end
	local inicio_teleport = {{102300,7300},{100200,17000},{90400,12900}}
	local imperio2 = pc.get_empire()
	pc.warp(inicio_teleport[imperio2][1],inicio_teleport[imperio2][2])
	return
	end
end
when logout or disconnect with pc.get_map_index()== 200 and game.get_event_flag("evento")== 1 begin
local counter = game.get_event_flag("login_counter")
game.set_event_flag("login_counter", counter-1)
end
when login with pc.get_map_index()== 200 and game.get_event_flag("evento")== 1 begin
local counter = game.get_event_flag("login_counter")
loop_timer("roca_imperio",2)
game.set_event_flag("login_counter", counter+1)
if game.get_event_flag("login_counter") == game.get_event_flag("player_count") then
notice_all("Ya se alcanzo el limite de jugadores en el mapa defender metin2")
warp_to_village()
else
affect.add_collect(apply.MOV_SPEED, -800, 1000) affect.add_collect(apply.ATT_SPEED, -800, 1000)
loop_timer("movimiento23", 2)
pc.setqf("check_mov1",1)
notice("Movimiento deshabilitado temporalmente")
end
end
when roca_imperio.timer begin
if pc.is_gm() then
	return end
if pc.get_empire()==2 and game.get_event_flag("roca_chunjo")== 1 then
cleartimer("roca_imperio")
warp_to_village()
else
if pc.get_empire()==1 and game.get_event_flag("roca_shinsoo")== 1 then
cleartimer("roca_imperio")
warp_to_village()
else
if pc.get_empire()==3 and game.get_event_flag("roca_jinno")== 1 then
cleartimer("roca_imperio")
warp_to_village()
end end end end
when movimiento23.timer begin
	if game.get_event_flag("movimiento_m2")== 1 then
	affect.remove_collect(apply.MOV_SPEED, -800, 1000) affect.remove_collect(apply.ATT_SPEED, -800, 1000)
	pc.setqf("check_mov1",0)
	cleartimer("movimiento23")
	notice("¡Movimiento activado!")
	notice("¡Defiende el metin de tu reino!")
end
end
when login with pc.getqf("check_mov1")== 1 begin
loop_timer("check_mov",5)
end
when check_mov.timer begin
affect.remove_collect(apply.MOV_SPEED, -800, 1000) affect.remove_collect(apply.ATT_SPEED, -800, 1000)
pc.setqf("check_mov1",0)
cleartimer("check_mov1")
chat("Movimiento activado")
end
when kill with npc.is_pc() and pc.get_map_index() == 200 and game.get_event_flag("evento")== 1 begin
local pc_derrota = npc.get_vid()
local pc_derrota2 = pc.select(pc_derrota)
if pc_derrota2 != 0 then
loop_timer("derrota",2)
pc.select(pc_derrota2)
		end
	end
when derrota.timer begin
local inicio_derrota = {87800,15800}
pc.warp(inicio_derrota[1],inicio_derrota[2])
cleartimer("derrota")
end
when 9003.chat."GM Iniciar" with pc.is_gm() and game.get_event_flag("evento")== 1 and pc.get_map_index()== 200 begin
say_title("Panel del evento defender metin2")
say("Cupo disponible: "..game.get_event_flag("login_counter").." Cupo maximo: "..game.get_event_flag("player_count").." ")
say_reward("Cierra la entrada al evento una vez que[ENTER]el cupo de jugadores en el mapa se llene")
say_reward("O vuelve a abrirlo si aun existe un cupo disponible")
local iniciar22 = select ("Iniciar evento","Cerrar entrada","Abrir entrada","Terminar evento","Cancelar")
if iniciar22 == 1 then
		if game.get_event_flag("block")== 1 then
		say("error block")
		return end
	defender_metin.activar()
	notice_all("defender metin2")
	elseif iniciar22 == 2 then
			if game.get_event_flag("entrada_off")== 1 then
				say("la entrada ya esta cerrada")
				return end
		game.set_event_flag("entrada_off",1)
		notice_all("La entrada al evento defender metin2 se ha cerrado")
		elseif iniciar22 == 3 then
			if game.get_event_flag("entrada_off")== 0 then
				say("la entrada ya esta abierta")
				return end
		game.set_event_flag("entrada_off",0)
		notice_all("La entrada al evento defender metin2 se ha abierto")
		elseif iniciar22 == 4 then
			defender_metin.desactivar2()
			notice_all("Seran enviados a sus aldeas en 10 segundos ")
			return

end
end
		when 8020.kill with pc.get_map_index() == 200 and game.get_event_flag("evento")== 1 begin
			notice_all("[Server]: El jugador "..pc.get_name().." a destruido la roca Shinsoo")
			notice_all("[Server]: El reino shinsoo a sido derrotado")
			game.set_event_flag("roca_shinsoo",1)
			if game.get_event_flag("roca_chunjo") == 0 and game.get_event_flag("roca_jinno") == 1 then
				notice_all("[Server]: El imperio Chunjo a derrotado a todos sus enemigos, se a declarado ganador.")
			end
			if game.get_event_flag("roca_chunjo") == 1 and game.get_event_flag("roca_jinno") == 0 then
				notice_all("[Server]: El imperio Jinno a derrotado a todos sus enemigos, se a declarado ganador.")
			end
		end
		when 8021.kill with pc.get_map_index() == 200 and game.get_event_flag("evento")== 1 begin
			notice_all("[Server]: El jugador "..pc.get_name().." a destruido la roca Jinno")
			notice_all("[Server]: El reino jinno a sido derrotado")
			game.set_event_flag("roca_jinno",1)
			if game.get_event_flag("roca_chunjo") == 0 and game.get_event_flag("roca_shinsoo") == 1 then
				notice_all("[Server]: El imperio Chunjo a derrotado a todos sus enemigos, se a declarado ganador.")
			end
			if game.get_event_flag("roca_chunjo") == 1 and game.get_event_flag("roca_shinsoo") == 0 then
				notice_all("[Server]: El imperio Shinsoo a derrotado a todos sus enemigos, se a declarado ganador.")
			end
		end
		when 8022.kill with pc.get_map_index() == 200 and game.get_event_flag("evento")== 1 begin
			notice_all("[Server]: El jugador "..pc.get_name().." a destruido la roca Chunjo")
			notice_all("[Server]: El reino chunjo a sido derrotado")
			game.set_event_flag("roca_chunjo",1)
			if game.get_event_flag("roca_shinsoo") == 0 and game.get_event_flag("roca_jinno") == 1 then
				notice_all("[Server]: El imperio Shinsoo a derrotado a todos sus enemigos, se a declarado ganador.")
			end
			if game.get_event_flag("roca_shinsoo") == 1 and game.get_event_flag("roca_jinno") == 0 then
				notice_all("[Server]: El imperio Jinno a derrotado a todos sus enemigos, se a declarado ganador.")
			end
		end
	end
end

 

 

Enlace para comentar
Compartir en otros sitios

Unirse a la conversación

Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.

Guest
Responder a este tema...

×   Has pegado contenido con formato .   Eliminar formato

  Only 75 emoji are allowed.

×   Tu enlace se ha incorporado automáticamente.   Mostrar un enlace en su lugar

×   Se ha restaurado el contenido anterior. .   Borrar editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recientemente navegando por este tema   0 miembros

    • No hay usuarios registrados visitando esta página.
×
×
  • Crear nuevo...