summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-05-29 12:06:46 -0300
committerpanikon <panikon@zoho.com>2014-05-29 12:06:46 -0300
commit407502abc921bb4cf06ff462ab6e2f23a327e950 (patch)
treeeecc5001577d844849330ea6ced79b60d91b961b
parentb7373b6de5b41a4b420741da9ebf0570e36c11c7 (diff)
downloadhercules-407502abc921bb4cf06ff462ab6e2f23a327e950.tar.gz
hercules-407502abc921bb4cf06ff462ab6e2f23a327e950.tar.bz2
hercules-407502abc921bb4cf06ff462ab6e2f23a327e950.tar.xz
hercules-407502abc921bb4cf06ff462ab6e2f23a327e950.zip
Added guild_castle_invite and guild_castle_expulsion to guild.conf, they determine how invite/expel work inside castles during WoE/GvG
See: http://hercules.ws/board/topic/1623-additional-settings-in-guildconf/
-rw-r--r--conf/battle/guild.conf5
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/guild.c30
4 files changed, 28 insertions, 11 deletions
diff --git a/conf/battle/guild.conf b/conf/battle/guild.conf
index a40cbbe3a..91c39fe71 100644
--- a/conf/battle/guild.conf
+++ b/conf/battle/guild.conf
@@ -42,3 +42,8 @@ max_guild_alliance: 3
// Upon changing maps: 1
// Do not re-display: 0 (disabled)
guild_notice_changemap: 2
+
+// Can guild members invite/expel members inside guild castles in WoE/GvG? (Note 1)
+// default: no
+guild_castle_invite: no
+guild_castle_expulsion: no \ No newline at end of file
diff --git a/src/map/battle.c b/src/map/battle.c
index 92f68d433..57302166e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6745,6 +6745,8 @@ static const struct _battle_data {
{ "mon_trans_disable_in_gvg", &battle_config.mon_trans_disable_in_gvg, 0, 0, 1, },
{ "case_sensitive_aegisnames", &battle_config.case_sensitive_aegisnames, 1, 0, 1, },
+ { "guild_castle_invite", &battle_config.guild_castle_invite, 0, 0, 1, },
+ { "guild_castle_expulsion", &battle_config.guild_castle_expulsion, 0, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
diff --git a/src/map/battle.h b/src/map/battle.h
index 0ae18ec30..433dca95f 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -469,6 +469,8 @@ struct Battle_Config {
int mon_trans_disable_in_gvg;
int case_sensitive_aegisnames;
+ int guild_castle_invite;
+ int guild_castle_expulsion;
};
extern struct Battle_Config battle_config;
diff --git a/src/map/guild.c b/src/map/guild.c
index 935cac8c0..042a6e801 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -621,9 +621,12 @@ int guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
return 0;
}
- if( tsd->status.guild_id > 0
- || tsd->guild_invite > 0
- || ((map->agit_flag || map->agit2_flag) && map->list[tsd->bl.m].flag.gvg_castle)
+ if( tsd->status.guild_id > 0
+ || tsd->guild_invite > 0
+ || ( (map->agit_flag || map->agit2_flag)
+ && map->list[tsd->bl.m].flag.gvg_castle
+ && !battle_config.guild_castle_invite
+ )
) {
//Can't invite people inside castles. [Skotlex]
clif->guild_inviteack(sd,0);
@@ -806,10 +809,13 @@ int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int c
return 0;
if( sd->status.account_id != account_id
- || sd->status.char_id != char_id
- || sd->status.guild_id != guild_id
- || ((map->agit_flag || map->agit2_flag) && map->list[sd->bl.m].flag.gvg_castle)
- )
+ || sd->status.char_id != char_id
+ || sd->status.guild_id != guild_id
+ // Can't leave inside castles
+ || ((map->agit_flag || map->agit2_flag)
+ && map->list[sd->bl.m].flag.gvg_castle
+ && !battle_config.guild_castle_expulsion)
+ )
return 0;
intif->guild_leave(sd->status.guild_id, sd->status.account_id, sd->status.char_id,0,mes);
@@ -838,10 +844,12 @@ int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, i
return 0; //Expulsion permission
//Can't leave inside guild castles.
- if ((tsd = map->id2sd(account_id))
- && tsd->status.char_id == char_id
- && ((map->agit_flag || map->agit2_flag) && map->list[tsd->bl.m].flag.gvg_castle)
- )
+ if ((tsd = map->id2sd(account_id))
+ && tsd->status.char_id == char_id
+ && ((map->agit_flag || map->agit2_flag)
+ && map->list[sd->bl.m].flag.gvg_castle
+ && !battle_config.guild_castle_expulsion)
+ )
return 0;
// find the member and perform expulsion