summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 03:02:19 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-06-22 03:02:19 +0200
commit527c5a20676780954567d6a791f240933afde7f2 (patch)
tree5e8e239d25b300afeab738ecd980eb6703a5245b
parent7851f5044beba57396c8889df85401c944b415e1 (diff)
downloadhercules-527c5a20676780954567d6a791f240933afde7f2.tar.gz
hercules-527c5a20676780954567d6a791f240933afde7f2.tar.bz2
hercules-527c5a20676780954567d6a791f240933afde7f2.tar.xz
hercules-527c5a20676780954567d6a791f240933afde7f2.zip
Add battle flag for configuration messages display
-rw-r--r--conf/map/battle/client.conf18
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c50
4 files changed, 51 insertions, 19 deletions
diff --git a/conf/map/battle/client.conf b/conf/map/battle/client.conf
index aad4d7652..722019fa7 100644
--- a/conf/map/battle/client.conf
+++ b/conf/map/battle/client.conf
@@ -210,3 +210,21 @@ drop_connection_on_quit: false
// 0x4 - Display rate modifier messages upon teleporting (regardless of changing maps).
// Default: 0x1 (Official behavior.)
display_rate_messages: 0x1
+
+// When to display the configuration messages and which? (Note 3)
+//
+// Flags for when to display the configuration messages:
+// 0x000 - Never display configuration messages.
+// 0x001 - Display configuration messages upon login. (Default. Should always be set.)
+// 0x002 - Display configuration messages upon map change.
+// 0x004 - Display configuration messages upon teleporting (regardless of changing maps).
+//
+// Flags for which configuration messages are displayed:
+// 0x010 - Character's party invitation state. (Default.)
+// 0x020 - Character's view equipment state. (Default.)
+// 0x040 - Character's Urgent Call state. (Default.)
+// 0x080 - Character's pet auto-feed state. (Default.)
+// 0x100 - Character's homunculus auto-feed state. (Default.)
+//
+// Default: 0x1F1 (Official behavior.)
+display_config_messages: 0x1F1
diff --git a/src/map/battle.c b/src/map/battle.c
index 7d85bf645..dc2535052 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7432,6 +7432,7 @@ static const struct battle_data {
{ "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, },
+ { "display_config_messages", &battle_config.display_config_messages, 0x1F1, 0, 0x1F7, },
{ "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 a116506dd..5a039a8ed 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -591,6 +591,7 @@ struct Battle_Config {
int drop_connection_on_quit;
int display_rate_messages;
+ int display_config_messages;
int enable_refinery_ui;
int replace_refine_npcs;
diff --git a/src/map/clif.c b/src/map/clif.c
index 4a34b1f0d..3f9cc2659 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10948,25 +10948,6 @@ 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);
- clif->equpcheckbox(sd);
-#endif
-
-#if PACKETVER_MAIN_NUM >= 20171025 || PACKETVER_RE_NUM >= 20170920
- clif->zc_config(sd, CZ_CONFIG_CALL, sd->status.allow_call);
-
- if (sd->pd != NULL)
- clif->zc_config(sd, CZ_CONFIG_PET_AUTOFEEDING, sd->pd->pet.autofeed);
- else
- clif->zc_config(sd, CZ_CONFIG_PET_AUTOFEEDING, false);
-
- if (sd->hd != NULL)
- clif->zc_config(sd, CZ_CONFIG_HOMUNCULUS_AUTOFEEDING, sd->hd->homunculus.autofeed);
- else
- clif->zc_config(sd, CZ_CONFIG_HOMUNCULUS_AUTOFEEDING, false);
-#endif
-
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);
@@ -11015,6 +10996,37 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd)
mail->clear(sd);
clif->maptypeproperty2(&sd->bl, SELF);
+ if (((battle_config.display_config_messages & 0x1) != 0 && first_time)
+ || ((battle_config.display_config_messages & 0x2) != 0 && !first_time && change_map)
+ || (battle_config.display_config_messages & 0x4) != 0) {
+#if PACKETVER >= 20070918
+ if ((battle_config.display_config_messages & 0x10) != 0)
+ clif->partyinvitationstate(sd);
+
+ if ((battle_config.display_config_messages & 0x20) != 0)
+ clif->equpcheckbox(sd);
+#endif
+
+#if PACKETVER_MAIN_NUM >= 20171025 || PACKETVER_RE_NUM >= 20170920
+ if ((battle_config.display_config_messages & 0x40) != 0)
+ clif->zc_config(sd, CZ_CONFIG_CALL, sd->status.allow_call);
+
+ if ((battle_config.display_config_messages & 0x80) != 0) {
+ if (sd->pd != NULL)
+ clif->zc_config(sd, CZ_CONFIG_PET_AUTOFEEDING, sd->pd->pet.autofeed);
+ else
+ clif->zc_config(sd, CZ_CONFIG_PET_AUTOFEEDING, false);
+ }
+
+ if ((battle_config.display_config_messages & 0x100) != 0) {
+ if (sd->hd != NULL)
+ clif->zc_config(sd, CZ_CONFIG_HOMUNCULUS_AUTOFEEDING, sd->hd->homunculus.autofeed);
+ else
+ clif->zc_config(sd, CZ_CONFIG_HOMUNCULUS_AUTOFEEDING, false);
+ }
+#endif
+ }
+
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) {