AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Item Class Reference

#include "Item.h"

Inheritance diagram for Item:
Object Bag

Public Member Functions

ItemCloneItem (uint32 count, Player const *player=nullptr) const
 
 Item ()
 
virtual bool Create (ObjectGuid::LowType guidlow, uint32 itemid, Player const *owner)
 
ItemTemplate const * GetTemplate () const
 
ObjectGuid GetOwnerGUID () const
 
void SetOwnerGUID (ObjectGuid guid)
 
PlayerGetOwner () const
 
void SetBinding (bool val)
 
bool IsSoulBound () const
 
bool IsBoundAccountWide () const
 
bool IsBindedNotWith (Player const *player) const
 
bool IsBoundByEnchant () const
 
bool IsBoundByTempEnchant () const
 
virtual void SaveToDB (CharacterDatabaseTransaction trans)
 
virtual bool LoadFromDB (ObjectGuid::LowType guid, ObjectGuid owner_guid, Field *fields, uint32 entry)
 
virtual void DeleteFromDB (CharacterDatabaseTransaction trans)
 
void DeleteFromInventoryDB (CharacterDatabaseTransaction trans)
 
void SaveRefundDataToDB ()
 
void DeleteRefundDataFromDB (CharacterDatabaseTransaction *trans)
 
BagToBag ()
 
Bag const * ToBag () const
 
bool IsLocked () const
 
bool IsBag () const
 
bool IsCurrencyToken () const
 
bool IsNotEmptyBag () const
 
bool IsBroken () const
 
bool CanBeTraded (bool mail=false, bool trade=false) const
 
void SetInTrade (bool b=true)
 
bool IsInTrade () const
 
bool IsRefundable () const
 
bool IsBOPTradable () const
 
bool IsWrapped () const
 
bool HasEnchantRequiredSkill (Player const *player) const
 
uint32 GetEnchantRequiredLevel () const
 
bool IsFitToSpellRequirements (SpellInfo const *spellInfo) const
 
bool IsLimitedToAnotherMapOrZone (uint32 cur_mapId, uint32 cur_zoneId) const
 
bool GemsFitSockets () const
 
uint32 GetCount () const
 
void SetCount (uint32 value)
 
uint32 GetMaxStackCount () const
 
bool HasSocket () const
 
uint8 GetGemCountWithID (uint32 GemID) const
 
uint8 GetGemCountWithLimitCategory (uint32 limitCategory) const
 
InventoryResult CanBeMergedPartlyWith (ItemTemplate const *proto) const
 
uint8 GetSlot () const
 
BagGetContainer ()
 
uint8 GetBagSlot () const
 
void SetSlot (uint8 slot)
 
uint16 GetPos () const
 
void SetContainer (Bag *container)
 
bool IsInBag () const
 
bool IsEquipped () const
 
uint32 GetSkill ()
 
uint32 GetSpell ()
 
int32 GetItemRandomPropertyId () const
 
uint32 GetItemSuffixFactor () const
 
void SetItemRandomProperties (int32 randomPropId)
 
void UpdateItemSuffixFactor ()
 
void SetEnchantment (EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, ObjectGuid caster=ObjectGuid::Empty)
 
void SetEnchantmentDuration (EnchantmentSlot slot, uint32 duration, Player *owner)
 
void SetEnchantmentCharges (EnchantmentSlot slot, uint32 charges)
 
void ClearEnchantment (EnchantmentSlot slot)
 
uint32 GetEnchantmentId (EnchantmentSlot slot) const
 
uint32 GetEnchantmentDuration (EnchantmentSlot slot) const
 
uint32 GetEnchantmentCharges (EnchantmentSlot slot) const
 
std::string const & GetText () const
 
void SetText (std::string const &text)
 
void SendUpdateSockets ()
 
void SendTimeUpdate (Player *owner)
 
void UpdateDuration (Player *owner, uint32 diff)
 
int32 GetSpellCharges (uint8 index=0) const
 
void SetSpellCharges (uint8 index, int32 value)
 
ItemUpdateState GetState () const
 
void SetState (ItemUpdateState state, Player *forplayer=nullptr)
 
void AddToUpdateQueueOf (Player *player)
 
void RemoveFromUpdateQueueOf (Player *player)
 
bool IsInUpdateQueue () const
 
uint32 GetQueuePos () const
 
void FSetState (ItemUpdateState state)
 
bool hasQuest (uint32 quest_id) const override
 
bool hasInvolvedQuest (uint32) const override
 
bool IsPotion () const
 
bool IsWeaponVellum () const
 
bool IsArmorVellum () const
 
bool IsConjuredConsumable () const
 
void SetNotRefundable (Player *owner, bool changestate=true, CharacterDatabaseTransaction *trans=nullptr)
 
void SetRefundRecipient (ObjectGuid::LowType pGuidLow)
 
void SetPaidMoney (uint32 money)
 
void SetPaidExtendedCost (uint32 iece)
 
ObjectGuid::LowType GetRefundRecipient ()
 
uint32 GetPaidMoney ()
 
uint32 GetPaidExtendedCost ()
 
void UpdatePlayedTime (Player *owner)
 
uint32 GetPlayedTime ()
 
bool IsRefundExpired ()
 
void SetSoulboundTradeable (AllowedLooterSet &allowedLooters)
 
void ClearSoulboundTradeable (Player *currentOwner)
 
bool CheckSoulboundTradeExpire ()
 
void BuildUpdate (UpdateDataMapType &data_map) override
 
void AddToObjectUpdate () override
 
void RemoveFromObjectUpdate () override
 
uint32 GetScriptId () const
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
bool IsInWorld () const
 
virtual void AddToWorld ()
 
virtual void RemoveFromWorld ()
 
ObjectGuid GetGUID () const
 
PackedGuid const & GetPackGUID () const
 
uint32 GetEntry () const
 
void SetEntry (uint32 entry)
 
float GetObjectScale () const
 
virtual void SetObjectScale (float scale)
 
virtual uint32 GetDynamicFlags () const
 
bool HasDynamicFlag (uint32 flag) const
 
virtual void SetDynamicFlag (uint32 flag)
 
virtual void RemoveDynamicFlag (uint32 flag)
 
virtual void ReplaceAllDynamicFlags (uint32 flag)
 
TypeID GetTypeId () const
 
bool isType (uint16 mask) const
 
virtual void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target)
 
void SendUpdateToPlayer (Player *player)
 
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player *target)
 
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
 
void BuildMovementUpdateBlock (UpdateData *data, uint32 flags=0) const
 
virtual void DestroyForPlayer (Player *target, bool onDeath=false) const
 
int32 GetInt32Value (uint16 index) const
 
uint32 GetUInt32Value (uint16 index) const
 
uint64 GetUInt64Value (uint16 index) const
 
float GetFloatValue (uint16 index) const
 
uint8 GetByteValue (uint16 index, uint8 offset) const
 
uint16 GetUInt16Value (uint16 index, uint8 offset) const
 
ObjectGuid GetGuidValue (uint16 index) const
 
void SetInt32Value (uint16 index, int32 value)
 
void SetUInt32Value (uint16 index, uint32 value)
 
void UpdateUInt32Value (uint16 index, uint32 value)
 
void SetUInt64Value (uint16 index, uint64 value)
 
void SetFloatValue (uint16 index, float value)
 
void SetByteValue (uint16 index, uint8 offset, uint8 value)
 
void SetUInt16Value (uint16 index, uint8 offset, uint16 value)
 
void SetInt16Value (uint16 index, uint8 offset, int16 value)
 
void SetGuidValue (uint16 index, ObjectGuid value)
 
void SetStatFloatValue (uint16 index, float value)
 
void SetStatInt32Value (uint16 index, int32 value)
 
bool AddGuidValue (uint16 index, ObjectGuid value)
 
bool RemoveGuidValue (uint16 index, ObjectGuid value)
 
void ApplyModUInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModUInt64Value (uint16 index, int32 val, bool apply)
 
void ApplyModPositiveFloatValue (uint16 index, float val, bool apply)
 
void ApplyModSignedFloatValue (uint16 index, float val, bool apply)
 
void SetFlag (uint16 index, uint32 newFlag)
 
void RemoveFlag (uint16 index, uint32 oldFlag)
 
void ToggleFlag (uint16 index, uint32 flag)
 
bool HasFlag (uint16 index, uint32 flag) const
 
void ApplyModFlag (uint16 index, uint32 flag, bool apply)
 
void SetByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
void RemoveByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
bool HasByteFlag (uint16 index, uint8 offset, uint8 flag) const
 
void SetFlag64 (uint16 index, uint64 newFlag)
 
void RemoveFlag64 (uint16 index, uint64 oldFlag)
 
void ToggleFlag64 (uint16 index, uint64 flag)
 
bool HasFlag64 (uint16 index, uint64 flag) const
 
void ApplyModFlag64 (uint16 index, uint64 flag, bool apply)
 
void ClearUpdateMask (bool remove)
 
uint16 GetValuesCount () const
 
void BuildFieldsUpdate (Player *, UpdateDataMapType &)
 
void SetFieldNotifyFlag (uint16 flag)
 
void RemoveFieldNotifyFlag (uint16 flag)
 
void ForceValuesUpdateAtIndex (uint32)
 
bool IsPlayer () const
 
PlayerToPlayer ()
 
Player const * ToPlayer () const
 
bool IsCreature () const
 
CreatureToCreature ()
 
Creature const * ToCreature () const
 
bool IsUnit () const
 
UnitToUnit ()
 
Unit const * ToUnit () const
 
bool IsGameObject () const
 
GameObjectToGameObject ()
 
GameObject const * ToGameObject () const
 
bool IsCorpse () const
 
CorpseToCorpse ()
 
Corpse const * ToCorpse () const
 
bool IsDynamicObject () const
 
DynamicObjectToDynObject ()
 
DynamicObject const * ToDynObject () const
 
bool IsItem () const
 
virtual void Heartbeat ()
 
template<typename... T>
bool EntryEquals (T... entries) const
 

Static Public Member Functions

static ItemCreateItem (uint32 item, uint32 count, Player const *player=nullptr, bool clone=false, uint32 randomPropertyId=0)
 
static void DeleteFromDB (CharacterDatabaseTransaction trans, ObjectGuid::LowType itemGuid)
 
static void DeleteFromInventoryDB (CharacterDatabaseTransaction trans, ObjectGuid::LowType itemGuid)
 
static int32 GenerateItemRandomPropertyId (uint32 item_id)
 
- Static Public Member Functions inherited from Object
static ObjectGuid GetGUID (Object const *o)
 

Public Attributes

Loot loot
 
bool m_lootGenerated
 
- Public Attributes inherited from Object
DataMap CustomData
 

Private Attributes

std::string m_text
 
uint8 m_slot
 
Bagm_container
 
ItemUpdateState uState
 
int32 uQueuePos
 
bool mb_in_trade
 
time_t m_lastPlayedTimeUpdate
 
uint32 m_refundRecipient
 
uint32 m_paidMoney
 
uint32 m_paidExtendedCost
 
AllowedLooterSet allowedGUIDs
 

Additional Inherited Members

- Protected Member Functions inherited from Object
 Object ()
 
void _InitValues ()
 
void _Create (ObjectGuid::LowType guidlow, uint32 entry, HighGuid guidhigh)
 
void _Create (ObjectGuid guid)
 
std::string _ConcatFields (uint16 startIndex, uint16 size) const
 
bool _LoadIntoDataField (std::string const &data, uint32 startOffset, uint32 count)
 
uint32 GetUpdateFieldData (Player const *target, uint32 *&flags) const
 
void BuildMovementUpdate (ByteBuffer *data, uint16 flags) const
 
virtual void BuildValuesUpdate (uint8 updateType, ByteBuffer *data, Player *target)
 
void AddToObjectUpdateIfNeeded ()
 
- Protected Attributes inherited from Object
uint16 m_objectType
 
