Core/Misc: Move GetContentTuningForArea from ObjectMgr to DB2Manager

Port From (https://github.com/TrinityCore/TrinityCore/commit/8f38c12c4e7d832a91c7719ee1a5ac4d801862a6)
This commit is contained in:
hondacrx
2023-03-14 04:14:30 -04:00
parent a98dc65a3b
commit 8bb67e69c5
3 changed files with 19 additions and 19 deletions
+18
View File
@@ -866,6 +866,24 @@ namespace Game.DataStorage
return false;
}
public ContentTuningRecord GetContentTuningForArea(AreaTableRecord areaEntry)
{
if (areaEntry == null)
return null;
// Get ContentTuning for the area
var contentTuning = ContentTuningStorage.LookupByKey(areaEntry.ContentTuningID);
if (contentTuning != null)
return contentTuning;
// If there is no data for the current area and it has a parent area, get data from the last (recursive)
var parentAreaEntry = AreaTableStorage.LookupByKey(areaEntry.ParentAreaID);
if (parentAreaEntry != null)
return GetContentTuningForArea(parentAreaEntry);
return null;
}
public List<ArtifactPowerRecord> GetArtifactPowers(byte artifactId)
{
return _artifactPowers.LookupByKey(artifactId);