summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-03-16 14:28:16 +0100
committerGitHub <noreply@github.com>2017-03-16 14:28:16 +0100
commit8a6625c2e0b1a426dca880ef3ed610a2c34a9f31 (patch)
tree88aa4e9d29a5c8697f115b0abec440caed134361
parent07639c861a7326c4ae022a6fedc161941f69e651 (diff)
parent880ea659c9ec5241579281c8f9bff256d3d42eac (diff)
downloadhercules-8a6625c2e0b1a426dca880ef3ed610a2c34a9f31.tar.gz
hercules-8a6625c2e0b1a426dca880ef3ed610a2c34a9f31.tar.bz2
hercules-8a6625c2e0b1a426dca880ef3ed610a2c34a9f31.tar.xz
hercules-8a6625c2e0b1a426dca880ef3ed610a2c34a9f31.zip
Merge pull request #1630 from Emistry/fix_mvp_message
Fixed MVP exp message issue for clients 2013-12-23cRagexe and newer
-rw-r--r--conf/map/battle/client.conf5
-rw-r--r--conf/messages.conf3
-rw-r--r--src/map/battle.c8
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/clif.h1
6 files changed, 26 insertions, 0 deletions
diff --git a/conf/map/battle/client.conf b/conf/map/battle/client.conf
index 15fa71faf..c3409b578 100644
--- a/conf/map/battle/client.conf
+++ b/conf/map/battle/client.conf
@@ -159,3 +159,8 @@ client_accept_chatdori: 0
// A value of 100 (allowing 100% blank pixels) disables this check.
// NOTE: Enabling this option slightly degrades performance.
client_emblem_max_blank_percent: 100
+
+// Show the MVP EXP reward message for clients 2013-12-23cRagexe and newer? (Note 1)
+// kRO removed the packet and this re-enables the message.
+// Official: false.
+mvp_exp_reward_message: false
diff --git a/conf/messages.conf b/conf/messages.conf
index a97a755f7..efc8d8a36 100644
--- a/conf/messages.conf
+++ b/conf/messages.conf
@@ -612,6 +612,9 @@
//670-855 FREE (please start using from the top if you need, leave the 670+ range for new jobs)
+// MVP exp message issue clients 2013-12-23cRagexe and newer.
+855: Congratulations! You are the MVP! Your reward EXP Points are %u !!
+
// MvP Tomb
856: Tomb
857: [ ^EE0000%s^000000 ]
diff --git a/src/map/battle.c b/src/map/battle.c
index 64fda033f..77bb99730 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7321,6 +7321,7 @@ static const struct battle_data {
{ "player_warp_keep_direction", &battle_config.player_warp_keep_direction, 0, 0, 1, },
{ "atcommand_levelup_events", &battle_config.atcommand_levelup_events, 0, 0, 1, },
{ "max_summoner_parameter", &battle_config.max_summoner_parameter, 120, 10, 10000, },
+ { "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
@@ -7599,6 +7600,13 @@ void battle_adjust_conf(void) {
}
#endif
+#if PACKETVER < 20131223
+ if (battle_config.mvp_exp_reward_message) {
+ ShowWarning("conf/map/battle/client.conf MVP EXP reward message is enabled but it requires PACKETVER 2013-12-23 or newer, disabling...\n");
+ battle_config.mvp_exp_reward_message = 0;
+ }
+#endif
+
#ifndef CELL_NOSTACK
if (battle_config.custom_cell_stack_limit != 1)
ShowWarning("Battle setting 'custom_cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support.\n");
diff --git a/src/map/battle.h b/src/map/battle.h
index c55d5ef19..b7bde1aa9 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -547,6 +547,7 @@ struct Battle_Config {
int atcommand_levelup_events; // Enable atcommands trigger level up events for NPCs
int max_summoner_parameter; // Summoner Max Stats
+ int mvp_exp_reward_message;
};
/* criteria for battle_config.idletime_critera */
diff --git a/src/map/clif.c b/src/map/clif.c
index 6897c357a..597a890ae 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7256,6 +7256,13 @@ void clif_mvp_item(struct map_session_data *sd,int nameid)
/// 010b <exp>.L
void clif_mvp_exp(struct map_session_data *sd, unsigned int exp)
{
+#if PACKETVER >= 20131223 // Kro removed this packet [Napster]
+ if (battle_config.mvp_exp_reward_message) {
+ char e_msg[CHAT_SIZE_MAX];
+ sprintf(e_msg, msg_txt(855), exp);
+ clif->messagecolor_self(sd->fd, COLOR_CYAN, e_msg); // Congratulations! You are the MVP! Your reward EXP Points are %u !!
+ }
+#else
int fd;
nullpo_retv(sd);
@@ -7265,6 +7272,7 @@ void clif_mvp_exp(struct map_session_data *sd, unsigned int exp)
WFIFOW(fd,0)=0x10b;
WFIFOL(fd,2)=cap_value(exp,0,INT32_MAX);
WFIFOSET(fd,packet_len(0x10b));
+#endif
}
/// Dropped MVP item reward message (ZC_THROW_MVPITEM).
diff --git a/src/map/clif.h b/src/map/clif.h
index aefba5974..c3a42372a 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -65,6 +65,7 @@ struct view_data;
#define MAX_ROULETTE_COLUMNS 9 /** client-defined value **/
#define RGB2BGR(c) (((c) & 0x0000FF) << 16 | ((c) & 0x00FF00) | ((c) & 0xFF0000) >> 16)
+#define COLOR_CYAN 0x00ffffU
#define COLOR_RED 0xff0000U
#define COLOR_GREEN 0x00ff00U
#define COLOR_WHITE 0xffffffU