Cleaned up item flags: separated item proto flags and item field flags
Implemented use of: ITEM_PROTO_FLAG_PROSPECTABLE and ITEM_PROTO_FLAG_MILLABLE now checked instead of bag family mask ITEM_PROTO_FLAG_SMART_LOOT for profession recipes, player has to have skillline and not know the recipe ITEM_PROTO_FLAG_OPENABLE item has to have it set to use item_loot_template ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA if this is set item can never be used in arena ITEM_FLAG_UNLOCKED marks unlocked items Simplified BoA check for mail sending Stackable items are no longer refundable Removed useless code that always set ITEM_FIELD_FLAGS equal to proto flags Unlocking items (lockpicking) is now blizzlike --HG-- branch : trunk
This commit is contained in:
@@ -239,7 +239,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (it->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_CONJURED) || it->GetUInt32Value(ITEM_FIELD_DURATION))
|
||||
if (it->GetProto()->Flags & ITEM_PROTO_FLAG_CONJURED || it->GetUInt32Value(ITEM_FIELD_DURATION))
|
||||
{
|
||||
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR);
|
||||
return;
|
||||
|
||||
@@ -263,7 +263,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_INDESTRUCTIBLE))
|
||||
if (pItem->GetProto()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE)
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL);
|
||||
return;
|
||||
@@ -1049,7 +1049,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gift->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPER))// cheating: non-wrapper wrapper
|
||||
if (!(gift->GetProto()->Flags & ITEM_PROTO_FLAG_WRAPPER)) // cheating: non-wrapper wrapper
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, gift, NULL);
|
||||
return;
|
||||
@@ -1120,7 +1120,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
|
||||
case 21830: item->SetEntry(21831); break;
|
||||
}
|
||||
item->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, _player->GetGUID());
|
||||
item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED);
|
||||
item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED);
|
||||
item->SetState(ITEM_CHANGED, _player);
|
||||
|
||||
if (item->GetState() == ITEM_NEW) // save new item, to have alway for `character_gifts` record in `item_instance`
|
||||
@@ -1219,7 +1219,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_PROTO_FLAG_UNIQUE_EQUIPPED)
|
||||
{
|
||||
for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
|
||||
{
|
||||
|
||||
@@ -407,8 +407,7 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
ItemPrototype const* proto = pItem->GetProto();
|
||||
|
||||
// destroy only 5 items from stack in case prospecting and milling
|
||||
if ((proto->BagFamily & (BAG_FAMILY_MASK_MINING_SUPP|BAG_FAMILY_MASK_HERBS)) &&
|
||||
proto->Class == ITEM_CLASS_TRADE_GOODS)
|
||||
if (proto->Flags & (ITEM_PROTO_FLAG_PROSPECTABLE | ITEM_PROTO_FLAG_MILLABLE))
|
||||
{
|
||||
pItem->m_lootGenerated = false;
|
||||
pItem->loot.clear();
|
||||
|
||||
@@ -94,9 +94,16 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
|
||||
}
|
||||
|
||||
// only allow conjured consumable, bandage, poisons (all should have the 2^21 item flag set in DB)
|
||||
if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_FLAGS_USEABLE_IN_ARENA) && pUser->InArena())
|
||||
if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_PROTO_FLAG_USEABLE_IN_ARENA) && pUser->InArena())
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH,pItem,NULL);
|
||||
pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// don't allow items banned in arena
|
||||
if (proto->Flags & ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA && pUser->InArena())
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -209,15 +216,15 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
// required picklocking
|
||||
if (lockInfo->Skill[1] || lockInfo->Skill[0])
|
||||
// was not unlocked yet
|
||||
if (pItem->IsLocked())
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_ITEM_LOCKED, pItem, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED))// wrapped?
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))// wrapped?
|
||||
{
|
||||
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT entry, flags FROM character_gifts WHERE item_guid = '%u'", pItem->GetGUIDLow());
|
||||
if (result)
|
||||
|
||||
@@ -104,7 +104,7 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/)
|
||||
data << uint32(item->GetProto()->DisplayInfoID);// display id
|
||||
data << uint32(item->GetCount()); // stack count
|
||||
// wrapped: hide stats but show giftcreator name
|
||||
data << uint32(item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED) ? 1 : 0);
|
||||
data << uint32(item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED) ? 1 : 0);
|
||||
data << uint64(item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR));
|
||||
// perm. enchantment and gems
|
||||
data << uint32(item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT));
|
||||
|
||||
Reference in New Issue
Block a user