TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Item.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef TRINITYCORE_ITEM_H
20 #define TRINITYCORE_ITEM_H
21 
22 #include "Common.h"
23 #include "Object.h"
24 #include "LootMgr.h"
25 #include "ItemTemplate.h"
26 #include "DatabaseEnv.h"
27 
28 class SpellInfo;
29 class Bag;
30 class Unit;
31 namespace WorldPackets
32 {
33  namespace Item
34  {
35  struct ItemInstance;
36  }
37 }
38 
40 {
43  std::unordered_set<ItemSetSpellEntry const*> SetBonuses;
44 };
45 
47 {
49  EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1, // You must reach level %d to use that item.
50  EQUIP_ERR_CANT_EQUIP_SKILL = 2, // You aren't skilled enough to use that item.
51  EQUIP_ERR_WRONG_SLOT = 3, // That item does not go in that slot.
52  EQUIP_ERR_BAG_FULL = 4, // That bag is full.
53  EQUIP_ERR_BAG_IN_BAG = 5, // Can't put non-empty bags in other bags.
54  EQUIP_ERR_TRADE_EQUIPPED_BAG = 6, // You can't trade equipped bags.
55  EQUIP_ERR_AMMO_ONLY = 7, // Only ammo can go there.
56  EQUIP_ERR_PROFICIENCY_NEEDED = 8, // You do not have the required proficiency for that item.
57  EQUIP_ERR_NO_SLOT_AVAILABLE = 9, // No equipment slot is available for that item.
58  EQUIP_ERR_CANT_EQUIP_EVER = 10, // You can never use that item.
59  EQUIP_ERR_CANT_EQUIP_EVER_2 = 11, // You can never use that item.
60  EQUIP_ERR_NO_SLOT_AVAILABLE_2 = 12, // No equipment slot is available for that item.
61  EQUIP_ERR_2HANDED_EQUIPPED = 13, // Cannot equip that with a two-handed weapon.
62  EQUIP_ERR_2HSKILLNOTFOUND = 14, // You cannot dual-wield
63  EQUIP_ERR_WRONG_BAG_TYPE = 15, // That item doesn't go in that container.
64  EQUIP_ERR_WRONG_BAG_TYPE_2 = 16, // That item doesn't go in that container.
65  EQUIP_ERR_ITEM_MAX_COUNT = 17, // You can't carry any more of those items.
66  EQUIP_ERR_NO_SLOT_AVAILABLE_3 = 18, // No equipment slot is available for that item.
67  EQUIP_ERR_CANT_STACK = 19, // This item cannot stack.
68  EQUIP_ERR_NOT_EQUIPPABLE = 20, // This item cannot be equipped.
69  EQUIP_ERR_CANT_SWAP = 21, // These items can't be swapped.
70  EQUIP_ERR_SLOT_EMPTY = 22, // That slot is empty.
71  EQUIP_ERR_ITEM_NOT_FOUND = 23, // The item was not found.
72  EQUIP_ERR_DROP_BOUND_ITEM = 24, // You can't drop a soulbound item.
73  EQUIP_ERR_OUT_OF_RANGE = 25, // Out of range.
74  EQUIP_ERR_TOO_FEW_TO_SPLIT = 26, // Tried to split more than number in stack.
75  EQUIP_ERR_SPLIT_FAILED = 27, // Couldn't split those items.
76  EQUIP_ERR_SPELL_FAILED_REAGENTS_GENERIC = 28, // Missing reagent
77  EQUIP_ERR_NOT_ENOUGH_MONEY = 29, // You don't have enough money.
78  EQUIP_ERR_NOT_A_BAG = 30, // Not a bag.
79  EQUIP_ERR_DESTROY_NONEMPTY_BAG = 31, // You can only do that with empty bags.
80  EQUIP_ERR_NOT_OWNER = 32, // You don't own that item.
81  EQUIP_ERR_ONLY_ONE_QUIVER = 33, // You can only equip one quiver.
82  EQUIP_ERR_NO_BANK_SLOT = 34, // You must purchase that bag slot first
83  EQUIP_ERR_NO_BANK_HERE = 35, // You are too far away from a bank.
84  EQUIP_ERR_ITEM_LOCKED = 36, // Item is locked.
85  EQUIP_ERR_GENERIC_STUNNED = 37, // You are stunned
86  EQUIP_ERR_PLAYER_DEAD = 38, // You can't do that when you're dead.
87  EQUIP_ERR_CLIENT_LOCKED_OUT = 39, // You can't do that right now.
88  EQUIP_ERR_INTERNAL_BAG_ERROR = 40, // Internal Bag Error
89  EQUIP_ERR_ONLY_ONE_BOLT = 41, // You can only equip one quiver.
90  EQUIP_ERR_ONLY_ONE_AMMO = 42, // You can only equip one ammo pouch.
91  EQUIP_ERR_CANT_WRAP_STACKABLE = 43, // Stackable items can't be wrapped.
92  EQUIP_ERR_CANT_WRAP_EQUIPPED = 44, // Equipped items can't be wrapped.
93  EQUIP_ERR_CANT_WRAP_WRAPPED = 45, // Wrapped items can't be wrapped.
94  EQUIP_ERR_CANT_WRAP_BOUND = 46, // Bound items can't be wrapped.
95  EQUIP_ERR_CANT_WRAP_UNIQUE = 47, // Unique items can't be wrapped.
96  EQUIP_ERR_CANT_WRAP_BAGS = 48, // Bags can't be wrapped.
97  EQUIP_ERR_LOOT_GONE = 49, // Already looted
98  EQUIP_ERR_INV_FULL = 50, // Inventory is full.
99  EQUIP_ERR_BANK_FULL = 51, // Your bank is full
100  EQUIP_ERR_VENDOR_SOLD_OUT = 52, // That item is currently sold out.
101  EQUIP_ERR_BAG_FULL_2 = 53, // That bag is full.
102  EQUIP_ERR_ITEM_NOT_FOUND_2 = 54, // The item was not found.
103  EQUIP_ERR_CANT_STACK_2 = 55, // This item cannot stack.
104  EQUIP_ERR_BAG_FULL_3 = 56, // That bag is full.
105  EQUIP_ERR_VENDOR_SOLD_OUT_2 = 57, // That item is currently sold out.
106  EQUIP_ERR_OBJECT_IS_BUSY = 58, // That object is busy.
108  EQUIP_ERR_NOT_IN_COMBAT = 60, // You can't do that while in combat
109  EQUIP_ERR_NOT_WHILE_DISARMED = 61, // You can't do that while disarmed
110  EQUIP_ERR_BAG_FULL_4 = 62, // That bag is full.
111  EQUIP_ERR_CANT_EQUIP_RANK = 63, // You don't have the required rank for that item
112  EQUIP_ERR_CANT_EQUIP_REPUTATION = 64, // You don't have the required reputation for that item
113  EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65, // You cannot equip another bag of that type
114  EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66, // You can't loot that item now.
115  EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE = 67, // You cannot equip more than one of those.
116  EQUIP_ERR_VENDOR_MISSING_TURNINS = 68, // You do not have the required items for that purchase
117  EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69, // You don't have enough honor points
118  EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70, // You don't have enough arena points
119  EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71, // You have the maximum number of those gems in your inventory or socketed into items.
120  EQUIP_ERR_MAIL_BOUND_ITEM = 72, // You can't mail soulbound items.
121  EQUIP_ERR_INTERNAL_BAG_ERROR_2 = 73, // Internal Bag Error
122  EQUIP_ERR_BAG_FULL_5 = 74, // That bag is full.
123  EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75, // You have the maximum number of those gems socketed into equipped items.
124  EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76, // You cannot socket more than one of those gems into a single item.
125  EQUIP_ERR_TOO_MUCH_GOLD = 77, // At gold limit
126  EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, // You can't do that while in an arena match
127  EQUIP_ERR_TRADE_BOUND_ITEM = 79, // You can't trade a soulbound item.
128  EQUIP_ERR_CANT_EQUIP_RATING = 80, // You don't have the personal, team, or battleground rating required to buy that item
130  EQUIP_ERR_NOT_SAME_ACCOUNT = 82, // Account-bound items can only be given to your own characters.
132  EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 84, // You can only carry %d %s
133  EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 85, // You can only equip %d |4item:items in the %s category
134  EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86, // Your level is too high to use that item
135  EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87, // You must reach level %d to purchase that item.
136  EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88, // You do not have the required talent to equip that.
137  EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 89, // You can only equip %d |4item:items in the %s category
138  EQUIP_ERR_SHAPESHIFT_FORM_CANNOT_EQUIP = 90, // Cannot equip item in this form
139  EQUIP_ERR_ITEM_INVENTORY_FULL_SATCHEL = 91, // Your inventory is full. Your satchel has been delivered to your mailbox.
140  EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_TOO_LOW = 92, // Your level is too low to use that item
141  EQUIP_ERR_CANT_BUY_QUANTITY = 93, // You can't buy the specified quantity of that item.
142  EQUIP_ERR_ITEM_IS_BATTLE_PAY_LOCKED = 94, // Your purchased item is still waiting to be unlocked
143  EQUIP_ERR_REAGENT_BANK_FULL = 95, // Your reagent bank is full
146 };
147 
149 {
159 };
160 
162 {
164  SELL_ERR_CANT_SELL_ITEM = 2, // merchant doesn't like that item
165  SELL_ERR_CANT_FIND_VENDOR = 3, // merchant doesn't like you
166  SELL_ERR_YOU_DONT_OWN_THAT_ITEM = 4, // you don't own that item
167  SELL_ERR_UNK = 5, // nothing appears...
168  SELL_ERR_ONLY_EMPTY_BAG = 6 // can only do with empty bags
169 };
170 
171 // -1 from client enchantment slot number
173 {
180  PRISMATIC_ENCHANTMENT_SLOT = 6, // added at apply special permanent enchantment
182 
184 
185  PROP_ENCHANTMENT_SLOT_0 = 8, // used with RandomSuffix
186  PROP_ENCHANTMENT_SLOT_1 = 9, // used with RandomSuffix
187  PROP_ENCHANTMENT_SLOT_2 = 10, // used with RandomSuffix and RandomProperty
188  PROP_ENCHANTMENT_SLOT_3 = 11, // used with RandomProperty
189  PROP_ENCHANTMENT_SLOT_4 = 12, // used with RandomProperty
191 };
192 
193 #define MAX_VISIBLE_ITEM_OFFSET 2 // 2 fields per visible item (entry+enchantment)
194 
195 #define MAX_GEM_SOCKETS MAX_ITEM_PROTO_SOCKETS// (BONUS_ENCHANTMENT_SLOT-SOCK_ENCHANTMENT_SLOT) and item proto size, equal value expected
196 
198 {
201  ENCHANTMENT_CHARGES_OFFSET = 2 // now here not only charges, but something new in wotlk
202 };
203 
204 #define MAX_ENCHANTMENT_OFFSET 3
205 
207 {
212 };
213 
215 {
218  ITEM_NEW = 2,
220 };
221 
223 {
228  ITEM_MODIFIER_BATTLE_PET_BREED_DATA = 4, // (breedId) | (breedQuality << 24)
232 
234 };
235 
236 #define MAX_ITEM_SPELLS 5
237 
238 bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto);
239 
240 struct BonusData
241 {
253 
254  void Initialize(ItemTemplate const* proto);
255  void Initialize(WorldPackets::Item::ItemInstance const& itemInstance);
256  void AddBonus(uint32 type, int32 const (&values)[2]);
257 };
258 
259 class TC_GAME_API Item : public Object
260 {
261  public:
262  static Item* CreateItem(uint32 itemEntry, uint32 count, Player const* player = NULL);
263  Item* CloneItem(uint32 count, Player const* player = NULL) const;
264 
265  Item();
266 
267  virtual bool Create(ObjectGuid::LowType guidlow, uint32 itemid, Player const* owner);
268 
269  ItemTemplate const* GetTemplate() const;
270  BonusData const* GetBonus() const { return &_bonusData; }
271 
274  Player* GetOwner()const;
275 
278  bool IsBoundAccountWide() const { return (GetTemplate()->GetFlags() & ITEM_FLAG_BIND_TO_ACCOUNT) != 0; }
279  bool IsBattlenetAccountBound() const { return (GetTemplate()->GetFlags2() & ITEM_FLAG2_BNET_ACCOUNT_BOUND) != 0; }
280  bool IsBindedNotWith(Player const* player) const;
281  bool IsBoundByEnchant() const;
282  virtual void SaveToDB(SQLTransaction& trans);
283  virtual bool LoadFromDB(ObjectGuid::LowType guid, ObjectGuid ownerGuid, Field* fields, uint32 entry);
284 
285  void AddBonuses(uint32 bonusListID);
286 
287  static void DeleteFromDB(SQLTransaction& trans, ObjectGuid::LowType itemGuid);
288  virtual void DeleteFromDB(SQLTransaction& trans);
289  static void DeleteFromInventoryDB(SQLTransaction& trans, ObjectGuid::LowType itemGuid);
290 
291  // Lootable items and their contents
292  void ItemContainerSaveLootToDB();
293  bool ItemContainerLoadLootFromDB();
294  void ItemContainerDeleteLootItemsFromDB();
295  void ItemContainerDeleteLootItemFromDB(uint32 itemID);
296  void ItemContainerDeleteLootMoneyFromDB();
297  void ItemContainerDeleteLootMoneyAndLootItemsFromDB();
298 
299  void DeleteFromInventoryDB(SQLTransaction& trans);
300  void SaveRefundDataToDB();
301  void DeleteRefundDataFromDB(SQLTransaction* trans);
302 
303  Bag* ToBag() { if (IsBag()) return reinterpret_cast<Bag*>(this); else return NULL; }
304  const Bag* ToBag() const { if (IsBag()) return reinterpret_cast<const Bag*>(this); else return NULL; }
305 
307  bool IsBag() const { return GetTemplate()->GetInventoryType() == INVTYPE_BAG; }
308  bool IsCurrencyToken() const { return GetTemplate()->IsCurrencyToken(); }
309  bool IsNotEmptyBag() const;
311  bool CanBeTraded(bool mail = false, bool trade = false) const;
312  void SetInTrade(bool b = true) { mb_in_trade = b; }
313  bool IsInTrade() const { return mb_in_trade; }
314 
315  bool HasEnchantRequiredSkill(const Player* player) const;
316  uint32 GetEnchantRequiredLevel() const;
317 
318  bool IsFitToSpellRequirements(SpellInfo const* spellInfo) const;
319  bool IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) const;
320  bool GemsFitSockets() const;
321 
323  void SetCount(uint32 value);
324  uint32 GetMaxStackCount() const { return GetTemplate()->GetMaxStackSize(); }
325  uint8 GetGemCountWithID(uint32 GemID) const;
326  uint8 GetGemCountWithLimitCategory(uint32 limitCategory) const;
327  InventoryResult CanBeMergedPartlyWith(ItemTemplate const* proto) const;
328 
329  uint8 GetSlot() const {return m_slot;}
330  Bag* GetContainer() { return m_container; }
331  uint8 GetBagSlot() const;
332  void SetSlot(uint8 slot) { m_slot = slot; }
333  uint16 GetPos() const { return uint16(GetBagSlot()) << 8 | GetSlot(); }
334  void SetContainer(Bag* container) { m_container = container; }
335 
336  bool IsInBag() const { return m_container != NULL; }
337  bool IsEquipped() const;
338 
339  uint32 GetSkill();
340 
341  // RandomPropertyId (signed but stored as unsigned)
344  void SetItemRandomProperties(int32 randomPropId);
345  void UpdateItemSuffixFactor();
346  static int32 GenerateItemRandomPropertyId(uint32 item_id);
347  void SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, ObjectGuid caster = ObjectGuid::Empty);
348  void SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration, Player* owner);
349  void SetEnchantmentCharges(EnchantmentSlot slot, uint32 charges);
350  void ClearEnchantment(EnchantmentSlot slot);
354 
355  std::string const& GetText() const { return m_text; }
356  void SetText(std::string const& text) { m_text = text; }
357 
358  void SendUpdateSockets();
359 
360  void SendTimeUpdate(Player* owner);
361  void UpdateDuration(Player* owner, uint32 diff);
362 
363  // spell charges (signed but stored as unsigned)
364  int32 GetSpellCharges(uint8 index/*0..5*/ = 0) const { return GetInt32Value(ITEM_FIELD_SPELL_CHARGES + index); }
365  void SetSpellCharges(uint8 index/*0..5*/, int32 value) { SetInt32Value(ITEM_FIELD_SPELL_CHARGES + index, value); }
366 
369 
370  // Update States
371  ItemUpdateState GetState() const { return uState; }
372  void SetState(ItemUpdateState state, Player* forplayer = NULL);
373  void AddToUpdateQueueOf(Player* player);
374  void RemoveFromUpdateQueueOf(Player* player);
375  bool IsInUpdateQueue() const { return uQueuePos != -1; }
376  uint16 GetQueuePos() const { return uQueuePos; }
377  void FSetState(ItemUpdateState state) // forced
378  {
379  uState = state;
380  }
381 
382  bool hasQuest(uint32 quest_id) const override { return GetTemplate()->GetStartQuest() == quest_id; }
383  bool hasInvolvedQuest(uint32 /*quest_id*/) const override { return false; }
384  bool IsPotion() const { return GetTemplate()->IsPotion(); }
385  bool IsVellum() const { return GetTemplate()->IsVellum(); }
386  bool IsConjuredConsumable() const { return GetTemplate()->IsConjuredConsumable(); }
387  bool IsRangedWeapon() const { return GetTemplate()->IsRangedWeapon(); }
388  uint32 GetQuality() const { return _bonusData.Quality; }
389  uint32 GetItemLevel(Player const* owner) const;
390  int32 GetRequiredLevel() const { return _bonusData.RequiredLevel; }
391  int32 GetItemStatType(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return _bonusData.ItemStatType[index]; }
392  int32 GetItemStatValue(uint32 index, Player const* owner) const;
393  SocketColor GetSocketColor(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_SOCKETS); return SocketColor(_bonusData.SocketColor[index]); }
394  uint32 GetAppearanceModId() const { return _bonusData.AppearanceModID; }
395  uint32 GetArmor(Player const* owner) const { return GetTemplate()->GetArmor(GetItemLevel(owner)); }
396  void GetDamage(Player const* owner, float& minDamage, float& maxDamage) const { GetTemplate()->GetDamage(GetItemLevel(owner), minDamage, maxDamage); }
397  uint32 GetDisplayId() const;
398  float GetRepairCostMultiplier() const { return _bonusData.RepairCostMultiplier; }
399  uint32 GetScalingStatDistribution() const { return _bonusData.ScalingStatDistribution; }
400 
401  // Item Refund system
402  void SetNotRefundable(Player* owner, bool changestate = true, SQLTransaction* trans = NULL);
403  void SetRefundRecipient(ObjectGuid const& guid) { m_refundRecipient = guid; }
404  void SetPaidMoney(uint32 money) { m_paidMoney = money; }
405  void SetPaidExtendedCost(uint32 iece) { m_paidExtendedCost = iece; }
406 
407  ObjectGuid const& GetRefundRecipient() const { return m_refundRecipient; }
408  uint32 GetPaidMoney() const { return m_paidMoney; }
409  uint32 GetPaidExtendedCost() const { return m_paidExtendedCost; }
410 
411  void UpdatePlayedTime(Player* owner);
412  uint32 GetPlayedTime();
413  bool IsRefundExpired();
414 
415  // Soulbound trade system
416  void SetSoulboundTradeable(GuidSet const& allowedLooters);
417  void ClearSoulboundTradeable(Player* currentOwner);
418  bool CheckSoulboundTradeExpire();
419 
420  void BuildUpdate(UpdateDataMapType&) override;
421  void BuildDynamicValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const override;
422  void AddToObjectUpdate() override;
423  void RemoveFromObjectUpdate() override;
424 
425  uint32 GetScriptId() const { return GetTemplate()->ScriptId; }
426 
427  bool IsValidTransmogrificationTarget() const;
428  static bool IsValidTransmogrificationSource(WorldPackets::Item::ItemInstance const& transmogrifier, BonusData const* bonus);
429  bool HasStats() const;
430  static bool HasStats(WorldPackets::Item::ItemInstance const& itemInstance, BonusData const* bonus);
431  static bool CanTransmogrifyItemWithItem(Item const* transmogrified, WorldPackets::Item::ItemInstance const& transmogrifier, BonusData const* bonus);
432  static uint32 GetSpecialPrice(ItemTemplate const* proto, uint32 minimumPrice = 10000);
433  uint32 GetSpecialPrice(uint32 minimumPrice = 10000) const { return Item::GetSpecialPrice(GetTemplate(), minimumPrice); }
434 
435  uint32 GetVisibleEntry() const;
436  uint32 GetVisibleAppearanceModId() const;
437 
438  static uint32 GetSellPrice(ItemTemplate const* proto, bool& success);
439 
440  uint32 GetModifier(ItemModifier modifier) const { return _modifiers[modifier]; }
441  void SetModifier(ItemModifier modifier, uint32 value);
442 
443  protected:
445 
446  private:
447  std::string m_text;
452  bool mb_in_trade; // true if item is currently in trade-window
459 };
460 #endif
Definition: Item.h:49
Definition: Object.h:95
Definition: Item.h:185
Definition: Item.h:96
bool IsVellum() const
Definition: Item.h:385
uint32 GetCount() const
Definition: Item.h:322
Definition: Item.h:80
Definition: Item.h:199
uint32 Quality
Definition: Item.h:242
uint32 GetQuality() const
Definition: Item.h:388
Definition: Item.h:98
int32 GetSpellCharges(uint8 index=0) const
Definition: Item.h:364
Definition: Item.h:89
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:300
Definition: ItemTemplate.h:135
Definition: Item.h:56
SellResult
Definition: Item.h:161
Definition: Item.h:167
Definition: Item.h:69
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: ByteBuffer.h:70
bool mb_in_trade
Definition: Item.h:452
Definition: Item.h:174
void SetContainer(Bag *container)
Definition: Item.h:334
void SetBinding(bool val)
Definition: Item.h:276
Definition: Item.h:82
uint32 GetPaidExtendedCost() const
Definition: Item.h:409
Definition: Item.h:165
bool IsConjuredConsumable() const
Definition: Item.h:386
Definition: Item.h:53
Definition: Item.h:58
void Initialize(ItemTemplate const *proto)
Definition: Item.cpp:1941
ObjectGuid m_refundRecipient
Definition: Item.h:454
uint32 GetAppearanceModId() const
Definition: Item.h:394
int32 ItemStatAllocation[MAX_ITEM_PROTO_STATS]
Definition: Item.h:247
uint32 GetItemSuffixFactor() const
Definition: Item.h:343
Definition: Item.h:151
Definition: Item.h:109
Definition: SpellInfo.h:326
bool IsSoulBound() const
Definition: Item.h:277
Bag * GetContainer()
Definition: Item.h:330
EnchantmentOffset
Definition: Item.h:197
Definition: Item.h:188
uint32 GetMaxStackCount() const
Definition: Item.h:324
virtual void BuildUpdate(UpdateDataMapType &)
Definition: Object.h:182
Definition: Item.h:107
float ItemStatSocketCostMultiplier[MAX_ITEM_PROTO_STATS]
Definition: Item.h:248
void FSetState(ItemUpdateState state)
Definition: Item.h:377
BuyResult
Definition: Item.h:148
void SetInt32Value(uint16 index, int32 value)
Definition: Object.cpp:983
Class used to access individual fields of database query result.
Definition: Field.h:56
EnchantmentSlot
Definition: Item.h:172
bool IsPotion() const
Definition: ItemTemplate.h:750
void LoadFromDB()
Definition: AddonMgr.cpp:40
float GetRepairCostMultiplier() const
Definition: Item.h:398
Definition: Item.h:187
Definition: UpdateFields.h:49
Definition: UpdateFields.h:53
bool IsLocked() const
Definition: Item.h:306
Definition: Item.h:130
ItemUpdateState GetState() const
Definition: Item.h:371
void SetInTrade(bool b=true)
Definition: Item.h:312
Definition: Item.h:128
Definition: Item.h:117
bool m_lootGenerated
Definition: Item.h:368
time_t m_lastPlayedTimeUpdate
Definition: Item.h:453
Definition: Item.h:93
Definition: ItemTemplate.h:226
uint32 GetSpecialPrice(uint32 minimumPrice=10000) const
Definition: Item.h:433
Definition: Item.h:166
uint16 GetPos() const
Definition: Item.h:333
Definition: Item.h:86
uint32 EquippedItemCount
Definition: Item.h:42
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: Item.h:62
void AddBonus(uint32 type, int32 const (&values)[2])
Definition: Item.cpp:1981
virtual void BuildDynamicValuesUpdate(uint8 updatetype, ByteBuffer *data, Player *target) const
Definition: Object.cpp:777
bool IsBattlenetAccountBound() const
Definition: Item.h:279
Definition: Item.h:90
Definition: UpdateFields.h:42
Definition: Item.h:106
int32 RequiredLevel
Definition: Item.h:244
uint32 m_paidExtendedCost
Definition: Item.h:456
float RepairCostMultiplier
Definition: Item.h:251
uint16 GetQueuePos() const
Definition: Item.h:376
void SetGuidValue(uint16 index, ObjectGuid const &value)
Definition: Object.cpp:1120
Definition: Item.h:97
Definition: Item.h:153
int32 ItemStatType[MAX_ITEM_PROTO_STATS]
Definition: Item.h:245
Bag * m_container
Definition: Item.h:449
void GetDamage(uint32 itemLevel, float &minDamage, float &maxDamage) const
Definition: ItemTemplate.cpp:74
ItemModifier
Definition: Item.h:222
Definition: Item.h:190
bool IsBag() const
Definition: Item.h:307
Definition: Item.h:63
int32 GetItemRandomPropertyId() const
Definition: Item.h:342
uint64 LowType
Definition: ObjectGuid.h:199
uint16_t uint16
Definition: g3dmath.h:166
Definition: Item.h:39
Definition: Item.h:112
Definition: Item.h:135
Definition: Item.h:120
Definition: Item.h:85
SocketColor GetSocketColor(uint32 index) const
Definition: Item.h:393
Definition: Item.h:157
uint32 GetEnchantmentDuration(EnchantmentSlot slot) const
Definition: Item.h:352
Definition: Item.h:210
bool IsVellum() const
Definition: ItemTemplate.h:751
Definition: Item.h:208
Definition: Item.h:181
Definition: Item.h:92
Definition: Item.h:108
static uint32 GetSpecialPrice(ItemTemplate const *proto, uint32 minimumPrice=10000)
Definition: Item.cpp:1661
Definition: Item.h:78
Definition: Item.h:127
SocketColor
Definition: ItemTemplate.h:318
ItemUpdateState uState
Definition: Item.h:450
Definition: Item.h:61
InventoryType GetInventoryType() const
Definition: ItemTemplate.h:664
virtual void RemoveFromObjectUpdate()=0
Definition: Item.h:100
uint32 ItemSetID
Definition: Item.h:41
Definition: Item.h:91
std::string const & GetText() const
Definition: Item.h:355
Definition: Item.h:48
bool IsBoundAccountWide() const
Definition: Item.h:278
bool ItemCanGoIntoBag(ItemTemplate const *proto, ItemTemplate const *pBagProto)
Definition: Item.cpp:157
Definition: Item.h:71
Definition: Bag.h:28
bool IsPotion() const
Definition: Item.h:384
Definition: Item.h:175
std::unordered_map< Player *, UpdateData > UpdateDataMapType
Definition: Object.h:91
Definition: Item.h:225
std::string m_text
Definition: Item.h:447
Definition: Item.h:141
Definition: Item.h:79
Definition: Item.h:143
Definition: Item.h:144
Definition: Item.h:189
Definition: Item.h:73
const Bag * ToBag() const
Definition: Item.h:304
Definition: Item.h:200
#define MAX_ITEM_PROTO_STATS
Definition: DB2Structure.h:790
Definition: Item.h:118
int32 GetInt32Value(uint16 index) const
Definition: Object.cpp:294
bool IsCurrencyToken() const
Definition: Item.h:308
Definition: Item.h:77
Definition: Item.h:125
Definition: Item.h:136
void SetSlot(uint8 slot)
Definition: Item.h:332
Definition: Item.h:55
Definition: LootMgr.h:314
uint32 GetPaidMoney() const
Definition: Item.h:408
Definition: Item.h:88
Definition: Item.h:150
void SetRefundRecipient(ObjectGuid const &guid)
Definition: Item.h:403
uint32 GetScalingStatDistribution() const
Definition: Item.h:399
Definition: Item.h:259
#define MAX_ENCHANTMENT_OFFSET
Definition: Item.h:204
Definition: Item.h:59
Definition: UpdateFields.h:51
ObjectGuid const & GetRefundRecipient() const
Definition: Item.h:407
Definition: Item.h:158
uint32 GetModifier(ItemModifier modifier) const
Definition: Item.h:440
int32_t int32
Definition: Define.h:146
bool hasQuest(uint32 quest_id) const override
Definition: Item.h:382
void SetPaidExtendedCost(uint32 iece)
Definition: Item.h:405
uint32_t uint32
Definition: Define.h:150
Definition: Item.h:54
Definition: Item.h:114
Definition: Item.h:122
Definition: Item.h:176
Definition: Item.h:74
ObjectGuid const & GetGuidValue(uint16 index) const
Definition: Object.cpp:332
uint16_t uint16
Definition: Define.h:151
Definition: ItemTemplate.h:200
uint32 GetArmor(Player const *owner) const
Definition: Item.h:395
Definition: Item.h:50
Definition: Item.h:83
Definition: Item.h:66
uint32 GetStartQuest() const
Definition: ItemTemplate.h:686
Definition: Item.h:65
BonusData _bonusData
Definition: Item.h:444
Definition: Item.h:201
Definition: Item.h:110
uint32 GetMaxStackSize() const
Definition: ItemTemplate.h:745
Definition: ItemTemplate.h:350
Definition: Item.h:81
Definition: Item.h:168
Definition: UpdateFields.h:46
Definition: Item.h:57
Definition: Item.h:186
Definition: Item.h:154
Definition: Item.h:119
Definition: Item.h:178
uint32 m_paidMoney
Definition: Item.h:455
bool IsConjuredConsumable() const
Definition: ItemTemplate.h:752
Bag * ToBag()
Definition: Item.h:303
Definition: Item.h:60
uint8 m_slot
Definition: Item.h:448
Definition: Item.h:152
int16 uQueuePos
Definition: Item.h:451
ObjectGuid GetOwnerGUID() const
Definition: Item.h:272
uint8 GetSlot() const
Definition: Item.h:329
Definition: Item.h:51
Definition: BattlegroundMgr.h:57
Definition: Item.h:75
void SetSpellCharges(uint8 index, int32 value)
Definition: Item.h:365
Definition: Item.h:70
bool IsCurrencyToken() const
Definition: ItemTemplate.h:743
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
Definition: Object.cpp:1247
Definition: Item.h:216
Definition: Item.h:177
BonusData const * GetBonus() const
Definition: Item.h:270
Definition: Item.h:240
Definition: Item.h:102
Definition: Item.h:217
bool IsBroken() const
Definition: Item.h:310
uint32 GetScriptId() const
Definition: Item.h:425
bool IsInTrade() const
Definition: Item.h:313
uint32 AppearanceModID
Definition: Item.h:250
Definition: Item.h:155
Definition: Item.h:72
int32 ItemLevel
Definition: Item.h:243
Definition: Item.h:64
Definition: Item.h:226
Definition: Item.h:116
ItemUpdateState
Definition: Item.h:214
Definition: ItemTemplate.h:647
uint32 GetEnchantmentCharges(EnchantmentSlot slot) const
Definition: Item.h:353
bool IsRangedWeapon() const
Definition: Item.h:387
#define MAX_ITEM_PROTO_SOCKETS
Definition: DB2Structure.h:789
int32 GetItemStatType(uint32 index) const
Definition: Item.h:391
Definition: Item.h:95
Definition: Item.h:113
Definition: Item.h:87
Definition: Item.h:156
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:332
Definition: Item.h:145
#define TC_GAME_API
Definition: Define.h:134
void GetDamage(Player const *owner, float &minDamage, float &maxDamage) const
Definition: Item.h:396
Definition: Item.h:84
uint32 ScalingStatDistribution
Definition: Item.h:252
int32 ItemStatValue[MAX_ITEM_PROTO_STATS]
Definition: Item.h:246
Definition: Item.h:121
uint8_t uint8
Definition: Define.h:152
Definition: Item.h:229
void SetOwnerGUID(ObjectGuid guid)
Definition: Item.h:273
bool IsRangedWeapon() const
Definition: ItemTemplate.h:754
int32 GetRequiredLevel() const
Definition: Item.h:390
#define ASSERT
Definition: Errors.h:55
EnchantmentSlotMask
Definition: Item.h:206
Definition: Item.h:219
Definition: Item.h:131
Definition: Item.h:126
const FieldDescriptor value
Definition: descriptor.h:1522
Definition: ItemPackets.h:40
int16_t int16
Definition: Define.h:147
Definition: Item.h:231
Definition: Item.h:164
Definition: ObjectGuid.h:189
Definition: UpdateFields.h:48
Definition: Item.h:218
Definition: Item.h:111
bool IsInBag() const
Definition: Item.h:336
Definition: Item.h:163
Definition: Item.h:103
Definition: Item.h:180
Definition: Item.h:211
bool hasInvolvedQuest(uint32) const override
Definition: Item.h:383
InventoryResult
Definition: Item.h:46
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.cpp:1239
bool IsInUpdateQueue() const
Definition: Item.h:375
Definition: UpdateFields.h:54
Definition: Item.h:99
std::unordered_set< ItemSetSpellEntry const * > SetBonuses
Definition: Item.h:43
Definition: Item.h:115
virtual void AddToObjectUpdate()=0
Definition: Item.h:104
Definition: Item.h:105
Definition: Unit.h:1305
uint32 ScriptId
Definition: ItemTemplate.h:710
Definition: Item.h:52
Definition: Item.h:179
Definition: Item.h:68
Definition: Item.h:183
Definition: UpdateFields.h:52
Definition: Item.h:233
void SetPaidMoney(uint32 money)
Definition: Item.h:404
Definition: Item.h:101
Definition: Item.h:94
Loot loot
Definition: Item.h:367
Definition: UpdateFields.h:50
Definition: Item.h:209
uint32 GetArmor(uint32 itemLevel) const
Definition: ItemTemplate.cpp:38
void SetText(std::string const &text)
Definition: Item.h:356
Definition: ItemTemplate.h:137
GuidSet allowedGUIDs
Definition: Item.h:457
Definition: Item.h:67
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58
uint32 GetEnchantmentId(EnchantmentSlot slot) const
Definition: Item.h:351