Jump to content

Evento pesca


Dilong

Recommended Posts

Es algo simple

Spoiler

quest manwoo begin
state start begin
when 9009.chat."GM Manwoo" with pc.is_gm() begin
say_title("Pescador")
say("texto")
local s = select("Activar","Cancelar","Cerrar")
if s == 1 then
	say_title("Pescador")
	say("Escribe la duracion del evento")
	say_reward("El maximo es 24 (24hs)")
	local duracion = tonumber(input())
	if duracion > 24 then
		say("Cantidad excedida")
		return end
		if duracion < 1 then
			say("Debes escribir minimo un uno (1)")
			return end
			if game.get_event_flag("manwoo1")== 1 then
			 say_title("Pescador")
			 say("El evento ya esta activo")
			 return end
			server_timer("manwoo", 60*60*duracion)
				game.set_event_flag("manwoo1",1)
				notice_all("El evento Manwoo ha comenzado, la duracion del evento es de: "..duracion.." Hora(s)")
				mysql_query("INSERT INTO player.log_manwoo (nombre, duracion_evento) VALUES ('"..pc.get_name().."','"..duracion.."')")
				elseif s == 2 then
				if game.get_event_flag("manwoo1")== 0 then
				say("El evento esta inactivo")
				return end
				game.set_event_flag("manwoo1",0)
				clear_server_timer("manwoo")
				notice_all("El evento Manwoo ha sido cancelado")
			return
		end
	end
	when manwoo.server_timer begin
	game.set_event_flag("manwoo1",0)
	notice_all("El evento Manwoo ha terminado")
end
when 9009.take with game.get_event_flag("manwoo1")== 1 begin
local baules = {29,39} -- Aqui pones la id de los baules
local aleatorio = math.random(1,2)
if item.get_vnum()== 19 then -- Cambiarlo por la id del pez
	pc.give_item2(baules[aleatorio],1)
	item.remove()
end
end
when 9009.chat."Manwoo" with game.get_event_flag("manwoo1")== 1 begin
say_title("Pescador")
say("texto")
say_item_vnum(19)
end
when letter with game.get_event_flag("manwoo1")== 1 begin
send_letter("¡Manwoo!")
end
when button or info begin
say_title("Evento")
say("El pescador esta recompensando a los[ENTER]guerreros al realizar una tarea de pesca")
end
end
end

 

Agregar esta query en /player para crear la tabla donde se guardara el log de los GM´s que han activado el evento

Spoiler

/*
Navicat MySQL Data Transfer

Source Server         : SF pruebas
Source Server Version : 50092
Source Host           : 25.95.22.100:3306
Source Database       : player

Target Server Type    : MYSQL
Target Server Version : 50092
File Encoding         : 65001

Date: 2018-02-23 16:34:53
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `log_manwoo`
-- ----------------------------
DROP TABLE IF EXISTS `log_manwoo`;
CREATE TABLE `log_manwoo` (
  `nombre` varchar(12) character set big5 default 'NONAME',
  `fecha` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `duracion_evento` int(12) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of log_manwoo
-- ----------------------------

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

  • Recently Browsing   0 members

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