Core/Spells: Load spell label data for future use

Port From (https://github.com/TrinityCore/TrinityCore/commit/e1f3f1254c3214c0a5b71db6de33f8900903d314)
This commit is contained in:
hondacrx
2021-06-04 16:26:25 -04:00
parent fee15ee311
commit 69a832b162
6 changed files with 48 additions and 3 deletions
+11 -1
View File
@@ -31,7 +31,7 @@ namespace Game.Spells
{
public class SpellInfo
{
public SpellInfo(SpellNameRecord spellName, Difficulty difficulty, SpellInfoLoadHelper data, List<SpellXSpellVisualRecord> visuals)
public SpellInfo(SpellNameRecord spellName, Difficulty difficulty, SpellInfoLoadHelper data, List<SpellLabelRecord> labels, List<SpellXSpellVisualRecord> visuals)
{
Id = spellName.Id;
Difficulty = difficulty;
@@ -185,6 +185,9 @@ namespace Game.Spells
ChannelInterruptFlags2 = (SpellAuraInterruptFlags2)_interrupt.ChannelInterruptFlags[1];
}
foreach (var label in labels)
Labels.Add(label.LabelID);
// SpellLevelsEntry
SpellLevelsRecord _levels = data.Levels;
if (_levels != null)
@@ -3555,6 +3558,11 @@ namespace Game.Spells
var playerCondition = CliDB.PlayerConditionStorage.LookupByKey(ShowFutureSpellPlayerConditionID);
return playerCondition == null || ConditionManager.IsPlayerMeetingCondition(player, playerCondition);
}
public bool HasLabel(uint labelId)
{
return Labels.Contains(labelId);
}
public static SpellCastTargetFlags GetTargetFlagMask(SpellTargetObjectTypes objType)
{
@@ -3724,6 +3732,8 @@ namespace Game.Spells
public int RequiredAreasID { get; set; }
public SpellSchoolMask SchoolMask { get; set; }
public uint ChargeCategoryId;
public List<uint> Labels = new();
// SpellScalingEntry
public ScalingInfo Scaling;
public uint ExplicitTargetMask { get; set; }