Core/Trainers: Remove all "hidden" rank based requirements for learning spell from trainers and always only rely on trainer_spell.ReqAbility fields in database

This commit is contained in:
Shauren
2021-02-06 18:30:07 +01:00
parent 0cae71eac5
commit 65df9d424d

View File

@@ -150,26 +150,11 @@ namespace Trainer
hasLearnSpellEffect = true;
if (!player->HasSpell(spellEffect->TriggerSpell))
knowsAllLearnedSpells = false;
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(spellEffect->TriggerSpell))
if (!player->HasSpell(previousRankSpellId))
return SpellState::Unavailable;
}
if (!hasLearnSpellEffect)
{
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(trainerSpell->SpellId))
if (!player->HasSpell(previousRankSpellId))
return SpellState::Unavailable;
}
else if (knowsAllLearnedSpells)
if (hasLearnSpellEffect && knowsAllLearnedSpells)
return SpellState::Known;
// check additional spell requirement
for (auto const& requirePair : sSpellMgr->GetSpellsRequiredForSpellBounds(trainerSpell->SpellId))
if (!player->HasSpell(requirePair.second))
return SpellState::Unavailable;
return SpellState::Available;
}