TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ItemSpecStats Struct Reference

Public Member Functions

 ItemSpecStats (ItemEntry const *item, ItemSparseEntry const *sparse)
 
void AddStat (ItemSpecStat statType)
 
void AddModStat (int32 itemStatType)
 

Public Attributes

uint32 ItemType
 
uint32 ItemSpecStatTypes [MAX_ITEM_PROTO_STATS]
 
uint32 ItemSpecStatCount
 

Constructor & Destructor Documentation

ItemSpecStats::ItemSpecStats ( ItemEntry const item,
ItemSparseEntry const sparse 
)
inline
2451  : ItemType(0), ItemSpecStatCount(0)
2452  {
2453  memset(ItemSpecStatTypes, -1, sizeof(ItemSpecStatTypes));
2454 
2455  if (item->Class == ITEM_CLASS_WEAPON)
2456  {
2457  ItemType = 5;
2458  switch (item->SubClass)
2459  {
2462  break;
2465  break;
2468  break;
2471  break;
2474  break;
2477  break;
2480  break;
2483  break;
2486  break;
2489  break;
2492  break;
2495  break;
2498  break;
2501  break;
2504  break;
2505  default:
2506  break;
2507  }
2508  }
2509  else if (item->Class == ITEM_CLASS_ARMOR && item->SubClass > 5 && item->SubClass <= 11)
2510  {
2511  switch (item->SubClass)
2512  {
2514  if (sparse->InventoryType != INVTYPE_CLOAK)
2515  {
2516  ItemType = 1;
2517  break;
2518  }
2519 
2520  ItemType = 0;
2522  break;
2524  ItemType = 2;
2525  break;
2527  ItemType = 3;
2528  break;
2530  ItemType = 4;
2531  break;
2532  default:
2533  ItemType = 6;
2534  if (item->SubClass == ITEM_SUBCLASS_ARMOR_SHIELD)
2536  else if (item->SubClass > ITEM_SUBCLASS_ARMOR_SHIELD && item->SubClass <= ITEM_SUBCLASS_ARMOR_RELIC)
2538  break;
2539  }
2540  }
2541  else
2542  ItemType = 0;
2543 
2544  for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
2545  if (sparse->ItemStatType[i] != -1)
2546  AddModStat(sparse->ItemStatType[i]);
2547  }
uint32 ItemType
Definition: ObjectMgr.cpp:2447
Definition: DBCEnums.h:568
Definition: DBCEnums.h:570
Definition: ItemTemplate.h:437
Definition: ItemTemplate.h:481
Definition: DBCEnums.h:567
Definition: DBCEnums.h:569
Definition: ItemTemplate.h:435
Definition: ItemTemplate.h:348
void AddModStat(int32 itemStatType)
Definition: ObjectMgr.cpp:2561
Definition: DBCEnums.h:562
Definition: DBCEnums.h:561
Definition: DBCEnums.h:564
Definition: DBCEnums.h:572
Definition: DBCEnums.h:571
Definition: ItemTemplate.h:474
Definition: ItemTemplate.h:432
Definition: ItemTemplate.h:473
Definition: ItemTemplate.h:428
Definition: DBCEnums.h:574
Definition: DBCEnums.h:576
Definition: ItemTemplate.h:426
Definition: ItemTemplate.h:424
Definition: DBCEnums.h:577
#define MAX_ITEM_PROTO_STATS
Definition: DB2Structure.h:790
Definition: ItemTemplate.h:430
Definition: DBCEnums.h:565
void AddStat(ItemSpecStat statType)
Definition: ObjectMgr.cpp:2549
Definition: ItemTemplate.h:438
Definition: DBCEnums.h:573
Definition: ItemTemplate.h:425
Definition: ItemTemplate.h:472
uint32 ItemSpecStatTypes[MAX_ITEM_PROTO_STATS]
Definition: ObjectMgr.cpp:2448
uint32_t uint32
Definition: Define.h:150
Definition: ItemTemplate.h:440
Definition: ItemTemplate.h:441
Definition: ItemTemplate.h:369
Definition: DBCEnums.h:566
Definition: ItemTemplate.h:422
uint32 ItemSpecStatCount
Definition: ObjectMgr.cpp:2449
Definition: DBCEnums.h:581
Definition: ItemTemplate.h:429
Definition: ItemTemplate.h:423
Definition: ItemTemplate.h:371
Definition: ItemTemplate.h:471
Definition: ItemTemplate.h:476
Definition: ItemTemplate.h:427
Definition: DBCEnums.h:575
Definition: DBCEnums.h:563

