From fb00561fc16f216ceea26b99cc0af618bc58bc77 Mon Sep 17 00:00:00 2001 From: Daegaladh Date: Tue, 30 Jun 2020 19:55:18 +0200 Subject: [PATCH] Added leader change restrictions to @changegm command (#5157) --- conf/msg_conf/map_msg.conf | 4 ++++ conf/msg_conf/map_msg_spn.conf | 4 ++++ src/map/atcommand.cpp | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/conf/msg_conf/map_msg.conf b/conf/msg_conf/map_msg.conf index 49ba23bfbe..0d94fe9167 100644 --- a/conf/msg_conf/map_msg.conf +++ b/conf/msg_conf/map_msg.conf @@ -1719,5 +1719,9 @@ 1511: > HUNTING : %d 1512: > PLAYTIME : %d +// @changegm +1513: Currently in WoE hours, unable to delegate Guild leader +1514: You have to wait for a while before delegating a new Guild leader + //Custom translations import: conf/msg_conf/import/map_msg_eng_conf.txt diff --git a/conf/msg_conf/map_msg_spn.conf b/conf/msg_conf/map_msg_spn.conf index 3f5b9812bd..a882cffa36 100644 --- a/conf/msg_conf/map_msg_spn.conf +++ b/conf/msg_conf/map_msg_spn.conf @@ -1666,5 +1666,9 @@ 1503: Has entrado en una zona PK. 1504: Has entrado en una zona PK (segura hasta el nivel %d). +// @changegm +1513: No puedes delegar el liderazgo del clan durante el horario de WoE +1514: Debes esperar un tiempo antes de poder designar un nuevo líder de clan + //Traducciones personalizadas import: conf/msg_conf/import/map_msg_spn_conf.txt diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index a278576c83..a2a4cac2bd 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -6140,6 +6140,24 @@ ACMD_FUNC(changegm) return -1; } + if( !battle_config.guild_leaderchange_woe && is_agit_start() ){ +#if PACKETVER >= 20151001 + clif_msg(sd, GUILD_MASTER_WOE); +#else + clif_displaymessage(fd, msg_txt(sd,1513)); // Currently in WoE hours, unable to delegate Guild leader +#endif + return -1; + } + + if( battle_config.guild_leaderchange_delay && DIFF_TICK(time(NULL),sd->guild->last_leader_change) < battle_config.guild_leaderchange_delay ){ +#if PACKETVER >= 20151001 + clif_msg(sd, GUILD_MASTER_DELAY); +#else + clif_displaymessage(fd, msg_txt(sd,1514)); // You have to wait for a while before delegating a new Guild leader +#endif + return -1; + } + guild_gm_change(sd->status.guild_id, pl_sd->status.char_id); return 0; }