* Implement item limit category (based on changes by VladimirMangos)

* Additional check for HandleAutoBankItemOpcode (thanks to VladimitMangos)
* Properly show empty vendor list for empty item list (author: a1ien)
* More stricted checks for store operations (thanks to VladimirMangos)
* Prevent autostoring of not empty bags (thanks to L1ghtGu4rd)

Changes need testing. Please post bugs on our tracker.

--HG--
branch : trunk
This commit is contained in:
azazel
2010-08-05 22:08:07 +06:00
parent a042b972ed
commit 885fc368fd
20 changed files with 198 additions and 179 deletions
@@ -213,6 +213,19 @@ uint32 Bag::GetItemCount(uint32 item, Item* eItem) const
return count;
}
uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem) const
{
uint32 count = 0;
for (uint32 i = 0; i < GetBagSize(); ++i)
if (Item *pItem = m_bagslot[i])
if (pItem != skipItem)
if (ItemPrototype const *pProto = pItem->GetProto())
if (pProto->ItemLimitCategory == limitCategory)
count += m_bagslot[i]->GetCount();
return count;
}
uint8 Bag::GetSlotByItemGUID(uint64 guid) const
{
for (uint32 i = 0; i < GetBagSize(); ++i)
@@ -45,6 +45,7 @@ class Bag : public Item
Item* GetItemByPos(uint8 slot) const;
uint32 GetItemCount(uint32 item, Item* eItem = NULL) const;
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const;
uint8 GetSlotByItemGUID(uint64 guid) const;
bool IsEmpty() const;
+7 -2
View File
@@ -120,10 +120,15 @@ enum InventoryChangeFailure
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78,
EQUIP_ERR_CANNOT_TRADE_THAT = 79,
EQUIP_ERR_PERSONAL_ARENA_RATING_TOO_LOW = 80,
// no output = 81,
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81,
EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS = 82,
// no output = 83,
// crash client = 84,
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED = 84,
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED = 85,
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86,
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87,
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88,
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED = 89
};
enum BuyFailure
+116 -141
View File
@@ -9483,6 +9483,41 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const
return count;
}
uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem) const
{
uint32 count = 0;
for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
if (pItem != skipItem)
if (ItemPrototype const *pProto = pItem->GetProto())
if (pProto->ItemLimitCategory == limitCategory)
count += pItem->GetCount();
for (int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
if (pItem != skipItem)
if (ItemPrototype const *pProto = pItem->GetProto())
if (pProto->ItemLimitCategory == limitCategory)
count += pItem->GetCount();
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
if (Bag* pBag = (Bag*) GetItemByPos(INVENTORY_SLOT_BAG_0, i))
count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem);
for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i)
if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
if (pItem != skipItem)
if (ItemPrototype const *pProto = pItem->GetProto())
if (pProto->ItemLimitCategory == limitCategory)
count += pItem->GetCount();
for (int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
if (Bag* pBag = (Bag*) GetItemByPos(INVENTORY_SLOT_BAG_0, i))
count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem);
return count;
}
Item* Player::GetItemByGuid(uint64 guid) const
{
for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
@@ -9634,16 +9669,16 @@ bool Player::IsBagPos(uint16 pos)
return false;
}
bool Player::IsValidPos(uint8 bag, uint8 slot)
bool Player::IsValidPos(uint8 bag, uint8 slot, bool explicit_pos)
{
// post selected
if (bag == NULL_BAG)
if (bag == NULL_BAG && !explicit_pos)
return true;
if (bag == INVENTORY_SLOT_BAG_0)
{
// any post selected
if (slot == NULL_SLOT)
if (slot == NULL_SLOT && !explicit_pos)
return true;
// equipment
@@ -9681,7 +9716,7 @@ bool Player::IsValidPos(uint8 bag, uint8 slot)
return false;
// any post selected
if (slot == NULL_SLOT)
if (slot == NULL_SLOT && !explicit_pos)
return true;
return slot < pBag->GetBagSize();
@@ -9695,7 +9730,7 @@ bool Player::IsValidPos(uint8 bag, uint8 slot)
return false;
// any post selected
if (slot == NULL_SLOT)
if (slot == NULL_SLOT && !explicit_pos)
return true;
return slot < pBag->GetBagSize();
@@ -9850,96 +9885,6 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32
return false;
}
uint8 Player::CountItemWithLimitCategory(uint32 limitCategory, Item* skipItem) const
{
uint8 tempcount = 0;
for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
{
Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (!pItem)
continue;
if (pItem == skipItem)
continue;
ItemPrototype const *pProto = pItem->GetProto();
if (pProto && pProto->ItemLimitCategory == limitCategory)
tempcount += pItem->GetCount();
}
for (int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
{
Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (!pItem)
continue;
if (pItem == skipItem)
continue;
ItemPrototype const *pProto = pItem->GetProto();
if (pProto && pProto->ItemLimitCategory == limitCategory)
tempcount += pItem->GetCount();
}
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (!pBag)
continue;
for (uint32 j = 0; j < pBag->GetBagSize(); ++j)
{
Item *pItem = GetItemByPos(i, j);
if (!pItem)
continue;
if (pItem == skipItem)
continue;
if (pItem->GetProto()->ItemLimitCategory == limitCategory)
tempcount += pItem->GetCount();
}
}
for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i)
{
Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (!pItem)
continue;
if (pItem == skipItem)
continue;
ItemPrototype const *pProto = pItem->GetProto();
if (pProto && pProto->ItemLimitCategory == limitCategory)
tempcount += pItem->GetCount();
}
for (int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
{
Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (!pBag)
continue;
for (uint32 j = 0; j < pBag->GetBagSize(); ++j)
{
Item *pItem = GetItemByPos(i, j);
if (!pItem)
continue;
if (pItem == skipItem)
continue;
if (pItem->GetProto()->ItemLimitCategory == limitCategory)
tempcount += pItem->GetCount();
}
}
return tempcount;
}
uint8 Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count) const
{
ItemPrototype const *pProto = objmgr.GetItemPrototype(entry);
@@ -9957,30 +9902,37 @@ uint8 Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem,
if (pProto->MaxCount <= 0 && pProto->ItemLimitCategory == 0 || pProto->MaxCount == 2147483647)
return EQUIP_ERR_OK;
uint32 curcount;
if (pProto->ItemLimitCategory)
curcount = CountItemWithLimitCategory(pProto->ItemLimitCategory,pItem);
else
curcount = GetItemCount(pProto->ItemId,true,pItem);
if ((curcount + count > uint32(pProto->MaxCount)) && !(pProto->ItemLimitCategory))
if (pProto->MaxCount > 0)
{
if (no_space_count)
*no_space_count = count +curcount - pProto->MaxCount;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
uint32 curcount = GetItemCount(pProto->ItemId, true, pItem);
if (curcount + count > uint32(pProto->MaxCount))
{
if (no_space_count)
*no_space_count = count + curcount - pProto->MaxCount;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
}
if (pProto->ItemLimitCategory && pProto->Class != ITEM_CLASS_GEM) // gem have equip check (maybe sort by bonding?)
// check unique-equipped limit
if (pProto->ItemLimitCategory)
{
ItemLimitCategoryEntry const* limitEntry = sItemLimitCategoryStore.LookupEntry(pProto->ItemLimitCategory);
if (!limitEntry)
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
if (curcount + count > limitEntry->maxCount)
{
if (no_space_count)
*no_space_count = count + curcount - limitEntry->maxCount;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; // attempt add too many limit category items
*no_space_count = count;
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
}
if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE)
{
uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, pItem);
if (curcount + count > uint32(limitEntry->maxCount))
{
if (no_space_count)
*no_space_count = count + curcount - limitEntry->maxCount;
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED;
}
}
}
@@ -10094,8 +10046,9 @@ uint8 Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototyp
if (bag == skip_bag)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
// skip not existed bag or self targeted bag
Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag);
if (!pBag)
if (!pBag || pBag == pSrcItem)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
ItemPrototype const* pBagProto = pBag->GetProto();
@@ -10588,6 +10541,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
}
}
if (pItem && pItem->IsBag() && !((Bag*)pItem)->IsEmpty())
return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG;
// search free slot
res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot);
if (res != EQUIP_ERR_OK)
@@ -11401,7 +11357,7 @@ void Player::SetAmmo(uint32 item)
uint8 msg = CanUseAmmo(item);
if (msg != EQUIP_ERR_OK)
{
SendEquipError(msg, NULL, NULL);
SendEquipError(msg, NULL, NULL, item);
return;
}
}
@@ -12752,7 +12708,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del)
}
}
void Player::SendEquipError(uint8 msg, Item* pItem, Item *pItem2)
void Player::SendEquipError(uint8 msg, Item* pItem, Item *pItem2, uint32 itemid)
{
sLog.outDebug("WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg);
WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18));
@@ -12762,17 +12718,34 @@ void Player::SendEquipError(uint8 msg, Item* pItem, Item *pItem2)
{
data << uint64(pItem ? pItem->GetGUID() : 0);
data << uint64(pItem2 ? pItem2->GetGUID() : 0);
data << uint8(0); // not 0 there...
data << uint8(0); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2
if (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I)
switch(msg)
{
uint8 level = 0;
if (pItem)
if (ItemPrototype const* proto = pItem->GetProto())
level = proto->RequiredLevel;
data << uint32(level); // new 2.4.0
case EQUIP_ERR_CANT_EQUIP_LEVEL_I:
case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW:
{
ItemPrototype const* proto = pItem ? pItem->GetProto() : objmgr.GetItemPrototype(itemid);
data << uint32(proto ? proto->RequiredLevel : 0);
break;
}
case EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM: // no idea about this one...
{
data << uint64(0);
data << uint32(0);
data << uint64(0);
break;
}
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED:
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED:
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED:
{
ItemPrototype const* proto = pItem ? pItem->GetProto() : objmgr.GetItemPrototype(itemid);
data << uint32(proto ? proto->ItemLimitCategory : 0);
break;
}
default:
break;
}
}
GetSession()->SendPacket(&data);
@@ -14049,7 +14022,7 @@ bool Player::CanAddQuest(Quest const *pQuest, bool msg)
return true;
else if (msg2 != EQUIP_ERR_OK)
{
SendEquipError(msg2, NULL, NULL);
SendEquipError(msg2, NULL, NULL, srcitem);
return false;
}
}
@@ -14165,7 +14138,7 @@ bool Player::CanRewardQuest(Quest const *pQuest, bool msg)
GetItemCount(pQuest->ReqItemId[i]) < pQuest->ReqItemCount[i])
{
if (msg)
SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL, pQuest->ReqItemId[i]);
return false;
}
}
@@ -14192,7 +14165,7 @@ bool Player::CanRewardQuest(Quest const *pQuest, uint32 reward, bool msg)
uint8 res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, pQuest->RewChoiceItemId[reward], pQuest->RewChoiceItemCount[reward]);
if (res != EQUIP_ERR_OK)
{
SendEquipError(res, NULL, NULL);
SendEquipError(res, NULL, NULL, pQuest->RewChoiceItemId[reward]);
return false;
}
}
@@ -14208,7 +14181,7 @@ bool Player::CanRewardQuest(Quest const *pQuest, uint32 reward, bool msg)
uint8 res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, pQuest->RewItemId[i], pQuest->RewItemCount[i]);
if (res != EQUIP_ERR_OK)
{
SendEquipError(res, NULL, NULL);
SendEquipError(res, NULL, NULL, pQuest->RewItemId[i]);
return false;
}
}
@@ -14929,7 +14902,7 @@ bool Player::GiveQuestSourceItem(Quest const *pQuest)
else if (msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS)
return true;
else
SendEquipError(msg, NULL, NULL);
SendEquipError(msg, NULL, NULL, srcitem);
return false;
}
@@ -14950,11 +14923,11 @@ bool Player::TakeQuestSourceItem(uint32 quest_id, bool msg)
// exist one case when destroy source quest item not possible:
// non un-equippable item (equipped non-empty bag, for example)
uint8 res = CanUnequipItems(srcitem,count);
uint8 res = CanUnequipItems(srcitem, count);
if (res != EQUIP_ERR_OK)
{
if (msg)
SendEquipError(res, NULL, NULL);
SendEquipError(res, NULL, NULL, srcitem);
return false;
}
@@ -19717,7 +19690,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
uint8 msg = CanStoreNewItem(bag, slot, dest, item, pProto->BuyCount * count);
if (msg != EQUIP_ERR_OK)
{
SendEquipError(msg, NULL, NULL);
SendEquipError(msg, NULL, NULL, item);
return false;
}
@@ -19774,7 +19747,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
uint8 msg = CanEquipNewItem(slot, dest, item, false);
if (msg != EQUIP_ERR_OK)
{
SendEquipError(msg, NULL, NULL);
SendEquipError(msg, NULL, NULL, item);
return false;
}
@@ -22608,18 +22581,18 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons
LootItem* lootItem = loot.LootItemInSlot(i,this);
ItemPosCountVec dest;
uint8 msg = CanStoreNewItem (bag,slot,dest,lootItem->itemid,lootItem->count);
uint8 msg = CanStoreNewItem(bag, slot, dest,lootItem->itemid, lootItem->count);
if (msg != EQUIP_ERR_OK && slot != NULL_SLOT)
msg = CanStoreNewItem(bag, NULL_SLOT,dest,lootItem->itemid,lootItem->count);
msg = CanStoreNewItem(bag, NULL_SLOT, dest, lootItem->itemid, lootItem->count);
if (msg != EQUIP_ERR_OK && bag != NULL_BAG)
msg = CanStoreNewItem(NULL_BAG, NULL_SLOT,dest,lootItem->itemid,lootItem->count);
msg = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, lootItem->itemid, lootItem->count);
if (msg != EQUIP_ERR_OK)
{
SendEquipError(msg, NULL, NULL);
SendEquipError(msg, NULL, NULL, lootItem->itemid);
continue;
}
Item* pItem = StoreNewItem (dest,lootItem->itemid,true,lootItem->randomPropertyId);
Item* pItem = StoreNewItem(dest,lootItem->itemid, true, lootItem->randomPropertyId);
SendNewItem(pItem, lootItem->count, false, false, broadcast);
}
}
@@ -22823,14 +22796,16 @@ uint8 Player::CanEquipUniqueItem(ItemPrototype const* itemProto, uint8 except_sl
{
ItemLimitCategoryEntry const* limitEntry = sItemLimitCategoryStore.LookupEntry(itemProto->ItemLimitCategory);
if (!limitEntry)
return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE;
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
// NOTE: limitEntry->mode not checked because if item have have-limit then it applied and to equip case
if (limit_count > limitEntry->maxCount)
return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE; // attempt add too many limit category items (gems)
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED;
// there is an equip limit on this item
if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory,limitEntry->maxCount-limit_count+1,except_slot))
return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE;
if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot))
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED;
}
return EQUIP_ERR_OK;
+4 -4
View File
@@ -1120,6 +1120,7 @@ class Player : public Unit, public GridObject<Player>
void SetSheath(SheathState sheathed); // overwrite Unit version
uint8 FindEquipSlot(ItemPrototype const* proto, uint32 slot, bool swap) const;
uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = NULL) const;
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const;
Item* GetItemByGuid(uint64 guid) const;
Item* GetItemByEntry(uint32 entry) const;
Item* GetItemByPos(uint16 pos) const;
@@ -1141,8 +1142,8 @@ class Player : public Unit, public GridObject<Player>
static bool IsBagPos(uint16 pos);
static bool IsBankPos(uint16 pos) { return IsBankPos(pos >> 8,pos & 255); }
static bool IsBankPos(uint8 bag, uint8 slot);
bool IsValidPos(uint16 pos) { return IsBankPos(pos >> 8,pos & 255); }
bool IsValidPos(uint8 bag, uint8 slot);
bool IsValidPos(uint16 pos, bool explicit_pos) { return IsValidPos(pos >> 8, pos & 255, explicit_pos); }
bool IsValidPos(uint8 bag, uint8 slot, bool explicit_pos);
uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_2, 2); }
void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, 2, count); }
bool HasItemCount(uint32 item, uint32 count, bool inBankAlso = false) const;
@@ -1150,7 +1151,6 @@ class Player : public Unit, public GridObject<Player>
bool CanNoReagentCast(SpellEntry const* spellInfo) const;
bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const;
bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const;
uint8 CountItemWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const;
uint8 CanTakeMoreSimilarItems(Item* pItem) const { return _CanTakeMoreSimilarItems(pItem->GetEntry(),pItem->GetCount(),pItem); }
uint8 CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return _CanTakeMoreSimilarItems(entry,count,NULL); }
uint8 CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const
@@ -1223,7 +1223,7 @@ class Player : public Unit, public GridObject<Player>
Item* GetItemFromBuyBackSlot(uint32 slot);
void RemoveItemFromBuyBackSlot(uint32 slot, bool del);
uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; }
void SendEquipError(uint8 msg, Item* pItem, Item *pItem2);
void SendEquipError(uint8 msg, Item* pItem, Item *pItem2 = NULL, uint32 itemid = 0);
void SendBuyError(uint8 msg, Creature* pCreature, uint32 item, uint32 param);
void SendSellError(uint8 msg, Creature* pCreature, uint64 guid, uint32 param);
void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; }