Core/Items: Implement azerite essences
Port From (https://github.com/TrinityCore/TrinityCore/commit/ec9d624aec9e0a39b1bcee7d4077f46be358faad)
This commit is contained in:
@@ -54,9 +54,13 @@ namespace Game.DataStorage
|
||||
ArtifactTierStorage = DBReader.Read<ArtifactTierRecord>("ArtifactTier.db2", HotfixStatements.SEL_ARTIFACT_TIER);
|
||||
ArtifactUnlockStorage = DBReader.Read<ArtifactUnlockRecord>("ArtifactUnlock.db2", HotfixStatements.SEL_ARTIFACT_UNLOCK);
|
||||
AuctionHouseStorage = DBReader.Read<AuctionHouseRecord>("AuctionHouse.db2", HotfixStatements.SEL_AUCTION_HOUSE, HotfixStatements.SEL_AUCTION_HOUSE_LOCALE);
|
||||
AzeriteEssenceStorage = DBReader.Read<AzeriteEssenceRecord>("AzeriteEssence.db2", HotfixStatements.SEL_AZERITE_ESSENCE, HotfixStatements.SEL_AZERITE_ESSENCE_LOCALE);
|
||||
AzeriteEssencePowerStorage = DBReader.Read<AzeriteEssencePowerRecord>("AzeriteEssencePower.db2", HotfixStatements.SEL_AZERITE_ESSENCE_POWER, HotfixStatements.SEL_AZERITE_ESSENCE_POWER_LOCALE);
|
||||
AzeriteItemStorage = DBReader.Read<AzeriteItemRecord>("AzeriteItem.db2", HotfixStatements.SEL_AZERITE_ITEM);
|
||||
AzeriteItemMilestonePowerStorage = DBReader.Read<AzeriteItemMilestonePowerRecord>("AzeriteItemMilestonePower.db2", HotfixStatements.SEL_AZERITE_ITEM_MILESTONE_POWER);
|
||||
AzeriteKnowledgeMultiplierStorage = DBReader.Read<AzeriteKnowledgeMultiplierRecord>("AzeriteKnowledgeMultiplier.db2", HotfixStatements.SEL_AZERITE_KNOWLEDGE_MULTIPLIER);
|
||||
AzeriteLevelInfoStorage = DBReader.Read<AzeriteLevelInfoRecord>("AzeriteLevelInfo.db2", HotfixStatements.SEL_AZERITE_LEVEL_INFO);
|
||||
AzeritePowerStorage = DBReader.Read<AzeritePowerRecord>("AzeritePower.db2", HotfixStatements.SEL_AZERITE_POWER);
|
||||
BankBagSlotPricesStorage = DBReader.Read<BankBagSlotPricesRecord>("BankBagSlotPrices.db2", HotfixStatements.SEL_BANK_BAG_SLOT_PRICES);
|
||||
//BannedAddOnsStorage = DBReader.Read<BannedAddOnsRecord>("BannedAddons.db2", HotfixStatements.SEL_BANNED_ADDONS);
|
||||
BarberShopStyleStorage = DBReader.Read<BarberShopStyleRecord>("BarberShopStyle.db2", HotfixStatements.SEL_BARBER_SHOP_STYLE, HotfixStatements.SEL_BARBER_SHOP_STYLE_LOCALE);
|
||||
@@ -218,6 +222,7 @@ namespace Game.DataStorage
|
||||
SkillRaceClassInfoStorage = DBReader.Read<SkillRaceClassInfoRecord>("SkillRaceClassInfo.db2", HotfixStatements.SEL_SKILL_RACE_CLASS_INFO);
|
||||
SoundKitStorage = DBReader.Read<SoundKitRecord>("SoundKit.db2", HotfixStatements.SEL_SOUND_KIT);
|
||||
SpecializationSpellsStorage = DBReader.Read<SpecializationSpellsRecord>("SpecializationSpells.db2", HotfixStatements.SEL_SPECIALIZATION_SPELLS, HotfixStatements.SEL_SPECIALIZATION_SPELLS_LOCALE);
|
||||
SpecSetMemberStorage = DBReader.Read<SpecSetMemberRecord>("SpecSetMember.db2", HotfixStatements.SEL_SPEC_SET_MEMBER);
|
||||
SpellNameStorage = DBReader.Read<SpellNameRecord>("SpellName.db2", HotfixStatements.SEL_SPELL_NAME, HotfixStatements.SEL_SPELL_NAME_LOCALE);
|
||||
SpellAuraOptionsStorage = DBReader.Read<SpellAuraOptionsRecord>("SpellAuraOptions.db2", HotfixStatements.SEL_SPELL_AURA_OPTIONS);
|
||||
SpellAuraRestrictionsStorage = DBReader.Read<SpellAuraRestrictionsRecord>("SpellAuraRestrictions.db2", HotfixStatements.SEL_SPELL_AURA_RESTRICTIONS);
|
||||
@@ -400,9 +405,13 @@ namespace Game.DataStorage
|
||||
public static DB6Storage<ArtifactTierRecord> ArtifactTierStorage;
|
||||
public static DB6Storage<ArtifactUnlockRecord> ArtifactUnlockStorage;
|
||||
public static DB6Storage<AuctionHouseRecord> AuctionHouseStorage;
|
||||
public static DB6Storage<AzeriteEssenceRecord> AzeriteEssenceStorage;
|
||||
public static DB6Storage<AzeriteEssencePowerRecord> AzeriteEssencePowerStorage;
|
||||
public static DB6Storage<AzeriteItemRecord> AzeriteItemStorage;
|
||||
public static DB6Storage<AzeriteItemMilestonePowerRecord> AzeriteItemMilestonePowerStorage;
|
||||
public static DB6Storage<AzeriteKnowledgeMultiplierRecord> AzeriteKnowledgeMultiplierStorage;
|
||||
public static DB6Storage<AzeriteLevelInfoRecord> AzeriteLevelInfoStorage;
|
||||
public static DB6Storage<AzeritePowerRecord> AzeritePowerStorage;
|
||||
public static DB6Storage<BankBagSlotPricesRecord> BankBagSlotPricesStorage;
|
||||
//public static DB6Storage<BannedAddOnsRecord> BannedAddOnsStorage;
|
||||
public static DB6Storage<BarberShopStyleRecord> BarberShopStyleStorage;
|
||||
@@ -564,6 +573,7 @@ namespace Game.DataStorage
|
||||
public static DB6Storage<SkillRaceClassInfoRecord> SkillRaceClassInfoStorage;
|
||||
public static DB6Storage<SoundKitRecord> SoundKitStorage;
|
||||
public static DB6Storage<SpecializationSpellsRecord> SpecializationSpellsStorage;
|
||||
public static DB6Storage<SpecSetMemberRecord> SpecSetMemberStorage;
|
||||
public static DB6Storage<SpellAuraOptionsRecord> SpellAuraOptionsStorage;
|
||||
public static DB6Storage<SpellAuraRestrictionsRecord> SpellAuraRestrictionsStorage;
|
||||
public static DB6Storage<SpellCastTimesRecord> SpellCastTimesStorage;
|
||||
|
||||
@@ -59,10 +59,30 @@ namespace Game.DataStorage
|
||||
CliDB.ArtifactPowerLinkStorage.Clear();
|
||||
|
||||
foreach (ArtifactPowerRankRecord artifactPowerRank in CliDB.ArtifactPowerRankStorage.Values)
|
||||
_artifactPowerRanks[Tuple.Create((uint)artifactPowerRank.ArtifactPowerID, artifactPowerRank.RankIndex)] = artifactPowerRank;
|
||||
_artifactPowerRanks[Tuple.Create(artifactPowerRank.ArtifactPowerID, artifactPowerRank.RankIndex)] = artifactPowerRank;
|
||||
|
||||
CliDB.ArtifactPowerRankStorage.Clear();
|
||||
|
||||
foreach (AzeriteEssencePowerRecord azeriteEssencePower in CliDB.AzeriteEssencePowerStorage.Values)
|
||||
_azeriteEssencePowersByIdAndRank[Tuple.Create((uint)azeriteEssencePower.AzeriteEssenceID, (uint)azeriteEssencePower.Tier)] = azeriteEssencePower;
|
||||
|
||||
foreach (AzeriteItemMilestonePowerRecord azeriteItemMilestonePower in CliDB.AzeriteItemMilestonePowerStorage.Values)
|
||||
_azeriteItemMilestonePowers.Add(azeriteItemMilestonePower);
|
||||
|
||||
_azeriteItemMilestonePowers = _azeriteItemMilestonePowers.OrderBy(p => p.RequiredLevel).ToList();
|
||||
|
||||
uint azeriteEssenceSlot = 0;
|
||||
foreach (AzeriteItemMilestonePowerRecord azeriteItemMilestonePower in _azeriteItemMilestonePowers)
|
||||
{
|
||||
AzeriteItemMilestoneType type = (AzeriteItemMilestoneType)azeriteItemMilestonePower.Type;
|
||||
if (type == AzeriteItemMilestoneType.MajorEssence || type == AzeriteItemMilestoneType.MinorEssence)
|
||||
{
|
||||
//ASSERT(azeriteEssenceSlot < MAX_AZERITE_ESSENCE_SLOT);
|
||||
_azeriteItemMilestonePowerByEssenceSlot[azeriteEssenceSlot] = azeriteItemMilestonePower;
|
||||
++azeriteEssenceSlot;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (CharacterFacialHairStylesRecord characterFacialStyle in CliDB.CharacterFacialHairStylesStorage.Values)
|
||||
_characterFacialHairStyles.Add(Tuple.Create(characterFacialStyle.RaceID, characterFacialStyle.SexID, (uint)characterFacialStyle.VariationID));
|
||||
|
||||
@@ -417,6 +437,9 @@ namespace Game.DataStorage
|
||||
|
||||
CliDB.SpecializationSpellsStorage.Clear();
|
||||
|
||||
foreach (SpecSetMemberRecord specSetMember in CliDB.SpecSetMemberStorage.Values)
|
||||
_specsBySpecSet.Add(Tuple.Create((int)specSetMember.SpecSetID, (uint)specSetMember.ChrSpecializationID));
|
||||
|
||||
foreach (SpellClassOptionsRecord classOption in CliDB.SpellClassOptionsStorage.Values)
|
||||
_spellFamilyNames.Add(classOption.SpellClassSet);
|
||||
|
||||
@@ -727,6 +750,22 @@ namespace Game.DataStorage
|
||||
return CliDB.AzeriteItemStorage.Any(pair => pair.Value.ItemID == itemId);
|
||||
}
|
||||
|
||||
public AzeriteEssencePowerRecord GetAzeriteEssencePower(uint azeriteEssenceId, uint rank)
|
||||
{
|
||||
return _azeriteEssencePowersByIdAndRank.LookupByKey((azeriteEssenceId, rank));
|
||||
}
|
||||
|
||||
public List<AzeriteItemMilestonePowerRecord> GetAzeriteItemMilestonePowers()
|
||||
{
|
||||
return _azeriteItemMilestonePowers;
|
||||
}
|
||||
|
||||
public AzeriteItemMilestonePowerRecord GetAzeriteItemMilestonePower(int slot)
|
||||
{
|
||||
//ASSERT(slot < MAX_AZERITE_ESSENCE_SLOT, "Slot %u must be lower than MAX_AZERITE_ESSENCE_SLOT (%u)", uint32(slot), MAX_AZERITE_ESSENCE_SLOT);
|
||||
return _azeriteItemMilestonePowerByEssenceSlot[slot];
|
||||
}
|
||||
|
||||
public string GetBroadcastTextValue(BroadcastTextRecord broadcastText, LocaleConstant locale = LocaleConstant.enUS, Gender gender = Gender.Male, bool forceGender = false)
|
||||
{
|
||||
if ((gender == Gender.Female || gender == Gender.None) && (forceGender || broadcastText.Text1.HasString(SharedConst.DefaultLocale)))
|
||||
@@ -1549,6 +1588,11 @@ namespace Game.DataStorage
|
||||
return _specializationSpellsBySpec.LookupByKey(specId);
|
||||
}
|
||||
|
||||
public bool IsSpecSetMember(int specSetId, uint specId)
|
||||
{
|
||||
return _specsBySpecSet.Contains(Tuple.Create(specSetId, specId));
|
||||
}
|
||||
|
||||
bool IsValidSpellFamiliyName(SpellFamilyNames family)
|
||||
{
|
||||
return _spellFamilyNames.Contains((byte)family);
|
||||
@@ -1938,6 +1982,9 @@ namespace Game.DataStorage
|
||||
MultiMap<uint, ArtifactPowerRecord> _artifactPowers = new MultiMap<uint, ArtifactPowerRecord>();
|
||||
MultiMap<uint, uint> _artifactPowerLinks = new MultiMap<uint, uint>();
|
||||
Dictionary<Tuple<uint, byte>, ArtifactPowerRankRecord> _artifactPowerRanks = new Dictionary<Tuple<uint, byte>, ArtifactPowerRankRecord>();
|
||||
Dictionary<Tuple<uint, uint>, AzeriteEssencePowerRecord> _azeriteEssencePowersByIdAndRank = new Dictionary<Tuple<uint, uint>, AzeriteEssencePowerRecord>();
|
||||
List<AzeriteItemMilestonePowerRecord> _azeriteItemMilestonePowers = new List<AzeriteItemMilestonePowerRecord>();
|
||||
AzeriteItemMilestonePowerRecord[] _azeriteItemMilestonePowerByEssenceSlot = new AzeriteItemMilestonePowerRecord[SharedConst.MaxAzeriteEssenceSlot];
|
||||
List<Tuple<byte, byte, uint>> _characterFacialHairStyles = new List<Tuple<byte, byte, uint>>();
|
||||
MultiMap<Tuple<byte, byte, CharBaseSectionVariation>, CharSectionsRecord> _charSections = new MultiMap<Tuple<byte, byte, CharBaseSectionVariation>, CharSectionsRecord>();
|
||||
Dictionary<uint, CharStartOutfitRecord> _charStartOutfits = new Dictionary<uint, CharStartOutfitRecord>();
|
||||
@@ -1981,6 +2028,7 @@ namespace Game.DataStorage
|
||||
MultiMap<uint, SkillLineAbilityRecord> _skillLineAbilitiesBySkillupSkill = new MultiMap<uint, SkillLineAbilityRecord>();
|
||||
MultiMap<uint, SkillRaceClassInfoRecord> _skillRaceClassInfoBySkill = new MultiMap<uint, SkillRaceClassInfoRecord>();
|
||||
MultiMap<uint, SpecializationSpellsRecord> _specializationSpellsBySpec = new MultiMap<uint, SpecializationSpellsRecord>();
|
||||
List<Tuple<int, uint>> _specsBySpecSet = new List<Tuple<int, uint>>();
|
||||
List<byte> _spellFamilyNames = new List<byte>();
|
||||
Dictionary<uint, List<SpellPowerRecord>> _spellPowers = new Dictionary<uint, List<SpellPowerRecord>>();
|
||||
Dictionary<uint, Dictionary<uint, List<SpellPowerRecord>>> _spellPowerDifficulties = new Dictionary<uint, Dictionary<uint, List<SpellPowerRecord>>>();
|
||||
|
||||
@@ -254,12 +254,42 @@ namespace Game.DataStorage
|
||||
public byte ConsignmentRate;
|
||||
}
|
||||
|
||||
public sealed class AzeriteEssenceRecord
|
||||
{
|
||||
public string Name;
|
||||
public string Description;
|
||||
public uint ID;
|
||||
public int SpecSetID;
|
||||
}
|
||||
|
||||
public sealed class AzeriteEssencePowerRecord
|
||||
{
|
||||
public uint ID;
|
||||
public string SourceAlliance;
|
||||
public string SourceHorde;
|
||||
public int AzeriteEssenceID;
|
||||
public byte Tier;
|
||||
public uint MajorPowerDescription;
|
||||
public uint MinorPowerDescription;
|
||||
public uint MajorPowerActual;
|
||||
public uint MinorPowerActual;
|
||||
}
|
||||
|
||||
public sealed class AzeriteItemRecord
|
||||
{
|
||||
public uint ID;
|
||||
public uint ItemID;
|
||||
}
|
||||
|
||||
public sealed class AzeriteItemMilestonePowerRecord
|
||||
{
|
||||
public uint ID;
|
||||
public int RequiredLevel;
|
||||
public int AzeritePowerID;
|
||||
public int Type;
|
||||
public int AutoUnlock;
|
||||
}
|
||||
|
||||
public sealed class AzeriteKnowledgeMultiplierRecord
|
||||
{
|
||||
public uint ID;
|
||||
@@ -273,4 +303,13 @@ namespace Game.DataStorage
|
||||
public ulong MinimumExperienceToNextLevel;
|
||||
public uint ItemLevel;
|
||||
}
|
||||
|
||||
public sealed class AzeritePowerRecord
|
||||
{
|
||||
public uint ID;
|
||||
public uint SpellID;
|
||||
public int ItemBonusListID;
|
||||
public int SpecSetID;
|
||||
public int Flags;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,6 +166,13 @@ namespace Game.DataStorage
|
||||
public byte DisplayOrder;
|
||||
}
|
||||
|
||||
public sealed class SpecSetMemberRecord
|
||||
{
|
||||
public uint ID;
|
||||
public uint ChrSpecializationID;
|
||||
public uint SpecSetID;
|
||||
}
|
||||
|
||||
public sealed class SpellAuraOptionsRecord
|
||||
{
|
||||
public uint Id;
|
||||
|
||||
Reference in New Issue
Block a user