TrinityCore
ItemTemplate Struct Reference

#include <ItemTemplate.h>

Public Member Functions

uint32 GetId () const
 
uint32 GetClass () const
 
uint32 GetSubClass () const
 
uint32 GetQuality () const
 
uint32 GetFlags () const
 
uint32 GetFlags2 () const
 
uint32 GetFlags3 () const
 
uint32 GetFlags4 () const
 
float GetPriceRandomValue () const
 
float GetPriceVariance () const
 
uint32 GetBuyCount () const
 
uint32 GetBuyPrice () const
 
uint32 GetSellPrice () const
 
InventoryType GetInventoryType () const
 
int32 GetAllowableClass () const
 
Trinity::RaceMask< int64GetAllowableRace () const
 
uint32 GetBaseItemLevel () const
 
int32 GetBaseRequiredLevel () const
 
uint32 GetRequiredSkill () const
 
uint32 GetRequiredSkillRank () const
 
uint32 GetRequiredSpell () const
 
uint32 GetRequiredReputationFaction () const
 
uint32 GetRequiredReputationRank () const
 
uint32 GetMaxCount () const
 
uint32 GetContainerSlots () const
 
int32 GetStatModifierBonusStat (uint32 index) const
 
int32 GetStatPercentEditor (uint32 index) const
 
float GetStatPercentageOfSocket (uint32 index) const
 
uint32 GetScalingStatContentTuning () const
 
uint32 GetPlayerLevelToItemLevelCurveId () const
 
uint32 GetDamageType () const
 
uint32 GetDelay () const
 
float GetRangedModRange () const
 
ItemBondingType GetBonding () const
 
char const * GetName (LocaleConstant locale) const
 
uint32 GetPageText () const
 
uint32 GetStartQuest () const
 
uint32 GetLockID () const
 
uint32 GetItemSet () const
 
uint32 GetArea (uint32 index) const
 
uint32 GetMap () const
 
uint32 GetBagFamily () const
 
uint32 GetTotemCategory () const
 
SocketColor GetSocketColor (uint32 index) const
 
uint32 GetSocketBonus () const
 
uint32 GetGemProperties () const
 
float GetQualityModifier () const
 
uint32 GetDuration () const
 
uint32 GetItemLimitCategory () const
 
HolidayIds GetHolidayID () const
 
float GetDmgVariance () const
 
uint8 GetArtifactID () const
 
uint8 GetRequiredExpansion () const
 
bool CanChangeEquipStateInCombat () const
 
bool IsCurrencyToken () const
 
uint32 GetMaxStackSize () const
 
uint32 GetSkill () const
 
bool IsPotion () const
 
bool IsVellum () const
 
bool IsConjuredConsumable () const
 
bool IsCraftingReagent () const
 
bool IsWeapon () const
 
bool IsRangedWeapon () const
 
char const * GetDefaultLocaleName () const
 
uint32 GetArmor (uint32 itemLevel) const
 
float GetDPS (uint32 itemLevel) const
 
void GetDamage (uint32 itemLevel, float &minDamage, float &maxDamage) const
 
bool IsUsableByLootSpecialization (Player const *player, bool alwaysAllowBoundToAccount) const
 

Static Public Member Functions

static std::size_t CalculateItemSpecBit (ChrSpecializationEntry const *spec)
 

Public Attributes

ItemEntry const * BasicData
 
ItemSparseEntry const * ExtendedData
 
uint32 MaxDurability
 
std::vector< ItemEffectEntry const * > Effects
 
uint32 ScriptId
 
uint32 FoodType
 
uint32 MinMoneyLoot
 
uint32 MaxMoneyLoot
 
uint32 FlagsCu
 
float SpellPPMRate
 
uint32 RandomBonusListTemplateId
 
std::bitset< MAX_CLASSES *MAX_SPECIALIZATIONSSpecializations [3]
 
uint32 ItemSpecClassMask
 

Member Function Documentation

◆ CalculateItemSpecBit()

std::size_t ItemTemplate::CalculateItemSpecBit ( ChrSpecializationEntry const *  spec)
static
268 {
269  return (spec->ClassID - 1) * MAX_SPECIALIZATIONS + spec->OrderIndex;
270 }
#define MAX_SPECIALIZATIONS
Definition: SharedDefines.h:915
+ Here is the caller graph for this function:

◆ CanChangeEquipStateInCombat()