TypeID m_objectTypeId
 
uint16 m_updateFlag
 
union { 
 
   int32 *   m_int32Values 
 
   uint32 *   m_uint32Values 
 
   float *   m_floatValues 
 
};  
 
UpdateMask _changesMask
 
uint16 m_valuesCount
 
uint16 _fieldNotifyFlags
 
bool m_objectUpdated
 

Detailed Description

Constructor & Destructor Documentation

◆ Item()

Item::Item ( )
263{
266
268
270 m_slot = 0;
272 uQueuePos = -1;
273 m_container = nullptr;
274 m_lootGenerated = false;
275 mb_in_trade = false;
277
279 m_paidMoney = 0;
281}
@ ITEM_NEW
Definition Item.h:211
@ TYPEID_ITEM
Definition ObjectGuid.h:36
@ TYPEMASK_ITEM
Definition ObjectGuid.h:50
@ UPDATEFLAG_LOWGUID
Definition UpdateData.h:43
@ ITEM_END
Definition UpdateFields.h:73
int32 uQueuePos
Definition Item.h:372
Bag * m_container
Definition Item.h:370
bool mb_in_trade
Definition Item.h:373
uint32 m_paidMoney
Definition Item.h:376
time_t m_lastPlayedTimeUpdate
Definition Item.h:374
uint32 m_paidExtendedCost
Definition Item.h:377
bool m_lootGenerated
Definition Item.h:321
uint32 m_refundRecipient
Definition Item.h:375
uint8 m_slot
Definition Item.h:369
ItemUpdateState uState
Definition Item.h:371
uint16 m_objectType
Definition Object.h:253
uint16 m_valuesCount
Definition Object.h:267
uint16 m_updateFlag
Definition Object.h:256
TypeID m_objectTypeId
Definition Object.h:255
Seconds GetGameTime()
Definition GameTime.cpp:38

References GameTime::GetGameTime(), ITEM_END, ITEM_NEW, m_container, m_lastPlayedTimeUpdate, m_lootGenerated, Object::m_objectType, Object::m_objectTypeId, m_paidExtendedCost, m_paidMoney, m_refundRecipient, m_slot, Object::m_updateFlag, Object::m_valuesCount, mb_in_trade, TYPEID_ITEM, TYPEMASK_ITEM, UPDATEFLAG_LOWGUID, uQueuePos, and uState.

Member Function Documentation

◆ AddToObjectUpdate()

void Item::AddToObjectUpdate ( )
overridevirtual

Implements Object.

1171{
1172 if (Player* owner = GetOwner())
1173 owner->GetMap()->AddUpdateObject(this);
1174}
Player * GetOwner() const
Definition Item.cpp:550
Definition Player.h:1086

References GetOwner().

◆ AddToUpdateQueueOf()

void Item::AddToUpdateQueueOf ( Player player)
746{
747 if (IsInUpdateQueue())
748 return;
749
750 ASSERT(player);
751
752 if (player->GetGUID() != GetOwnerGUID())
753 {
754 LOG_DEBUG("entities.player.items", "Item::AddToUpdateQueueOf - Owner's guid ({}) and player's guid ({}) don't match!", GetOwnerGUID().ToString(), player->GetGUID().ToString());
755 return;
756 }
757
758 if (player->m_itemUpdateQueueBlocked)
759 return;
760
761 player->m_itemUpdateQueue.push_back(this);
762 uQueuePos = player->m_itemUpdateQueue.size() - 1;
763}
#define ASSERT
Definition Errors.h:68
#define LOG_DEBUG(filterType__,...)
Definition Log.h:157
ObjectGuid GetOwnerGUID() const
Definition Item.h:231
bool IsInUpdateQueue() const
Definition Item.h:328
std::string ToString() const
Definition ObjectGuid.cpp:48
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
std::vector< Item * > m_itemUpdateQueue
Definition Player.h:2852
bool m_itemUpdateQueueBlocked
Definition Player.h:2853
std::string ToString(Type &&val, Params &&... params)
Definition StringConvert.h:250

References ASSERT, Object::GetGUID(), GetOwnerGUID(), IsInUpdateQueue(), LOG_DEBUG, Player::m_itemUpdateQueue, Player::m_itemUpdateQueueBlocked, ObjectGuid::ToString(), and uQueuePos.

Referenced by SetState().

◆ BuildUpdate()

void Item::BuildUpdate ( UpdateDataMapType data_map)
overridevirtual

Reimplemented from Object.

1164{
1165 if (Player* owner = GetOwner())
1166 BuildFieldsUpdate(owner, data_map);
1167 ClearUpdateMask(false);
1168}
void BuildFieldsUpdate(Player *, UpdateDataMapType &)
Definition Object.cpp:538
void ClearUpdateMask(bool remove)
Definition Object.cpp:526

References Object::BuildFieldsUpdate(), Object::ClearUpdateMask(), and GetOwner().

◆ CanBeMergedPartlyWith()

InventoryResult Item::CanBeMergedPartlyWith ( ItemTemplate const *  proto) const
869{
870 // not allow merge looting currently items
871 if (m_lootGenerated)
873
874 // check item type
875 if (GetEntry() != proto->ItemId)
877
878 // check free space (full stacks can't be target of merge
879 if (GetCount() >= proto->GetMaxStackSize())
881
882 return EQUIP_ERR_OK;
883}
@ EQUIP_ERR_ALREADY_LOOTED
Definition Item.h:96
@ EQUIP_ERR_OK
Definition Item.h:47
@ EQUIP_ERR_ITEM_CANT_STACK
Definition Item.h:66
uint32 GetCount() const
Definition Item.h:272
uint32 GetEntry() const
Definition Object.h:117

References EQUIP_ERR_ALREADY_LOOTED, EQUIP_ERR_ITEM_CANT_STACK, EQUIP_ERR_OK, GetCount(), Object::GetEntry(), ItemTemplate::GetMaxStackSize(), ItemTemplate::ItemId, and m_lootGenerated.

Referenced by Player::CanStoreItem_InBag(), Player::CanStoreItem_InInventorySlots(), Player::CanStoreItem_InSpecificSlot(), and Player::CanStoreItems().

◆ CanBeTraded()

bool Item::CanBeTraded ( bool  mail = false,
bool  trade = false 
) const
796{
797 if ((!mail || !IsBoundAccountWide()) && (IsSoulBound() && (!IsBOPTradable() || !trade)))
798 return false;
799
800 if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()))
801 return false;
802
803 if (Player* owner = GetOwner())
804 {
805 if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK)
806 return false;
807
808 // Xinef: check if item is looted now
809 if (owner->GetLootGUID() == GetGUID())
810 return false;
811 }
812
813 if (IsBoundByTempEnchant()) // pussywizard
814 return false;
815
816 if ((!mail || !IsBoundAccountWide()) && IsBoundByEnchant())
817 return false;
818
819 return true;
820}
Definition Bag.h:28
bool IsBoundByTempEnchant() const
Definition Item.cpp:859
bool IsBoundAccountWide() const
Definition Item.h:237
bool IsSoulBound() const
Definition Item.h:236
bool IsBOPTradable() const
Definition Item.h:262
uint16 GetPos() const
Definition Item.h:285
bool IsBoundByEnchant() const
Definition Item.cpp:848
bool IsBag() const
Definition Item.h:254
ObjectGuid GetGUID() const
Definition Object.h:115
static bool IsBagPos(uint16 pos)
Definition PlayerStorage.cpp:594

References EQUIP_ERR_OK, Object::GetGUID(), GetOwner(), GetPos(), IsBag(), Player::IsBagPos(), IsBOPTradable(), IsBoundAccountWide(), IsBoundByEnchant(), IsBoundByTempEnchant(), and IsSoulBound().

Referenced by ToCloud9GrpcHandler::GetPlayerItemsByGuids(), WorldSession::HandleAuctionSellItem(), WorldSession::HandleSendMail(), and WorldSession::HandleSetTradeItemOpcode().

◆ CheckSoulboundTradeExpire()

bool Item::CheckSoulboundTradeExpire ( )
1288{
1289 // called from owner's update - GetOwner() MUST be valid
1290 if (GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME) + 2 * HOUR < GetOwner()->GetTotalPlayedTime())
1291 {
1293 return true; // remove from tradeable list
1294 }
1295
1296 return false;
1297}
constexpr auto HOUR
Definition Common.h:48
@ ITEM_FIELD_CREATE_PLAYED_TIME
Definition UpdateFields.h:71
void ClearSoulboundTradeable(Player *currentOwner)
Definition Item.cpp:1274
uint32 GetUInt32Value(uint16 index) const
Definition Object.cpp:298

References ClearSoulboundTradeable(), GetOwner(), Object::GetUInt32Value(), HOUR, and ITEM_FIELD_CREATE_PLAYED_TIME.

◆ ClearEnchantment()

void Item::ClearEnchantment ( EnchantmentSlot  slot)
962{
963 if (!GetEnchantmentId(slot))
964 return;
965
966 for (uint8 x = 0; x < MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS; ++x)
969}
#define MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS
Definition DBCStructure.h:1838
std::uint8_t uint8
Definition Define.h:109
#define MAX_ENCHANTMENT_OFFSET
Definition Item.h:197
@ ITEM_CHANGED
Definition Item.h:210
@ ITEM_FIELD_ENCHANTMENT_1_1
Definition UpdateFields.h:43
void SetState(ItemUpdateState state, Player *forplayer=nullptr)
Definition Item.cpp:715
uint32 GetEnchantmentId(EnchantmentSlot slot) const
Definition Item.h:304
void SetUInt32Value(uint16 index, uint32 value)
Definition Object.cpp:643

References GetEnchantmentId(), GetOwner(), ITEM_CHANGED, ITEM_FIELD_ENCHANTMENT_1_1, MAX_ENCHANTMENT_OFFSET, MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS, SetState(), and Object::SetUInt32Value().

Referenced by Player::CastItemCombatSpell(), WorldSession::HandleCancelTempEnchantmentOpcode(), and Player::SetVirtualItemSlot().

◆ ClearSoulboundTradeable()

void Item::ClearSoulboundTradeable ( Player currentOwner)
1275{
1277 if (allowedGUIDs.empty())
1278 return;
1279
1280 allowedGUIDs.clear();
1281 SetState(ITEM_CHANGED, currentOwner);
1283 stmt->SetData(0, GetGUID().GetCounter());
1284 CharacterDatabase.Execute(stmt);
1285}
@ CHAR_DEL_ITEM_BOP_TRADE
Definition CharacterDatabase.h:121
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition DatabaseEnv.cpp:21
@ ITEM_FIELD_FLAG_BOP_TRADEABLE
Definition ItemTemplate.h:117
@ ITEM_FIELD_FLAGS
Definition UpdateFields.h:42
AllowedLooterSet allowedGUIDs
Definition Item.h:378
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition Object.cpp:846
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition PreparedStatement.h:77
Definition PreparedStatement.h:157

References allowedGUIDs, CHAR_DEL_ITEM_BOP_TRADE, CharacterDatabase, Object::GetGUID(), ITEM_CHANGED, ITEM_FIELD_FLAG_BOP_TRADEABLE, ITEM_FIELD_FLAGS, Object::RemoveFlag(), PreparedStatementBase::SetData(), and SetState().

Referenced by Player::_LoadItem(), Player::_StoreItem(), CheckSoulboundTradeExpire(), Player::DestroyItem(), Spell::EffectEnchantItemPerm(), Spell::EffectEnchantItemPrismatic(), Spell::EffectEnchantItemTmp(), Player::EquipItem(), and WorldSession::HandleSocketOpcode().

◆ CloneItem()

