smarter dps target and tank target

This commit is contained in:
Yunfan Li
2023-10-22 01:27:37 +08:00
parent f303a9e83a
commit a63c6b6709
14 changed files with 184 additions and 53 deletions

View File

@@ -1399,6 +1399,19 @@ bool PlayerbotAI::IsRangedDpsAssistantOfIndex(Player* player, int index)
return false;
}
bool PlayerbotAI::HasAggro(Unit* unit)
{
if (!unit) {
return false;
}
bool isMT = IsMainTank(bot);
Unit* victim = unit->GetVictim();
if (victim && (victim->GetGUID() == bot->GetGUID() || (!isMT && victim->ToPlayer() && IsTank(victim->ToPlayer())))) {
return true;
}
return false;
}
int32 PlayerbotAI::GetGroupSlotIndex(Player* player)
{
Group* group = bot->GetGroup();