bool ItemTemplate::CanChangeEquipStateInCombat ( ) const
56 {
57  switch (GetInventoryType())
58  {
59  case INVTYPE_RELIC:
60  case INVTYPE_SHIELD:
61  case INVTYPE_HOLDABLE:
62  return true;
63  default:
64  break;
65  }
66 
67  switch (GetClass())
68  {
69  case ITEM_CLASS_WEAPON:
71  return true;
72  }
73 
74  return false;
75 }
InventoryType GetInventoryType() const
Definition: ItemTemplate.h:748
uint32 GetClass() const
Definition: ItemTemplate.h:736
Definition: ItemTemplate.h:409
Definition: ItemTemplate.h:386
Definition: ItemTemplate.h:413
Definition: ItemTemplate.h:395
Definition: ItemTemplate.h:400
+ Here is the call graph for this function:

◆ GetAllowableClass()

int32 ItemTemplate::GetAllowableClass ( ) const
inline
749 { return ExtendedData->AllowableClass; }
int16 AllowableClass
Definition: DB2Structure.h:2178
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetAllowableRace()

Trinity::RaceMask<int64> ItemTemplate::GetAllowableRace ( ) const
inline
750 { return ExtendedData->AllowableRace; }
Trinity::RaceMask< int64 > AllowableRace
Definition: DB2Structure.h:2133
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetArea()

uint32 ItemTemplate::GetArea ( uint32  index) const
inline
774 { ASSERT(index < MAX_ITEM_PROTO_ZONES); return ExtendedData->ZoneBound[index]; }
#define MAX_ITEM_PROTO_ZONES
Definition: DBCEnums.h:730
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
uint16 ZoneBound[MAX_ITEM_PROTO_ZONES]
Definition: DB2Structure.h:2168
#define ASSERT
Definition: Errors.h:57
+ Here is the caller graph for this function:

◆ GetArmor()

uint32 ItemTemplate::GetArmor ( uint32  itemLevel) const
119 {
121  if (quality > ITEM_QUALITY_ARTIFACT)
122  return 0;
123 
124  // all items but shields
126  {
127  ItemArmorQualityEntry const* armorQuality = sItemArmorQualityStore.LookupEntry(itemLevel);
128  ItemArmorTotalEntry const* armorTotal = sItemArmorTotalStore.LookupEntry(itemLevel);
129  if (!armorQuality || !armorTotal)
130  return 0;
131 
132  uint32 inventoryType = GetInventoryType();
133  if (inventoryType == INVTYPE_ROBE)
134  inventoryType = INVTYPE_CHEST;
135 
136  ArmorLocationEntry const* location = sArmorLocationStore.LookupEntry(inventoryType);
137  if (!location)
138  return 0;
139 
141  return 0;
142 
143  float total = 1.0f;
144  float locationModifier = 1.0f;
145  switch (GetSubClass())
146  {
148  total = armorTotal->Cloth;
149  locationModifier = location->Clothmodifier;
150  break;
152  total = armorTotal->Leather;
153  locationModifier = location->Leathermodifier;
154  break;
156  total = armorTotal->Mail;
157  locationModifier = location->Chainmodifier;
158  break;
160  total = armorTotal->Plate;
161  locationModifier = location->Platemodifier;
162  break;
163  default:
164  break;
165  }
166 
167  return uint32(armorQuality->Qualitymod[quality] * total * locationModifier + 0.5f);
168  }
169 
170  // shields
171  ItemArmorShieldEntry const* shield = sItemArmorShieldStore.LookupEntry(itemLevel);
172  if (!shield)
173  return 0;
174 
175  return uint32(shield->Quality[quality] + 0.5f);
176 }
InventoryType GetInventoryType() const
Definition: ItemTemplate.h:748
float Platemodifier
Definition: DB2Structure.h:197
float Quality[7]
Definition: DB2Structure.h:1850
DB2Storage< ItemArmorTotalEntry > sItemArmorTotalStore("ItemArmorTotal.db2", ItemArmorTotalLoadInfo::Instance())
uint32 GetClass() const
Definition: ItemTemplate.h:736
float Cloth
Definition: DB2Structure.h:1858
float Clothmodifier
Definition: DB2Structure.h:194
Definition: DB2Structure.h:1841
DB2Storage< ItemArmorQualityEntry > sItemArmorQualityStore("ItemArmorQuality.db2", ItemArmorQualityLoadInfo::Instance())
float Plate
Definition: DB2Structure.h:1861
Definition: ItemTemplate.h:518
Definition: ItemTemplate.h:517
Definition: SharedDefines.h:345
DB2Storage< ArmorLocationEntry > sArmorLocationStore("ArmorLocation.db2", ArmorLocationLoadInfo::Instance())
float Chainmodifier
Definition: DB2Structure.h:196
Definition: DB2Structure.h:191
Definition: ItemTemplate.h:392
float Qualitymod[7]
Definition: DB2Structure.h:1844
uint32 GetQuality() const
Definition: ItemTemplate.h:738
Definition: ItemTemplate.h:516
uint32_t uint32
Definition: Define.h:152
Definition: SharedDefines.h:344
float Mail
Definition: DB2Structure.h:1860
Definition: ItemTemplate.h:411
DB2Storage< ItemArmorShieldEntry > sItemArmorShieldStore("ItemArmorShield.db2", ItemArmorShieldLoadInfo::Instance())
ItemQualities
Definition: SharedDefines.h:336
float Leather
Definition: DB2Structure.h:1859
Definition: ItemTemplate.h:377
float Leathermodifier
Definition: DB2Structure.h:195
Definition: SharedDefines.h:341
uint32 GetSubClass() const
Definition: ItemTemplate.h:737
Definition: ItemTemplate.h:515
Definition: DB2Structure.h:1847
Definition: ItemTemplate.h:520
Definition: DB2Structure.h:1854
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetArtifactID()