+ Here is the call graph for this function:

Member Function Documentation

void ItemSpecStats::AddModStat ( int32  itemStatType)
inline
2562  {
2563  switch (itemStatType)
2564  {
2565  case ITEM_MOD_AGILITY:
2567  break;
2568  case ITEM_MOD_STRENGTH:
2570  break;
2571  case ITEM_MOD_INTELLECT:
2573  break;
2574  case ITEM_MOD_SPIRIT:
2576  break;
2577  case ITEM_MOD_DODGE_RATING:
2579  break;
2580  case ITEM_MOD_PARRY_RATING:
2582  break;
2586  case ITEM_MOD_CRIT_RATING:
2588  break;
2592  case ITEM_MOD_HASTE_RATING:
2594  break;
2595  case ITEM_MOD_HIT_RATING:
2597  break;
2598  case ITEM_MOD_EXTRA_ARMOR:
2600  break;
2601  case ITEM_MOD_AGI_STR_INT:
2605  break;
2606  case ITEM_MOD_AGI_STR:
2609  break;
2610  case ITEM_MOD_AGI_INT:
2613  break;
2614  case ITEM_MOD_STR_INT:
2617  break;
2618  }
2619  }
Definition: ItemTemplate.h:93
Definition: ItemTemplate.h:51
Definition: DBCEnums.h:580
Definition: ItemTemplate.h:36
Definition: ItemTemplate.h:53
Definition: DBCEnums.h:554
Definition: ItemTemplate.h:96
Definition: DBCEnums.h:556
Definition: DBCEnums.h:560
Definition: ItemTemplate.h:95
Definition: ItemTemplate.h:42
Definition: DBCEnums.h:559
Definition: ItemTemplate.h:31
Definition: ItemTemplate.h:35
Definition: DBCEnums.h:578
void AddStat(ItemSpecStat statType)
Definition: ObjectMgr.cpp:2549
Definition: ItemTemplate.h:72
Definition: DBCEnums.h:579
Definition: ItemTemplate.h:32
Definition: ItemTemplate.h:58
Definition: ItemTemplate.h:94
Definition: ItemTemplate.h:54
Definition: ItemTemplate.h:41
Definition: ItemTemplate.h:30
Definition: DBCEnums.h:558
Definition: ItemTemplate.h:29
Definition: ItemTemplate.h:50
Definition: DBCEnums.h:555
Definition: ItemTemplate.h:52
Definition: ItemTemplate.h:43
Definition: DBCEnums.h:557

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ItemSpecStats::AddStat ( ItemSpecStat  statType)
inline
2550  {
2552  return;
2553 
2554  for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
2555  if (ItemSpecStatTypes[i] == uint32(statType))
2556  return;
2557 
2558  ItemSpecStatTypes[ItemSpecStatCount++] = statType;
2559  }
#define MAX_ITEM_PROTO_STATS
Definition: DB2Structure.h:790
uint32 ItemSpecStatTypes[MAX_ITEM_PROTO_STATS]
Definition: ObjectMgr.cpp:2448
uint32_t uint32
Definition: Define.h:150
uint32 ItemSpecStatCount
Definition: ObjectMgr.cpp:2449
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the caller graph for this function:

Member Data Documentation

uint32 ItemSpecStats::ItemSpecStatCount
uint32 ItemSpecStats::ItemSpecStatTypes[MAX_ITEM_PROTO_STATS]
uint32 ItemSpecStats::ItemType

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