瀏覽代碼

Added leader change restrictions to @changegm command (#5157)

Daegaladh 5 年之前
父節點
當前提交
fb00561fc1
共有 3 個文件被更改,包括 26 次插入0 次删除
  1. 4 0
      conf/msg_conf/map_msg.conf
  2. 4 0
      conf/msg_conf/map_msg_spn.conf
  3. 18 0
      src/map/atcommand.cpp

+ 4 - 0
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

+ 4 - 0
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

+ 18 - 0
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;
 }