uint8 ItemTemplate::GetArtifactID ( ) const
inline
786 { return ExtendedData->ArtifactID; }
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
uint8 ArtifactID
Definition: DB2Structure.h:2179
+ Here is the caller graph for this function:

◆ GetBagFamily()

uint32 ItemTemplate::GetBagFamily ( ) const
inline
776 { return ExtendedData->BagFamily; }
uint32 BagFamily
Definition: DB2Structure.h:2144
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetBaseItemLevel()

uint32 ItemTemplate::GetBaseItemLevel ( ) const
inline
751 { return ExtendedData->ItemLevel; }
uint16 ItemLevel
Definition: DB2Structure.h:2177
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetBaseRequiredLevel()

int32 ItemTemplate::GetBaseRequiredLevel ( ) const
inline
752 { return ExtendedData->RequiredLevel; }
int8 RequiredLevel
Definition: DB2Structure.h:2194
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetBonding()

ItemBondingType ItemTemplate::GetBonding ( ) const
inline
ItemBondingType
Definition: ItemTemplate.h:120
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
uint8 Bonding
Definition: DB2Structure.h:2187
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetBuyCount()

uint32 ItemTemplate::GetBuyCount ( ) const
inline
745 { return std::max<uint32>(ExtendedData->VendorStackCount, 1u); }
uint32 VendorStackCount
Definition: DB2Structure.h:2153
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetBuyPrice()

uint32 ItemTemplate::GetBuyPrice ( ) const
inline
746 { return ExtendedData->BuyPrice; }
uint32 BuyPrice
Definition: DB2Structure.h:2152
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetClass()

uint32 ItemTemplate::GetClass ( ) const
inline
736 { return BasicData->ClassID; }
ItemEntry const * BasicData
Definition: ItemTemplate.h:732
uint8 ClassID
Definition: DB2Structure.h:1820
+ Here is the caller graph for this function:

◆ GetContainerSlots()

uint32 ItemTemplate::GetContainerSlots ( ) const
inline
759 { return ExtendedData->ContainerSlots; }
uint8 ContainerSlots
Definition: DB2Structure.h:2190
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetDamage()

void ItemTemplate::GetDamage ( uint32  itemLevel,
float &  minDamage,
float &  maxDamage 
) const
232 {
233  minDamage = maxDamage = 0.0f;
234  float dps = GetDPS(itemLevel);
235  if (dps > 0.0f)
236  {
237  float avgDamage = dps * GetDelay() * 0.001f;
238  minDamage = (GetDmgVariance() * -0.5f + 1.0f) * avgDamage;
239  maxDamage = floor(float(avgDamage * (GetDmgVariance() * 0.5f + 1.0f) + 0.5f));
240  }
241 }
float GetDPS(uint32 itemLevel) const
Definition: ItemTemplate.cpp:178
float GetDmgVariance() const
Definition: ItemTemplate.h:785
uint32 GetDelay() const
Definition: ItemTemplate.h:766
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDamageType()

uint32 ItemTemplate::GetDamageType ( ) const
inline
765 { return ExtendedData->DamageDamageType; }
uint8 DamageDamageType
Definition: DB2Structure.h:2188
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733

◆ GetDefaultLocaleName()

