summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-10-21 00:15:29 +0200
committerGitHub <noreply@github.com>2017-10-21 00:15:29 +0200
commit53b6fbfbcad4624f3efa096cb6ee1a785113dc4b (patch)
tree66956180b2b4624ae6fb2a01cbdcf7f586a58897
parent04f10f3b61044a78e9b3741cecbbdb8cf3a21236 (diff)
parent4bde7760f12752a385ff065c8d83bc66765b93b8 (diff)
downloadhercules-53b6fbfbcad4624f3efa096cb6ee1a785113dc4b.tar.gz
hercules-53b6fbfbcad4624f3efa096cb6ee1a785113dc4b.tar.bz2
hercules-53b6fbfbcad4624f3efa096cb6ee1a785113dc4b.tar.xz
hercules-53b6fbfbcad4624f3efa096cb6ee1a785113dc4b.zip
Merge pull request #1812 from mekolat/partyleader2
add option to restrict party leader change to same map
-rw-r--r--conf/map/battle/party.conf6
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h3
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/party.c5
5 files changed, 15 insertions, 1 deletions
diff --git a/conf/map/battle/party.conf b/conf/map/battle/party.conf
index 07a0bdaea..a38321806 100644
--- a/conf/map/battle/party.conf
+++ b/conf/map/battle/party.conf
@@ -41,6 +41,12 @@ party_update_interval: 1000
// 1: Athena - bar is updated with the party map dots (up to 1 second delay)
party_hp_mode: 0
+// When changing party leader, should the new leader be in the same map
+// as the current leader. (Note 1)
+// true: Aegis - They must be in the same map
+// false: Athena - They can be in different maps
+party_change_leader_same_map: true
+
// When 'Party Share' item sharing is enabled in a party,
// announce in the party which party-member received the item and what's he received? (Note 1)
show_party_share_picker: true
diff --git a/src/map/battle.c b/src/map/battle.c
index 2861599b8..9c6e67694 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7096,6 +7096,7 @@ static const struct battle_data {
{ "vending_over_max", &battle_config.vending_over_max, 1, 0, 1, },
{ "show_steal_in_same_party", &battle_config.show_steal_in_same_party, 0, 0, 1, },
{ "party_hp_mode", &battle_config.party_hp_mode, 0, 0, 1, },
+ { "party_change_leader_same_map", &battle_config.party_change_leader_same_map, 0, 0, 1, },
{ "show_party_share_picker", &battle_config.party_show_share_picker, 1, 0, 1, },
{ "show_picker_item_type", &battle_config.show_picker_item_type, 112, 0, INT_MAX, },
{ "party_update_interval", &battle_config.party_update_interval, 1000, 100, INT_MAX, },
diff --git a/src/map/battle.h b/src/map/battle.h
index e6129ca7c..4a63887c4 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -298,6 +298,7 @@ struct Battle_Config {
int show_steal_in_same_party;
int party_share_type;
int party_hp_mode;
+ int party_change_leader_same_map;
int party_show_share_picker;
int show_picker_item_type;
int attack_attr_none;
@@ -545,7 +546,7 @@ struct Battle_Config {
int player_warp_keep_direction;
int atcommand_levelup_events; // Enable atcommands trigger level up events for NPCs
-
+
int bow_unequip_arrow;
int max_summoner_parameter; // Summoner Max Stats
diff --git a/src/map/clif.h b/src/map/clif.h
index ac8cc8d35..73cb72128 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -385,6 +385,7 @@ enum clif_messages {
MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use
MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found.
MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found.
+ MSG_PARTY_LEADER_SAMEMAP = 0x82e, //< It is only possible to change the party leader while on the same map.
};
/**
diff --git a/src/map/party.c b/src/map/party.c
index 26b4bae8b..a4a7e6dca 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -731,6 +731,11 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts
return false;
}
+ if (battle_config.party_change_leader_same_map && sd->bl.m != tsd->bl.m) {
+ clif->msgtable(sd, MSG_PARTY_LEADER_SAMEMAP); // It is only possible to change the party leader while on the same map.
+ return false;
+ }
+
if( map->list[sd->bl.m].flag.partylock ) {
clif->message(sd->fd, msg_sd(sd,287)); // You cannot change party leaders in this map.
return false;