32 if (pItem != skipItem && pItem->
GetEntry() == item)
33 count += pItem->GetCount();
37 count += pBag->GetItemCount(item, skipItem);
43 count += pItem->GetGemCountWithID(item);
50 if (pItem != skipItem && pItem->
GetEntry() == item)
51 count += pItem->GetCount();
55 count += pBag->GetItemCount(item, skipItem);
61 count += pItem->GetGemCountWithID(item);
72 if (pItem != skipItem)
74 if (pProto->ItemLimitCategory == limitCategory)
75 count += pItem->GetCount();
79 count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem);
83 if (pItem != skipItem)
85 if (pProto->ItemLimitCategory == limitCategory)
86 count += pItem->GetCount();
90 count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem);
99 if (pItem->GetGUID() == guid)
104 if (pItem->GetGUID() == guid)
109 for (
uint32 j = 0; j < pBag->GetBagSize(); ++j)
110 if (
Item* pItem = pBag->GetItemByPos(j))
111 if (pItem->GetGUID() == guid)
116 for (
uint32 j = 0; j < pBag->GetBagSize(); ++j)
117 if (
Item* pItem = pBag->GetItemByPos(j))
118 if (pItem->GetGUID() == guid)
126 uint8 bag = pos >> 8;
127 uint8 slot = pos & 255;
136 return pBag->GetItemByPos(slot);
153 return item->
ToBag();
170 default:
return NULL;
252 uint8 bag = pos >> 8;
253 uint8 slot = pos & 255;
264 if (bag ==
NULL_BAG && !explicit_pos)
304 return slot < pBag->GetBagSize();
320 if (tempcount >= count)
329 for (
uint32 j = 0; j < pBag->GetBagSize(); j++)
335 if (tempcount >= count)
350 if (tempcount >= count)
358 for (
uint32 j = 0; j < pBag->GetBagSize(); j++)
364 if (tempcount >= count)
380 if (i == except_slot)
384 if (pItem && pItem->
GetEntry() == item)
387 if (tempcount >= count)
397 if (i == except_slot)
404 if (tempcount >= count)
418 if (i == except_slot)
432 if (tempcount >= count)
439 if (tempcount >= count)
453 *no_space_count = count;
470 *no_space_count = count + curcount - pProto->
MaxCount;
482 *no_space_count = count;
492 *no_space_count = count + curcount - limitEntry->
maxCount;
503 return CanStoreItem(bag, slot, dest, item, count, NULL,
false, no_space_count);
519 if (pItem2 == pSrcItem)
568 if (need_space > count)
574 dest.push_back(newPosition);
588 if (!pBag || pBag == pSrcItem)
614 if (pItem2 == pSrcItem)
618 if ((pItem2 != NULL) != merge)
634 if (need_space > count)
640 dest.push_back(newPosition);
656 for (
uint32 j = slot_begin; j < slot_end; j++)
665 if (pItem2 == pSrcItem)
669 if ((pItem2 != NULL) != merge)
685 if (need_space > count)
691 dest.push_back(newPosition);
703 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count);
709 *no_space_count = count;
719 *no_space_count = count;
726 *no_space_count = count;
732 uint32 no_similar_count = 0;
736 if (count == no_similar_count)
739 *no_space_count = no_similar_count;
742 count -= no_similar_count;
752 *no_space_count = count + no_similar_count;
758 if (no_similar_count == 0)
762 *no_space_count = count + no_similar_count;
781 *no_space_count = count + no_similar_count;
787 if (no_similar_count == 0)
791 *no_space_count = count + no_similar_count;
805 *no_space_count = count + no_similar_count;
811 if (no_similar_count == 0)
815 *no_space_count = count + no_similar_count;
828 *no_space_count = count + no_similar_count;
834 if (no_similar_count == 0)
838 *no_space_count = count + no_similar_count;
851 *no_space_count = count + no_similar_count;
857 if (no_similar_count == 0)
861 *no_space_count = count + no_similar_count;
876 *no_space_count = count + no_similar_count;
882 if (no_similar_count == 0)
886 *no_space_count = count + no_similar_count;
900 if (no_similar_count == 0)
904 *no_space_count = count + no_similar_count;
918 if (no_similar_count == 0)
922 *no_space_count = count + no_similar_count;
939 if (no_similar_count == 0)
943 *no_space_count = count + no_similar_count;
957 *no_space_count = count + no_similar_count;
963 if (no_similar_count == 0)
967 *no_space_count = count + no_similar_count;
979 if (no_similar_count == 0)
983 *no_space_count = count + no_similar_count;
989 *no_space_count = count + no_similar_count;
1015 for (
uint32 j = 0; j < pBag->GetBagSize(); j++)
1023 for (
int k = 0; k < count; ++k)
1025 Item* pItem = pItems[k];
1031 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->
GetEntry(), pItem->
GetCount());
1056 bool b_found =
false;
1077 for (
uint32 j = 0; j < bag->GetBagSize(); j++)
1097 bool b_found =
false;
1103 pBagProto = bag->GetTemplate();
1109 for (
uint32 j = 0; j < bag->GetBagSize(); j++)
1126 bool b_found =
false;
1144 pBagProto = bag->GetTemplate();
1150 for (
uint32 j = 0; j < bag->GetBagSize(); j++)
1172 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: Creating initial item, itemId = %u, count = %u", titem_id, titem_amount);
1175 while (titem_amount > 0)
1187 if (titem_amount == 0)
1201 SF_LOG_ERROR(
"entities.player.items",
"STORAGE: Can't equip or store initial item %u for race %u class %u, error msg = %u", titem_id,
getRace(),
getClass(), msg);
1213 if (pItem->GetEntry() == item)
1218 tempcount += pItem->GetCount();
1219 if (tempcount >= count)
1228 if (pItem->GetEntry() == item)
1230 tempcount += pItem->GetCount();
1231 if (tempcount >= count)
1238 for (
uint32 j = 0; j < pBag->GetBagSize(); ++j)
1240 if (pItem->GetEntry() == item)
1242 tempcount += pItem->GetCount();
1243 if (tempcount >= count)
1270 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->
GetEntry(), pItem->
GetCount());
1369 if (
ItemTemplate const* pBagProto = pBag->GetTemplate())
1370 if (pBagProto->Class == pProto->
Class && (!swap || pBag->GetSlot() != eslot))
1413 if (offItem && (!not_loading ||
1439 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->
GetEntry(), pItem->
GetCount());
1475 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->
GetEntry(), pItem->
GetCount());
1490 SF_LOG_ERROR(
"entities.player",
"Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!",
1505 if (!pItem->
IsBag())
1660 if (!
IsAlive() && not_loading)
1678 bool allowEquip =
false;
1757 Map const* map = lootedObject->
GetMap();
1842 for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
1843 count += itr->count;
1851 if (randomPropertyId)
1862 std::ostringstream ss;
1863 AllowedLooterSet::const_iterator itr = allowedLooters.begin();
1865 for (++itr; itr != allowedLooters.end(); ++itr)
1882 Item* lastItem = pItem;
1883 for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();)
1886 uint32 count = itr->count;
1890 if (itr == dest.end())
1892 lastItem =
_StoreItem(pos, pItem, count,
false, update);
1896 lastItem =
_StoreItem(pos, pItem, count,
true, update);
1907 uint8 bag = pos >> 8;
1908 uint8 slot = pos & 255;
1910 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->
GetEntry(), count, pItem->
GetGUIDLow());
2027 uint8 bag = pos >> 8;
2028 uint8 slot = pos & 255;
2041 if (pProto && pProto->
ItemSet)
2052 SF_LOG_ERROR(
"entities.player",
"Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell);
2068 size_t bitpos = data.
bitwpos();
2073 data <<
uint32(cooldownSpell);
2159 uint8 slot = pos & 255;
2197 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: EquipItem slot = %u, item = %u", slot, pItem->
GetEntry());
2227 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->
GetEntry());
2240 if (pProto && pProto->
ItemSet)
2290 pBag->RemoveItem(slot, update);
2307 it->SetNotRefundable(
this,
false);
2308 it->RemoveFromUpdateQueueOf(
this);
2309 if (it->IsInWorld())
2311 it->RemoveFromWorld();
2312 it->DestroyForPlayer(
this);
2328 if (pLastItem == pItem)
2348 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->
GetEntry());
2388 if (pProto && pProto->
ItemSet)
2424 pBag->RemoveItem(slot, update);
2447 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: DestroyItemCount item = %u, count = %u", itemEntry, count);
2455 if (item->GetEntry() == itemEntry && !item->IsInTrade())
2457 if (item->GetCount() + remcount <= count)
2460 remcount += item->GetCount();
2463 if (remcount >= count)
2469 item->SetCount(item->GetCount() - count + remcount);
2471 item->SendUpdateToPlayer(
this);
2484 for (
uint32 j = 0; j < bag->GetBagSize(); j++)
2486 if (
Item* item = bag->GetItemByPos(j))
2488 if (item->GetEntry() == itemEntry && !item->IsInTrade())
2491 if (item->GetCount() + remcount <= count)
2493 remcount += item->GetCount();
2496 if (remcount >= count)
2502 item->SetCount(item->GetCount() - count + remcount);
2504 item->SendUpdateToPlayer(
this);
2519 if (item && item->GetEntry() == itemEntry && !item->IsInTrade())
2521 if (item->GetCount() + remcount <= count)
2525 remcount += item->GetCount();
2528 if (remcount >= count)
2535 item->SetCount(item->GetCount() - count + remcount);
2537 item->SendUpdateToPlayer(
this);
2550 if (item->GetEntry() == itemEntry && !item->IsInTrade())
2552 if (item->GetCount() + remcount <= count)
2554 remcount += item->GetCount();
2556 if (remcount >= count)
2562 item->SetCount(item->GetCount() - count + remcount);
2564 item->SendUpdateToPlayer(
this);
2577 for (
uint32 j = 0; j < bag->GetBagSize(); j++)
2579 if (
Item* item = bag->GetItemByPos(j))
2581 if (item->GetEntry() == itemEntry && !item->IsInTrade())
2584 if (item->GetCount() + remcount <= count)
2586 remcount += item->GetCount();
2589 if (remcount >= count)
2595 item->SetCount(item->GetCount() - count + remcount);
2597 item->SendUpdateToPlayer(
this);
2610 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: DestroyZoneLimitedItem in map %u and area %u",
GetMapId(), new_zone);
2615 if (pItem->IsLimitedToAnotherMapOrZone(
GetMapId(), new_zone))
2621 for (
uint32 j = 0; j < pBag->GetBagSize(); j++)
2622 if (
Item* pItem = pBag->GetItemByPos(j))
2623 if (pItem->IsLimitedToAnotherMapOrZone(
GetMapId(), new_zone))
2629 if (pItem->IsLimitedToAnotherMapOrZone(
GetMapId(), new_zone))
2637 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: DestroyConjuredItems");
2642 if (pItem->IsConjuredConsumable())
2648 for (
uint32 j = 0; j < pBag->GetBagSize(); j++)
2649 if (
Item* pItem = pBag->GetItemByPos(j))
2650 if (pItem->IsConjuredConsumable())
2656 if (pItem->IsConjuredConsumable())
2665 if (pItem->GetEntry() == entry)
2670 for (
uint32 j = 0; j < pBag->GetBagSize(); ++j)
2671 if (
Item* pItem = pBag->GetItemByPos(j))
2672 if (pItem->GetEntry() == entry)
2677 if (pItem->GetEntry() == entry)
2688 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->
GetGUIDLow(), pItem->
GetEntry(), count);
2709 uint8 srcbag = src >> 8;
2710 uint8 srcslot = src & 255;
2712 uint8 dstbag = dst >> 8;
2713 uint8 dstslot = dst & 255;
2751 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->
GetEntry(), count);
2824 uint8 srcbag = src >> 8;
2825 uint8 srcslot = src & 255;
2827 uint8 dstbag = dst >> 8;
2828 uint8 dstslot = dst & 255;
2836 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->
GetEntry());
2866 if (
IsBagPos(src) && srcslot == dstbag)
2873 if (
IsBagPos(dst) && srcbag == dstslot)
2957 if (!pSrcItem->
IsBag() && !pDstItem->
IsBag())
2963 msg =
CanStoreItem(dstbag, dstslot, sDest, pSrcItem,
false);
2965 msg =
CanBankItem(dstbag, dstslot, sDest, pSrcItem,
false);
3012 msg =
CanStoreItem(dstbag, dstslot, sDest, pSrcItem,
true);
3014 msg =
CanBankItem(dstbag, dstslot, sDest, pSrcItem,
true);
3032 msg =
CanStoreItem(srcbag, srcslot, sDest2, pDstItem,
true);
3034 msg =
CanBankItem(srcbag, srcslot, sDest2, pDstItem,
true);
3049 if (
Bag* srcBag = pSrcItem->
ToBag())
3051 if (
Bag* dstBag = pDstItem->
ToBag())
3053 Bag* emptyBag = NULL;
3054 Bag* fullBag = NULL;
3055 if (srcBag->IsEmpty() && !
IsBagPos(src))
3060 else if (dstBag->IsEmpty() && !
IsBagPos(dst))
3067 if (emptyBag && fullBag)
3106 emptyBag->
StoreItem(count, bagItem,
true);
3139 bool released =
false;
3147 if (bagItem->m_lootGenerated)
3157 if (!released &&
IsBagPos(dst) && pDstItem)
3164 if (bagItem->m_lootGenerated)
3200 if (oldest_time > i_time)
3202 oldest_time = i_time;
3212 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->
GetEntry(), slot);
3215 time_t base = time(NULL);
3234 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: GetItemFromBuyBackSlot slot = %u", slot);
3242 SF_LOG_DEBUG(
"entities.player.items",
"STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot);
3268 SF_LOG_DEBUG(
"network",
"WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg);
3407 if (limit_count > limitEntry->
maxCount)
@ CHAR_INS_ITEM_BOP_TRADE
@ ITEM_LIMIT_CATEGORY_MODE_HAVE
@ ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM
@ ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM
@ ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM
@ ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< ScalingStatDistributionEntry > sScalingStatDistributionStore(ScalingStatDistributionfmt)
DBCStorage< ItemLimitCategoryEntry > sItemLimitCategoryStore(ItemLimitCategoryEntryfmt)
bool IsHolidayActive(HolidayIds id)
bool ItemCanGoIntoBag(ItemTemplate const *pProto, ItemTemplate const *pBagProto)
@ PROP_ENCHANTMENT_SLOT_0
@ PRISMATIC_ENCHANTMENT_SLOT
@ PROP_ENCHANTMENT_SLOT_1
@ PROP_ENCHANTMENT_SLOT_4
@ PROP_ENCHANTMENT_SLOT_3
@ EQUIP_ERR_CANT_EQUIP_EVER
@ EQUIP_ERR_NO_SLOT_AVAILABLE
@ EQUIP_ERR_ONLY_ONE_QUIVER
@ EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED
@ EQUIP_ERR_DESTROY_NONEMPTY_BAG
@ EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE
@ EQUIP_ERR_NOT_DURING_ARENA_MATCH
@ EQUIP_ERR_CLIENT_LOCKED_OUT
@ EQUIP_ERR_NOT_IN_COMBAT
@ EQUIP_ERR_CANT_EQUIP_LEVEL_I
@ EQUIP_ERR_GENERIC_STUNNED
@ EQUIP_ERR_WRONG_BAG_TYPE
@ EQUIP_ERR_PROFICIENCY_NEEDED
@ EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS
@ EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW
@ EQUIP_ERR_ITEM_NOT_FOUND
@ EQUIP_ERR_CANT_EQUIP_REPUTATION
@ EQUIP_ERR_CANT_EQUIP_SKILL
@ EQUIP_ERR_2HANDED_EQUIPPED
@ EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS
@ EQUIP_ERR_NOT_EQUIPPABLE
@ EQUIP_ERR_2HSKILLNOTFOUND
@ EQUIP_ERR_ONLY_ONE_AMMO
@ EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS
@ EQUIP_ERR_ITEM_MAX_COUNT
@ EQUIP_ERR_TOO_FEW_TO_SPLIT
@ ITEM_SUBCLASS_WEAPON_POLEARM
@ ITEM_SPELLTRIGGER_ON_NO_DELAY_USE
@ ITEM_SUBCLASS_CONTAINER
@ ITEM_SUBCLASS_AMMO_POUCH
@ ITEM_PROTO_FLAG_UNIQUE_EQUIPPED
@ ITEM_PROTO_FLAG_OPENABLE
@ ITEM_SUBCLASS_ARMOR_MAIL
@ ITEM_SUBCLASS_ARMOR_BUCKLER
@ ITEM_SUBCLASS_ARMOR_CLOTH
@ ITEM_SUBCLASS_ARMOR_LEATHER
@ ITEM_SUBCLASS_ARMOR_PLATE
@ ITEM_SUBCLASS_ARMOR_MISCELLANEOUS
@ ITEM_FLAGS_EXTRA_ALLIANCE_ONLY
@ ITEM_FLAGS_EXTRA_HORDE_ONLY
#define MAX_ITEM_PROTO_SPELLS
@ ITEM_FLAG_BOP_TRADEABLE
#define MAX_ITEM_SUBCLASS_WEAPON
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
std::set< uint32 > AllowedLooterSet
void AddItemsSetItem(Player *player, Item *item)
std::vector< ItemPosCount > ItemPosCountVec
@ INVENTORY_SLOT_ITEM_START
@ INVENTORY_SLOT_ITEM_END
void RemoveItemsSetItem(Player *player, ItemTemplate const *proto)
@ INVENTORY_SLOT_BAG_START
@ EQUIPMENT_SLOT_MAINHAND
@ EQUIPMENT_SLOT_TRINKET1
@ EQUIPMENT_SLOT_TRINKET2
#define INVENTORY_SLOT_BAG_0
@ ITEM_FIELD_CONTAINED_IN
@ ITEM_FIELD_DYNAMIC_FLAGS
@ ITEM_FIELD_CREATE_PLAYED_TIME
@ PLAYER_FIELD_VENDORBUYBACK_SLOTS
@ PLAYER_FIELD_BUYBACK_TIMESTAMP
@ PLAYER_FIELD_BUYBACK_PRICE
@ PLAYER_FIELD_VISIBLE_ITEMS
uint32 GetBagSize() const
void StoreItem(uint8 slot, Item *pItem, bool update)
Item * GetItemByPos(uint8 slot) const
void RemoveItem(uint8 slot, bool update)
void WriteGuidBytes(const ObjectGuid &guid, Offsets... offsets)
bool WriteBit(uint32 bit)
void WriteGuidMask(const ObjectGuid &guid, Offsets... offsets)
size_t bitwpos() const
Returns position of last written bit.
void WriteBits(T value, size_t bits)
void WriteByteSeq(uint8 b)
void AddGlobalCooldown(SpellInfo const *spellInfo, uint32 gcd)
bool IsCurrencyToken() const
void SetNotRefundable(Player *owner, bool changestate=true, SQLTransaction *trans=NULL)
void SetBinding(bool val)
void SetState(ItemUpdateState state, Player *forplayer=NULL)
uint32 GetEnchantmentId(EnchantmentSlot slot) const
void SetOwnerGUID(uint64 guid)
void SetSoulboundTradeable(AllowedLooterSet const &allowedLooters)
void SetItemRandomProperties(int32 randomPropId)
uint8 GetGemCountWithID(uint32 GemID) const
Item * CloneItem(uint32 count, Player const *player=NULL) const
void ItemContainerDeleteLootMoneyAndLootItemsFromDB()
void SetCount(uint32 value)
ItemTemplate const * GetTemplate() const
uint32 GetVisibleEntry() const
uint32 GetItemSuffixFactor() const
bool IsBindedNotWith(Player const *player) const
static Item * CreateItem(uint32 itemEntry, uint32 count, Player const *player=NULL)
void ClearEnchantment(EnchantmentSlot slot)
InventoryResult CanBeMergedPartlyWith(ItemTemplate const *proto) const
uint64 GetOwnerGUID() const
uint8 GetGemCountWithLimitCategory(uint32 limitCategory) const
void ClearSoulboundTradeable(Player *currentOwner)
bool IsNotEmptyBag() const
void SetContainer(Bag *container)
static int32 GenerateItemRandomPropertyId(uint32 item_id)
DifficultyID GetDifficulty() const
void SetUInt16Value(uint16 index, uint8 offset, uint16 value)
uint32 GetUInt32Value(uint16 index) const
virtual void DestroyForPlayer(Player *target, bool onDeath=false) const
uint32 GetGUIDLow() const
virtual void AddToWorld()
bool HasFlag(uint16 index, uint32 flag) const
virtual void RemoveFromWorld()
void SendUpdateToPlayer(Player *player)
void SetUInt32Value(uint16 index, uint32 value)
void SetUInt64Value(uint16 index, uint64 value)
bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count)
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=NULL, uint32 itemid=0)
void ItemRemovedQuestCheck(uint32 entry, uint32 count)
static bool IsEquipmentPos(uint16 pos)
InventoryResult CanUnequipItem(uint16 src, bool swap) const
void RemoveItemDependentAurasAndCasts(Item *pItem)
InventoryResult CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, bool not_loading=true) const
InventoryResult CanEquipNewItem(uint8 slot, uint16 &dest, uint32 item, bool swap) const
Bag * GetBagByPos(uint8 slot) const
void QuickEquipItem(uint16 pos, Item *pItem)
uint32 GetTotalPlayedTime() const
InventoryResult CanRollForItemInLFG(ItemTemplate const *item, WorldObject const *lootedObject) const
uint16 GetSkillValue(uint32 skill) const
Item * BankItem(ItemPosCountVec const &dest, Item *pItem, bool update)
void SendGameError(GameError error, uint32 arg1=0, uint32 arg2=0)
void SplitItem(uint16 src, uint16 dst, uint32 count)
InventoryResult CanEquipUniqueItem(Item *pItem, uint8 except_slot=NULL_SLOT, uint32 limit_count=1) const
Item * GetItemByEntry(uint32 entry) const
Item * GetUseableItemByPos(uint8 bag, uint8 slot) const
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pItem, bool swap=false) const
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
uint8 GetBankBagSlotCount() const
void RemoveItemFromBuyBackSlot(uint32 slot, bool del)
bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot=NULL_SLOT) const
Item * EquipNewItem(uint16 pos, uint32 item, bool update)
void AddItemToBuyBackSlot(Item *pItem)
void RecalculateRating(CombatRating cr)
void AddEnchantmentDurations(Item *item)
bool CanTitanGrip() const
void SwapItem(uint16 src, uint16 dst)
bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot=NULL_SLOT) const
uint64 GetLootGUID() const
bool IsTwoHandUsed() const
InventoryResult CanStoreItems(Item **pItem, int count) const
void RemoveTradeableItem(Item *item)
Item * _StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool update)
Item * StoreItem(ItemPosCountVec const &pos, Item *pItem, bool update)
WorldSession * GetSession() const
Item * GetItemByGuid(uint64 guid) const
void DestroyConjuredItems(bool update)
Item * GetItemByPos(uint16 pos) const
bool HasSkill(uint32 skill) const
void UpdateExpertise(WeaponAttackType attType)
uint32 m_currentBuybackSlot
InventoryResult CanTakeMoreSimilarItems(Item *pItem) const
uint32 GetItemCount(uint32 item, bool inBankAlso=false, Item *skipItem=NULL) const
void DestroyItem(uint8 bag, uint8 slot, bool update)
void MoveItemFromInventory(uint8 bag, uint8 slot, bool update)
static bool IsInventoryPos(uint16 pos)
uint32 m_weaponChangeTimer
void _ApplyItemMods(Item *item, uint8 slot, bool apply)
GlobalCooldownMgr & GetGlobalCooldownMgr()
void MoveItemToInventory(ItemPosCountVec const &dest, Item *pItem, bool update, bool in_characterInventoryDB=false)
Item * GetShield(bool useable=false) const
Battleground * GetBattleground() const
uint8 FindEquipSlot(ItemTemplate const *proto, uint32 slot, bool swap) const
TradeData * GetTradeData() const
void SendRefundInfo(Item *item)
void AutoUnequipOffhandIfNeed(bool force=false)
void RemoveEnchantmentDurations(Item *item)
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, Unit *unit=NULL)
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=NULL) const
Item * EquipItem(uint16 pos, Item *pItem, bool update)
Item * m_items[PLAYER_SLOTS_COUNT]
void AddItemDurations(Item *item)
static bool IsBagPos(uint16 pos)
void ApplyEquipCooldown(Item *pItem)
InventoryResult CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec &dest, ItemTemplate const *pProto, uint32 &count, bool merge, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const
void DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check=false)
void AddTradeableItem(Item *item)
Item * GetItemFromBuyBackSlot(uint32 slot)
void RemoveItemDurations(Item *item)
InventoryResult CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemTemplate const *pProto, uint32 &count, bool merge, bool non_specialized, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const
InventoryResult CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pItem, bool swap, bool not_loading=true) const
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item *skipItem=NULL) const
ReputationRank GetReputationRank(uint32 faction_id) const
InventoryResult CanUnequipItems(uint32 item, uint32 count) const
void ItemAddedQuestCheck(uint32 entry, uint32 count)
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
bool IsUseEquipedWeapon(bool mainhand) const
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 item, bool update, int32 randomPropertyId=0, AllowedLooterSet const &allowedLooters=AllowedLooterSet())
static bool IsBankPos(uint16 pos)
void RemoveItem(uint8 bag, uint8 slot, bool update)
bool HasSpell(uint32 spell) const override
void VisualizeItem(uint8 slot, Item *pItem)
InventoryResult CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec &dest, ItemTemplate const *pProto, uint32 &count, bool swap, Item *pSrcItem) const
void SetVisibleItemSlot(uint8 slot, Item *pItem)
static WeaponAttackType GetAttackBySlot(uint8 slot)
void DestroyZoneLimitedItem(bool update, uint32 new_zone)
bool IsValidPos(uint16 pos, bool explicit_pos)
InventoryResult CanUseItem(Item *pItem, bool not_loading=true) const
void setString(const uint8 index, const std::string &value)
void setUInt32(const uint8 index, const uint32 value)
bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID=0, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool CanDualWield() const
bool HasAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
bool CanUseAttackType(WeaponAttackType attacktype) const
uint32 getRaceMask() const
bool HasUnitState(const uint32 f) const
uint32 getClassMask() const
bool IsInFeralForm() const
std::string const & GetName() const
WorldObject(bool isWorldObject)
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
@ SMSG_DISPLAY_GAME_ERROR
@ SMSG_INVENTORY_CHANGE_FAILURE
bool isContainedIn(std::vector< ItemPosCount > const &vec) const
bool CanChangeEquipStateInCombat() const
uint32 GetMaxStackSize() const
_Spell Spells[MAX_ITEM_PROTO_SPELLS]
uint32 RequiredReputationRank
uint32 RequiredReputationFaction
uint32 ScalingStatDistribution
_Socket Socket[MAX_ITEM_PROTO_SOCKETS]