Item * Item::CloneItem ( uint32  count,
Player const *  player = nullptr 
) const
1129{
1130 // player CAN be nullptr in which case we must not update random properties because that accesses player's item update queue
1131 Item* newItem = CreateItem(GetEntry(), count, player, true, player ? GetItemRandomPropertyId() : 0);
1132 if (!newItem)
1133 return nullptr;
1134
1139 return newItem;
1140}
@ ITEM_FIELD_FLAG_REFUNDABLE
Definition ItemTemplate.h:121
@ ITEM_FIELD_DURATION
Definition UpdateFields.h:40
@ ITEM_FIELD_CREATOR
Definition UpdateFields.h:37
@ ITEM_FIELD_GIFTCREATOR
Definition UpdateFields.h:38
Definition Item.h:220
static Item * CreateItem(uint32 item, uint32 count, Player const *player=nullptr, bool clone=false, uint32 randomPropertyId=0)
Definition Item.cpp:1094
int32 GetItemRandomPropertyId() const
Definition Item.h:295

References CreateItem(), Object::GetEntry(), GetItemRandomPropertyId(), Object::GetUInt32Value(), ITEM_FIELD_CREATOR, ITEM_FIELD_DURATION, ITEM_FIELD_FLAG_BOP_TRADEABLE, ITEM_FIELD_FLAG_REFUNDABLE, ITEM_FIELD_FLAGS, ITEM_FIELD_GIFTCREATOR, and Object::SetUInt32Value().

Referenced by Guild::BankMoveItemData::_StoreItem(), Player::_StoreItem(), WorldSession::HandleAcceptTradeOpcode(), WorldSession::HandleAuctionSellItem(), WorldSession::HandleSellItemOpcode(), and Player::SplitItem().

◆ Create()

bool Item::Create ( ObjectGuid::LowType  guidlow,
uint32  itemid,
Player const *  owner 
)
virtual

Reimplemented in Bag.

284{
285 Object::_Create(guidlow, 0, HighGuid::Item);
286
287 SetEntry(itemid);
288 SetObjectScale(1.0f);
289
290 SetGuidValue(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : ObjectGuid::Empty);
291 SetGuidValue(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : ObjectGuid::Empty);
292
293 ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(itemid);
294 if (!itemProto)
295 return false;
296
300
301 for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
302 SetSpellCharges(i, itemProto->Spells[i].SpellCharges);
303
306 sScriptMgr->OnItemCreate(this, itemProto, owner);
307 return true;
308}
#define MAX_ITEM_PROTO_SPELLS
Definition ItemTemplate.h:615
#define sObjectMgr
Definition ObjectMgr.h:1730
#define sScriptMgr
Definition ScriptMgr.h:743
@ ITEM_FIELD_DURABILITY
Definition UpdateFields.h:69
@ ITEM_FIELD_STACK_COUNT
Definition UpdateFields.h:39
@ ITEM_FIELD_MAXDURABILITY
Definition UpdateFields.h:70
@ ITEM_FIELD_OWNER
Definition UpdateFields.h:35
@ ITEM_FIELD_CONTAINED
Definition UpdateFields.h:36
void SetSpellCharges(uint8 index, int32 value)
Definition Item.h:318
Definition ObjectGuid.h:121
void _Create(ObjectGuid::LowType guidlow, uint32 entry, HighGuid guidhigh)
Definition Object.cpp:123
void SetGuidValue(uint16 index, ObjectGuid value)
Definition Object.cpp:716
void SetEntry(uint32 entry)
Definition Object.h:118
virtual void SetObjectScale(float scale)
Definition Object.h:121
Definition ItemTemplate.h:619
_Spell Spells[MAX_ITEM_PROTO_SPELLS]
Definition ItemTemplate.h:662
uint32 MaxDurability
Definition ItemTemplate.h:676
uint32 Duration
Definition ItemTemplate.h:686
int32 SpellCharges
Definition ItemTemplate.h:593

References Object::_Create(), ObjectGuid::Empty, Object::GetGUID(), Item, ITEM_FIELD_CONTAINED, ITEM_FIELD_CREATE_PLAYED_TIME, ITEM_FIELD_DURABILITY, ITEM_FIELD_DURATION, ITEM_FIELD_MAXDURABILITY, ITEM_FIELD_OWNER, ITEM_FIELD_STACK_COUNT, MAX_ITEM_PROTO_SPELLS, Object::SetEntry(), Object::SetGuidValue(), Object::SetObjectScale(), SetSpellCharges(), Object::SetUInt32Value(), sObjectMgr, and sScriptMgr.

Referenced by ToCloud9GrpcHandler::AddExistingItemToPlayer(), CreateItem(), and WorldSession::HandleMailCreateTextItem().

◆ CreateItem()

Item * Item::CreateItem ( uint32  item,
uint32  count,
Player const *  player = nullptr,
bool  clone = false,
uint32  randomPropertyId = 0 
)
static
1095{
1096 if (count < 1)
1097 return nullptr; //don't create item at zero count
1098
1099 ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
1100 if (!pProto)
1101 ABORT();
1102
1103 if (count > pProto->GetMaxStackSize())
1104 count = pProto->GetMaxStackSize();
1105
1106 ASSERT_NODEBUGINFO(count != 0 && "pProto->Stackable == 0 but checked at loading already");
1107
1109 if (sToCloud9Sidecar->IsCrossrealm() && player)
1110 realmId = player->GetGUID().GetRealmID();
1111
1112 Item* pItem = NewItemOrBag(pProto);
1113 if (!pItem->Create(sObjectMgr->GetGenerator<HighGuid::Item>().Generate(realmId), item, player))
1114 {
1115 delete pItem;
1116 return nullptr;
1117 }
1118
1119 pItem->SetCount(count);
1120 if (!clone)
1121 pItem->SetItemRandomProperties(randomPropertyId ? randomPropertyId : Item::GenerateItemRandomPropertyId(item));
1122 else if (randomPropertyId)
1123 pItem->SetItemRandomProperties(randomPropertyId);
1124
1125 return pItem;
1126}
Item * NewItemOrBag(ItemTemplate const *proto)
Definition Bag.h:67
std::uint16_t uint16
Definition Define.h:108
#define ABORT
Definition Errors.h:76
#define ASSERT_NODEBUGINFO
Definition Errors.h:69
constexpr uint16 DEFAULT_NON_CROSSREALM_REALM_ID
Definition ObjectGuid.h:31
#define sToCloud9Sidecar
Definition TC9Sidecar.h:76
virtual bool Create(ObjectGuid::LowType guidlow, uint32 itemid, Player const *owner)
Definition Item.cpp:283
void SetItemRandomProperties(int32 randomPropId)
Definition Item.cpp:669
void SetCount(uint32 value)
Definition Item.h:273
static int32 GenerateItemRandomPropertyId(uint32 item_id)
Definition Item.cpp:623
uint32 GetMaxStackSize() const
Definition ItemTemplate.h:727

References ABORT, ASSERT_NODEBUGINFO, Create(), DEFAULT_NON_CROSSREALM_REALM_ID, GenerateItemRandomPropertyId(), Object::GetGUID(), ItemTemplate::GetMaxStackSize(), ObjectGuid::GetRealmID(), Item, NewItemOrBag(), SetCount(), SetItemRandomProperties(), sObjectMgr, and sToCloud9Sidecar.

Referenced by Player::CanEquipNewItem(), CloneItem(), AchievementMgr::CompletedAchievement(), Spell::EffectSummonChangeItem(), Player::EquipNewItem(), item_commandscript::HandleItemRefundCommand(), item_commandscript::HandleItemRestoreCommand(), quest_commandscript::HandleQuestComplete(), quest_commandscript::HandleQuestReward(), spell_gen_spirit_of_competition_participant::HandleScript(), spell_gen_spirit_of_competition_winner::HandleScript(), send_commandscript::HandleSendItemsCommand(), MailDraft::prepareItems(), ArenaSeasonTeamRewarderImpl::RewardWithMail(), Player::SendItemRetrievalMail(), SendRollWonItemViaMail(), WorldState::SendScourgeInvasionMail(), ServerMailMgr::SendServerMail(), and Player::StoreNewItem().

◆ DeleteFromDB() [1/2]

void Item::DeleteFromDB ( CharacterDatabaseTransaction  trans)
virtual

Reimplemented in Bag.

528{
529 DeleteFromDB(trans, GetGUID().GetCounter());
530}
static void DeleteFromDB(CharacterDatabaseTransaction trans, ObjectGuid::LowType itemGuid)
Definition Item.cpp:519

References DeleteFromDB(), and Object::GetGUID().

◆ DeleteFromDB() [2/2]

void Item::DeleteFromDB ( CharacterDatabaseTransaction  trans,
ObjectGuid::LowType  itemGuid 
)
static

◆ DeleteFromInventoryDB() [1/2]

void Item::DeleteFromInventoryDB ( CharacterDatabaseTransaction  trans)
541{
542 DeleteFromInventoryDB(trans, GetGUID().GetCounter());
543}
static void DeleteFromInventoryDB(CharacterDatabaseTransaction trans, ObjectGuid::LowType itemGuid)
Definition Item.cpp:533

References DeleteFromInventoryDB(), and Object::GetGUID().

◆ DeleteFromInventoryDB() [2/2]

◆ DeleteRefundDataFromDB()

void Item::DeleteRefundDataFromDB ( CharacterDatabaseTransaction trans)
1201{
1202 if (trans)
1203 {
1205 stmt->SetData(0, GetGUID().GetCounter());
1206 (*trans)->Append(stmt);
1207 }
1208}
@ CHAR_DEL_ITEM_REFUND_INSTANCE
Definition CharacterDatabase.h:380

References CHAR_DEL_ITEM_REFUND_INSTANCE, CharacterDatabase, Object::GetGUID(), and PreparedStatementBase::SetData().

Referenced by SetNotRefundable().

◆ FSetState()

◆ GemsFitSockets()

bool Item::GemsFitSockets ( ) const
972{
973 for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + MAX_GEM_SOCKETS; ++enchant_slot)
974 {
976
977 if (!SocketColor) // no socket slot
978 continue;
979
980 uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
981 if (!enchant_id) // no gems on this socket
982 return false;
983
984 SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
985 if (!enchantEntry) // invalid gem id on this socket
986 return false;
987
988 uint8 GemColor = 0;
989
990 uint32 gemid = enchantEntry->GemID;
991 if (gemid)
992 {
993 ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(gemid);
994 if (gemProto)
995 {
996 GemPropertiesEntry const* gemProperty = sGemPropertiesStore.LookupEntry(gemProto->GemProperties);
997 if (gemProperty)
998 GemColor = gemProperty->color;
999 }
1000 }
1001
1002 if (!(GemColor & SocketColor)) // bad gem color on this socket
1003 return false;
1004 }
1005 return true;
1006}
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< GemPropertiesEntry > sGemPropertiesStore(GemPropertiesEntryfmt)
std::uint32_t uint32
Definition Define.h:107
SocketColor
Definition ItemTemplate.h:245
#define MAX_GEM_SOCKETS
Definition Item.h:188
EnchantmentSlot
Definition Item.h:168
@ SOCK_ENCHANTMENT_SLOT
Definition Item.h:171
ItemTemplate const * GetTemplate() const
Definition Item.cpp:545
Definition DBCStructure.h:1017
uint32 color
Definition DBCStructure.h:1020
uint32 GemProperties
Definition ItemTemplate.h:683
_Socket Socket[MAX_ITEM_PROTO_SOCKETS]
Definition ItemTemplate.h:681
Definition DBCStructure.h:1841
uint32 GemID
Definition DBCStructure.h:1852
uint32 Color
Definition ItemTemplate.h:602

References _Socket::Color, GemPropertiesEntry::color, SpellItemEnchantmentEntry::GemID, ItemTemplate::GemProperties, GetEnchantmentId(), GetTemplate(), MAX_GEM_SOCKETS, sGemPropertiesStore, sObjectMgr, SOCK_ENCHANTMENT_SLOT, ItemTemplate::Socket, and sSpellItemEnchantmentStore.

