Core/Creature: Profession trainer fixes (PR #22904)
Closes #22903 (cherry picked from commit 19791a35df11e2c5c42ee437bfc13466c708ea43)
This commit is contained in:
@@ -115,6 +115,16 @@ namespace Trainer
|
||||
if (trainerSpellInfo->IsPrimaryProfessionFirstRank() && !player->GetFreePrimaryProfessionPoints())
|
||||
return false;
|
||||
|
||||
for (SpellEffectInfo const& effect : trainerSpellInfo->GetEffects())
|
||||
{
|
||||
if (!effect.IsEffect(SPELL_EFFECT_LEARN_SPELL))
|
||||
continue;
|
||||
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(effect.TriggerSpell, DIFFICULTY_NONE);
|
||||
if (learnedSpellInfo && learnedSpellInfo->IsPrimaryProfessionFirstRank() && !player->GetFreePrimaryProfessionPoints())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user