From bfc49fb01301d5699b7bfd4c5675c6f250f75843 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 2 Sep 2022 14:28:27 -0400 Subject: [PATCH] Misc fixes --- Source/Game/Chat/Commands/LearnCommands.cs | 10 +++++----- Source/Game/Spells/SpellManager.cs | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/Game/Chat/Commands/LearnCommands.cs b/Source/Game/Chat/Commands/LearnCommands.cs index c486f641c..5fb81bb3c 100644 --- a/Source/Game/Chat/Commands/LearnCommands.cs +++ b/Source/Game/Chat/Commands/LearnCommands.cs @@ -246,12 +246,12 @@ namespace Game.Chat.Commands { uint classmask = player.GetClassMask(); - foreach (var skillLine in CliDB.SkillLineAbilityStorage.Values) - { - // wrong skill - if (skillLine.SkillLine != skillId) - continue; + var skillLineAbilities = Global.DB2Mgr.GetSkillLineAbilitiesBySkill(skillId); + if (skillLineAbilities == null) + return; + foreach (var skillLine in skillLineAbilities) + { // not high rank if (skillLine.SupercedesSpell != 0) continue; diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index f012675ff..780899c05 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -1799,11 +1799,12 @@ namespace Game.Entities if (creatureFamily.SkillLine[j] == 0) continue; - foreach (var skillLine in CliDB.SkillLineAbilityStorage.Values) - { - if (skillLine.SkillLine != creatureFamily.SkillLine[j]) - continue; + var skillLineAbilities = Global.DB2Mgr.GetSkillLineAbilitiesBySkill((uint)creatureFamily.SkillLine[j]); + if (skillLineAbilities == null) + continue; + foreach (var skillLine in skillLineAbilities) + { if (skillLine.AcquireMethod != AbilityLearnType.OnSkillLearn) continue;