Переглянути джерело

Adds a battle config for Guild Skill saving (#7262)

* Fixes #7256.
* Adds battle config guild_skill_relog_type to allow the ability to save Guild Skill cooldowns on relog or reset them.
* Adjusts the check to account for any new Guild Skills.
Thanks to @Xypr0 and @Lemongrass3110!
Aleos 2 роки тому
батько
коміт
05923b3ded
4 змінених файлів з 14 додано та 4 видалено
  1. 7 1
      conf/battle/guild.conf
  2. 5 0
      src/map/battle.cpp
  3. 1 0
      src/map/battle.hpp
  4. 1 3
      src/map/chrif.cpp

+ 7 - 1
conf/battle/guild.conf

@@ -17,7 +17,13 @@ guild_exp_limit: 50
 guild_max_castles: 0
 
 // Activate guild skills delay by relog?
-// Official setting is 5 minutes (300000 ms), otherwise allow guild leaders to relog to cancel the 5 minute delay.
+// 0 - Save cooldown and resume on relog.
+// 1 - Don't save cooldown and restart the timer on relog.
+// Default on official servers: 1 for Pre-renewal, 0 for Renewal
+//guild_skill_relog_type: 0
+
+// Delay in milliseconds that are applied to guild skills.
+// Official setting is 5 minutes (300000 ms).
 // Note: This was changed in renewal in favor of individual skill cooldown.
 guild_skill_relog_delay: 300000
 

+ 5 - 0
src/map/battle.cpp

@@ -9739,6 +9739,11 @@ static const struct _battle_data {
 	{ "gtb_sc_immunity",                    &battle_config.gtb_sc_immunity,                 50,     0,      INT_MAX,        },
 	{ "guild_max_castles",                  &battle_config.guild_max_castles,               0,      0,      INT_MAX,        },
 	{ "guild_skill_relog_delay",            &battle_config.guild_skill_relog_delay,         300000, 0,      INT_MAX,        },
+#ifdef RENEWAL
+	{ "guild_skill_relog_type",             &battle_config.guild_skill_relog_type,          0,      0,      1,              },
+#else
+	{ "guild_skill_relog_type",             &battle_config.guild_skill_relog_type,          1,      0,      1,              },
+#endif
 	{ "emergency_call",                     &battle_config.emergency_call,                  11,     0,      31,             },
 	{ "atcommand_spawn_quantity_limit",     &battle_config.atc_spawn_quantity_limit,        100,    0,      INT_MAX,        },
 	{ "atcommand_slave_clone_limit",        &battle_config.atc_slave_clone_limit,           25,     0,      INT_MAX,        },

+ 1 - 0
src/map/battle.hpp

@@ -216,6 +216,7 @@ struct Battle_Config
 	int guild_exp_limit;
 	int guild_max_castles;
 	int guild_skill_relog_delay;
+	int guild_skill_relog_type;
 	int emergency_call;
 	int guild_aura;
 	int pc_invincible_time;

+ 1 - 3
src/map/chrif.cpp

@@ -1371,10 +1371,8 @@ int chrif_skillcooldown_save(struct map_session_data *sd) {
 		if (!sd->scd[i])
 			continue;
 
-#ifndef RENEWAL
-		if (!battle_config.guild_skill_relog_delay && (sd->scd[i]->skill_id >= GD_BATTLEORDER && sd->scd[i]->skill_id <= GD_EMERGENCYCALL))
+		if (battle_config.guild_skill_relog_type == 1 && SKILL_CHK_GUILD(sd->scd[i]->skill_id))
 			continue;
-#endif
 
 		timer = get_timer(sd->scd[i]->timer);
 		if (timer == NULL || timer->func != skill_blockpc_end || DIFF_TICK(timer->tick, tick) < 0)