Core/Instances: Use level requirements from MapDifficultyXCondition.db2 instead of access_requirement db table
Port From (https://github.com/TrinityCore/TrinityCore/commit/3afed1788a81fe65ee414c590936be65d69f9314)
This commit is contained in:
@@ -205,6 +205,7 @@ namespace Game.DataStorage
|
||||
MailTemplateStorage = ReadDB2<MailTemplateRecord>("MailTemplate.db2", HotfixStatements.SEL_MAIL_TEMPLATE, HotfixStatements.SEL_MAIL_TEMPLATE_LOCALE);
|
||||
MapStorage = ReadDB2<MapRecord>("Map.db2", HotfixStatements.SEL_MAP, HotfixStatements.SEL_MAP_LOCALE);
|
||||
MapDifficultyStorage = ReadDB2<MapDifficultyRecord>("MapDifficulty.db2", HotfixStatements.SEL_MAP_DIFFICULTY, HotfixStatements.SEL_MAP_DIFFICULTY_LOCALE);
|
||||
MapDifficultyXConditionStorage = ReadDB2<MapDifficultyXConditionRecord>("MapDifficultyXCondition.db2", HotfixStatements.SEL_MAP_DIFFICULTY_X_CONDITION, HotfixStatements.SEL_MAP_DIFFICULTY_X_CONDITION_LOCALE);
|
||||
ModifierTreeStorage = ReadDB2<ModifierTreeRecord>("ModifierTree.db2", HotfixStatements.SEL_MODIFIER_TREE);
|
||||
MountCapabilityStorage = ReadDB2<MountCapabilityRecord>("MountCapability.db2", HotfixStatements.SEL_MOUNT_CAPABILITY);
|
||||
MountStorage = ReadDB2<MountRecord>("Mount.db2", HotfixStatements.SEL_MOUNT, HotfixStatements.SEL_MOUNT_LOCALE);
|
||||
@@ -561,6 +562,7 @@ namespace Game.DataStorage
|
||||
public static DB6Storage<MailTemplateRecord> MailTemplateStorage;
|
||||
public static DB6Storage<MapRecord> MapStorage;
|
||||
public static DB6Storage<MapDifficultyRecord> MapDifficultyStorage;
|
||||
public static DB6Storage<MapDifficultyXConditionRecord> MapDifficultyXConditionStorage;
|
||||
public static DB6Storage<ModifierTreeRecord> ModifierTreeStorage;
|
||||
public static DB6Storage<MountCapabilityRecord> MountCapabilityStorage;
|
||||
public static DB6Storage<MountRecord> MountStorage;
|
||||
|
||||
@@ -376,6 +376,19 @@ namespace Game.DataStorage
|
||||
|
||||
CliDB.MapDifficultyStorage.Clear();
|
||||
|
||||
List<MapDifficultyXConditionRecord> mapDifficultyConditions = new List<MapDifficultyXConditionRecord>();
|
||||
foreach (var mapDifficultyCondition in CliDB.MapDifficultyXConditionStorage.Values)
|
||||
mapDifficultyConditions.Add(mapDifficultyCondition);
|
||||
|
||||
mapDifficultyConditions = mapDifficultyConditions.OrderBy(p => p.OrderIndex).ToList();
|
||||
|
||||
foreach (var mapDifficultyCondition in mapDifficultyConditions)
|
||||
{
|
||||
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(mapDifficultyCondition.PlayerConditionID);
|
||||
if (playerCondition != null)
|
||||
_mapDifficultyConditions.Add(mapDifficultyCondition.MapDifficultyID, Tuple.Create(mapDifficultyCondition.Id, playerCondition));
|
||||
}
|
||||
|
||||
foreach (var mount in CliDB.MountStorage.Values)
|
||||
_mountsBySpellId[mount.SourceSpellID] = mount;
|
||||
|
||||
@@ -1674,12 +1687,17 @@ namespace Game.DataStorage
|
||||
return mapDiff;
|
||||
}
|
||||
|
||||
public List<Tuple<uint, PlayerConditionRecord>> GetMapDifficultyConditions(uint mapDifficultyId)
|
||||
{
|
||||
return _mapDifficultyConditions.LookupByKey(mapDifficultyId);
|
||||
}
|
||||
|
||||
public MountRecord GetMount(uint spellId)
|
||||
{
|
||||
return _mountsBySpellId.LookupByKey(spellId);
|
||||
}
|
||||
|
||||
MountRecord GetMountById(uint id)
|
||||
public MountRecord GetMountById(uint id)
|
||||
{
|
||||
return CliDB.MountStorage.LookupByKey(id);
|
||||
}
|
||||
@@ -2286,6 +2304,7 @@ namespace Game.DataStorage
|
||||
MultiMap<uint, ItemSetSpellRecord> _itemSetSpells = new MultiMap<uint, ItemSetSpellRecord>();
|
||||
MultiMap<uint, ItemSpecOverrideRecord> _itemSpecOverrides = new MultiMap<uint, ItemSpecOverrideRecord>();
|
||||
Dictionary<uint, Dictionary<uint, MapDifficultyRecord>> _mapDifficulties = new Dictionary<uint, Dictionary<uint, MapDifficultyRecord>>();
|
||||
MultiMap<uint, Tuple<uint, PlayerConditionRecord>> _mapDifficultyConditions = new MultiMap<uint, Tuple<uint, PlayerConditionRecord>>();
|
||||
Dictionary<uint, MountRecord> _mountsBySpellId = new Dictionary<uint, MountRecord>();
|
||||
MultiMap<uint, MountTypeXCapabilityRecord> _mountCapabilitiesByType = new MultiMap<uint, MountTypeXCapabilityRecord>();
|
||||
MultiMap<uint, MountXDisplayRecord> _mountDisplays = new MultiMap<uint, MountXDisplayRecord>();
|
||||
|
||||
@@ -116,6 +116,15 @@ namespace Game.DataStorage
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MapDifficultyXConditionRecord
|
||||
{
|
||||
public uint Id;
|
||||
public LocalizedString FailureDescription;
|
||||
public uint PlayerConditionID;
|
||||
public int OrderIndex;
|
||||
public uint MapDifficultyID;
|
||||
}
|
||||
|
||||
public sealed class ModifierTreeRecord
|
||||
{
|
||||
public uint Id;
|
||||
|
||||
Reference in New Issue
Block a user