[10206] Implement ITEM_FLAGS2_HORDE_ONLY and ITEM_FLAGS2_ALLIANCE_ONLY

* Check item_template data
* Check at equip/use
* Skip at loot if not compatible
* Skip in vendor list if not compatible
This commit is contained in:
VladimirMangos 2010-07-17 07:00:10 +04:00
parent f2e3881a77
commit 9882bc811f
7 changed files with 84 additions and 52 deletions

View file

@ -757,12 +757,26 @@ void WorldSession::SendListInventory(uint64 vendorguid)
for(uint8 vendorslot = 0; vendorslot < numitems; ++vendorslot )
{
if(VendorItem const* crItem = vItems->GetItem(vendorslot))
if (VendorItem const* crItem = vItems->GetItem(vendorslot))
{
if(ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(crItem->item))
if (ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(crItem->item))
{
if((pProto->AllowableClass & _player->getClassMask()) == 0 && pProto->Bonding == BIND_WHEN_PICKED_UP && !_player->isGameMaster())
continue;
if (!_player->isGameMaster())
{
// class wrong item skip only for bindable case
if ((pProto->AllowableClass & _player->getClassMask()) == 0 && pProto->Bonding == BIND_WHEN_PICKED_UP)
continue;
// race wrong item skip always
if ((pProto->Flags2 & ITEM_FLAGS2_HORDE_ONLY) && _player->GetTeam() != HORDE)
continue;
if ((pProto->Flags2 & ITEM_FLAGS2_ALLIANCE_ONLY) && _player->GetTeam() != ALLIANCE)
continue;
if ((pProto->AllowableRace & _player->getRaceMask()) == 0)
continue;
}
++count;