char const * ItemTemplate::GetDefaultLocaleName ( ) const
114 {
115  return ExtendedData->Display[sWorld->GetDefaultDbcLocale()];
116 }
#define sWorld
Definition: World.h:925
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
LocalizedString Display
Definition: DB2Structure.h:2138
+ Here is the caller graph for this function:

◆ GetDelay()

uint32 ItemTemplate::GetDelay ( ) const
inline
766 { return ExtendedData->ItemDelay; }
uint16 ItemDelay
Definition: DB2Structure.h:2173
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetDmgVariance()

float ItemTemplate::GetDmgVariance ( ) const
inline
785 { return ExtendedData->DmgVariance; }
float DmgVariance
Definition: DB2Structure.h:2140
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetDPS()

float ItemTemplate::GetDPS ( uint32  itemLevel) const
179 {
181  if (GetClass() != ITEM_CLASS_WEAPON || quality > ITEM_QUALITY_ARTIFACT)
182  return 0.0f;
183 
184  float dps = 0.0f;
185  switch (GetInventoryType())
186  {
187  case INVTYPE_AMMO:
188  dps = sItemDamageAmmoStore.AssertEntry(itemLevel)->Quality[quality];
189  break;
190  case INVTYPE_2HWEAPON:
192  dps = sItemDamageTwoHandCasterStore.AssertEntry(itemLevel)->Quality[quality];
193  else
194  dps = sItemDamageTwoHandStore.AssertEntry(itemLevel)->Quality[quality];
195  break;
196  case INVTYPE_RANGED:
197  case INVTYPE_THROWN:
198  case INVTYPE_RANGEDRIGHT:
199  switch (GetSubClass())
200  {
202  dps = sItemDamageOneHandCasterStore.AssertEntry(itemLevel)->Quality[quality];
203  break;
208  dps = sItemDamageTwoHandCasterStore.AssertEntry(itemLevel)->Quality[quality];
209  else
210  dps = sItemDamageTwoHandStore.AssertEntry(itemLevel)->Quality[quality];
211  break;
212  default:
213  break;
214  }
215  break;
216  case INVTYPE_WEAPON:
220  dps = sItemDamageOneHandCasterStore.AssertEntry(itemLevel)->Quality[quality];
221  else
222  dps = sItemDamageOneHandStore.AssertEntry(itemLevel)->Quality[quality];
223  break;
224  default:
225  break;
226  }
227 
228  return dps;
229 }
InventoryType GetInventoryType() const
Definition: ItemTemplate.h:748
Definition: ItemTemplate.h:397
uint32 GetClass() const
Definition: ItemTemplate.h:736
Definition: ItemTemplate.h:223
Definition: ItemTemplate.h:394
Definition: SharedDefines.h:345
Definition: ItemTemplate.h:467
Definition: ItemTemplate.h:398
Definition: ItemTemplate.h:385
DB2Storage< ItemDamageOneHandCasterEntry > sItemDamageOneHandCasterStore("ItemDamageOneHandCaster.db2", ItemDamageOneHandCasterLoadInfo::Instance())
Definition: ItemTemplate.h:393
uint32 GetQuality() const
Definition: ItemTemplate.h:738
Definition: ItemTemplate.h:468
Definition: ItemTemplate.h:409
uint32_t uint32
Definition: Define.h:152
Definition: SharedDefines.h:344
DB2Storage< ItemDamageTwoHandCasterEntry > sItemDamageTwoHandCasterStore("ItemDamageTwoHandCaster.db2", ItemDamageTwoHandCasterLoadInfo::Instance())
DB2Storage< ItemDamageAmmoEntry > sItemDamageAmmoStore("ItemDamageAmmo.db2", ItemDamageAmmoLoadInfo::Instance())
ItemQualities
Definition: SharedDefines.h:336
Definition: ItemTemplate.h:483
Definition: ItemTemplate.h:484
DB2Storage< ItemDamageOneHandEntry > sItemDamageOneHandStore("ItemDamageOneHand.db2", ItemDamageOneHandLoadInfo::Instance())
Definition: ItemTemplate.h:387
uint32 GetFlags2() const
Definition: ItemTemplate.h:740
DB2Storage< ItemDamageTwoHandEntry > sItemDamageTwoHandStore("ItemDamageTwoHand.db2", ItemDamageTwoHandLoadInfo::Instance())
Definition: SharedDefines.h:341
uint32 GetSubClass() const
Definition: ItemTemplate.h:737
Definition: ItemTemplate.h:389
Definition: ItemTemplate.h:396
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDuration()

