mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 06:36:24 +00:00
fix(Core/Trainers): add new column ReqSpell to npc_trainer table (#9490)
Prevent learning gnomish and goblin engineering recipes at same time. Fixes #5390 Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com>
This commit is contained in:
@@ -182,9 +182,15 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle)
|
||||
if (learnedSpellInfo && learnedSpellInfo->IsPrimaryProfessionFirstRank())
|
||||
primary_prof_first_rank = true;
|
||||
}
|
||||
|
||||
if (!valid)
|
||||
continue;
|
||||
|
||||
if (tSpell->reqSpell && !_player->HasSpell(tSpell->reqSpell))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
TrainerSpellState state = _player->GetTrainerSpellState(tSpell);
|
||||
|
||||
data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case)
|
||||
@@ -263,6 +269,11 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
|
||||
if (!trainer_spell)
|
||||
return;
|
||||
|
||||
if (trainer_spell->reqSpell && !_player->HasSpell(trainer_spell->reqSpell))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// can't be learn, cheat? Or double learn with lags...
|
||||
if (_player->GetTrainerSpellState(trainer_spell) != TRAINER_SPELL_GREEN)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user