Core/Battleground: Rework BattlegroundScore

Port From (https://github.com/TrinityCore/TrinityCore/commit/da0ec4f830c4428a17fd4e52124dca6c63e25961)
This commit is contained in:
hondacrx
2024-02-04 00:27:52 -05:00
parent 3c2bb6829c
commit 90ad7ed6ea
13 changed files with 184 additions and 369 deletions
+2
View File
@@ -258,6 +258,7 @@ namespace Game.DataStorage
PrestigeLevelInfoStorage = ReadDB2<PrestigeLevelInfoRecord>("PrestigeLevelInfo.db2", HotfixStatements.SEL_PRESTIGE_LEVEL_INFO, HotfixStatements.SEL_PRESTIGE_LEVEL_INFO_LOCALE);
PvpDifficultyStorage = ReadDB2<PvpDifficultyRecord>("PVPDifficulty.db2", HotfixStatements.SEL_PVP_DIFFICULTY);
PvpItemStorage = ReadDB2<PvpItemRecord>("PVPItem.db2", HotfixStatements.SEL_PVP_ITEM);
PvpStatStorage = ReadDB2<PvpStatRecord>("PVPStat.db2", HotfixStatements.SEL_PVP_STAT, HotfixStatements.SEL_PVP_STAT_LOCALE);
PvpSeasonStorage = ReadDB2<PvpSeasonRecord>("PvpSeason.db2", HotfixStatements.SEL_PVP_SEASON);
PvpTalentStorage = ReadDB2<PvpTalentRecord>("PvpTalent.db2", HotfixStatements.SEL_PVP_TALENT, HotfixStatements.SEL_PVP_TALENT_LOCALE);
PvpTalentCategoryStorage = ReadDB2<PvpTalentCategoryRecord>("PvpTalentCategory.db2", HotfixStatements.SEL_PVP_TALENT_CATEGORY);
@@ -693,6 +694,7 @@ namespace Game.DataStorage
public static DB6Storage<PrestigeLevelInfoRecord> PrestigeLevelInfoStorage;
public static DB6Storage<PvpDifficultyRecord> PvpDifficultyStorage;
public static DB6Storage<PvpItemRecord> PvpItemStorage;
public static DB6Storage<PvpStatRecord> PvpStatStorage;
public static DB6Storage<PvpSeasonRecord> PvpSeasonStorage;
public static DB6Storage<PvpTalentRecord> PvpTalentStorage;
public static DB6Storage<PvpTalentCategoryRecord> PvpTalentCategoryStorage;
+18 -9
View File
@@ -630,6 +630,9 @@ namespace Game.DataStorage
foreach (WMOAreaTableRecord entry in WMOAreaTableStorage.Values)
_wmoAreaTableLookup[Tuple.Create((short)entry.WmoID, (sbyte)entry.NameSetID, entry.WmoGroupID)] = entry;
foreach (PvpStatRecord pvpStat in PvpStatStorage.Values)
_pvpStatIdsByMap.Add(pvpStat.MapID, pvpStat.Id);
}
public IDB2Storage GetStorage(uint type)
@@ -1051,7 +1054,7 @@ namespace Game.DataStorage
return contentTuningId;
}
public ContentTuningLevels? GetContentTuningData(uint contentTuningId, uint redirectFlag, bool forItem = false)
{
ContentTuningRecord contentTuning = ContentTuningStorage.LookupByKey(GetRedirectedContentTuningId(contentTuningId, redirectFlag));
@@ -1095,7 +1098,7 @@ namespace Game.DataStorage
{
return _contentTuningLabels.Contains((contentTuningId, label));
}
public string GetCreatureFamilyPetName(CreatureFamily petfamily, Locale locale)
{
if (petfamily == CreatureFamily.None)
@@ -1294,16 +1297,16 @@ namespace Game.DataStorage
{
var mythicPlusSeason = MythicPlusSeasonStorage.LookupByKey(contentTuningXExpected.MinMythicPlusSeasonID);
if (mythicPlusSeason != null)
if (ActiveMilestoneSeason < mythicPlusSeason.MilestoneSeason)
return mod;
if (ActiveMilestoneSeason < mythicPlusSeason.MilestoneSeason)
return mod;
}
if (contentTuningXExpected.MaxMythicPlusSeasonID != 0)
{
var mythicPlusSeason = MythicPlusSeasonStorage.LookupByKey(contentTuningXExpected.MaxMythicPlusSeasonID);
if (mythicPlusSeason != null)
if (ActiveMilestoneSeason >= mythicPlusSeason.MilestoneSeason)
return mod;
if (ActiveMilestoneSeason >= mythicPlusSeason.MilestoneSeason)
return mod;
}
var expectedStatMod = ExpectedStatModStorage.LookupByKey(contentTuningXExpected.ExpectedStatModID);
@@ -1872,7 +1875,7 @@ namespace Game.DataStorage
{
return _skillRaceClassInfoBySkill.LookupByKey(skill);
}
public SoulbindConduitRankRecord GetSoulbindConduitRank(int soulbindConduitId, int rank)
{
return _soulbindConduitRanks.LookupByKey(Tuple.Create(soulbindConduitId, rank));
@@ -1902,7 +1905,7 @@ namespace Game.DataStorage
{
return _spellVisualMissilesBySet.LookupByKey(spellVisualMissileSetId);
}
public List<TalentRecord> GetTalentsByPosition(Class class_, uint tier, uint column)
{
return _talentsByPosition[(int)class_][tier][column];
@@ -2223,6 +2226,11 @@ namespace Game.DataStorage
return null;
}
public List<uint> GetPVPStatIDsForMap(uint mapId)
{
return _pvpStatIdsByMap.LookupByKey(mapId);
}
public bool HasItemCurrencyCost(uint itemId) { return _itemsWithCurrencyCost.Contains(itemId); }
public Dictionary<uint, Dictionary<uint, MapDifficultyRecord>> GetMapDifficulties() { return _mapDifficulties; }
@@ -2316,6 +2324,7 @@ namespace Game.DataStorage
MultiMap<int, UiMapAssignmentRecord>[] _uiMapAssignmentByWmoGroup = new MultiMap<int, UiMapAssignmentRecord>[(int)UiMapSystem.Max];
List<int> _uiMapPhases = new();
Dictionary<Tuple<short, sbyte, int>, WMOAreaTableRecord> _wmoAreaTableLookup = new();
MultiMap<uint, uint> _pvpStatIdsByMap = new();
}
class UiMapBounds
@@ -2526,7 +2535,7 @@ namespace Game.DataStorage
UniqueID = data.ReadUInt32();
}
}
public class HotfixOptionalData
{
public uint Key;
@@ -178,6 +178,13 @@ namespace Game.DataStorage
public byte ItemLevelDelta;
}
public sealed class PvpStatRecord
{
public LocalizedString Description;
public uint Id;
public uint MapID;
}
public sealed class PvpSeasonRecord
{
public uint Id;