uint32 ItemTemplate::GetDuration ( ) const
inline
uint32 DurationInInventory
Definition: DB2Structure.h:2142
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetFlags()

uint32 ItemTemplate::GetFlags ( ) const
inline
739 { return ExtendedData->Flags[0]; }
int32 Flags[MAX_ITEM_PROTO_FLAGS]
Definition: DB2Structure.h:2156
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetFlags2()

uint32 ItemTemplate::GetFlags2 ( ) const
inline
740 { return ExtendedData->Flags[1]; }
int32 Flags[MAX_ITEM_PROTO_FLAGS]
Definition: DB2Structure.h:2156
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetFlags3()

uint32 ItemTemplate::GetFlags3 ( ) const
inline
741 { return ExtendedData->Flags[2]; }
int32 Flags[MAX_ITEM_PROTO_FLAGS]
Definition: DB2Structure.h:2156
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetFlags4()

uint32 ItemTemplate::GetFlags4 ( ) const
inline
742 { return ExtendedData->Flags[3]; }
int32 Flags[MAX_ITEM_PROTO_FLAGS]
Definition: DB2Structure.h:2156
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetGemProperties()

uint32 ItemTemplate::GetGemProperties ( ) const
inline
780 { return ExtendedData->GemProperties; }
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
uint16 GemProperties
Definition: DB2Structure.h:2165
+ Here is the caller graph for this function:

◆ GetHolidayID()

HolidayIds ItemTemplate::GetHolidayID ( ) const
inline
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
uint16 RequiredHoliday
Definition: DB2Structure.h:2163
HolidayIds
Definition: SharedDefines.h:4475
+ Here is the caller graph for this function:

◆ GetId()

uint32 ItemTemplate::GetId ( ) const
inline
735 { return BasicData->ID; }
ItemEntry const * BasicData
Definition: ItemTemplate.h:732
uint32 ID
Definition: DB2Structure.h:1819
+ Here is the caller graph for this function:

◆ GetInventoryType()

InventoryType ItemTemplate::GetInventoryType ( ) const
inline
uint8 InventoryType
Definition: DB2Structure.h:2195
InventoryType
Definition: ItemTemplate.h:370
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetItemLimitCategory()

uint32 ItemTemplate::GetItemLimitCategory ( ) const
inline
783 { return ExtendedData->LimitCategory; }
uint16 LimitCategory
Definition: DB2Structure.h:2164
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetItemSet()

uint32 ItemTemplate::GetItemSet ( ) const
inline
773 { return ExtendedData->ItemSet; }
uint16 ItemSet
Definition: DB2Structure.h:2169
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetLockID()

uint32 ItemTemplate::GetLockID ( ) const
inline
772 { return ExtendedData->LockID; }
uint16 LockID
Definition: DB2Structure.h:2170
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetMap()

uint32 ItemTemplate::GetMap ( ) const
inline
775 { return ExtendedData->InstanceBound; }
int32 InstanceBound
Definition: DB2Structure.h:2141
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetMaxCount()

uint32 ItemTemplate::GetMaxCount ( ) const
inline
758 { return ExtendedData->MaxCount; }
int32 MaxCount
Definition: DB2Structure.h:2149
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetMaxStackSize()

uint32 ItemTemplate::GetMaxStackSize ( ) const
inline
809  {
810  return (ExtendedData->Stackable == 2147483647 || ExtendedData->Stackable <= 0) ? uint32(0x7FFFFFFF - 1) : uint32(ExtendedData->Stackable);
811  }
int32 Stackable
Definition: DB2Structure.h:2148
uint32_t uint32
Definition: Define.h:152
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetName()

char const * ItemTemplate::GetName ( LocaleConstant  locale) const
47 {
48  if (!strlen(ExtendedData->Display[locale]))
49  return GetDefaultLocaleName();
50 
51  return ExtendedData->Display[locale];
52 }
char const * GetDefaultLocaleName() const
Definition: ItemTemplate.cpp:113
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
LocalizedString Display
Definition: DB2Structure.h:2138
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPageText()

uint32 ItemTemplate::GetPageText ( ) const
inline
770 { return ExtendedData->PageID; }
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
uint16 PageID
Definition: DB2Structure.h:2172
+ Here is the caller graph for this function:

◆ GetPlayerLevelToItemLevelCurveId()

uint32 ItemTemplate::GetPlayerLevelToItemLevelCurveId ( ) const
inline
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
int32 PlayerLevelToItemLevelCurveID
Definition: DB2Structure.h:2160
+ Here is the caller graph for this function:

