[10641] Fixed use item dynamic/item proto flags.

* List its independelty. Each from this 2 fields have own flags. Cleanup lists.
* Not copy proto flags to item flags update field. This fix heroic item versions
  show in client in result mixed use ITEM_DYNFLAG_WRAPPED (0x8) with ITEM_FLAG_HEROIC (0x8)
* Update uses to proto case use for some cases where before wrongly has been used item dyn.flags
* For ITEM_DYNFLAG_UNLOCKED (0x4) set for item at unlock and check for prevent re-unlocking.
  This mostly for future case when will be implemented partly loting items support.
* For ITEM_FLAG_LOOTABLE (0x4) check loot absent or conflicting setting with containers/casted at use items.
  Report wrong cases art loading.
* Better check related loot tables content using ITEM_FLAG_PROSPECTABLE and ITEM_FLAG_MILLABLE
This commit is contained in:
VladimirMangos 2010-10-24 20:31:50 +04:00
parent d53fe93e9d
commit 46d740bbf4
17 changed files with 208 additions and 103 deletions

View file

@ -262,7 +262,7 @@ void WorldSession::HandleDestroyItemOpcode( WorldPacket & recv_data )
}
// checked at client side and not have server side appropriate error output
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_INDESTRUCTIBLE))
if (pItem->GetProto()->Flags & ITEM_FLAG_INDESTRUCTIBLE)
{
_player->SendEquipError( EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL );
return;
@ -777,10 +777,10 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid)
continue;
// race wrong item skip always
if ((pProto->Flags2 & ITEM_FLAGS2_HORDE_ONLY) && _player->GetTeam() != HORDE)
if ((pProto->Flags2 & ITEM_FLAG2_HORDE_ONLY) && _player->GetTeam() != HORDE)
continue;
if ((pProto->Flags2 & ITEM_FLAGS2_ALLIANCE_ONLY) && _player->GetTeam() != ALLIANCE)
if ((pProto->Flags2 & ITEM_FLAG2_ALLIANCE_ONLY) && _player->GetTeam() != ALLIANCE)
continue;
if ((pProto->AllowableRace & _player->getRaceMask()) == 0)
@ -790,7 +790,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid)
++count;
// reputation discount
uint32 price = (crItem->ExtendedCost == 0 || pProto->Flags2 & ITEM_FLAGS2_EXT_COST_REQUIRES_GOLD) ? uint32(floor(pProto->BuyPrice * discountMod)) : 0;
uint32 price = (crItem->ExtendedCost == 0 || pProto->Flags2 & ITEM_FLAG2_EXT_COST_REQUIRES_GOLD) ? uint32(floor(pProto->BuyPrice * discountMod)) : 0;
data << uint32(vendorslot +1); // client size expected counting from 1
data << uint32(crItem->item);
@ -1111,7 +1111,8 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
return;
}
if (!gift->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPER))// cheating: non-wrapper wrapper
// cheating: non-wrapper wrapper (all empty wrappers is stackable)
if (!(gift->GetProto()->Flags & ITEM_FLAG_WRAPPER) || gift->GetMaxStackCount() == 1)
{
_player->SendEquipError( EQUIP_ERR_ITEM_NOT_FOUND, gift, NULL );
return;
@ -1137,7 +1138,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
return;
}
if (!item->GetGuidValue(ITEM_FIELD_GIFTCREATOR).IsEmpty())// HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED);
if (!item->GetGuidValue(ITEM_FIELD_GIFTCREATOR).IsEmpty())// HasFlag(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_WRAPPED);
{
_player->SendEquipError( EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL );
return;
@ -1182,7 +1183,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
case 21830: item->SetEntry(21831); break;
}
item->SetGuidValue(ITEM_FIELD_GIFTCREATOR, _player->GetObjectGuid());
item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED);
item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_WRAPPED);
item->SetState(ITEM_CHANGED, _player);
if(item->GetState() == ITEM_NEW) // save new item, to have alway for `character_gifts` record in `item_instance`
@ -1281,7 +1282,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
ItemPrototype const* iGemProto = Gems[i]->GetProto();
// unique item (for new and already placed bit removed enchantments
if (iGemProto->Flags & ITEM_FLAGS_UNIQUE_EQUIPPED)
if (iGemProto->Flags & ITEM_FLAG_UNIQUE_EQUIPPED)
{
for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
{
@ -1438,7 +1439,7 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data)
return;
}
if(!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE))
if(!(item->GetProto()->Flags & ITEM_FLAG_REFUNDABLE))
{
DEBUG_LOG("Item refund: item not refundable!");
return;