Jump to content

algien abria crear una quest asi


peri200

Mensajes recomendados

Hay muchas formas, una de ellas seria enviando ese texto a una tabla especial, esos datos que serian texto se actualizarian constantemente al enviar uno, la informacion que tenga esa tabla, se visualizaría unicamente para algun miembro del staff, seria la manera mas facil y rapida y si funcionaria

 

PD: tambien se podria llenar la tabla, y ala hora de enviar el mensaje con el pergamino o con un npc, debes señalar el nombre del miembro del staff al que se lo quieres enviar, o algo paresido solo habria que pensarlo y que el men este sea mas especifico con lo que quiere :|

Enlace para comentar
Compartir en otros sitios

seria que al usuario saliera una mision diciendo informar un gm y posteior al abrirla saliera para escribir y enviar ( llegaria al buzon de gm)

 

algo asi 

 

( busque en google pero nada y de quest estoi en basico ya que no suelo crear dinguna)

Aquí está una quest de blackyuyo:

 

Está quest lo que hace es crear un archivo txt con el nombre del jugador que ha enviado el reporte, la fecha y su mensaje. El archivo se crea usr/home/game/share/locale/spain(germany, etc)/quest/bug_report/

 

Quest

quest gm_inform begin
	state start begin
	when login begin
		set_state(information)
	end
end
	state information begin
		when letter begin
			send_letter("Reporta un informe")
		end		
		when button or info begin
			say_title("Reportar un informe")
			say_reward("Atención: Tu nombre será guardado[ENTER]")
			say ("Quieres informar de un algo?[ENTER]")
			local s = select ("Si", "No")
			if s == 2 then
				return
			end
			local max_rows = 20
			local row_n = 1
			local bug_mex = ""
			local stop = false
			-- Read all rows
			repeat
				say_title("Reportar informe - Linea "..row_n.." / "..max_rows)
				say("Por favor, haz una descripción detallada")
				say("del informe:[ENTER]")
				local line = input()
				say_title("Reportar informe - Linea "..row_n.." / "..max_rows)
				if string.len(line) < 4 then
					-- Row too short
					say("Has insertado un texto demasiado corto.[ENTER]")
					if row_n == 1 then
						wait()
					else
						local s = select("Continuar", "Enviar reporte")
						if s == 2 then
							stop = true
						end
					end
				else
					-- Next line
					bug_mex = bug_mex..NEW_LINE_FILE..line
					row_n = row_n+1
					if row_n == max_rows then
						say("Has realizado el reporte con éxito.[ENTER]")
						wait()
						stop = true
					else
						say("Deseas escribir más lineas?[ENTER]")
						local s = select("Si", "No")
						if s == 2 then
							stop = true
						end
					end
				end
			until stop	
			-- Finsh reading rows
			say_title("Reportes")
			if (BugReport.Report(bug_mex)) then
				say("Tu reporte se ha enviado correctamente[ENTER]")
			else
				say("Ha ocurrido un error al enviar el reporte.")
				say("Prueba más tarde.[ENTER]")
			end
		end	-- when
	end	-- state
end	-- quest

Questlib.lua

--**
--** Report functions
--**
BugReport = {['Folder'] = get_locale_base_path().."/quest/bug_report/"}

--** Write bug report to file
function BugReport.Report(bug_message)
	local written = false
	local new_count = BugReport.Count.Update()
	local file_name = BugReport.Folder..pc.get_name().."_"..new_count..".txt"
	local file = io.open(file_name, "w")
	if file != nil then
		written = true
		file:write("Personaje: "..pc.get_name().." (PID: "..pc.get_player_id()..")\n")
		file:write("Fecha: "..os.date("%d/%m/%Y - Ore: %H:%M").."\n")
		file:write("Mensaje:\n")
		file:write(bug_message.."\n")
		file:close()
	end
	return written
end

--** Bug count handling
BugReport.Count = {['Flag'] = "bug_count"}

--** Get the bug count for a player
function BugReport.Count.Get()
	return pc.getqf(BugReport.Count.Flag)
