[9221] Implement minimal area team size for some items arena rating requirements.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
LordJZ 2010-01-20 11:41:16 +03:00 committed by VladimirMangos
parent a20a0a9d5c
commit 0375c89347
5 changed files with 7 additions and 7 deletions

View file

@ -17927,7 +17927,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
}
// check for personal arena rating requirement
if( GetMaxPersonalArenaRatingRequirement() < iece->reqpersonalarenarating )
if( GetMaxPersonalArenaRatingRequirement(iece->reqarenaslot) < iece->reqpersonalarenarating )
{
// probably not the proper equip err
SendEquipError(EQUIP_ERR_CANT_EQUIP_RANK,NULL,NULL);
@ -18041,13 +18041,13 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
return crItem->maxcount != 0;
}
uint32 Player::GetMaxPersonalArenaRatingRequirement()
uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot)
{
// returns the maximal personal arena rating that can be used to purchase items requiring this condition
// the personal rating of the arena team must match the required limit as well
// so return max[in arenateams](min(personalrating[teamtype], teamrating[teamtype]))
uint32 max_personal_rating = 0;
for(int i = 0; i < MAX_ARENA_SLOT; ++i)
for(int i = minarenaslot; i < MAX_ARENA_SLOT; ++i)
{
if(ArenaTeam * at = sObjectMgr.GetArenaTeamById(GetArenaTeamId(i)))
{