◆ GetPriceRandomValue()

float ItemTemplate::GetPriceRandomValue ( ) const
inline
743 { return ExtendedData->PriceRandomValue; }
float PriceRandomValue
Definition: DB2Structure.h:2155
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetPriceVariance()

float ItemTemplate::GetPriceVariance ( ) const
inline
744 { return ExtendedData->PriceVariance; }
float PriceVariance
Definition: DB2Structure.h:2154
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetQuality()

uint32 ItemTemplate::GetQuality ( ) const
inline
738 { return ExtendedData->OverallQualityID; }
uint8 OverallQualityID
Definition: DB2Structure.h:2196
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetQualityModifier()

float ItemTemplate::GetQualityModifier ( ) const
inline
781 { return ExtendedData->QualityModifier; }
float QualityModifier
Definition: DB2Structure.h:2143
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733

◆ GetRangedModRange()

float ItemTemplate::GetRangedModRange ( ) const
inline
767 { return ExtendedData->ItemRange; }
float ItemRange
Definition: DB2Structure.h:2145
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733

◆ GetRequiredExpansion()

uint8 ItemTemplate::GetRequiredExpansion ( ) const
inline
787 { return ExtendedData->ExpansionID; }
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
int32 ExpansionID
Definition: DB2Structure.h:2139
+ Here is the caller graph for this function:

◆ GetRequiredReputationFaction()

uint32 ItemTemplate::GetRequiredReputationFaction ( ) const
inline
756 { return ExtendedData->MinFactionID; }
uint16 MinFactionID
Definition: DB2Structure.h:2174
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetRequiredReputationRank()

uint32 ItemTemplate::GetRequiredReputationRank ( ) const
inline
757 { return ExtendedData->MinReputation; }
uint8 MinReputation
Definition: DB2Structure.h:2191
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetRequiredSkill()

uint32 ItemTemplate::GetRequiredSkill ( ) const
inline
753 { return ExtendedData->RequiredSkill; }
uint16 RequiredSkill
Definition: DB2Structure.h:2176
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetRequiredSkillRank()

uint32 ItemTemplate::GetRequiredSkillRank ( ) const
inline
754 { return ExtendedData->RequiredSkillRank; }
uint16 RequiredSkillRank
Definition: DB2Structure.h:2175
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetRequiredSpell()

uint32 ItemTemplate::GetRequiredSpell ( ) const
inline
755 { return ExtendedData->RequiredAbility; }
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
uint32 RequiredAbility
Definition: DB2Structure.h:2150
+ Here is the caller graph for this function:

◆ GetScalingStatContentTuning()

uint32 ItemTemplate::GetScalingStatContentTuning ( ) const
inline
763 { return ExtendedData->ContentTuningID; }
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
int32 ContentTuningID
Definition: DB2Structure.h:2159
+ Here is the caller graph for this function:

◆ GetSellPrice()

uint32 ItemTemplate::GetSellPrice ( ) const
inline
747 { return ExtendedData->SellPrice; }
uint32 SellPrice
Definition: DB2Structure.h:2151
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetSkill()

uint32 ItemTemplate::GetSkill ( ) const
78 {
79  static uint32 const itemWeaponSkills[MAX_ITEM_SUBCLASS_WEAPON] =
80  {
86  };
87 
88  static uint32 const itemArmorSkills[MAX_ITEM_SUBCLASS_ARMOR] =
89  {
91  };
92 
93 
94  switch (GetClass())
95  {
96  case ITEM_CLASS_WEAPON:
98  return 0;
99  else
100  return itemWeaponSkills[GetSubClass()];
101 
102  case ITEM_CLASS_ARMOR:
104  return 0;
105  else
106  return itemArmorSkills[GetSubClass()];
107 
108  default:
109  return 0;
110  }
111 }
Definition: SharedDefines.h:5131
Definition: SharedDefines.h:5067
Definition: SharedDefines.h:5094
uint32 GetClass() const
Definition: ItemTemplate.h:736
Definition: SharedDefines.h:5127
Definition: SharedDefines.h:5070
Definition: SharedDefines.h:5140
Definition: SharedDefines.h:5243
Definition: SharedDefines.h:5082
#define MAX_ITEM_SUBCLASS_ARMOR
Definition: ItemTemplate.h:528
Definition: SharedDefines.h:5139
Definition: SharedDefines.h:5099
Definition: SharedDefines.h:5069
Definition: SharedDefines.h:5100
#define MAX_ITEM_SUBCLASS_WEAPON
Definition: ItemTemplate.h:492
Definition: SharedDefines.h:5135
Definition: ItemTemplate.h:409
uint32_t uint32
Definition: Define.h:152
Definition: SharedDefines.h:5066
Definition: ItemTemplate.h:411
Definition: SharedDefines.h:5126
Definition: SharedDefines.h:5065
uint32 GetSubClass() const
Definition: ItemTemplate.h:737
Definition: SharedDefines.h:5138
Definition: SharedDefines.h:5125
Definition: SharedDefines.h:5137
Definition: SharedDefines.h:5068
Definition: SharedDefines.h:5141
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSocketBonus()

