fix(Core/Groups): Level restriction on allowing raid groups (#12110)
This commit is contained in:
@@ -3588,6 +3588,16 @@ Calculate.Creature.Zone.Area.Data = 0
|
|||||||
|
|
||||||
Calculate.Gameoject.Zone.Area.Data = 0
|
Calculate.Gameoject.Zone.Area.Data = 0
|
||||||
|
|
||||||
|
#
|
||||||
|
# Group.Raid.LevelRestriction
|
||||||
|
#
|
||||||
|
# The Group members need to the same, or higher level than the specified value.
|
||||||
|
# Minimum level is 10.
|
||||||
|
# Default: 10
|
||||||
|
#
|
||||||
|
|
||||||
|
Group.Raid.LevelRestriction = 10
|
||||||
|
|
||||||
#
|
#
|
||||||
# LFG.Location.All
|
# LFG.Location.All
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "Group.h"
|
#include "Group.h"
|
||||||
#include "Battleground.h"
|
#include "Battleground.h"
|
||||||
#include "BattlegroundMgr.h"
|
#include "BattlegroundMgr.h"
|
||||||
|
#include "Config.h"
|
||||||
#include "DatabaseEnv.h"
|
#include "DatabaseEnv.h"
|
||||||
#include "GameTime.h"
|
#include "GameTime.h"
|
||||||
#include "GroupMgr.h"
|
#include "GroupMgr.h"
|
||||||
@@ -278,6 +279,16 @@ void Group::ConvertToLFG(bool restricted /*= true*/)
|
|||||||
SendUpdate();
|
SendUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Group::CheckLevelForRaid()
|
||||||
|
{
|
||||||
|
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||||
|
if (Player* player = ObjectAccessor::FindPlayer(citr->guid))
|
||||||
|
if (player->getLevel() < sConfigMgr->GetOption<int32>("Group.Raid.LevelRestriction", 10))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void Group::ConvertToRaid()
|
void Group::ConvertToRaid()
|
||||||
{
|
{
|
||||||
m_groupType = GroupType(m_groupType | GROUPTYPE_RAID);
|
m_groupType = GroupType(m_groupType | GROUPTYPE_RAID);
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ public:
|
|||||||
uint8 GetMemberGroup(ObjectGuid guid) const;
|
uint8 GetMemberGroup(ObjectGuid guid) const;
|
||||||
|
|
||||||
void ConvertToLFG(bool restricted = true);
|
void ConvertToLFG(bool restricted = true);
|
||||||
|
bool CheckLevelForRaid();
|
||||||
void ConvertToRaid();
|
void ConvertToRaid();
|
||||||
|
|
||||||
void SetBattlegroundGroup(Battleground* bg);
|
void SetBattlegroundGroup(Battleground* bg);
|
||||||
|
|||||||
@@ -621,6 +621,12 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& /*recvData*/)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/** error handling **/
|
/** error handling **/
|
||||||
|
if (group->CheckLevelForRaid())
|
||||||
|
{
|
||||||
|
SendPartyResult(PARTY_OP_INVITE, "", ERR_RAID_DISALLOWED_BY_LEVEL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!group->IsLeader(GetPlayer()->GetGUID()) || group->GetMembersCount() < 2 || group->isLFGGroup()) // pussywizard: not allowed for lfg groups, it is either raid from the beginning or not!
|
if (!group->IsLeader(GetPlayer()->GetGUID()) || group->GetMembersCount() < 2 || group->isLFGGroup()) // pussywizard: not allowed for lfg groups, it is either raid from the beginning or not!
|
||||||
return;
|
return;
|
||||||
/********************/
|
/********************/
|
||||||
|
|||||||
Reference in New Issue
Block a user