Referenced by WorldSession::HandleSocketOpcode().

◆ GenerateItemRandomPropertyId()

int32 Item::GenerateItemRandomPropertyId ( uint32  item_id)
static
624{
625 ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id);
626
627 if (!itemProto)
628 return 0;
629
630 // item must have one from this field values not null if it can have random enchantments
631 if ((!itemProto->RandomProperty) && (!itemProto->RandomSuffix))
632 return 0;
633
634 // item can have not null only one from field values
635 if ((itemProto->RandomProperty) && (itemProto->RandomSuffix))
636 {
637 LOG_ERROR("sql.sql", "Item template {} have RandomProperty == {} and RandomSuffix == {}, but must have one from field =0", itemProto->ItemId, itemProto->RandomProperty, itemProto->RandomSuffix);
638 return 0;
639 }
640
641 // RandomProperty case
642 if (itemProto->RandomProperty)
643 {
644 uint32 randomPropId = GetItemEnchantMod(itemProto->RandomProperty);
645 ItemRandomPropertiesEntry const* random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
646 if (!random_id)
647 {
648 LOG_ERROR("sql.sql", "Enchantment id #{} used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
649 return 0;
650 }
651
652 return random_id->ID;
653 }
654 // RandomSuffix case
655 else
656 {
657 uint32 randomPropId = GetItemEnchantMod(itemProto->RandomSuffix);
658 ItemRandomSuffixEntry const* random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
659 if (!random_id)
660 {
661 LOG_ERROR("sql.sql", "Enchantment id #{} used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
662 return 0;
663 }
664
665 return -int32(random_id->ID);
666 }
667}
DBCStorage< ItemRandomSuffixEntry > sItemRandomSuffixStore(ItemRandomSuffixfmt)
DBCStorage< ItemRandomPropertiesEntry > sItemRandomPropertiesStore(ItemRandomPropertiesfmt)
std::int32_t int32
Definition Define.h:103
uint32 GetItemEnchantMod(int32 entry)
Definition ItemEnchantmentMgr.cpp:84
#define LOG_ERROR(filterType__,...)
Definition Log.h:145
Definition DBCStructure.h:1210
uint32 ID
Definition DBCStructure.h:1211
Definition DBCStructure.h:1219
uint32 ID
Definition DBCStructure.h:1220
int32 RandomProperty
Definition ItemTemplate.h:672
int32 RandomSuffix
Definition ItemTemplate.h:673
uint32 ItemId
Definition ItemTemplate.h:620

References GetItemEnchantMod(), ItemRandomPropertiesEntry::ID, ItemRandomSuffixEntry::ID, ItemTemplate::ItemId, LOG_ERROR, ItemTemplate::RandomProperty, ItemTemplate::RandomSuffix, sItemRandomPropertiesStore, sItemRandomSuffixStore, and sObjectMgr.

Referenced by CreateItem(), and LootItem::LootItem().

◆ GetBagSlot()

◆ GetContainer()

Bag * Item::GetContainer ( )
inline

◆ GetCount()

uint32 Item::GetCount ( ) const
inline

References Object::GetUInt32Value(), and ITEM_FIELD_STACK_COUNT.

Referenced by Guild::_DoItemsMove(), Guild::BankMoveItemData::_ReserveSpace(), Player::_StoreItem(), AuctionHouseSearcher::AddAuction(), Player::CanBankItem(), CanBeMergedPartlyWith(), Player::CanEquipItem(), Guild::BankMoveItemData::CanStore(), Player::CanStoreItem(), Player::CanStoreItem_InBag(), Player::CanStoreItem_InInventorySlots(), Player::CanStoreItem_InSpecificSlot(), Player::CanStoreItems(), Player::CanTakeMoreSimilarItems(), Player::CanUnequipItem(), Spell::CheckItems(), Player::DestroyItem(), Player::DestroyItemCount(), WorldSession::DoLootRelease(), Spell::EffectMilling(), Spell::EffectProspecting(), Player::EquipItem(), GetDebugInfo(), Bag::GetItemCount(), Bag::GetItemCountWithLimitCategory(), ToCloud9GrpcHandler::GetPlayerItemsByGuids(), WorldSession::HandleAcceptTradeOpcode(), WorldSession::HandleAuctionSellItem(), WorldSession::HandleAutoBankItemOpcode(), WorldSession::HandleAutoStoreBankItemOpcode(), WorldSession::HandleBuybackItem(), WorldSession::HandleGetMailList(), WorldSession::HandleMailTakeItem(), WorldSession::HandleSellItemOpcode(), WorldSession::HandleSendMail(), Player::HasItemCount(), Player::HasItemOrGemWithIdEquipped(), Player::HasItemOrGemWithLimitCategoryEquipped(), Guild::BankMoveItemData::LogAction(), Player::MoveItemToInventory(), WorldSession::recoveryItem(), SaveToDB(), Player::SendNewItem(), Player::SplitItem(), Guild::BankMoveItemData::StoreItem(), and Player::SwapItem().

◆ GetDebugInfo()

std::string Item::GetDebugInfo ( ) const
overridevirtual

Reimplemented from Object.

1300{
1301 std::stringstream sstr;
1302 sstr << Object::GetDebugInfo() << "\n"
1303 << std::boolalpha
1304 << "Owner: " << GetOwnerGUID().ToString() << " Count: " << GetCount()
1305 << " BagSlot: " << std::to_string(GetBagSlot()) << " Slot: " << std::to_string(GetSlot()) << " Equipped: " << IsEquipped();
1306 return sstr.str();
1307}
bool IsEquipped() const
Definition Item.cpp:790
uint8 GetBagSlot() const
Definition Item.cpp:785
virtual std::string GetDebugInfo() const
Definition Object.cpp:995

References GetBagSlot(), GetCount(), Object::GetDebugInfo(), GetOwnerGUID(), GetSlot(), IsEquipped(), and ObjectGuid::ToString().

Referenced by Bag::GetDebugInfo().

◆ GetEnchantmentCharges()

◆ GetEnchantmentDuration()

◆ GetEnchantmentId()

◆ GetEnchantRequiredLevel()

uint32 Item::GetEnchantRequiredLevel ( ) const
835{
836 uint32 level = 0;
837
838 // Check all enchants for required level
839 for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
840 if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
841 if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
842 if (enchantEntry->requiredLevel > level)
843 level = enchantEntry->requiredLevel;
844
845 return level;
846}
@ PERM_ENCHANTMENT_SLOT
Definition Item.h:169
@ MAX_ENCHANTMENT_SLOT
Definition Item.h:183

References GetEnchantmentId(), MAX_ENCHANTMENT_SLOT, PERM_ENCHANTMENT_SLOT, and sSpellItemEnchantmentStore.

◆ GetGemCountWithID()

uint8 Item::GetGemCountWithID ( uint32  GemID) const
1016{
1017 uint8 count = 0;
1018 for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot <= PRISMATIC_ENCHANTMENT_SLOT; ++enchant_slot)
1019 {
1020 if (enchant_slot == BONUS_ENCHANTMENT_SLOT)
1021 continue;
1022
1023 uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
1024 if (!enchant_id)
1025 continue;
1026
1027 SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
1028 if (!enchantEntry)
1029 continue;
1030
1031 if (GemID == enchantEntry->GemID)
1032 ++count;
1033 }
1034 return count;
1035}
@ PRISMATIC_ENCHANTMENT_SLOT
Definition Item.h:175
@ BONUS_ENCHANTMENT_SLOT
Definition Item.h:174

References BONUS_ENCHANTMENT_SLOT, SpellItemEnchantmentEntry::GemID, GetEnchantmentId(), PRISMATIC_ENCHANTMENT_SLOT, SOCK_ENCHANTMENT_SLOT, and sSpellItemEnchantmentStore.

Referenced by Bag::GetItemCount(), and Player::HasItemOrGemWithIdEquipped().

◆ GetGemCountWithLimitCategory()

uint8 Item::GetGemCountWithLimitCategory ( uint32  limitCategory) const
1038{
1039 uint8 count = 0;
1040 for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot <= PRISMATIC_ENCHANTMENT_SLOT; ++enchant_slot)
1041 {
1042 if (enchant_slot == BONUS_ENCHANTMENT_SLOT)
1043 continue;
1044
1045 uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
1046 if (!enchant_id)
1047 continue;
1048
1049 SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
1050 if (!enchantEntry)
1051 continue;
1052
1053 ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID);
1054 if (!gemProto)
1055 continue;
1056
1057 if (gemProto->ItemLimitCategory == limitCategory)
1058 ++count;
1059 }
1060 return count;
1061}
uint32 ItemLimitCategory
Definition ItemTemplate.h:687

References BONUS_ENCHANTMENT_SLOT, SpellItemEnchantmentEntry::GemID, GetEnchantmentId(), ItemTemplate::ItemLimitCategory, PRISMATIC_ENCHANTMENT_SLOT, sObjectMgr, SOCK_ENCHANTMENT_SLOT, and sSpellItemEnchantmentStore.

Referenced by Player::CanEquipUniqueItem(), and Player::HasItemOrGemWithLimitCategoryEquipped().

◆ GetItemRandomPropertyId()

◆ GetItemSuffixFactor()

◆ GetMaxStackCount()

◆ GetOwner()

◆ GetOwnerGUID()

◆ GetPaidExtendedCost()

uint32 Item::GetPaidExtendedCost ( )
inline

◆ GetPaidMoney()

uint32 Item::GetPaidMoney ( )
inline

◆ GetPlayedTime()

uint32 Item::GetPlayedTime ( )

◆ GetPos()

◆ GetQueuePos()

uint32 Item::GetQueuePos ( ) const
inline

◆ GetRefundRecipient()

ObjectGuid::LowType Item::GetRefundRecipient ( )
inline

◆ GetScriptId()

◆ GetSkill()

uint32 Item::GetSkill ( )
557{
558 return GetTemplate()->GetSkill();
559}
uint32 GetSkill() const
Definition ItemTemplate.h:782

References ItemTemplate::GetSkill(), and GetTemplate().

Referenced by Player::CanUseItem(), Player::GetBaseWeaponSkillValue(), Unit::GetWeaponSkillValue(), and Player::UpdateWeaponSkill().

◆ GetSlot()

◆ GetSpell()

uint32 Item::GetSpell ( )
562{
563 ItemTemplate const* proto = GetTemplate();
564
565 switch (proto->Class)
566 {
568 switch (proto->SubClass)
569 {
571 return 196;
573 return 197;
575 return 264;
577 return 266;
579 return 198;
581 return 199;
583 return 200;
585 return 201;
587 return 202;
589 return 227;
591 return 1180;
593 return 2567;
595 return 3386;
597 return 5011;
599 return 5009;
600 default:
601 return 0;
602 }
603 case ITEM_CLASS_ARMOR:
604 switch (proto->SubClass)
605 {
607 return 9078;
609 return 9077;
611 return 8737;
613 return 750;
615 return 9116;
616 default:
617 return 0;
618 }
619 }
620 return 0;
621}
@ ITEM_SUBCLASS_WEAPON_CROSSBOW
Definition ItemTemplate.h:362
@ ITEM_SUBCLASS_WEAPON_GUN
Definition ItemTemplate.h:347
@ ITEM_SUBCLASS_WEAPON_AXE2
Definition ItemTemplate.h:345
@ ITEM_SUBCLASS_WEAPON_SPEAR
Definition ItemTemplate.h:361
@ ITEM_SUBCLASS_WEAPON_STAFF
Definition ItemTemplate.h:354
@ ITEM_SUBCLASS_WEAPON_MACE
Definition ItemTemplate.h:348
@ ITEM_SUBCLASS_WEAPON_MACE2
Definition ItemTemplate.h:349
@ ITEM_SUBCLASS_WEAPON_DAGGER
Definition ItemTemplate.h:359
@ ITEM_SUBCLASS_WEAPON_BOW
Definition ItemTemplate.h:346
@ ITEM_SUBCLASS_WEAPON_SWORD
Definition ItemTemplate.h:351
@ ITEM_SUBCLASS_WEAPON_AXE
Definition ItemTemplate.h:344
@ ITEM_SUBCLASS_WEAPON_WAND
Definition ItemTemplate.h:363
@ ITEM_SUBCLASS_WEAPON_THROWN
Definition ItemTemplate.h:360
@ ITEM_SUBCLASS_WEAPON_SWORD2
Definition ItemTemplate.h:352
@ ITEM_SUBCLASS_WEAPON_POLEARM
Definition ItemTemplate.h:350
@ ITEM_SUBCLASS_ARMOR_MAIL
Definition ItemTemplate.h:393
@ ITEM_SUBCLASS_ARMOR_CLOTH
Definition ItemTemplate.h:391
@ ITEM_SUBCLASS_ARMOR_LEATHER
Definition ItemTemplate.h:392
@ ITEM_SUBCLASS_ARMOR_SHIELD
Definition ItemTemplate.h:396
@ ITEM_SUBCLASS_ARMOR_PLATE
Definition ItemTemplate.h:394
@ ITEM_CLASS_ARMOR
Definition ItemTemplate.h:295
@ ITEM_CLASS_WEAPON
Definition ItemTemplate.h:293
uint32 Class
Definition ItemTemplate.h:621
uint32 SubClass
Definition ItemTemplate.h:622

