OregonCore  revision fb2a440-git
Your Favourite TBC server
ItemPrototype.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef _ITEMPROTOTYPE_H
19 #define _ITEMPROTOTYPE_H
20 
21 #include "Common.h"
22 
24 {
58 };
59 
60 #define MAX_ITEM_MOD 38
61 
63 {
64  ITEM_SPELLTRIGGER_ON_USE = 0, // use after equip cooldown
68  ITEM_SPELLTRIGGER_ON_NO_DELAY_USE = 5, // no equip cooldown
69  ITEM_SPELLTRIGGER_LEARN_SPELL_ID = 6 // used in item_template.spell_2 with spell_id with SPELL_GENERIC_LEARN in spell_1
70 };
71 
72 #define MAX_ITEM_SPELLTRIGGER 7
73 
75 {
76  NO_BIND = 0,
81  BIND_QUEST_ITEM1 = 5 // not used in game
82 };
83 
84 #define MAX_BIND_TYPE 6
85 
86 /* /// @todo: Requiring actual cases in which using (an) item isn't allowed while shapeshifted. Else, this flag would need an implementation.
87  ITEM_PROTO_FLAG_USABLE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms */
88 
90 {
91  ITEM_PROTO_FLAG_NO_PICKUP = 0x00000001, // ?
92  ITEM_PROTO_FLAG_CONJURED = 0x00000002, // Conjured item
93  ITEM_PROTO_FLAG_HAS_LOOT = 0x00000004, // Item can be right clicked to open for loot
94  ITEM_PROTO_FLAG_HEROIC = 0x00000008, // Makes green "Heroic" text appear on item
95  ITEM_PROTO_FLAG_DEPRECATED = 0x00000010, // Cannot equip or use
96  ITEM_PROTO_FLAG_INDESTRUCTIBLE = 0x00000020, // Item can not be destroyed, except by using spell (item can be reagent for spell)
97  ITEM_PROTO_FLAG_PLAYER_CAST = 0x00000040, // Item's spells are castable by players
98  ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN = 0x00000080, // No default 30 seconds cooldown when equipped
100  ITEM_PROTO_FLAG_IS_WRAPPER = 0x00000200, // Item can wrap other items
102  ITEM_PROTO_FLAG_MULTI_DROP = 0x00000800, // Looting this item does not remove it from available loot
103  ITEM_PROTO_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost)
104  ITEM_PROTO_FLAG_PETITION = 0x00002000, // Item is guild or arena charter
105  ITEM_PROTO_FLAG_UNK5 = 0x00004000, // Only readable items have this (but not all)
106  ITEM_PROTO_FLAG_UNK6 = 0x00008000, // ?
107  ITEM_PROTO_FLAG_UNK7 = 0x00010000, // ?
108  ITEM_PROTO_FLAG_UNK8 = 0x00020000, // ?
109  ITEM_PROTO_FLAG_PROSPECTABLE = 0x00040000, // Item can be prospected
110  ITEM_PROTO_FLAG_UNIQUE_EQUIPPED = 0x00080000, // You can only equip one of these
111  ITEM_PROTO_FLAG_UNK9 = 0x00100000, // ?
112  ITEM_PROTO_FLAG_USEABLE_IN_ARENA = 0x00200000, // Item can be used during arena match
113  ITEM_PROTO_FLAG_THROWABLE = 0x00400000, // Some Thrown weapons have it (and only Thrown) but not all
114  ITEM_PROTO_FLAG_USABLE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms
115  ITEM_PROTO_FLAG_UNK10 = 0x01000000, // ?
116  ITEM_PROTO_FLAG_SMART_LOOT = 0x02000000, // Profession recipes: can only be looted if you meet requirements and don't already know it
117  ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA = 0x04000000, // Item cannot be used in arena
118  ITEM_PROTO_FLAG_BIND_TO_ACCOUNT = 0x08000000, // Item binds to account and can be sent only to your own characters
119  ITEM_PROTO_FLAG_TRIGGERED_CAST = 0x10000000, // Spell is cast with triggered flag
120  ITEM_PROTO_FLAG_MILLABLE = 0x20000000, // Item can be milled
121  ITEM_PROTO_FLAG_UNK11 = 0x40000000, // ?
122  ITEM_PROTO_FLAG_UNK12 = 0x80000000 // ?
123 };
124 
125 // masks for ITEM_FIELD_FLAGS field
127 {
128  ITEM_FLAG_SOULBOUND = 0x00000001, // Item is soulbound and cannot be traded <<--
129  ITEM_FLAG_UNK1 = 0x00000002, // ?
130  ITEM_FLAG_UNLOCKED = 0x00000004, // Item had lock but can be opened now
131  ITEM_FLAG_WRAPPED = 0x00000008, // Item is wrapped and contains another item
132  ITEM_FLAG_UNK2 = 0x00000010, // ?
133  ITEM_FLAG_UNK3 = 0x00000020, // ?
134  ITEM_FLAG_UNK4 = 0x00000040, // ?
135  ITEM_FLAG_UNK5 = 0x00000080, // ?
136  ITEM_FLAG_BOP_TRADEABLE = 0x00000100, // Allows trading soulbound items
137  ITEM_FLAG_READABLE = 0x00000200, // Opens text page when right clicked
138  ITEM_FLAG_UNK6 = 0x00000400, // ?
139  ITEM_FLAG_UNK7 = 0x00000800, // ?
140  ITEM_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost)
141  ITEM_FLAG_UNK8 = 0x00002000, // ?
142  ITEM_FLAG_UNK9 = 0x00004000, // ?
143  ITEM_FLAG_UNK10 = 0x00008000, // ?
144  ITEM_FLAG_UNK11 = 0x00010000, // ?
145  ITEM_FLAG_UNK12 = 0x00020000, // ?
146  ITEM_FLAG_UNK13 = 0x00040000, // ?
147  ITEM_FLAG_UNK14 = 0x00080000, // ?
148  ITEM_FLAG_UNK15 = 0x00100000, // ?
149  ITEM_FLAG_UNK16 = 0x00200000, // ?
150  ITEM_FLAG_UNK17 = 0x00400000, // ?
151  ITEM_FLAG_UNK18 = 0x00800000, // ?
152  ITEM_FLAG_UNK19 = 0x01000000, // ?
153  ITEM_FLAG_UNK20 = 0x02000000, // ?
154  ITEM_FLAG_UNK21 = 0x04000000, // ?
155  ITEM_FLAG_UNK22 = 0x08000000, // ?
156  ITEM_FLAG_UNK23 = 0x10000000, // ?
157  ITEM_FLAG_UNK24 = 0x20000000, // ?
158 };
159 
161 {
167  BAG_FAMILY_MASK_HERBS = 0x00000020,
170  BAG_FAMILY_MASK_KEYS = 0x00000100,
171  BAG_FAMILY_MASK_GEMS = 0x00000200,
177 };
178 
180 {
185 };
186 
187 #define SOCKET_COLOR_ALL (SOCKET_COLOR_META | SOCKET_COLOR_RED | SOCKET_COLOR_YELLOW | SOCKET_COLOR_BLUE)
188 
190 {
220 };
221 
222 #define MAX_INVTYPE 29
223 
225 {
242 };
243 
244 #define MAX_ITEM_CLASS 16
245 
247 {
257 };
258 
259 #define MAX_ITEM_SUBCLASS_CONSUMABLE 9
260 
262 {
271 };
272 
273 #define MAX_ITEM_SUBCLASS_CONTAINER 8
274 
276 {
298 };
299 
300 #define MAX_ITEM_SUBCLASS_WEAPON 21
301 
303 {
313 };
314 
315 #define MAX_ITEM_SUBCLASS_GEM 9
316 
318 {
329 };
330 
331 #define MAX_ITEM_SUBCLASS_ARMOR 10
332 
334 {
336 };
337 
338 #define MAX_ITEM_SUBCLASS_REAGENT 1
339 
341 {
342  ITEM_SUBCLASS_WAND = 0, // ABS
343  ITEM_SUBCLASS_BOLT = 1, // ABS
347 };
348 
349 #define MAX_ITEM_SUBCLASS_PROJECTILE 5
350 
352 {
366  ITEM_SUBCLASS_MATERIAL = 13 // Added in 2.4.2
367 };
368 
369 #define MAX_ITEM_SUBCLASS_TRADE_GOODS 14
370 
372 {
374 };
375 
376 #define MAX_ITEM_SUBCLASS_GENERIC 1
377 
379 {
391 };
392 
393 #define MAX_ITEM_SUBCLASS_RECIPE 11
394 
396 {
398 };
399 
400 #define MAX_ITEM_SUBCLASS_MONEY 1
401 
403 {
408 };
409 
410 #define MAX_ITEM_SUBCLASS_QUIVER 4
411 
413 {
415 };
416 
417 #define MAX_ITEM_SUBCLASS_QUEST 1
418 
420 {
423 };
424 
425 #define MAX_ITEM_SUBCLASS_KEY 2
426 
428 {
430 };
431 
432 #define MAX_ITEM_SUBCLASS_PERMANENT 1
433 
435 {
442 };
443 
444 #define MAX_ITEM_SUBCLASS_JUNK 6
445 
447 {
458 };
459 
460 #define MAX_ITEM_SUBCLASS_GLYPH 12
461 
463 {
480 };
481 
483 {
484  switch (ItemClass)
485  {
486  case ITEM_CLASS_WEAPON:
487  return ItemSubClass;
488  case ITEM_CLASS_ARMOR:
489  return ItemSubClass + 21;
490  }
491  return 0;
492 }
493 
494 // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
495 #if defined(__GNUC__)
496 #pragma pack(1)
497 #else
498 #pragma pack(push,1)
499 #endif
500 
501 struct _Damage
502 {
503  float DamageMin;
504  float DamageMax;
505  uint32 DamageType; // id from Resistances.dbc
506 };
507 
508 struct _ItemStat
509 {
512 };
513 struct _Spell
514 {
515  uint32 SpellId; // id from Spell.dbc
520  uint32 SpellCategory; // id from SpellCategory.dbc
522 };
523 
524 struct _Socket
525 {
528 };
529 
530 #define MAX_ITEM_PROTO_SPELLS 5
531 
533 {
535  uint32 Class; // id from ItemClass.dbc
536  uint32 SubClass; // id from ItemSubClass.dbc
537  uint32 SoundOverrideSubclass; // < 0: id from ItemSubClass.dbc, used to override weapon sound from actual SubClass
538  char* Name1;
539  uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
550  uint32 RequiredSkill; // id from SkillLine.dbc
552  uint32 RequiredSpell; // id from Spell.dbc
555  uint32 RequiredReputationFaction; // id from Faction.dbc
560  _ItemStat ItemStat[10];
561  _Damage Damage[5];
572  _Spell Spells[5];
574  char* Description;
578  uint32 StartQuest; // id from QuestCache.wdb
580  uint32 Material; // id from Material.dbc
582  uint32 RandomProperty; // id from ItemRandomProperties.dbc
583  uint32 RandomSuffix; // id from ItemRandomSuffix.dbc
585  uint32 ItemSet; // id from ItemSet.dbc
587  uint32 Area; // id from AreaTable.dbc
588  uint32 Map; // id from Map.dbc
589  uint32 BagFamily; // id from ItemBagFamily.dbc
590  uint32 TotemCategory; // id from TotemCategory.dbc
591  _Socket Socket[3];
592  uint32 socketBonus; // id from SpellItemEnchantment.dbc
593  uint32 GemProperties; // id from GemProperties.dbc
601  int32 Duration; // negative = realtime, positive = ingame time
602 
603  // helpers
605  {
606  switch (InventoryType)
607  {
608  case INVTYPE_RELIC:
609  case INVTYPE_SHIELD:
610  case INVTYPE_HOLDABLE:
611  return true;
612  }
613 
614  switch (Class)
615  {
616  case ITEM_CLASS_WEAPON:
618  return true;
619  }
620 
621  return false;
622  }
623 
625  {
626  return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF - 1) : uint32(Stackable);
627  }
628 };
629 
631 {
632  std::vector<std::string> Name;
633  std::vector<std::string> Description;
634 };
635 
636 // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
637 #if defined(__GNUC__)
638 #pragma pack()
639 #else
640 #pragma pack(pop)
641 #endif
642 #endif
643 
uint32 ItemLevel
#define MAX_ITEM_SUBCLASS_PERMANENT
InventoryType
#define MAX_ITEM_SUBCLASS_REAGENT
uint32 RequiredSkillRank
#define MAX_ITEM_SUBCLASS_GENERIC
#define MAX_ITEM_SUBCLASS_MONEY
uint32 InventoryType
std::vector< std::string > Description
uint32 RequiredSkill
int32 SpellCategoryCooldown
ItemSubclassContainer
SocketColor
uint32 SellPrice
std::vector< std::string > Name
ItemSubclassReagent
ItemSubclassGeneric
float RangedModRange
uint32 socketBonus
uint32 MaxMoneyLoot
uint32 RequiredCityRank
ItemFieldFlags
ItemSpelltriggerType
Definition: ItemPrototype.h:62
#define MAX_ITEM_SUBCLASS_ARMOR
uint32 ShadowRes
ACE_INT32 int32
Definition: Define.h:67
uint32 RequiredReputationFaction
uint32 ArcaneRes
ItemSubclassMoney
uint32 SpellId
#define MAX_ITEM_SUBCLASS_CONTAINER
uint32 NatureRes
uint32 TotemCategory
uint32 SpellTrigger
#define MAX_ITEM_SUBCLASS_PROJECTILE
float DamageMax
uint32 RequiredReputationRank
uint32 SpellCategory
int32 SpellCharges
#define MAX_ITEM_SUBCLASS_KEY
ItemSubclassGem
ItemSubclassArmor
uint32 DamageType
uint32 Color
uint32 RandomSuffix
float ArmorDamageModifier
bool CanChangeEquipStateInCombat() const
ItemSubclassTradeGoods
uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemSubClass)
ItemBondingType
Definition: ItemPrototype.h:74
ACE_UINT8 uint8
Definition: Define.h:73
ItemClass
uint32 DisplayInfoID
uint32 AllowableClass
ItemModType
Definition: ItemPrototype.h:23
float SpellPPMRate
char * Description
const uint32 MaxItemSubclassValues[MAX_ITEM_CLASS]
#define MAX_ITEM_SUBCLASS_TRADE_GOODS
uint32 DisenchantID
uint32 RequiredLevel
#define MAX_ITEM_SUBCLASS_JUNK
ItemSubclassKey
ItemSubclassWeapon
uint32 RequiredDisenchantSkill
#define MAX_ITEM_SUBCLASS_RECIPE
uint32 GetMaxStackSize() const
uint32 ItemStatType
#define MAX_ITEM_SUBCLASS_CONSUMABLE
ItemSubclassRecipe
uint32 Content
uint32 MaxDurability
ItemProtoFlags
Definition: ItemPrototype.h:89
ItemSubclassProjectile
ItemSubclassQuest
uint32 ContainerSlots
int32 SpellCooldown
uint32 AllowableRace
BAG_FAMILY_MASK
ItemSubclassGlyph
ItemSubclassQuiver
ItemSubclassConsumable
uint32 Stackable
#define MAX_ITEM_SUBCLASS_GEM
#define MAX_ITEM_SUBCLASS_QUEST
ItemSubclassPermanent
uint32 RequiredSpell
uint32 MinMoneyLoot
ACE_UINT32 uint32
Definition: Define.h:71
#define MAX_ITEM_SUBCLASS_QUIVER
uint32 RequiredHonorRank
uint32 LanguageID
#define MAX_ITEM_CLASS
ItemSubclassJunk
uint32 PageMaterial
uint32 RandomProperty
uint32 SoundOverrideSubclass
float DamageMin
uint32 BagFamily
int32 ItemStatValue
uint32 StartQuest
uint32 GemProperties
#define MAX_ITEM_SUBCLASS_WEAPON