grind, teleport, move random for rndbot

This commit is contained in:
Yunfan Li
2023-07-31 12:49:27 +08:00
parent 366867d773
commit 0cd1fa4db3
12 changed files with 145 additions and 99 deletions

View File

@@ -4,6 +4,8 @@
#include "GrindTargetValue.h"
#include "Playerbots.h"
#include "ReputationMgr.h"
#include "SharedDefines.h"
Unit* GrindTargetValue::Calculate()
{
@@ -54,14 +56,19 @@ Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount)
if (!unit)
continue;
// if (unit->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE)) {
// continue;
// }
auto &rep = bot->ToPlayer()->GetReputationMgr();
if (unit->ToCreature() && !unit->ToCreature()->GetCreatureTemplate()->lootid && bot->GetReactionTo(unit) >= REP_NEUTRAL) {
continue;
}
if (!bot->IsHostileTo(unit) && unit->GetNpcFlags() != UNIT_NPC_FLAG_NONE) {
continue;
}
if (!bot->isHonorOrXPTarget(unit)) {
continue;
}
if (abs(bot->GetPositionZ() - unit->GetPositionZ()) > sPlayerbotAIConfig->spellDistance)
continue;