mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 07:06:23 +00:00
feat(Core/Guild): Allow to limit the amount of members within a guild (#17697)
* feat(Core/Guild): Allow to limit the amount of members within a guild * Update Guild.cpp * Update Guild.cpp * Update Guild.cpp * Update Guild.cpp * improve message to player
This commit is contained in:
@@ -3356,6 +3356,13 @@ Guild.BankTabCost3 = 10000000
|
||||
Guild.BankTabCost4 = 25000000
|
||||
Guild.BankTabCost5 = 50000000#
|
||||
|
||||
#
|
||||
# Guild.MemberLimit
|
||||
# Description: Do not allow inviting new players to the guild if the member limit is met or exceeded.
|
||||
# Default: 0 - Disabled
|
||||
|
||||
Guild.MemberLimit = 0
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
|
||||
@@ -1440,6 +1440,14 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name)
|
||||
if (pInvitee->GetSocial()->HasIgnore(player->GetGUID()))
|
||||
return;
|
||||
|
||||
uint32 memberLimit = sConfigMgr->GetOption<uint32>("Guild.MemberLimit", 0);
|
||||
if (memberLimit > 0 && player->GetGuild()->GetMemberCount() >= memberLimit)
|
||||
{
|
||||
ChatHandler(player->GetSession()).PSendSysMessage("Your guild has reached the maximum amount of members (%u). You cannot send another invite until the guild member count is lower.", memberLimit);
|
||||
SendCommandResult(session, GUILD_COMMAND_INVITE, ERR_GUILD_INTERNAL, name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeamId(true) != player->GetTeamId(true))
|
||||
{
|
||||
SendCommandResult(session, GUILD_COMMAND_INVITE, ERR_GUILD_NOT_ALLIED, name);
|
||||
|
||||
Reference in New Issue
Block a user