Core/AdventureJournal: Check if player can access adventure journal with ChrClassUIDisplay.db2
Port From (https://github.com/TrinityCore/TrinityCore/commit/d0246e5835ea184b22896e6b354fb28c28890810)
This commit is contained in:
@@ -96,6 +96,7 @@ namespace Game.DataStorage
|
||||
CharacterLoadoutStorage = ReadDB2<CharacterLoadoutRecord>("CharacterLoadout.db2", HotfixStatements.SEL_CHARACTER_LOADOUT);
|
||||
CharacterLoadoutItemStorage = ReadDB2<CharacterLoadoutItemRecord>("CharacterLoadoutItem.db2", HotfixStatements.SEL_CHARACTER_LOADOUT_ITEM);
|
||||
ChatChannelsStorage = ReadDB2<ChatChannelsRecord>("ChatChannels.db2", HotfixStatements.SEL_CHAT_CHANNELS, HotfixStatements.SEL_CHAT_CHANNELS_LOCALE);
|
||||
ChrClassUIDisplayStorage = ReadDB2<ChrClassUIDisplayRecord>("ChrClassUIDisplay.db2", HotfixStatements.SEL_CHR_CLASS_UI_DISPLAY);
|
||||
ChrClassesStorage = ReadDB2<ChrClassesRecord>("ChrClasses.db2", HotfixStatements.SEL_CHR_CLASSES, HotfixStatements.SEL_CHR_CLASSES_LOCALE);
|
||||
ChrClassesXPowerTypesStorage = ReadDB2<ChrClassesXPowerTypesRecord>("ChrClassesXPowerTypes.db2", HotfixStatements.SEL_CHR_CLASSES_X_POWER_TYPES);
|
||||
ChrCustomizationChoiceStorage= ReadDB2<ChrCustomizationChoiceRecord>("ChrCustomizationChoice.db2", HotfixStatements.SEL_CHR_CUSTOMIZATION_CHOICE, HotfixStatements.SEL_CHR_CUSTOMIZATION_CHOICE_LOCALE);
|
||||
@@ -455,6 +456,7 @@ namespace Game.DataStorage
|
||||
public static DB6Storage<CharacterLoadoutRecord> CharacterLoadoutStorage;
|
||||
public static DB6Storage<CharacterLoadoutItemRecord> CharacterLoadoutItemStorage;
|
||||
public static DB6Storage<ChatChannelsRecord> ChatChannelsStorage;
|
||||
public static DB6Storage<ChrClassUIDisplayRecord> ChrClassUIDisplayStorage;
|
||||
public static DB6Storage<ChrClassesRecord> ChrClassesStorage;
|
||||
public static DB6Storage<ChrClassesXPowerTypesRecord> ChrClassesXPowerTypesStorage;
|
||||
public static DB6Storage<ChrCustomizationChoiceRecord> ChrCustomizationChoiceStorage;
|
||||
|
||||
@@ -133,6 +133,12 @@ namespace Game.DataStorage
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var uiDisplay in CliDB.ChrClassUIDisplayStorage.Values)
|
||||
{
|
||||
Cypher.Assert(uiDisplay.ChrClassesID < (byte)Class.Max);
|
||||
_uiDisplayByClass[uiDisplay.ChrClassesID] = uiDisplay;
|
||||
}
|
||||
|
||||
var powers = new List<ChrClassesXPowerTypesRecord>();
|
||||
foreach (var chrClasses in CliDB.ChrClassesXPowerTypesStorage.Values)
|
||||
powers.Add(chrClasses);
|
||||
@@ -999,6 +1005,12 @@ namespace Game.DataStorage
|
||||
return broadcastText.Text[SharedConst.DefaultLocale];
|
||||
}
|
||||
|
||||
public ChrClassUIDisplayRecord GetUiDisplayForClass(Class unitClass)
|
||||
{
|
||||
Cypher.Assert(unitClass < Class.Max);
|
||||
return _uiDisplayByClass[(int)unitClass];
|
||||
}
|
||||
|
||||
public string GetClassName(Class class_, Locale locale = Locale.enUS)
|
||||
{
|
||||
ChrClassesRecord classEntry = CliDB.ChrClassesStorage.LookupByKey(class_);
|
||||
@@ -2292,6 +2304,7 @@ namespace Game.DataStorage
|
||||
MultiMap<uint, AzeritePowerSetMemberRecord> _azeritePowers = new MultiMap<uint, AzeritePowerSetMemberRecord>();
|
||||
Dictionary<(uint azeriteUnlockSetId, ItemContext itemContext), byte[]> _azeriteTierUnlockLevels = new Dictionary<(uint azeriteUnlockSetId, ItemContext itemContext), byte[]>();
|
||||
Dictionary<(uint itemId, ItemContext itemContext), AzeriteUnlockMappingRecord> _azeriteUnlockMappings = new Dictionary<(uint itemId, ItemContext itemContext), AzeriteUnlockMappingRecord>();
|
||||
ChrClassUIDisplayRecord[] _uiDisplayByClass = new ChrClassUIDisplayRecord[(int)Class.Max];
|
||||
uint[][] _powersByClass = new uint[(int)Class.Max][];
|
||||
MultiMap<uint, ChrCustomizationChoiceRecord> _chrCustomizationChoicesByOption = new MultiMap<uint, ChrCustomizationChoiceRecord>();
|
||||
Dictionary<Tuple<byte, byte>, ChrModelRecord> _chrModelsByRaceAndGender = new Dictionary<Tuple<byte, byte>, ChrModelRecord>();
|
||||
|
||||
@@ -66,6 +66,14 @@ namespace Game.DataStorage
|
||||
public int Ruleset;
|
||||
}
|
||||
|
||||
public sealed class ChrClassUIDisplayRecord
|
||||
{
|
||||
public uint Id;
|
||||
public byte ChrClassesID;
|
||||
public uint AdvGuidePlayerConditionID;
|
||||
public uint SplashPlayerConditionID;
|
||||
}
|
||||
|
||||
public sealed class ChrClassesRecord
|
||||
{
|
||||
public LocalizedString Name;
|
||||
|
||||
Reference in New Issue
Block a user