aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp10
-rw-r--r--src/server/game/DataStores/DB2Stores.h2
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp4
3 files changed, 16 insertions, 0 deletions
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index 96eb19dddc8..c49057bea44 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -460,6 +460,7 @@ namespace
ItemModifiedAppearanceByItemContainer _itemModifiedAppearancesByItem;
ItemSetSpellContainer _itemSetSpells;
ItemSpecOverridesContainer _itemSpecOverrides;
+ std::unordered_map<uint32 /*itemId*/, std::vector<ItemEffectEntry const*>> _itemEffectsByItemId;
std::vector<JournalTierEntry const*> _journalTiersByIndex;
MapDifficultyContainer _mapDifficulties;
std::unordered_map<uint32, DB2Manager::MapDifficultyConditionsContainer> _mapDifficultyConditions;
@@ -731,6 +732,7 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul
LOAD_DB2(sGlyphBindableSpellStore);
LOAD_DB2(sGlyphPropertiesStore);
LOAD_DB2(sGlyphRequiredSpecStore);
+ LOAD_DB2(sGlyphSlotStore);
LOAD_DB2(sGossipNPCOptionStore);
LOAD_DB2(sGuildColorBackgroundStore);
LOAD_DB2(sGuildColorBorderStore);
@@ -1230,6 +1232,9 @@ uint32 DB2Manager::LoadStores(std::string const& dataPath, LocaleConstant defaul
for (ItemCurrencyCostEntry const* itemCurrencyCost : sItemCurrencyCostStore)
_itemsWithCurrencyCost.insert(itemCurrencyCost->ItemID);
+ for (ItemEffectEntry const* itemEffect : sItemEffectStore)
+ _itemEffectsByItemId[itemEffect->ParentItemID].push_back(itemEffect);
+
for (ItemLimitCategoryConditionEntry const* condition : sItemLimitCategoryConditionStore)
_itemCategoryConditions[condition->ParentItemLimitCategoryID].push_back(condition);
@@ -3161,3 +3166,8 @@ bool DB2Manager::MountTypeXCapabilityEntryComparator::Compare(MountTypeXCapabili
return left->OrderIndex < right->OrderIndex;
return left->MountTypeID < right->MountTypeID;
}
+
+std::vector<ItemEffectEntry const*> const* DB2Manager::GetItemEffectsForItemId(uint32 itemId) const
+{
+ return Trinity::Containers::MapGetValuePtr(_itemEffectsByItemId, itemId);
+}
diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h
index bec4b932b64..9f7031a702a 100644
--- a/src/server/game/DataStores/DB2Stores.h
+++ b/src/server/game/DataStores/DB2Stores.h
@@ -122,6 +122,7 @@ TC_GAME_API extern DB2Storage<GarrSiteLevelPlotInstEntry> sGarrSiteLev
TC_GAME_API extern DB2Storage<GarrTalentTreeEntry> sGarrTalentTreeStore;
TC_GAME_API extern DB2Storage<GemPropertiesEntry> sGemPropertiesStore;
TC_GAME_API extern DB2Storage<GlyphPropertiesEntry> sGlyphPropertiesStore;
+TC_GAME_API extern DB2Storage<GlyphSlotEntry> sGlyphSlotStore;
TC_GAME_API extern DB2Storage<GossipNPCOptionEntry> sGossipNPCOptionStore;
TC_GAME_API extern DB2Storage<GuildColorBackgroundEntry> sGuildColorBackgroundStore;
TC_GAME_API extern DB2Storage<GuildColorBorderEntry> sGuildColorBorderStore;
@@ -505,6 +506,7 @@ public:
void Map2ZoneCoordinates(uint32 areaId, float& x, float& y) const;
bool IsUiMapPhase(uint32 phaseId) const;
WMOAreaTableEntry const* GetWMOAreaTable(int32 rootId, int32 adtId, int32 groupId) const;
+ std::vector<ItemEffectEntry const*> const* GetItemEffectsForItemId(uint32 itemId) const;
private:
friend class DB2HotfixGeneratorBase;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index bfae9397b9a..d1d607ad2f3 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -3334,6 +3334,10 @@ void ObjectMgr::LoadItemTemplates()
for (auto& specs : itemTemplate.Specializations)
if (specs.count() == 0)
specs.set();
+
+ if (std::vector<ItemEffectEntry const*> const* itemEffects = sDB2Manager.GetItemEffectsForItemId(sparse->ID))
+ for (ItemEffectEntry const* itemEffect : *itemEffects)
+ itemTemplate.Effects.push_back(itemEffect);
}
TC_LOG_INFO("server.loading", ">> Loaded {} item templates in {} ms", _itemTemplateStore.size(), GetMSTimeDiffToNow(oldMSTime));