mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
@@ -48,10 +48,15 @@ namespace Trainer
|
||||
if (!player->IsSpellFitByClassAndRace(trainerSpell.SpellId))
|
||||
continue;
|
||||
|
||||
SpellInfo const* trainerSpellInfo = sSpellMgr->AssertSpellInfo(trainerSpell.SpellId);
|
||||
|
||||
bool primaryProfessionFirstRank = false;
|
||||
for (int32 reqAbility : trainerSpell.ReqAbility)
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(reqAbility);
|
||||
if (trainerSpellInfo->Effects[i].Effect != SPELL_EFFECT_LEARN_SPELL)
|
||||
continue;
|
||||
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(trainerSpellInfo->Effects[i].TriggerSpell);
|
||||
if (learnedSpellInfo && learnedSpellInfo->IsPrimaryProfessionFirstRank())
|
||||
primaryProfessionFirstRank = true;
|
||||
}
|
||||
@@ -132,8 +137,16 @@ namespace Trainer
|
||||
return false;
|
||||
|
||||
SpellInfo const* trainerSpellInfo = sSpellMgr->AssertSpellInfo(trainerSpell->SpellId);
|
||||
if (trainerSpellInfo->IsPrimaryProfessionFirstRank() && !player->GetFreePrimaryProfessionPoints())
|
||||
return false;
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (trainerSpellInfo->Effects[i].Effect != SPELL_EFFECT_LEARN_SPELL)
|
||||
continue;
|
||||
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(trainerSpellInfo->Effects[i].TriggerSpell);
|
||||
if (learnedSpellInfo && learnedSpellInfo->IsPrimaryProfessionFirstRank() && !player->GetFreePrimaryProfessionPoints())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user