References ItemTemplate::Class, GetTemplate(), ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON, ITEM_SUBCLASS_ARMOR_CLOTH, ITEM_SUBCLASS_ARMOR_LEATHER, ITEM_SUBCLASS_ARMOR_MAIL, ITEM_SUBCLASS_ARMOR_PLATE, ITEM_SUBCLASS_ARMOR_SHIELD, ITEM_SUBCLASS_WEAPON_AXE, ITEM_SUBCLASS_WEAPON_AXE2, ITEM_SUBCLASS_WEAPON_BOW, ITEM_SUBCLASS_WEAPON_CROSSBOW, ITEM_SUBCLASS_WEAPON_DAGGER, ITEM_SUBCLASS_WEAPON_GUN, ITEM_SUBCLASS_WEAPON_MACE, ITEM_SUBCLASS_WEAPON_MACE2, ITEM_SUBCLASS_WEAPON_POLEARM, ITEM_SUBCLASS_WEAPON_SPEAR, ITEM_SUBCLASS_WEAPON_STAFF, ITEM_SUBCLASS_WEAPON_SWORD, ITEM_SUBCLASS_WEAPON_SWORD2, ITEM_SUBCLASS_WEAPON_THROWN, ITEM_SUBCLASS_WEAPON_WAND, and ItemTemplate::SubClass.

◆ GetSpellCharges()

int32 Item::GetSpellCharges ( uint8  index = 0) const
inline

◆ GetState()

◆ GetTemplate()

ItemTemplate const * Item::GetTemplate ( ) const
546{
547 return sObjectMgr->GetItemTemplate(GetEntry());
548}

References Object::GetEntry(), and sObjectMgr.

Referenced by Player::_ApplyAllItemMods(), Player::_ApplyAllLevelScaleItemMods(), Player::_ApplyItemMods(), Player::_LoadItem(), Player::_RemoveAllItemMods(), Player::_SaveInventory(), Player::_StoreItem(), AuctionHouseSearcher::AddAuction(), AddItemsSetItem(), Player::AddQuestAndCheckCompletion(), Player::ApplyEnchantment(), Player::ApplyEquipCooldown(), Player::ApplyItemEquipSpell(), Player::ApplyItemObtainSpells(), Player::AutoUnequipOffhandIfNeed(), AuraEffect::CalculateAmount(), Player::CanBankItem(), Player::CanEquipItem(), Player::CanEquipUniqueItem(), Guild::BankMoveItemData::CanStore(), Player::CanStoreItem_InBag(), Player::CanStoreItem_InSpecificSlot(), Player::CanStoreItems(), Player::CanUnequipItem(), Player::CanUseItem(), Player::CastItemUseSpell(), Player::CheckAmmoCompatibility(), Spell::CheckCast(), Spell::CheckItems(), Player::CreateCorpse(), Player::DestroyItem(), Spell::DoCreateItem(), WorldSession::DoLootRelease(), Spell::DoSpellHitOnUnit(), Player::DurabilityRepair(), Spell::EffectDisEnchant(), Spell::EffectEnchantItemPerm(), Spell::EffectEnchantItemPrismatic(), Spell::EffectEnchantItemTmp(), Spell::EffectFeedPet(), Spell::EffectMilling(), Spell::EffectOpenLock(), Spell::EffectProspecting(), Player::EquipItem(), EquippedOk(), GemsFitSockets(), Unit::GetAPMultiplier(), AuctionHouseMgr::GetAuctionDeposit(), Player::GetAverageItemLevel(), Player::GetAverageItemLevelForDF(), Player::GetItemCount(), Bag::GetItemCount(), GetMaxStackCount(), GetScriptId(), Player::GetShield(), GetSkill(), GetSpell(), Player::GetTotalItemLevel(), Unit::GetUnitBlockChance(), Player::GetWeaponForAttack(), WorldSession::HandleAcceptTradeOpcode(), WorldSession::HandleAuctionSellItem(), WorldSession::HandleAutoEquipItemOpcode(), debug_commandscript::HandleDebugItemExpireCommand(), WorldSession::HandleDestroyItemOpcode(), WorldSession::HandleMailTakeItem(), WorldSession::HandleOpenItemOpcode(), WorldSession::HandleOpenWrappedItemCallback(), WorldSession::HandleReadItem(), WorldSession::HandleSellItemOpcode(), WorldSession::HandleSendMail(), WorldSession::HandleSocketOpcode(), WorldSession::HandleUseItemOpcode(), WorldSession::HandleWrapItemOpcode(), Player::HasItemOrGemWithLimitCategoryEquipped(), Player::HasItemTotemCategory(), hasQuest(), HasSocket(), IsArmorVellum(), IsBag(), IsBoundAccountWide(), IsConjuredConsumable(), IsCurrencyToken(), IsFitToSpellRequirements(), IsLimitedToAnotherMapOrZone(), IsPotion(), Player::IsTwoHandUsed(), IsWeaponVellum(), LoadFromDB(), Bag::LoadFromDB(), Guild::BankMoveItemData::LogAction(), WorldSession::recoveryItem(), Player::RemoveItem(), Player::SendEquipError(), Player::SendLoot(), SendRollWonItemViaMail(), Player::SetRegularAttackTime(), Player::StoreNewItem(), Spell::SummonGuardian(), Player::SwapItem(), Spell::TakeAmmo(), Spell::TakeCastItem(), Spell::TakeReagents(), Player::ToggleMetaGemsActive(), Player::UpdateDamageDoneMods(), UpdateDuration(), Player::UpdateItemDuration(), Player::UpdateWeaponSkill(), Player::VisualizeItem(), and Spell::WriteAmmoToPacket().

◆ GetText()

std::string const & Item::GetText ( ) const
inline
308{ return m_text; }
std::string m_text
Definition Item.h:368

References m_text.

Referenced by ToCloud9GrpcHandler::GetPlayerItemsByGuids().

◆ HasEnchantRequiredSkill()

bool Item::HasEnchantRequiredSkill ( Player const *  player) const
823{
824 // Check all enchants for required skill
825 for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
826 if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
827 if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
828 if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue)
829 return false;
830
831 return true;
832}

References GetEnchantmentId(), Player::GetSkillValue(), MAX_ENCHANTMENT_SLOT, PERM_ENCHANTMENT_SLOT, and sSpellItemEnchantmentStore.

◆ hasInvolvedQuest()

bool Item::hasInvolvedQuest ( uint32  ) const
inlineoverridevirtual

Reimplemented from Object.

336{ return false; }

◆ hasQuest()

bool Item::hasQuest ( uint32  quest_id) const
inlineoverridevirtual

Reimplemented from Object.

335{ return GetTemplate()->StartQuest == quest_id; }
uint32 StartQuest
Definition ItemTemplate.h:668

References GetTemplate(), and ItemTemplate::StartQuest.

◆ HasSocket()

bool Item::HasSocket ( ) const
1009{
1010 // There can only be one socket added, and it's always in slot `PRISMATIC_ENCHANTMENT_SLOT`.
1011 // Built-in sockets Socket from upgrade
1013}

References _Socket::Color, GetEnchantmentId(), GetTemplate(), PRISMATIC_ENCHANTMENT_SLOT, and ItemTemplate::Socket.

Referenced by Player::_ApplyItemMods(), Player::CorrectMetaGemEnchants(), Player::EnchantmentFitsRequirements(), Player::GetItemCount(), Bag::GetItemCount(), and Player::HasItemOrGemWithIdEquipped().

◆ IsArmorVellum()

bool Item::IsArmorVellum ( ) const
inline
339{ return GetTemplate()->IsArmorVellum(); }
bool IsArmorVellum() const
Definition ItemTemplate.h:819

References GetTemplate(), and ItemTemplate::IsArmorVellum().

Referenced by Spell::CheckItems(), and Spell::EffectEnchantItemPerm().

◆ IsBag()

bool Item::IsBag ( ) const
inline

◆ IsBindedNotWith()

bool Item::IsBindedNotWith ( Player const *  player) const
1143{
1144 // not binded item
1145 if (!IsSoulBound())
1146 return false;
1147
1148 // own item
1149 if (GetOwnerGUID() == player->GetGUID())
1150 return false;
1151
1152 if (IsBOPTradable())
1153 if (allowedGUIDs.find(player->GetGUID()) != allowedGUIDs.end())
1154 return false;
1155
1156 // BOA item case
1157 if (IsBoundAccountWide())
1158 return false;
1159
1160 return true;
1161}

References allowedGUIDs, Object::GetGUID(), GetOwnerGUID(), IsBOPTradable(), IsBoundAccountWide(), and IsSoulBound().

Referenced by Player::CanBankItem(), Player::CanEquipItem(), Player::CanStoreItem(), Player::CanStoreItems(), Player::CanUseItem(), and WorldSession::HandleSetTradeItemOpcode().

◆ IsBOPTradable()

bool Item::IsBOPTradable ( ) const
inline

◆ IsBoundAccountWide()

bool Item::IsBoundAccountWide ( ) const
inline
@ ITEM_FLAG_IS_BOUND_TO_ACCOUNT
Definition ItemTemplate.h:174
bool HasFlag(ItemFlags flag) const
Definition ItemTemplate.h:825

References GetTemplate(), ItemTemplate::HasFlag(), and ITEM_FLAG_IS_BOUND_TO_ACCOUNT.

Referenced by CanBeTraded(), WorldSession::HandleSendMail(), and IsBindedNotWith().

◆ IsBoundByEnchant()

bool Item::IsBoundByEnchant ( ) const
849{
850 // Check all enchants for soulbound
851 for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
852 if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
853 if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
854 if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
855 return true;
856 return false;
857}
@ ENCHANTMENT_CAN_SOULBOUND
Definition Item.h:201

References ENCHANTMENT_CAN_SOULBOUND, GetEnchantmentId(), MAX_ENCHANTMENT_SLOT, PERM_ENCHANTMENT_SLOT, and sSpellItemEnchantmentStore.

Referenced by CanBeTraded().

◆ IsBoundByTempEnchant()

bool Item::IsBoundByTempEnchant ( ) const
860{
862 if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
863 if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
864 return true;
865 return false;
866}
@ TEMP_ENCHANTMENT_SLOT
Definition Item.h:170

References ENCHANTMENT_CAN_SOULBOUND, GetEnchantmentId(), sSpellItemEnchantmentStore, and TEMP_ENCHANTMENT_SLOT.

Referenced by CanBeTraded().

◆ IsBroken()

◆ IsConjuredConsumable()