uint32 ItemTemplate::GetSocketBonus ( ) const
inline
uint16 SocketMatchEnchantmentId
Definition: DB2Structure.h:2166
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetSocketColor()

SocketColor ItemTemplate::GetSocketColor ( uint32  index) const
inline
778 { ASSERT(index < MAX_ITEM_PROTO_SOCKETS); return SocketColor(ExtendedData->SocketType[index]); }
SocketColor
Definition: ItemTemplate.h:344
#define MAX_ITEM_PROTO_SOCKETS
Definition: DBCEnums.h:731
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
#define ASSERT
Definition: Errors.h:57
uint8 SocketType[MAX_ITEM_PROTO_SOCKETS]
Definition: DB2Structure.h:2182
+ Here is the caller graph for this function:

◆ GetStartQuest()

uint32 ItemTemplate::GetStartQuest ( ) const
inline
771 { return ExtendedData->StartQuestID; }
uint16 StartQuestID
Definition: DB2Structure.h:2171
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ GetStatModifierBonusStat()

int32 ItemTemplate::GetStatModifierBonusStat ( uint32  index) const
inline
int8 StatModifierBonusStat[MAX_ITEM_PROTO_STATS]
Definition: DB2Structure.h:2189
#define MAX_ITEM_PROTO_STATS
Definition: DBCEnums.h:732
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
#define ASSERT
Definition: Errors.h:57
+ Here is the caller graph for this function:

◆ GetStatPercentageOfSocket()

float ItemTemplate::GetStatPercentageOfSocket ( uint32  index) const
inline
#define MAX_ITEM_PROTO_STATS
Definition: DBCEnums.h:732
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
#define ASSERT
Definition: Errors.h:57
float StatPercentageOfSocket[MAX_ITEM_PROTO_STATS]
Definition: DB2Structure.h:2146
+ Here is the caller graph for this function:

◆ GetStatPercentEditor()

int32 ItemTemplate::GetStatPercentEditor ( uint32  index) const
inline
761 { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatPercentEditor[index]; }
#define MAX_ITEM_PROTO_STATS
Definition: DBCEnums.h:732
int32 StatPercentEditor[MAX_ITEM_PROTO_STATS]
Definition: DB2Structure.h:2147
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
#define ASSERT
Definition: Errors.h:57
+ Here is the caller graph for this function:

◆ GetSubClass()

uint32 ItemTemplate::GetSubClass ( ) const
inline
737 { return BasicData->SubclassID; }
ItemEntry const * BasicData
Definition: ItemTemplate.h:732
uint8 SubclassID
Definition: DB2Structure.h:1821
+ Here is the caller graph for this function:

◆ GetTotemCategory()

uint32 ItemTemplate::GetTotemCategory ( ) const
inline
777 { return ExtendedData->TotemCategoryID; }
uint16 TotemCategoryID
Definition: DB2Structure.h:2167
ItemSparseEntry const * ExtendedData
Definition: ItemTemplate.h:733
+ Here is the caller graph for this function:

◆ IsConjuredConsumable()

bool ItemTemplate::IsConjuredConsumable ( ) const
inline
Definition: ItemTemplate.h:179
uint32 GetClass() const
Definition: ItemTemplate.h:736
uint32 GetFlags() const
Definition: ItemTemplate.h:739
Definition: ItemTemplate.h:407
+ Here is the caller graph for this function:

◆ IsCraftingReagent()

bool ItemTemplate::IsCraftingReagent ( ) const
inline
818 { return (GetFlags2() & ITEM_FLAG2_USED_IN_A_TRADESKILL) != 0; }
Definition: ItemTemplate.h:245
uint32 GetFlags2() const
Definition: ItemTemplate.h:740
+ Here is the caller graph for this function:

◆ IsCurrencyToken()