end

--** Set the bug count for a player
function BugReport.Count.Set(new_count)
	pc.setqf(BugReport.Count.Flag, new_count)
end

--** Update bug count for a player
function BugReport.Count.Update()
	local new_count = BugReport.Count.Get()+1
	BugReport.Count.Set(new_count)
	return new_count
end

Enlace para comentar
Compartir en otros sitios

 

Aquí está una quest de blackyuyo:

 

Está quest lo que hace es crear un archivo txt con el nombre del jugador que ha enviado el reporte, la fecha y su mensaje. El archivo se crea usr/home/game/share/locale/spain(germany, etc)/quest/bug_report/

 

Quest

quest gm_inform begin
	state start begin
	when login begin
		set_state(information)
	end
end
	state information begin
		when letter begin
			send_letter("Reporta un informe")
		end		
		when button or info begin
			say_title("Reportar un informe")
			say_reward("Atención: Tu nombre será guardado[ENTER]")
			say ("Quieres informar de un algo?[ENTER]")
			local s = select ("Si", "No")
			if s == 2 then
				return
			end
			local max_rows = 20
			local row_n = 1
			local bug_mex = ""
			local stop = false
			-- Read all rows
			repeat
				say_title("Reportar informe - Linea "..row_n.." / "..max_rows)
				say("Por favor, haz una descripción detallada")
				say("del informe:[ENTER]")
				local line = input()
				say_title("Reportar informe - Linea "..row_n.." / "..max_rows)
				if string.len(line) < 4 then
					-- Row too short
					say("Has insertado un texto demasiado corto.[ENTER]")
					if row_n == 1 then
						wait()
					else
						local s = select("Continuar", "Enviar reporte")
						if s == 2 then
							stop = true
						end
					end
				else
					-- Next line
					bug_mex = bug_mex..NEW_LINE_FILE..line
					row_n = row_n+1
					if row_n == max_rows then
						say("Has realizado el reporte con éxito.[ENTER]")
						wait()
						stop = true
					else
						say("Deseas escribir más lineas?[ENTER]")
						local s = select("Si", "No")
						if s == 2 then
							stop = true
						end
					end
				end
			until stop	
			-- Finsh reading rows
			say_title("Reportes")
			if (BugReport.Report(bug_mex)) then
				say("Tu reporte se ha enviado correctamente[ENTER]")
			else
				say("Ha ocurrido un error al enviar el reporte.")
				say("Prueba más tarde.[ENTER]")
			end
		end	-- when
	end	-- state
end	-- quest

Questlib.lua

--**
--** Report functions
--**
BugReport = {['Folder'] = get_locale_base_path().."/quest/bug_report/"}

--** Write bug report to file
function BugReport.Report(bug_message)
	local written = false
	local new_count = BugReport.Count.Update()
	local file_name = BugReport.Folder..pc.get_name().."_"..new_count..".txt"
	local file = io.open(file_name, "w")
	if file != nil then
		written = true
		file:write("Personaje: "..pc.get_name().." (PID: "..pc.get_player_id()..")\n")
		file:write("Fecha: "..os.date("%d/%m/%Y - Ore: %H:%M").."\n")
		file:write("Mensaje:\n")
		file:write(bug_message.."\n")
		file:close()
	end
	return written
end

--** Bug count handling
BugReport.Count = {['Flag'] = "bug_count"}

--** Get the bug count for a player
function BugReport.Count.Get()
	return pc.getqf(BugReport.Count.Flag)
end

--** Set the bug count for a player
function BugReport.Count.Set(new_count)
	pc.setqf(BugReport.Count.Flag, new_count)
end

--** Update bug count for a player
function BugReport.Count.Update()
	local new_count = BugReport.Count.Get()+1
	BugReport.Count.Set(new_count)
	return new_count
end

 

gracias :D

Enlace para comentar
Compartir en otros sitios

  • Dilong locked this tema
Guest
Este tema está cerrado a otras respuestas.
  • Recientemente navegando por este tema   0 miembros

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