[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

@ -1809,6 +1809,25 @@ void ObjectMgr::LoadItemPrototypes()
const_cast<ItemPrototype*>(proto)->Quality = ITEM_QUALITY_NORMAL;
}
if (proto->Flags2 & ITEM_FLAGS2_HORDE_ONLY)
{
if (FactionEntry const* faction = sFactionStore.LookupEntry(HORDE))
if ((proto->AllowableRace & faction->BaseRepRaceMask[0]) == 0)
sLog.outErrorDb("Item (Entry: %u) have in `AllowableRace` races (%u) only not compatible with ITEM_FLAGS2_HORDE_ONLY (%u) in Flags field, item any way will can't be equipped or use by this races.",
i, proto->AllowableRace, ITEM_FLAGS2_HORDE_ONLY);
if (proto->Flags2 & ITEM_FLAGS2_ALLIANCE_ONLY)
sLog.outErrorDb("Item (Entry: %u) have in `Flags2` flags ITEM_FLAGS2_ALLIANCE_ONLY (%u) and ITEM_FLAGS2_HORDE_ONLY (%u) in Flags field, this is wrong combination.",
i, ITEM_FLAGS2_ALLIANCE_ONLY, ITEM_FLAGS2_HORDE_ONLY);
}
else if (proto->Flags2 & ITEM_FLAGS2_ALLIANCE_ONLY)
{
if (FactionEntry const* faction = sFactionStore.LookupEntry(ALLIANCE))
if ((proto->AllowableRace & faction->BaseRepRaceMask[0]) == 0)
sLog.outErrorDb("Item (Entry: %u) have in `AllowableRace` races (%u) only not compatible with ITEM_FLAGS2_ALLIANCE_ONLY (%u) in Flags field, item any way will can't be equipped or use by this races.",
i, proto->AllowableRace, ITEM_FLAGS2_ALLIANCE_ONLY);
}
if(proto->BuyCount <= 0)
{
sLog.outErrorDb("Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).",i,proto->BuyCount);