From 0375c893471a3f0de17bd03fc71d7c35ceb61bd4 Mon Sep 17 00:00:00 2001 From: LordJZ Date: Wed, 20 Jan 2010 11:41:16 +0300 Subject: [PATCH] [9221] Implement minimal area team size for some items arena rating requirements. Signed-off-by: VladimirMangos --- src/game/DBCStructure.h | 2 +- src/game/DBCfmt.h | 2 +- src/game/Player.cpp | 6 +++--- src/game/Player.h | 2 +- src/shared/revision_nr.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index a3ae27ed9..5fc061343 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1007,7 +1007,7 @@ struct ItemExtendedCostEntry uint32 ID; // 0 extended-cost entry id uint32 reqhonorpoints; // 1 required honor points uint32 reqarenapoints; // 2 required arena points - //uint32 unk1; // 4 probably indicates new 2v2 bracket restrictions + uint32 reqarenaslot; // 4 arena slot restrctions (min slot value) uint32 reqitem[5]; // 5-8 required item id uint32 reqitemcount[5]; // 9-13 required count of 1st item uint32 reqpersonalarenarating; // 14 required personal arena rating diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index a71e9dee1..104140447 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -65,7 +65,7 @@ const char Itemfmt[]="niiiiiii"; const char ItemBagFamilyfmt[]="nxxxxxxxxxxxxxxxxx"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; //const char ItemCondExtCostsEntryfmt[]="xiii"; -const char ItemExtendedCostEntryfmt[]="niixiiiiiiiiiiix"; +const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiiix"; const char ItemLimitCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxix"; const char ItemRandomPropertiesfmt[]="nxiiiiissssssssssssssssx"; const char ItemRandomSuffixfmt[]="nssssssssssssssssxxiiiiiiiiii"; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 3e6900450..b76e628e4 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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))) { diff --git a/src/game/Player.h b/src/game/Player.h index f0edc3901..9cd562e88 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1943,7 +1943,7 @@ class MANGOS_DLL_SPEC Player : public Unit uint32 GetArenaPoints() { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); } void ModifyHonorPoints( int32 value ); void ModifyArenaPoints( int32 value ); - uint32 GetMaxPersonalArenaRatingRequirement(); + uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot); //End of PvP System diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3b91a6abf..7989912be 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9220" + #define REVISION_NR "9221" #endif // __REVISION_NR_H__