diff --git a/Source/Framework/Constants/CliDBConst.cs b/Source/Framework/Constants/CliDBConst.cs index f02423509..acafe287f 100644 --- a/Source/Framework/Constants/CliDBConst.cs +++ b/Source/Framework/Constants/CliDBConst.cs @@ -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] diff --git a/Source/Game/DataStorage/Structs/S_Records.cs b/Source/Game/DataStorage/Structs/S_Records.cs index c969b42ef..56608167e 100644 --- a/Source/Game/DataStorage/Structs/S_Records.cs +++ b/Source/Game/DataStorage/Structs/S_Records.cs @@ -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; diff --git a/Source/Game/Entities/Player/Player.Quest.cs b/Source/Game/Entities/Player/Player.Quest.cs index 856ebe01c..2bcd35c2d 100644 --- a/Source/Game/Entities/Player/Player.Quest.cs +++ b/Source/Game/Entities/Player/Player.Quest.cs @@ -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; diff --git a/Source/Game/Entities/Player/Player.Spells.cs b/Source/Game/Entities/Player/Player.Spells.cs index af86407c0..5178ebc3f 100644 --- a/Source/Game/Entities/Player/Player.Spells.cs +++ b/Source/Game/Entities/Player/Player.Spells.cs @@ -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()); diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 0bb3b234a..6c183eac1 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -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);