Core/DataStores: Convert SkillLineAbilityAcquireMethod to enum
Port From (https://github.com/TrinityCore/TrinityCore/commit/531afa6bcc485db7c115e5ab5d874bda2cbf642e)
This commit is contained in:
@@ -47,11 +47,13 @@ namespace Framework.Constants
|
||||
RacialForThePurposeOfTemporaryRaceChange = 0x8000,
|
||||
}
|
||||
|
||||
public enum AbilityLearnType : int
|
||||
public enum SkillLineAbilityAcquireMethod : int
|
||||
{
|
||||
OnSkillValue = 1, // Spell state will update depending on skill value
|
||||
OnSkillLearn = 2, // Spell will be learned/removed together with entire skill
|
||||
RewardedFromQuest = 4 // Learned as quest reward, also re-learned if missing
|
||||
Learned = 0,
|
||||
AutomaticSkillRank = 1, // Spell state will update depending on skill value
|
||||
AutomaticCharLevel = 2, // Spell will be learned/removed together with entire skill
|
||||
NeverLearned = 3,
|
||||
LearnedOrAutomaticCharLevel = 4,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Game.DataStorage
|
||||
public short MinSkillLineRank;
|
||||
public int ClassMask;
|
||||
public uint SupercedesSpell;
|
||||
public AbilityLearnType AcquireMethod;
|
||||
public SkillLineAbilityAcquireMethod AcquireMethod;
|
||||
public ushort TrivialSkillLineRankHigh;
|
||||
public ushort TrivialSkillLineRankLow;
|
||||
public int Flags;
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Game.Entities
|
||||
var skills = Global.SpellMgr.GetSkillLineAbilityMapBounds(learned_0);
|
||||
foreach (var skillLine in skills)
|
||||
{
|
||||
if (skillLine.AcquireMethod == AbilityLearnType.RewardedFromQuest)
|
||||
if (skillLine.AcquireMethod == SkillLineAbilityAcquireMethod.LearnedOrAutomaticCharLevel)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
|
||||
@@ -1660,10 +1660,10 @@ namespace Game.Entities
|
||||
|
||||
switch (ability.AcquireMethod)
|
||||
{
|
||||
case AbilityLearnType.OnSkillValue:
|
||||
case AbilityLearnType.OnSkillLearn:
|
||||
case SkillLineAbilityAcquireMethod.AutomaticSkillRank:
|
||||
case SkillLineAbilityAcquireMethod.AutomaticCharLevel:
|
||||
break;
|
||||
case AbilityLearnType.RewardedFromQuest:
|
||||
case SkillLineAbilityAcquireMethod.LearnedOrAutomaticCharLevel:
|
||||
if (!ability.HasFlag(SkillLineAbilityFlags.CanFallbackToLearnedOnSkillLearn) ||
|
||||
!spellInfo.MeetsFutureSpellPlayerCondition(this))
|
||||
continue;
|
||||
@@ -1687,7 +1687,7 @@ namespace Game.Entities
|
||||
continue;
|
||||
|
||||
// need unlearn spell
|
||||
if (skillValue < ability.MinSkillLineRank && ability.AcquireMethod == AbilityLearnType.OnSkillValue)
|
||||
if (skillValue < ability.MinSkillLineRank && ability.AcquireMethod == SkillLineAbilityAcquireMethod.AutomaticSkillRank)
|
||||
RemoveSpell(ability.Spell);
|
||||
// need learn
|
||||
else if (!IsInWorld)
|
||||
@@ -2847,7 +2847,7 @@ namespace Game.Entities
|
||||
continue;
|
||||
|
||||
// Runeforging special case
|
||||
if ((_spell_idx.AcquireMethod == AbilityLearnType.OnSkillLearn && !HasSkill((SkillType)_spell_idx.SkillLine))
|
||||
if ((_spell_idx.AcquireMethod == SkillLineAbilityAcquireMethod.AutomaticCharLevel && !HasSkill((SkillType)_spell_idx.SkillLine))
|
||||
|| ((_spell_idx.SkillLine == (int)SkillType.Runeforging) && _spell_idx.TrivialSkillLineRankHigh == 0))
|
||||
{
|
||||
SkillRaceClassInfoRecord rcInfo = Global.DB2Mgr.GetSkillRaceClassInfo(_spell_idx.SkillLine, GetRace(), GetClass());
|
||||
|
||||
@@ -1860,7 +1860,7 @@ namespace Game.Entities
|
||||
|
||||
foreach (var skillLine in skillLineAbilities)
|
||||
{
|
||||
if (skillLine.AcquireMethod != AbilityLearnType.OnSkillLearn)
|
||||
if (skillLine.AcquireMethod != SkillLineAbilityAcquireMethod.AutomaticCharLevel)
|
||||
continue;
|
||||
|
||||
SpellInfo spell = GetSpellInfo(skillLine.Spell, Difficulty.None);
|
||||
@@ -4650,6 +4650,24 @@ namespace Game.Entities
|
||||
spellInfo._LoadSqrtTargetLimit(5, 0, null, 1, null, null);
|
||||
});
|
||||
|
||||
// Ice Nova
|
||||
ApplySpellFix([157997], spellInfo =>
|
||||
{
|
||||
spellInfo._LoadSqrtTargetLimit(8, 0, null, 2, null, null);
|
||||
});
|
||||
|
||||
// Raze
|
||||
ApplySpellFix([400254], spellInfo =>
|
||||
{
|
||||
spellInfo._LoadSqrtTargetLimit(5, 0, null, 2, null, null);
|
||||
});
|
||||
|
||||
// Explosive Shot
|
||||
ApplySpellFix([212680], spellInfo =>
|
||||
{
|
||||
spellInfo._LoadSqrtTargetLimit(5, 0, 212431, 1, null, null);
|
||||
});
|
||||
|
||||
Log.outInfo(LogFilter.ServerLoading, $"Loaded SpellInfo target caps in {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
|
||||
}
|
||||
|
||||
@@ -4677,7 +4695,7 @@ namespace Game.Entities
|
||||
if (skillLine.SkillLine != cFamily.SkillLine[0] && skillLine.SkillLine != cFamily.SkillLine[1])
|
||||
continue;
|
||||
|
||||
if (skillLine.AcquireMethod != AbilityLearnType.OnSkillLearn)
|
||||
if (skillLine.AcquireMethod != SkillLineAbilityAcquireMethod.AutomaticCharLevel)
|
||||
continue;
|
||||
|
||||
Global.SpellMgr.PetFamilySpellsStorage.Add(cFamily.Id, spellInfo.Id);
|
||||
|
||||
Reference in New Issue
Block a user