summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 03:00:22 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 03:00:22 +0200
commitedad604582cbe6b17de7f19a958c38710f5cf9ab (patch)
tree290021773f1db8f2c02837287e36e844a5eecd78
parent584f1e0797ae83fc760ec607ab134166f6426417 (diff)
downloadhercules-edad604582cbe6b17de7f19a958c38710f5cf9ab.tar.gz
hercules-edad604582cbe6b17de7f19a958c38710f5cf9ab.tar.bz2
hercules-edad604582cbe6b17de7f19a958c38710f5cf9ab.tar.xz
hercules-edad604582cbe6b17de7f19a958c38710f5cf9ab.zip
Add battle flag for rate modifier messages display
-rw-r--r--conf/map/battle/client.conf8
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c10
4 files changed, 18 insertions, 2 deletions
diff --git a/conf/map/battle/client.conf b/conf/map/battle/client.conf
index 5601dbc9e..aad4d7652 100644
--- a/conf/map/battle/client.conf
+++ b/conf/map/battle/client.conf
@@ -202,3 +202,11 @@ ping_time: 20
// Drop or not connection after client send disconnect request packet
// Official is false
drop_connection_on_quit: false
+
+// When to display the rate modifier messages?
+// 0x0 - Never display rate modifier messages.
+// 0x1 - Display rate modifier messages upon login.
+// 0x2 - Display rate modifier messages upon map change.
+// 0x4 - Display rate modifier messages upon teleporting (regardless of changing maps).
+// Default: 0x1 (Official behavior.)
+display_rate_messages: 0x1
diff --git a/src/map/battle.c b/src/map/battle.c
index 611154953..7d85bf645 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7431,6 +7431,7 @@ static const struct battle_data {
{ "ping_time", &battle_config.ping_time, 20, 0, 99999999, },
{ "option_drop_max_loop", &battle_config.option_drop_max_loop, 10, 1, 100000, },
{ "drop_connection_on_quit", &battle_config.drop_connection_on_quit, 0, 0, 1, },
+ { "display_rate_messages", &battle_config.display_rate_messages, 1, 0, 7, },
{ "features/enable_refinery_ui", &battle_config.enable_refinery_ui, 1, 0, 1, },
{ "features/replace_refine_npcs", &battle_config.replace_refine_npcs, 1, 0, 1, },
{ "batk_min_limit", &battle_config.batk_min, 0, 0, INT_MAX, },
diff --git a/src/map/battle.h b/src/map/battle.h
index 55ee32445..a116506dd 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -590,6 +590,7 @@ struct Battle_Config {
int option_drop_max_loop;
int drop_connection_on_quit;
+ int display_rate_messages;
int enable_refinery_ui;
int replace_refine_npcs;
diff --git a/src/map/clif.c b/src/map/clif.c
index 03432c9e4..01f116cc7 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10945,6 +10945,8 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd)
}
}
+ bool change_map = (sd->state.changemap != 0);
+
if (sd->state.changemap != 0) { // Restore information that gets lost on map-change.
#if PACKETVER >= 20070918
clif->partyinvitationstate(sd);
@@ -10958,8 +10960,6 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd)
clif->zc_config(sd, CZ_CONFIG_HOMUNCULUS_AUTOFEEDING, false);
#endif
- clif->show_modifiers(sd);
-
bool flee_penalty = (battle_config.bg_flee_penalty != 100 || battle_config.gvg_flee_penalty != 100);
bool is_gvg = (map_flag_gvg2(sd->state.pmap) || map_flag_gvg2(sd->bl.m));
bool is_bg = (map->list[sd->state.pmap].flag.battleground != 0 || map->list[sd->bl.m].flag.battleground != 0);
@@ -11008,6 +11008,12 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd)
mail->clear(sd);
clif->maptypeproperty2(&sd->bl, SELF);
+ if (((battle_config.display_rate_messages & 0x1) != 0 && first_time)
+ || ((battle_config.display_rate_messages & 0x2) != 0 && !first_time && change_map)
+ || (battle_config.display_rate_messages & 0x4) != 0) {
+ clif->show_modifiers(sd);
+ }
+
// Init guild aura.
if (sd->state.gmaster_flag != 0) {
guild->aura_refresh(sd, GD_LEADERSHIP, guild->checkskill(sd->guild, GD_LEADERSHIP));