Core/Creature: Profession trainer fixes
Port From (https://github.com/TrinityCore/TrinityCore/commit/f4d029b9523b35c38b80f0fb4aa9fb317a42e237)
This commit is contained in:
@@ -102,6 +102,16 @@ namespace Game.Entities
|
|||||||
if (trainerSpellInfo.IsPrimaryProfessionFirstRank() && player.GetFreePrimaryProfessionPoints() == 0)
|
if (trainerSpellInfo.IsPrimaryProfessionFirstRank() && player.GetFreePrimaryProfessionPoints() == 0)
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user