bool ItemTemplate::IsCurrencyToken ( ) const
inline
806 { return (GetBagFamily() & BAG_FAMILY_MASK_CURRENCY_TOKENS) != 0; }
Definition: ItemTemplate.h:338
uint32 GetBagFamily() const
Definition: ItemTemplate.h:776
+ Here is the caller graph for this function:

◆ IsPotion()

bool ItemTemplate::IsPotion ( ) const
inline
uint32 GetClass() const
Definition: ItemTemplate.h:736
Definition: ItemTemplate.h:433
Definition: ItemTemplate.h:407
uint32 GetSubClass() const
Definition: ItemTemplate.h:737
+ Here is the caller graph for this function:

◆ IsRangedWeapon()

bool ItemTemplate::IsRangedWeapon ( ) const
inline
823  {
824  return IsWeapon() ||
828  }
Definition: ItemTemplate.h:467
Definition: ItemTemplate.h:468
Definition: ItemTemplate.h:483
bool IsWeapon() const
Definition: ItemTemplate.h:820
uint32 GetSubClass() const
Definition: ItemTemplate.h:737
+ Here is the caller graph for this function:

◆ IsUsableByLootSpecialization()

bool ItemTemplate::IsUsableByLootSpecialization ( Player const *  player,
bool  alwaysAllowBoundToAccount 
) const
244 {
245  if (GetFlags() & ITEM_FLAG_IS_BOUND_TO_ACCOUNT && alwaysAllowBoundToAccount)
246  return true;
247 
248  uint32 spec = player->GetLootSpecId();
249  if (!spec)
250  spec = player->GetPrimarySpecialization();
251  if (!spec)
252  spec = player->GetDefaultSpecId();
253 
254  ChrSpecializationEntry const* chrSpecialization = sChrSpecializationStore.LookupEntry(spec);
255  if (!chrSpecialization)
256  return false;
257 
258  std::size_t levelIndex = 0;
259  if (player->getLevel() >= 110)
260  levelIndex = 2;
261  else if (player->getLevel() > 40)
262  levelIndex = 1;
263 
264  return Specializations[levelIndex].test(CalculateItemSpecBit(chrSpecialization));
265 }
std::bitset< MAX_CLASSES *MAX_SPECIALIZATIONS > Specializations[3]
Definition: ItemTemplate.h:800
DB2Storage< ChrSpecializationEntry > sChrSpecializationStore("ChrSpecialization.db2", ChrSpecializationLoadInfo::Instance())
uint32 GetFlags() const
Definition: ItemTemplate.h:739
static std::size_t CalculateItemSpecBit(ChrSpecializationEntry const *spec)
Definition: ItemTemplate.cpp:267
Definition: DB2Structure.h:796
uint32_t uint32
Definition: Define.h:152
Definition: ItemTemplate.h:205
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsVellum()

bool ItemTemplate::IsVellum ( ) const
inline
uint32 GetFlags3() const
Definition: ItemTemplate.h:741
Definition: ItemTemplate.h:274
+ Here is the caller graph for this function:

◆ IsWeapon()

bool ItemTemplate::IsWeapon ( ) const
inline
820 { return GetClass() == ITEM_CLASS_WEAPON; }
uint32 GetClass() const
Definition: ItemTemplate.h:736
Definition: ItemTemplate.h:409
+ Here is the caller graph for this function:

Member Data Documentation

◆ BasicData

ItemEntry const* ItemTemplate::BasicData

◆ Effects

std::vector<ItemEffectEntry const*> ItemTemplate::Effects

◆ ExtendedData

ItemSparseEntry const* ItemTemplate::ExtendedData

◆ FlagsCu

uint32 ItemTemplate::FlagsCu

◆ FoodType

uint32 ItemTemplate::FoodType

◆ ItemSpecClassMask

uint32 ItemTemplate::ItemSpecClassMask

◆ MaxDurability

uint32 ItemTemplate::MaxDurability

◆ MaxMoneyLoot

uint32 ItemTemplate::MaxMoneyLoot

◆ MinMoneyLoot

uint32 ItemTemplate::MinMoneyLoot

◆ RandomBonusListTemplateId

uint32 ItemTemplate::RandomBonusListTemplateId

◆ ScriptId

uint32 ItemTemplate::ScriptId

◆ Specializations

std::bitset<MAX_CLASSES * MAX_SPECIALIZATIONS> ItemTemplate::Specializations[3]

◆ SpellPPMRate

float ItemTemplate::SpellPPMRate

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