Core/Creature: Profession trainer fixes

Port From (https://github.com/TrinityCore/TrinityCore/commit/f4d029b9523b35c38b80f0fb4aa9fb317a42e237)
This commit is contained in:
hondacrx
2021-11-18 19:41:22 -05:00
parent 2ce3cc84f8
commit 462e1f34a1
+10
View File
@@ -102,6 +102,16 @@ namespace Game.Entities
if (trainerSpellInfo.IsPrimaryProfessionFirstRank() && player.GetFreePrimaryProfessionPoints() == 0)
return false;
foreach (SpellEffectInfo effect in trainerSpellInfo.GetEffects())
{
if (!effect.IsEffect(SpellEffectName.LearnSpell))
continue;
SpellInfo learnedSpellInfo = Global.SpellMgr.GetSpellInfo(effect.TriggerSpell, Difficulty.None);
if (learnedSpellInfo != null && learnedSpellInfo.IsPrimaryProfessionFirstRank() && player.GetFreePrimaryProfessionPoints() == 0)
return false;
}
return true;
}