tank target, formation arrow, mount fix, miscs

This commit is contained in:
Yunfan Li
2023-06-02 15:49:49 +08:00
parent ebfd338af0
commit 25da0af70e
12 changed files with 206 additions and 49 deletions

View File

@@ -14,11 +14,20 @@ class FindTargetForTankStrategy : public FindNonCcTargetStrategy
void CheckAttacker(Unit* creature, ThreatMgr* threatMgr) override
{
Player* bot = botAI->GetBot();
if (IsCcTarget(creature))
return;
float threat = threatMgr->GetThreat(bot);
if (!result || (minThreat - threat) > 0.1f)
if (!result) {
minThreat = threat;
result = creature;
}
// neglect if victim is main tank, or no victim (for untauntable target)
if (threatMgr->getCurrentVictim()) {
// float max_threat = threatMgr->GetThreat(threatMgr->getCurrentVictim()->getTarget());
Unit* victim = threatMgr->getCurrentVictim()->getTarget();
if (victim && victim->ToPlayer() && botAI->IsMainTank(victim->ToPlayer())) {
return;
}
}
if (minThreat >= threat)
{
minThreat = threat;
result = creature;