mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Use PVPDificulty.dbc for bg/arena bracket selection (levels and difficulty)
This commit is contained in:
parent
75c81894b2
commit
63709fdc49
15 changed files with 167 additions and 98 deletions
|
|
@ -1462,7 +1462,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed )
|
|||
SendUpdate();
|
||||
}
|
||||
|
||||
uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot)
|
||||
uint32 Group::CanJoinBattleGroundQueue(BattleGround const* bgOrTemplate, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot)
|
||||
{
|
||||
// check for min / max count
|
||||
uint32 memberscount = GetMembersCount();
|
||||
|
|
@ -1477,7 +1477,10 @@ uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGround
|
|||
if(!reference)
|
||||
return BG_JOIN_ERR_OFFLINE_MEMBER;
|
||||
|
||||
BattleGroundBracketId bracket_id = reference->GetBattleGroundBracketIdFromLevel();
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(),reference->getLevel());
|
||||
if(!bracketEntry)
|
||||
return BG_JOIN_ERR_OFFLINE_MEMBER;
|
||||
|
||||
uint32 arenaTeamId = reference->GetArenaTeamId(arenaSlot);
|
||||
uint32 team = reference->GetTeam();
|
||||
|
||||
|
|
@ -1492,7 +1495,8 @@ uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGround
|
|||
if(member->GetTeam() != team)
|
||||
return BG_JOIN_ERR_MIXED_FACTION;
|
||||
// not in the same battleground level braket, don't let join
|
||||
if(member->GetBattleGroundBracketIdFromLevel() != bracket_id)
|
||||
PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId,member->getLevel());
|
||||
if(memberBracketEntry != bracketEntry)
|
||||
return BG_JOIN_ERR_MIXED_LEVELS;
|
||||
// don't let join rated matches if the arena team id doesn't match
|
||||
if(isRated && member->GetArenaTeamId(arenaSlot) != arenaTeamId)
|
||||
|
|
@ -1501,7 +1505,7 @@ uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGround
|
|||
if(member->InBattleGroundQueueForBattleGroundQueueType(bgQueueTypeId))
|
||||
return BG_JOIN_ERR_GROUP_MEMBER_ALREADY_IN_QUEUE;
|
||||
// check for deserter debuff in case not arena queue
|
||||
if(bgTypeId != BATTLEGROUND_AA && !member->CanJoinToBattleground())
|
||||
if(bgOrTemplate->GetTypeID() != BATTLEGROUND_AA && !member->CanJoinToBattleground())
|
||||
return BG_JOIN_ERR_GROUP_DESERTER;
|
||||
// check if member can join any more battleground queues
|
||||
if(!member->HasFreeBattleGroundQueueId())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue