18#ifndef TRINITYCORE_ITEM_H
19#define TRINITYCORE_ITEM_H
40#define MAX_GEM_SOCKETS MAX_ITEM_PROTO_SOCKETS
49#define MAX_ENCHANTMENT_OFFSET 3
83 bool IsBindedNotWith(
Player const* player)
const;
84 bool IsBoundByEnchant()
const;
92 void SaveRefundDataToDB();
95 Bag*
ToBag() {
if (IsBag())
return reinterpret_cast<Bag*
>(
this);
else return nullptr; }
96 Bag const*
ToBag()
const {
if (IsBag())
return reinterpret_cast<Bag const*
>(
this);
else return nullptr; }
104 bool IsNotEmptyBag()
const;
106 bool CanBeTraded(
bool mail =
false,
bool trade =
false)
const;
110 uint32 CalculateDurabilityRepairCost(
float discount)
const;
112 bool HasEnchantRequiredSkill(
Player const* player)
const;
113 uint32 GetEnchantRequiredLevel()
const;
115 bool IsFitToSpellRequirements(
SpellInfo const* spellInfo)
const;
116 bool IsLimitedToAnotherMapOrZone(
uint32 cur_mapId,
uint32 cur_zoneId)
const;
117 bool GemsFitSockets()
const;
120 void SetCount(
uint32 value);
123 uint8 GetGemCountWithLimitCategory(
uint32 limitCategory)
const;
128 uint8 GetBagSlot()
const;
133 bool IsInBag()
const {
return m_container !=
nullptr; }
134 bool IsEquipped()
const;
142 void SetItemRandomProperties(
int32 randomPropId);
143 void UpdateItemSuffixFactor();
152 std::string
const&
GetText()
const {
return m_text; }
153 void SetText(std::string
const& text) { m_text = text; }
155 void SendUpdateSockets();
157 void SendTimeUpdate(
Player* owner);
194 void UpdatePlayedTime(
Player* owner);
196 bool IsRefundExpired();
199 void SetSoulboundTradeable(
GuidSet const& allowedLooters);
200 void ClearSoulboundTradeable(
Player* currentOwner);
201 bool CheckSoulboundTradeExpire();
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
@ ITEM_FIELD_FLAG_REFUNDABLE
@ ITEM_FIELD_FLAG_UNLOCKED
@ ITEM_FIELD_FLAG_SOULBOUND
@ ITEM_FIELD_FLAG_WRAPPED
@ ITEM_FIELD_FLAG_BOP_TRADEABLE
@ ITEM_FLAG_IS_BOUND_TO_ACCOUNT
void RemoveItemFromUpdateQueueOf(Item *item, Player *player)
void AddItemToUpdateQueueOf(Item *item, Player *player)
#define MAX_ENCHANTMENT_OFFSET
@ ENCHANTMENT_CHARGES_OFFSET
@ ENCHANTMENT_DURATION_OFFSET
bool ItemCanGoIntoBag(ItemTemplate const *proto, ItemTemplate const *pBagProto)
std::set< ObjectGuid > GuidSet
std::unordered_map< Player *, UpdateData > UpdateDataMapType
static void SaveToDB(QuestPool const &pool, CharacterDatabaseTransaction trans)
@ ITEM_FIELD_MAXDURABILITY
@ ITEM_FIELD_RANDOM_PROPERTIES_ID
@ ITEM_FIELD_PROPERTY_SEED
@ ITEM_FIELD_ENCHANTMENT_1_1
@ ITEM_FIELD_SPELL_CHARGES
Class used to access individual fields of database query result.
uint32 GetPaidExtendedCost() const
bool hasInvolvedQuest(uint32) const override
std::string const & GetText() const
bool IsCurrencyToken() const
uint32 GetScriptId() const
void SetSpellCharges(uint8 index, int32 value)
void SetText(std::string const &text)
void SetBinding(bool val)
uint32 GetEnchantmentId(EnchantmentSlot slot) const
int32 GetSpellCharges(uint8 index=0) const
void SetPaidMoney(uint32 money)
bool IsBoundAccountWide() const
uint32 GetEnchantmentDuration(EnchantmentSlot slot) const
int32 GetItemRandomPropertyId() const
bool IsBOPTradeable() const
ItemUpdateState GetState() const
uint32 GetItemSuffixFactor() const
bool IsWeaponVellum() const
uint16 GetQueuePos() const
bool IsArmorVellum() const
ObjectGuid GetOwnerGUID() const
Bag const * ToBag() const
time_t m_lastPlayedTimeUpdate
bool IsRefundable() const
ObjectGuid m_refundRecipient
void FSetState(ItemUpdateState state)
uint32 m_paidExtendedCost
ObjectGuid const & GetRefundRecipient() const
void SetPaidExtendedCost(uint32 iece)
uint32 GetEnchantmentCharges(EnchantmentSlot slot) const
void SetRefundRecipient(ObjectGuid const &guid)
uint32 GetPaidMoney() const
void SetOwnerGUID(ObjectGuid guid)
void SetContainer(Bag *container)
bool hasQuest(uint32 quest_id) const override
uint32 GetMaxStackCount() const
bool IsConjuredConsumable() const
bool IsInUpdateQueue() const
void SetInTrade(bool b=true)
static ObjectGuid const Empty
int32 GetInt32Value(uint16 index) const
void SetInt32Value(uint16 index, int32 value)
uint32 GetUInt32Value(uint16 index) const
virtual bool AddToObjectUpdate()=0
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
void SetGuidValue(uint16 index, ObjectGuid value)
virtual std::string GetDebugInfo() const
virtual void BuildUpdate(UpdateDataMapType &)
virtual void RemoveFromObjectUpdate()=0
bool HasFlag(uint16 index, uint32 flag) const
ObjectGuid GetGuidValue(uint16 index) const
SpellInfo const * spells[8]
uint32 GetMaxStackSize() const
bool IsCurrencyToken() const
bool IsArmorVellum() const
bool IsConjuredConsumable() const
bool HasFlag(ItemFlags flag) const
bool IsWeaponVellum() const