trainer learn command

This commit is contained in:
Yunfan Li
2023-10-28 22:34:27 +08:00
parent d48670b545
commit 9701af6f95
4 changed files with 117 additions and 113 deletions

View File

@@ -89,11 +89,15 @@ bool TrainerAction::Execute(Event event)
Player* master = GetMaster();
Creature* creature = botAI->GetCreature(bot->GetTarget());
if (AI_VALUE(GuidPosition, "rpg target") != bot->GetTarget())
if (master)
creature = botAI->GetCreature(master->GetTarget());
else
return false;
if (master) {
creature = master->GetSelectedUnit() ? master->GetSelectedUnit()->ToCreature() : nullptr;
}
// if (AI_VALUE(GuidPosition, "rpg target") != bot->GetTarget())
// if (master)
// creature = botAI->GetCreature(master->GetTarget());
// else
// return false;
if (!creature || !creature->IsTrainer())
return false;