Updated to support latest master (#1965)

This needs extensive testing.

What's important is spells given to bots. Class spells, mounts,
professions etc. Make sure they get the spells they should, when they
should.

Requires https://github.com/mod-playerbots/azerothcore-wotlk/pull/132
This commit is contained in:
Revision
2026-01-05 15:06:45 +01:00
committed by GitHub
parent 83c6977de5
commit 962fdeb3d1
7 changed files with 76 additions and 167 deletions

View File

@@ -302,12 +302,14 @@ bool NewRpgBaseAction::CanInteractWithQuestGiver(Object* questGiver)
if (creature->GetReactionTo(bot) <= REP_UNFRIENDLY)
return false;
Trainer::Trainer* trainer = sObjectMgr->GetTrainer(creature->GetEntry());
// pussywizard: many npcs have missing conditions for class training and rogue trainer can for eg. train
// dual wield to a shaman :/ too many to change in sql and watch in the future pussywizard: this function is
// not used when talking, but when already taking action (buy spell, reset talents, show spell list)
if (npcflagmask & (UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_TRAINER_CLASS) &&
creature->GetCreatureTemplate()->trainer_type == TRAINER_TYPE_CLASS &&
!bot->IsClass((Classes)creature->GetCreatureTemplate()->trainer_class, CLASS_CONTEXT_CLASS_TRAINER))
trainer->GetTrainerType() == Trainer::Type::Class &&
!trainer->IsTrainerValidForPlayer(bot))
return false;
return true;