bool Item::IsConjuredConsumable ( ) const
inline
340{ return GetTemplate()->IsConjuredConsumable(); }
bool IsConjuredConsumable() const
Definition ItemTemplate.h:820

References GetTemplate(), and ItemTemplate::IsConjuredConsumable().

◆ IsCurrencyToken()

bool Item::IsCurrencyToken ( ) const
inline
255{ return GetTemplate()->IsCurrencyToken(); }
bool IsCurrencyToken() const
Definition ItemTemplate.h:725

References GetTemplate(), and ItemTemplate::IsCurrencyToken().

◆ IsEquipped()

◆ IsFitToSpellRequirements()

bool Item::IsFitToSpellRequirements ( SpellInfo const *  spellInfo) const
886{
887 ItemTemplate const* proto = GetTemplate();
888
889 if (spellInfo->EquippedItemClass != -1) // -1 == any item class
890 {
891 // Special case - accept vellum for armor/weapon requirements
892 if ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && proto->IsArmorVellum())
893 || (spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && proto->IsWeaponVellum()))
894 if (spellInfo->IsAbilityOfSkillType(SKILL_ENCHANTING)) // only for enchanting spells
895 return true;
896
897 if (spellInfo->EquippedItemClass != int32(proto->Class))
898 return false; // wrong item class
899
900 if (spellInfo->EquippedItemSubClassMask != 0) // 0 == any subclass
901 {
902 if ((spellInfo->EquippedItemSubClassMask & (1 << proto->SubClass)) == 0)
903 return false; // subclass not present in mask
904 }
905 }
906
907 if (spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type
908 {
909 // Special case - accept weapon type for main and offhand requirements
910 if (proto->InventoryType == INVTYPE_WEAPON &&
911 (spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONMAINHAND) ||
912 spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONOFFHAND)))
913 return true;
914 else if ((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0)
915 return false; // inventory type not present in mask
916 }
917
918 return true;
919}
@ INVTYPE_WEAPON
Definition ItemTemplate.h:269
@ INVTYPE_WEAPONMAINHAND
Definition ItemTemplate.h:277
@ INVTYPE_WEAPONOFFHAND
Definition ItemTemplate.h:278
@ SKILL_ENCHANTING
Definition SharedDefines.h:3187
bool IsWeaponVellum() const
Definition ItemTemplate.h:818

References ItemTemplate::Class, SpellInfo::EquippedItemClass, SpellInfo::EquippedItemInventoryTypeMask, SpellInfo::EquippedItemSubClassMask, GetTemplate(), ItemTemplate::InventoryType, INVTYPE_WEAPON, INVTYPE_WEAPONMAINHAND, INVTYPE_WEAPONOFFHAND, SpellInfo::IsAbilityOfSkillType(), ItemTemplate::IsArmorVellum(), ItemTemplate::IsWeaponVellum(), ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON, SKILL_ENCHANTING, and ItemTemplate::SubClass.

Referenced by Player::CheckAttackFitToAuraRequirement(), Spell::CheckItems(), Aura::GetProcEffectMask(), Player::HasItemFitToSpellRequirements(), and Player::UpdateExpertise().

◆ IsInBag()

bool Item::IsInBag ( ) const
inline
288{ return m_container != nullptr; }

References m_container.

Referenced by IsEquipped().

◆ IsInTrade()

bool Item::IsInTrade ( ) const
inline
260{ return mb_in_trade; }

References mb_in_trade.

Referenced by Player::CanStoreItems(), and Player::HasItemCount().

◆ IsInUpdateQueue()

bool Item::IsInUpdateQueue ( ) const
inline

◆ IsLimitedToAnotherMapOrZone()

bool Item::IsLimitedToAnotherMapOrZone ( uint32  cur_mapId,
uint32  cur_zoneId 
) const
1064{
1065 ItemTemplate const* proto = GetTemplate();
1066 return proto && ((proto->Map && proto->Map != cur_mapId) || (proto->Area && proto->Area != cur_zoneId));
1067}
uint32 Map
Definition ItemTemplate.h:678
uint32 Area
Definition ItemTemplate.h:677

References ItemTemplate::Area, GetTemplate(), and ItemTemplate::Map.

Referenced by Player::_LoadItem().

◆ IsLocked()

bool Item::IsLocked ( ) const
inline

◆ IsNotEmptyBag()

bool Item::IsNotEmptyBag ( ) const

◆ IsPotion()

bool Item::IsPotion ( ) const
inline
337{ return GetTemplate()->IsPotion(); }
bool IsPotion() const
Definition ItemTemplate.h:817

References GetTemplate(), and ItemTemplate::IsPotion().

Referenced by Spell::CheckCast(), and Spell::SendSpellCooldown().

◆ IsRefundable()

◆ IsRefundExpired()

bool Item::IsRefundExpired ( )
1264{
1265 return (GetPlayedTime() > 2 * HOUR);
1266}
uint32 GetPlayedTime()
Definition Item.cpp:1256

References GetPlayedTime(), and HOUR.

Referenced by Player::RefundItem().

◆ IsSoulBound()

◆ IsWeaponVellum()

bool Item::IsWeaponVellum ( ) const
inline

◆ IsWrapped()

◆ LoadFromDB()

bool Item::LoadFromDB ( ObjectGuid::LowType  guid,
ObjectGuid  owner_guid,
Field fields,
uint32  entry 
)
virtual

Reimplemented in Bag.

421{
422 // 0 1 2 3 4 5 6 7 8 9 10
423 //result = CharacterDatabase.Query("SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text FROM item_instance WHERE guid = '{}'", guid);
424
425 // create item before any checks for store correct guid
426 // and allow use "FSetState(ITEM_REMOVED); SaveToDB();" for deleting item from DB
428
429 // Set entry, MUST be before proto check
430 SetEntry(entry);
431 SetObjectScale(1.0f);
432
433 ItemTemplate const* proto = GetTemplate();
434 if (!proto)
435 {
436 LOG_ERROR("entities.item", "Invalid entry {} for item {}. Refusing to load.", GetEntry(), GetGUID().ToString());
437 return false;
438 }
439
440 // set owner (not if item is only loaded for gbank/auction/mail
441 if (owner_guid)
442 SetOwnerGUID(owner_guid);
443
444 bool need_save = false; // need explicit save data at load fixes
445 SetGuidValue(ITEM_FIELD_CREATOR, ObjectGuid::Create<HighGuid::Player>(fields[0].Get<uint32>()));
446 SetGuidValue(ITEM_FIELD_GIFTCREATOR, ObjectGuid::Create<HighGuid::Player>(fields[1].Get<uint32>()));
447 SetCount(fields[2].Get<uint32>());
448
449 uint32 duration = fields[3].Get<uint32>();
451 // update duration if need, and remove if not need
452 if ((proto->Duration == 0) != (duration == 0))
453 {
455 need_save = true;
456 }
457
458 std::vector<std::string_view> tokens = Acore::Tokenize(fields[4].Get<std::string_view>(), ' ', false);
459 if (tokens.size() == MAX_ITEM_PROTO_SPELLS)
460 {
461 for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
462 {
463 if (Optional<int32> charges = Acore::StringTo<int32>(tokens[i]))
464 SetSpellCharges(i, *charges);
465 else
466 LOG_ERROR("entities.item", "Invalid charge info '{}' for item {}, charge data not loaded.", tokens.at(i), GetGUID().ToString());
467 }
468 }
469
470 SetUInt32Value(ITEM_FIELD_FLAGS, fields[5].Get<uint32>());
471 // Remove bind flag for items vs NO_BIND set
472 if (IsSoulBound() && proto->Bonding == NO_BIND && sScriptMgr->CanApplySoulboundFlag(this, proto))
473 {
475 need_save = true;
476 }
477
478 std::string enchants = fields[6].Get<std::string>();
479
481 {
482 LOG_WARN("entities.item", "Invalid enchantment data '{}' for item {}. Forcing partial load.", fields[6].Get<std::string>(), GetGUID().ToString());
483 }
484
485 SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID, fields[7].Get<int16>());
486 // recalculate suffix factor
487 if (GetItemRandomPropertyId() < 0)
489
490 uint32 durability = fields[8].Get<uint16>();
492
493 // update max durability (and durability) if need
494 // xinef: do not overwrite durability for wrapped items!!
496 if (durability > proto->MaxDurability && !IsWrapped())
497 {
499 need_save = true;
500 }
501
502 SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, fields[9].Get<uint32>());
503 SetText(fields[10].Get<std::string>());
504
505 if (need_save) // normal item changed state set not work at loading
506 {
511 stmt->SetData(3, guid);
512 CharacterDatabase.Execute(stmt);
513 }
514
515 return true;
516}
@ CHAR_UPD_ITEM_INSTANCE_ON_LOAD
Definition CharacterDatabase.h:126
@ NO_BIND
Definition ItemTemplate.h:95
#define LOG_WARN(filterType__,...)
Definition Log.h:149
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:24
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition Field.h:112
void UpdateItemSuffixFactor()
Definition Item.cpp:707
bool IsWrapped() const
Definition Item.h:263
void SetText(std::string const &text)
Definition Item.h:309
void SetOwnerGUID(ObjectGuid guid)
Definition Item.h:232
void SetInt32Value(uint16 index, int32 value)
Definition Object.cpp:630
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
Definition Object.cpp:885
bool _LoadIntoDataField(std::string const &data, uint32 startOffset, uint32 count)
Definition Object.cpp:605
std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
Definition Tokenize.cpp:20
uint32 Bonding
Definition ItemTemplate.h:663

References Object::_Create(), Object::_LoadIntoDataField(), Object::ApplyModFlag(), ItemTemplate::Bonding, CHAR_UPD_ITEM_INSTANCE_ON_LOAD, CharacterDatabase, ItemTemplate::Duration, Field::Get(), Object::GetEntry(), Object::GetGUID(), GetItemRandomPropertyId(), GetTemplate(), Object::GetUInt32Value(), IsSoulBound(), IsWrapped(), Item, ITEM_FIELD_CREATE_PLAYED_TIME, ITEM_FIELD_CREATOR, ITEM_FIELD_DURABILITY, ITEM_FIELD_DURATION, ITEM_FIELD_ENCHANTMENT_1_1, ITEM_FIELD_FLAG_SOULBOUND, ITEM_FIELD_FLAGS, ITEM_FIELD_GIFTCREATOR, ITEM_FIELD_MAXDURABILITY, ITEM_FIELD_RANDOM_PROPERTIES_ID, LOG_ERROR, LOG_WARN, MAX_ENCHANTMENT_OFFSET, MAX_ENCHANTMENT_SLOT, MAX_ITEM_PROTO_SPELLS, ItemTemplate::MaxDurability, NO_BIND, SetCount(), PreparedStatementBase::SetData(), Object::SetEntry(), Object::SetGuidValue(), Object::SetInt32Value(), Object::SetObjectScale(), SetOwnerGUID(), SetSpellCharges(), SetText(), Object::SetUInt32Value(), sScriptMgr, Acore::Tokenize(), and UpdateItemSuffixFactor().

Referenced by Player::_LoadItem(), Player::_LoadMailedItem(), mail_commandscript::HandleMailReturnCommand(), AuctionHouseMgr::LoadAuctionItems(), Bag::LoadFromDB(), and Guild::BankTab::LoadItemFromDB().

◆ RemoveFromObjectUpdate()

void Item::RemoveFromObjectUpdate ( )
overridevirtual

Implements Object.

1177{
1178 if (Player* owner = GetOwner())
1179 owner->GetMap()->RemoveUpdateObject(this);
1180}

References GetOwner().

◆ RemoveFromUpdateQueueOf()

void Item::RemoveFromUpdateQueueOf ( Player player)
766{
767 if (!IsInUpdateQueue())
768 return;
769
770 ASSERT(player);
771
772 if (player->GetGUID() != GetOwnerGUID())
773 {
774 LOG_DEBUG("entities.player.items", "Item::RemoveFromUpdateQueueOf - Owner's guid ({}) and player's guid ({}) don't match!", GetOwnerGUID().ToString(), player->GetGUID().ToString());
775 return;
776 }
777
778 if (player->m_itemUpdateQueueBlocked)
779 return;
780
781 player->m_itemUpdateQueue[uQueuePos] = nullptr;
782 uQueuePos = -1;
783}

References ASSERT, Object::GetGUID(), GetOwnerGUID(), IsInUpdateQueue(), LOG_DEBUG, Player::m_itemUpdateQueue, Player::m_itemUpdateQueueBlocked, ObjectGuid::ToString(), and uQueuePos.

Referenced by Player::CanEquipNewItem(), WorldSession::HandleSellItemOpcode(), and SetState().

◆ SaveRefundDataToDB()

void Item::SaveRefundDataToDB ( )
1183{
1184 CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
1185
1187 stmt->SetData(0, GetGUID().GetCounter());
1188 trans->Append(stmt);
1189
1190 stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_REFUND_INSTANCE);
1191 stmt->SetData(0, GetGUID().GetCounter());
1192 stmt->SetData(1, GetRefundRecipient());
1193 stmt->SetData(2, GetPaidMoney());
1194 stmt->SetData(3, uint16(GetPaidExtendedCost()));
1195 trans->Append(stmt);
1196
1197 CharacterDatabase.CommitTransaction(trans);
1198}
@ CHAR_INS_ITEM_REFUND_INSTANCE
Definition CharacterDatabase.h:381
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
Definition DatabaseEnvFwd.h:69
uint32 GetPaidExtendedCost()
Definition Item.h:349
uint32 GetPaidMoney()
Definition Item.h:348
ObjectGuid::LowType GetRefundRecipient()
Definition Item.h:347

References CHAR_DEL_ITEM_REFUND_INSTANCE, CHAR_INS_ITEM_REFUND_INSTANCE, CharacterDatabase, Object::GetGUID(), GetPaidExtendedCost(), GetPaidMoney(), GetRefundRecipient(), and PreparedStatementBase::SetData().

Referenced by Player::_StoreOrEquipNewItem().

◆ SaveToDB()

void Item::SaveToDB ( CharacterDatabaseTransaction  trans)
virtual

Reimplemented in Bag.

338{
339 bool isInTransaction = static_cast<bool>(trans);
340 if (!isInTransaction)
341 trans = CharacterDatabase.BeginTransaction();
342
344 switch (uState)
345 {
346 case ITEM_NEW:
347 case ITEM_CHANGED:
348 {
349 uint8 index = 0;
351 stmt->SetData( index, GetEntry());
352 stmt->SetData(++index, GetOwnerGUID().GetRawValue());
353 stmt->SetData(++index, GetGuidValue(ITEM_FIELD_CREATOR).GetCounter());
354 stmt->SetData(++index, GetGuidValue(ITEM_FIELD_GIFTCREATOR).GetCounter());
355 stmt->SetData(++index, GetCount());
357
358 std::ostringstream ssSpells;
359 for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
360 ssSpells << GetSpellCharges(i) << ' ';
361 stmt->SetData(++index, ssSpells.str());
362
363 stmt->SetData(++index, GetUInt32Value(ITEM_FIELD_FLAGS));
364
365 std::ostringstream ssEnchants;
366 for (uint8 i = 0; i < MAX_ENCHANTMENT_SLOT; ++i)
367 {
368 ssEnchants << GetEnchantmentId(EnchantmentSlot(i)) << ' ';
369 ssEnchants << GetEnchantmentDuration(EnchantmentSlot(i)) << ' ';
370 ssEnchants << GetEnchantmentCharges(EnchantmentSlot(i)) << ' ';
371 }
372 stmt->SetData(++index, ssEnchants.str());
373
374 stmt->SetData (++index, GetItemRandomPropertyId());
377 stmt->SetData(++index, m_text);
378 stmt->SetData(++index, guid);
379
380 trans->Append(stmt);
381
382 if ((uState == ITEM_CHANGED) && IsWrapped())
383 {
384 stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GIFT_OWNER);
385 stmt->SetData(0, GetOwnerGUID().GetRawValue());
386 stmt->SetData(1, guid);
387 trans->Append(stmt);
388 }
389 break;
390 }
391 case ITEM_REMOVED:
392 {
394 stmt->SetData(0, guid);
395 trans->Append(stmt);
396
397 if (IsWrapped())
398 {
399 stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
400 stmt->SetData(0, guid);
401 trans->Append(stmt);
402 }
403
404 if (!isInTransaction)
405 CharacterDatabase.CommitTransaction(trans);
406
407 delete this;
408 return;
409 }
410 case ITEM_UNCHANGED:
411 break;
412 }
413
415
416 if (!isInTransaction)
417 CharacterDatabase.CommitTransaction(trans);
418}
@ CHAR_UPD_ITEM_INSTANCE
Definition CharacterDatabase.h:125
@ CHAR_UPD_GIFT_OWNER
Definition CharacterDatabase.h:130
@ CHAR_DEL_GIFT
Definition CharacterDatabase.h:131
@ CHAR_REP_ITEM_INSTANCE
Definition CharacterDatabase.h:124
@ ITEM_REMOVED
Definition Item.h:212
@ ITEM_UNCHANGED
Definition Item.h:209
int32 GetSpellCharges(uint8 index=0) const
Definition Item.h:317
uint32 GetEnchantmentDuration(EnchantmentSlot slot) const
Definition Item.h:305
uint32 GetEnchantmentCharges(EnchantmentSlot slot) const
Definition Item.h:306
LowType GetCounter() const
Definition ObjectGuid.h:149
uint32 LowType
Definition ObjectGuid.h:125

References CHAR_DEL_GIFT, CHAR_DEL_ITEM_INSTANCE, CHAR_REP_ITEM_INSTANCE, CHAR_UPD_GIFT_OWNER, CHAR_UPD_ITEM_INSTANCE, CharacterDatabase, GetCount(), ObjectGuid::GetCounter(), GetEnchantmentCharges(), GetEnchantmentDuration(), GetEnchantmentId(), Object::GetEntry(), Object::GetGUID(), Object::GetGuidValue(), GetItemRandomPropertyId(), GetOwnerGUID(), ObjectGuid::GetRawValue(), GetSpellCharges(), Object::GetUInt32Value(), IsWrapped(), ITEM_CHANGED, ITEM_FIELD_CREATE_PLAYED_TIME, ITEM_FIELD_CREATOR, ITEM_FIELD_DURABILITY, ITEM_FIELD_DURATION, ITEM_FIELD_FLAGS, ITEM_FIELD_GIFTCREATOR, ITEM_NEW, ITEM_REMOVED, ITEM_UNCHANGED, m_text, MAX_ENCHANTMENT_SLOT, MAX_ITEM_PROTO_SPELLS, PreparedStatementBase::SetData(), SetState(), and uState.

Referenced by Player::_LoadItem(), Player::_LoadMailedItem(), Player::_SaveInventory(), Player::AutoUnequipOffhandIfNeed(), AchievementMgr::CompletedAchievement(), WorldSession::HandleAuctionSellItem(), mail_commandscript::HandleMailReturnCommand(), WorldSession::HandleSendMail(), ToCloud9GrpcHandler::RemoveItemsWithGuidsFromPlayer(), Bag::SaveToDB(), Player::SendItemRetrievalMail(), and MailDraft::SendReturnToSender().

◆ SendTimeUpdate()

void Item::SendTimeUpdate ( Player owner)
1083{
1085 if (!duration)
1086 return;
1087
1088 WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8 + 4));
1089 data << GetGUID();
1090 data << uint32(duration);
1091 owner->SendDirectMessage(&data);
1092}
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:5852
Definition WorldPacket.h:26
@ SMSG_ITEM_TIME_UPDATE
Definition Opcodes.h:520

References Object::GetGUID(), Object::GetUInt32Value(), ITEM_FIELD_DURATION, Player::SendDirectMessage(), and SMSG_ITEM_TIME_UPDATE.

Referenced by Player::AddItemDurations().

◆ SendUpdateSockets()

void Item::SendUpdateSockets ( )
1070{
1071 WorldPacket data(SMSG_SOCKET_GEMS_RESULT, 8 + 4 + 4 + 4 + 4);
1072 data << GetGUID();
1075
1076 GetOwner()->SendDirectMessage(&data);
1077}
@ SMSG_SOCKET_GEMS_RESULT
Definition Opcodes.h:1321

References BONUS_ENCHANTMENT_SLOT, GetEnchantmentId(), Object::GetGUID(), GetOwner(), Player::SendDirectMessage(), SMSG_SOCKET_GEMS_RESULT, and SOCK_ENCHANTMENT_SLOT.

Referenced by WorldSession::HandleSocketOpcode().

◆ SetBinding()

◆ SetContainer()

void Item::SetContainer ( Bag container)
inline

◆ SetCount()

◆ SetEnchantment()

void Item::SetEnchantment ( EnchantmentSlot  slot,
uint32  id,
uint32  duration,
uint32  charges,
ObjectGuid  caster = ObjectGuid::Empty 
)
922{
923 // Better lost small time at check in comparison lost time at item save to DB.
924 if ((GetEnchantmentId(slot) == id) && (GetEnchantmentDuration(slot) == duration) && (GetEnchantmentCharges(slot) == charges))
925 return;
926
927 Player* owner = GetOwner();
929 {
930 if (uint32 oldEnchant = GetEnchantmentId(slot))
932
933 if (id)
934 owner->GetSession()->SendEnchantmentLog(GetOwnerGUID(), caster, GetEntry(), id);
935 }
936
940 SetState(ITEM_CHANGED, owner);
941}
@ MAX_INSPECTED_ENCHANTMENT_SLOT
Definition Item.h:176
static ObjectGuid const Empty
Definition ObjectGuid.h:123
WorldSession * GetSession() const
Definition Player.h:2030
void SendEnchantmentLog(ObjectGuid target, ObjectGuid caster, uint32 itemId, uint32 enchantId)
Definition ItemHandler.cpp:1041

References ObjectGuid::Empty, ENCHANTMENT_CHARGES_OFFSET, ENCHANTMENT_DURATION_OFFSET, ENCHANTMENT_ID_OFFSET, GetEnchantmentCharges(), GetEnchantmentDuration(), GetEnchantmentId(), Object::GetEntry(), GetOwner(), GetOwnerGUID(), Player::GetSession(), ITEM_CHANGED, ITEM_FIELD_ENCHANTMENT_1_1, MAX_ENCHANTMENT_OFFSET, MAX_INSPECTED_ENCHANTMENT_SLOT, WorldSession::SendEnchantmentLog(), SetState(), and Object::SetUInt32Value().

Referenced by Spell::EffectEnchantHeldItem(), Spell::EffectEnchantItemPerm(), Spell::EffectEnchantItemPrismatic(), Spell::EffectEnchantItemTmp(), Spell::EffectSummonChangeItem(), WorldSession::HandleSocketOpcode(), and SetItemRandomProperties().

◆ SetEnchantmentCharges()

◆ SetEnchantmentDuration()

void Item::SetEnchantmentDuration ( EnchantmentSlot  slot,
uint32  duration,
Player owner 
)
943{
944 if (GetEnchantmentDuration(slot) == duration)
945 return;
946
948 SetState(ITEM_CHANGED, owner);
949 // Cannot use GetOwner() here, has to be passed as an argument to avoid freeze due to hashtable locking
950}

References ENCHANTMENT_DURATION_OFFSET, GetEnchantmentDuration(), ITEM_CHANGED, ITEM_FIELD_ENCHANTMENT_1_1, MAX_ENCHANTMENT_OFFSET, SetState(), and Object::SetUInt32Value().

Referenced by Player::RemoveEnchantmentDurations().

