Core/Reputation: Implemented paragon reputation

Port From (https://github.com/TrinityCore/TrinityCore/commit/b01fba4bd9530213ee0c9547e09d1f16b3ce5d67)
This commit is contained in:
hondacrx
2021-06-05 20:35:26 -04:00
parent 6ab6fc81a5
commit 21d8fbee40
8 changed files with 148 additions and 13 deletions
+2
View File
@@ -227,6 +227,7 @@ namespace Game.DataStorage
NamesReservedLocaleStorage = ReadDB2<NamesReservedLocaleRecord>("NamesReservedLocale.db2", HotfixStatements.SEL_NAMES_RESERVED_LOCALE);
NumTalentsAtLevelStorage = ReadDB2<NumTalentsAtLevelRecord>("NumTalentsAtLevel.db2", HotfixStatements.SEL_NUM_TALENTS_AT_LEVEL);
OverrideSpellDataStorage = ReadDB2<OverrideSpellDataRecord>("OverrideSpellData.db2", HotfixStatements.SEL_OVERRIDE_SPELL_DATA);
ParagonReputationStorage = ReadDB2<ParagonReputationRecord>("ParagonReputation.db2", HotfixStatements.SEL_PARAGON_REPUTATION);
PhaseStorage = ReadDB2<PhaseRecord>("Phase.db2", HotfixStatements.SEL_PHASE);
PhaseXPhaseGroupStorage = ReadDB2<PhaseXPhaseGroupRecord>("PhaseXPhaseGroup.db2", HotfixStatements.SEL_PHASE_X_PHASE_GROUP);
PlayerConditionStorage = ReadDB2<PlayerConditionRecord>("PlayerCondition.db2", HotfixStatements.SEL_PLAYER_CONDITION, HotfixStatements.SEL_PLAYER_CONDITION_LOCALE);
@@ -594,6 +595,7 @@ namespace Game.DataStorage
public static DB6Storage<NamesReservedLocaleRecord> NamesReservedLocaleStorage;
public static DB6Storage<NumTalentsAtLevelRecord> NumTalentsAtLevelStorage;
public static DB6Storage<OverrideSpellDataRecord> OverrideSpellDataStorage;
public static DB6Storage<ParagonReputationRecord> ParagonReputationStorage;
public static DB6Storage<PhaseRecord> PhaseStorage;
public static DB6Storage<PhaseXPhaseGroupRecord> PhaseXPhaseGroupStorage;
public static DB6Storage<PlayerConditionRecord> PlayerConditionStorage;
+10
View File
@@ -414,6 +414,10 @@ namespace Game.DataStorage
}
}
foreach (ParagonReputationRecord paragonReputation in CliDB.ParagonReputationStorage.Values)
if (CliDB.FactionStorage.HasRecord(paragonReputation.FactionID))
_paragonReputations[paragonReputation.FactionID] = paragonReputation;
foreach (var group in CliDB.PhaseXPhaseGroupStorage.Values)
{
PhaseRecord phase = CliDB.PhaseStorage.LookupByKey(group.PhaseId);
@@ -1722,6 +1726,11 @@ namespace Game.DataStorage
return 0;
}
public ParagonReputationRecord GetParagonReputation(uint factionId)
{
return _paragonReputations.LookupByKey(factionId);
}
public PvpDifficultyRecord GetBattlegroundBracketByLevel(uint mapid, uint level)
{
PvpDifficultyRecord maxEntry = null; // used for level > max listed level case
@@ -2275,6 +2284,7 @@ namespace Game.DataStorage
MultiMap<uint, MountXDisplayRecord> _mountDisplays = new();
Dictionary<uint, List<NameGenRecord>[]> _nameGenData = new();
List<string>[] _nameValidators = new List<string>[(int)Locale.Total + 1];
Dictionary<uint, ParagonReputationRecord> _paragonReputations = new();
MultiMap<uint, uint> _phasesByGroup = new();
Dictionary<PowerType, PowerTypeRecord> _powerTypes = new();
Dictionary<uint, byte> _pvpItemBonus = new();
@@ -19,6 +19,14 @@ using Framework.Constants;
namespace Game.DataStorage
{
public sealed class ParagonReputationRecord
{
public uint Id;
public uint FactionID;
public int LevelThreshold;
public int QuestID;
}
public sealed class PhaseRecord
{
public uint Id;