aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Item/Item.cpp25
-rw-r--r--src/server/game/Entities/Item/Item.h2
-rw-r--r--src/server/game/Entities/Item/ItemTemplate.h1
3 files changed, 5 insertions, 23 deletions
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 04c3577e4f7..0fdaf2e4609 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1573,7 +1573,7 @@ bool Item::HasStats() const
bool Item::HasStats(WorldPackets::Item::ItemInstance const& /*itemInstance*/, BonusData const* bonus)
{
for (uint8 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
- if (bonus->StatPercentEditor[i] != 0)
+ if (bonus->ItemStatBonusAmount[i] != 0)
return true;
return false;
@@ -1932,26 +1932,7 @@ uint32 Item::GetItemLevel(ItemTemplate const* itemTemplate, BonusData const& bon
float Item::GetItemStatValue(uint32 index, Player const* owner) const
{
ASSERT(index < MAX_ITEM_PROTO_STATS);
- switch (GetItemStatType(index))
- {
- case ITEM_MOD_CORRUPTION:
- case ITEM_MOD_CORRUPTION_RESISTANCE:
- return _bonusData.StatPercentEditor[index];
- default:
- break;
- }
-
- uint32 itemLevel = GetItemLevel(owner);
- if (float randomPropPoints = GetRandomPropertyPoints(itemLevel, GetQuality(), GetTemplate()->GetInventoryType(), GetTemplate()->GetSubClass()))
- {
- float statValue = float(_bonusData.StatPercentEditor[index] * randomPropPoints) * 0.0001f;
- if (GtItemSocketCostPerLevelEntry const* gtCost = sItemSocketCostPerLevelGameTable.GetRow(itemLevel))
- statValue -= float(int32(_bonusData.ItemStatSocketCostMultiplier[index] * gtCost->SocketCost));
-
- return statValue;
- }
-
- return 0.0f;
+ return static_cast<float>(_bonusData.ItemStatBonusAmount[index]);
}
ItemDisenchantLootEntry const* Item::GetDisenchantLoot(Player const* owner) const
@@ -2173,7 +2154,7 @@ void BonusData::Initialize(ItemTemplate const* proto)
ItemStatType[i] = proto->GetStatModifierBonusStat(i);
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
- StatPercentEditor[i] = proto->GetStatPercentEditor(i);
+ ItemStatBonusAmount[i] = proto->GetStatModifierBonusAmount(i);
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
ItemStatSocketCostMultiplier[i] = proto->GetStatPercentageOfSocket(i);
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index ad4ee06102b..2057db84847 100644
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -71,7 +71,7 @@ struct BonusData
int32 ItemLevelBonus;
int32 RequiredLevel;
int32 ItemStatType[MAX_ITEM_PROTO_STATS];
- int32 StatPercentEditor[MAX_ITEM_PROTO_STATS];
+ int32 ItemStatBonusAmount[MAX_ITEM_PROTO_STATS];
float ItemStatSocketCostMultiplier[MAX_ITEM_PROTO_STATS];
uint32 SocketColor[MAX_ITEM_PROTO_SOCKETS];
ItemBondingType Bonding;
diff --git a/src/server/game/Entities/Item/ItemTemplate.h b/src/server/game/Entities/Item/ItemTemplate.h
index 161aeef0892..ddcc76d7268 100644
--- a/src/server/game/Entities/Item/ItemTemplate.h
+++ b/src/server/game/Entities/Item/ItemTemplate.h
@@ -796,6 +796,7 @@ struct TC_GAME_API ItemTemplate
uint32 GetMaxCount() const { return ExtendedData->MaxCount; }
uint32 GetContainerSlots() const { return ExtendedData->ContainerSlots; }
int32 GetStatModifierBonusStat(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatModifierBonusStat[index]; }
+ int32 GetStatModifierBonusAmount(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatModifierBonusAmount[index]; }
int32 GetStatPercentEditor(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatPercentEditor[index]; }
float GetStatPercentageOfSocket(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatPercentageOfSocket[index]; }
uint32 GetScalingStatContentTuning() const { return ExtendedData->ContentTuningID; }