◆ SetInTrade()

void Item::SetInTrade ( bool  b = true)
inline
259{ mb_in_trade = b; }

References mb_in_trade.

Referenced by clearAcceptTradeMode(), and setAcceptTradeMode().

◆ SetItemRandomProperties()

void Item::SetItemRandomProperties ( int32  randomPropId)
670{
671 if (!randomPropId)
672 return;
673
674 if (randomPropId > 0)
675 {
676 ItemRandomPropertiesEntry const* item_rand = sItemRandomPropertiesStore.LookupEntry(randomPropId);
677 if (item_rand)
678 {
680 {
683 }
686 }
687 }
688 else
689 {
690 ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(-randomPropId);
691 if (item_rand)
692 {
695 {
699 }
700
703 }
704 }
705}
@ PROP_ENCHANTMENT_SLOT_0
Definition Item.h:178
uint32 GetItemSuffixFactor() const
Definition Item.h:296
void SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, ObjectGuid caster=ObjectGuid::Empty)
Definition Item.cpp:921
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > Enchantment
Definition DBCStructure.h:1213
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > Enchantment
Definition DBCStructure.h:1224

References ItemRandomPropertiesEntry::Enchantment, ItemRandomSuffixEntry::Enchantment, Object::GetInt32Value(), GetItemSuffixFactor(), GetOwner(), ItemRandomPropertiesEntry::ID, ItemRandomSuffixEntry::ID, ITEM_CHANGED, ITEM_FIELD_RANDOM_PROPERTIES_ID, MAX_ENCHANTMENT_SLOT, PROP_ENCHANTMENT_SLOT_0, SetEnchantment(), Object::SetInt32Value(), SetState(), sItemRandomPropertiesStore, sItemRandomSuffixStore, and UpdateItemSuffixFactor().

Referenced by ToCloud9GrpcHandler::AddExistingItemToPlayer(), and CreateItem().

◆ SetNotRefundable()

void Item::SetNotRefundable ( Player owner,
bool  changestate = true,
CharacterDatabaseTransaction trans = nullptr 
)
1211{
1212 if (!IsRefundable())
1213 return;
1214
1216 // Following is not applicable in the trading procedure
1217 if (changestate)
1218 SetState(ITEM_CHANGED, owner);
1219
1221 SetPaidMoney(0);
1224
1226}
void DeleteRefundDataFromDB(CharacterDatabaseTransaction *trans)
Definition Item.cpp:1200
void SetPaidMoney(uint32 money)
Definition Item.h:345
void SetRefundRecipient(ObjectGuid::LowType pGuidLow)
Definition Item.h:344
bool IsRefundable() const
Definition Item.h:261
void SetPaidExtendedCost(uint32 iece)
Definition Item.h:346
void DeleteRefundReference(ObjectGuid itemGUID)
Definition Player.cpp:15946

References DeleteRefundDataFromDB(), Player::DeleteRefundReference(), Object::GetGUID(), IsRefundable(), ITEM_CHANGED, ITEM_FIELD_FLAG_REFUNDABLE, ITEM_FIELD_FLAGS, Object::RemoveFlag(), SetPaidExtendedCost(), SetPaidMoney(), SetRefundRecipient(), and SetState().

Referenced by Player::_StoreItem(), Player::DestroyItem(), Player::EquipItem(), WorldSession::HandleSendMail(), Player::RefundItem(), ToCloud9GrpcHandler::RemoveItemsWithGuidsFromPlayer(), Player::SendRefundInfo(), and UpdatePlayedTime().

◆ SetOwnerGUID()

◆ SetPaidExtendedCost()

void Item::SetPaidExtendedCost ( uint32  iece)
inline

◆ SetPaidMoney()

void Item::SetPaidMoney ( uint32  money)
inline

◆ SetRefundRecipient()

void Item::SetRefundRecipient ( ObjectGuid::LowType  pGuidLow)
inline

◆ SetSlot()

void Item::SetSlot ( uint8  slot)
inline

◆ SetSoulboundTradeable()

void Item::SetSoulboundTradeable ( AllowedLooterSet allowedLooters)
1269{
1271 allowedGUIDs = allowedLooters;
1272}
void SetFlag(uint16 index, uint32 newFlag)
Definition Object.cpp:831

References allowedGUIDs, ITEM_FIELD_FLAG_BOP_TRADEABLE, ITEM_FIELD_FLAGS, and Object::SetFlag().

Referenced by Player::_LoadItem(), Player::_LoadMailedItem(), SendRollWonItemViaMail(), and Player::StoreNewItem().

◆ SetSpellCharges()

void Item::SetSpellCharges ( uint8  index,
int32  value 
)
inline

◆ SetState()

void Item::SetState ( ItemUpdateState  state,
Player forplayer = nullptr 
)
716{
717 if (uState == ITEM_NEW && state == ITEM_REMOVED)
718 {
719 // pretend the item never existed
720 if (forplayer)
721 {
722 RemoveFromUpdateQueueOf(forplayer);
723 forplayer->DeleteRefundReference(GetGUID());
724 }
725 delete this;
726 return;
727 }
728 if (state != ITEM_UNCHANGED)
729 {
730 // new items must stay in new state until saved
731 if (uState != ITEM_NEW)
732 uState = state;
733 if (forplayer)
734 AddToUpdateQueueOf(forplayer);
735 }
736 else
737 {
738 // unset in queue
739 // the item must be removed from the queue manually
740 uQueuePos = -1;
742 }
743}
void AddToUpdateQueueOf(Player *player)
Definition Item.cpp:745
void RemoveFromUpdateQueueOf(Player *player)
Definition Item.cpp:765

References AddToUpdateQueueOf(), Player::DeleteRefundReference(), Object::GetGUID(), ITEM_NEW, ITEM_REMOVED, ITEM_UNCHANGED, RemoveFromUpdateQueueOf(), uQueuePos, and uState.

Referenced by Player::_StoreItem(), ClearEnchantment(), ClearSoulboundTradeable(), Player::DestroyItem(), Player::DestroyItemCount(), Player::DurabilityPointsLoss(), Player::DurabilityRepair(), Spell::EffectOpenLock(), Player::EquipItem(), WorldSession::HandleAuctionSellItem(), WorldSession::HandleMailTakeItem(), WorldSession::HandleOpenWrappedItemCallback(), WorldSession::HandlePetitionBuyOpcode(), WorldSession::HandleSellItemOpcode(), WorldSession::HandleUseItemOpcode(), WorldSession::HandleWrapItemOpcode(), Player::MoveItemToInventory(), Player::RemoveItemFromBuyBackSlot(), ToCloud9GrpcHandler::RemoveItemsWithGuidsFromPlayer(), SaveToDB(), SetEnchantment(), SetEnchantmentCharges(), SetEnchantmentDuration(), SetItemRandomProperties(), SetNotRefundable(), Player::SplitItem(), Player::SwapItem(), Spell::TakeCastItem(), UpdateDuration(), UpdatePlayedTime(), and Player::VisualizeItem().

◆ SetText()

void Item::SetText ( std::string const &  text)
inline
309{ m_text = text; }

References m_text.

Referenced by WorldSession::HandleMailCreateTextItem(), and LoadFromDB().

◆ ToBag() [1/2]

Bag * Item::ToBag ( )
inline
250{ if (IsBag()) return reinterpret_cast<Bag*>(this); else return nullptr; }

References IsBag().

Referenced by Player::_LoadInventory(), Player::GetBagByPos(), debug_commandscript::HandleDebugGetItemStateCommand(), IsNotEmptyBag(), and Player::SwapItem().

◆ ToBag() [2/2]

Bag const * Item::ToBag ( ) const
inline
251{ if (IsBag()) return reinterpret_cast<Bag const*>(this); else return nullptr; }

References IsBag().

◆ UpdateDuration()

void Item::UpdateDuration ( Player owner,
uint32  diff 
)
320{
322 return;
323
324 LOG_DEBUG("entities.player.items", "Item::UpdateDuration Item (Entry: {} Duration {} Diff {})", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff);
325
327 {
328 sScriptMgr->OnItemExpire(owner, GetTemplate());
329 owner->DestroyItem(GetBagSlot(), GetSlot(), true);
330 return;
331 }
332
334 SetState(ITEM_CHANGED, owner); // save new time in database
335}
void DestroyItem(uint8 bag, uint8 slot, bool update)
Definition PlayerStorage.cpp:3099

References Player::DestroyItem(), GetBagSlot(), Object::GetEntry(), GetSlot(), GetTemplate(), Object::GetUInt32Value(), ITEM_CHANGED, ITEM_FIELD_DURATION, LOG_DEBUG, SetState(), Object::SetUInt32Value(), and sScriptMgr.

Referenced by Player::UpdateItemDuration().

◆ UpdateItemSuffixFactor()

void Item::UpdateItemSuffixFactor ( )
708{
709 uint32 suffixFactor = GenerateEnchSuffixFactor(GetEntry());
710 if (GetItemSuffixFactor() == suffixFactor)
711 return;
713}
uint32 GenerateEnchSuffixFactor(uint32 item_id)
Definition ItemEnchantmentMgr.cpp:125

References GenerateEnchSuffixFactor(), Object::GetEntry(), GetItemSuffixFactor(), ITEM_FIELD_PROPERTY_SEED, and Object::SetUInt32Value().

Referenced by LoadFromDB(), and SetItemRandomProperties().

◆ UpdatePlayedTime()

void Item::UpdatePlayedTime ( Player owner)
1229{
1230 /* Here we update our played time
1231 We simply add a number to the current played time,
1232 based on the time elapsed since the last update hereof.
1233 */
1234 // Get current played time
1236 // Calculate time elapsed since last played time update
1237 time_t curtime = GameTime::GetGameTime().count();
1238 uint32 elapsed = uint32(curtime - m_lastPlayedTimeUpdate);
1239 uint32 new_playtime = current_playtime + elapsed;
1240 // Check if the refund timer has expired yet
1241 if (new_playtime <= 2 * HOUR)
1242 {
1243 // No? Proceed.
1244 // Update the data field
1246 // Flag as changed to get saved to DB
1247 SetState(ITEM_CHANGED, owner);
1248 // Speaks for itself
1249 m_lastPlayedTimeUpdate = curtime;
1250 return;
1251 }
1252 // Yes
1253 SetNotRefundable(owner);
1254}
void SetNotRefundable(Player *owner, bool changestate=true, CharacterDatabaseTransaction *trans=nullptr)
Definition Item.cpp:1210

References GameTime::GetGameTime(), Object::GetUInt32Value(), HOUR, ITEM_CHANGED, ITEM_FIELD_CREATE_PLAYED_TIME, m_lastPlayedTimeUpdate, SetNotRefundable(), SetState(), and Object::SetUInt32Value().

Referenced by Player::_SaveInventory(), and Player::SendRefundInfo().

Member Data Documentation

◆ allowedGUIDs

◆ loot

◆ m_container

Bag* Item::m_container
private

◆ m_lastPlayedTimeUpdate

time_t Item::m_lastPlayedTimeUpdate
private

◆ m_lootGenerated

◆ m_paidExtendedCost

uint32 Item::m_paidExtendedCost
private

◆ m_paidMoney

uint32 Item::m_paidMoney
private

Referenced by GetPaidMoney(), Item(), and SetPaidMoney().

◆ m_refundRecipient

uint32 Item::m_refundRecipient
private

◆ m_slot

uint8 Item::m_slot
private

Referenced by GetSlot(), IsEquipped(), Item(), and SetSlot().

◆ m_text

std::string Item::m_text
private

Referenced by GetText(), SaveToDB(), and SetText().

◆ mb_in_trade

bool Item::mb_in_trade
private

Referenced by IsInTrade(), Item(), and SetInTrade().

◆ uQueuePos

◆ uState

ItemUpdateState Item::uState
private

The documentation for this class was generated from the following files: