mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-18 11:15:43 +00:00
tank target, formation arrow, mount fix, miscs
This commit is contained in:
@@ -19,6 +19,9 @@ WorldLocation ArrowFormation::GetLocationInternal()
|
||||
float offset = 0.f;
|
||||
|
||||
Player* master = botAI->GetMaster();
|
||||
if (!master) {
|
||||
return Formation::NullLocation;
|
||||
}
|
||||
float orientation = master->GetOrientation();
|
||||
MultiLineUnitPlacer placer(orientation);
|
||||
|
||||
@@ -29,7 +32,7 @@ WorldLocation ArrowFormation::GetLocationInternal()
|
||||
melee.PlaceUnits(&placer);
|
||||
melee.Move(-cos(orientation) * offset, -sin(orientation) * offset);
|
||||
|
||||
offset += meleeLines * sPlayerbotAIConfig->followDistance;
|
||||
offset += meleeLines * sPlayerbotAIConfig->followDistance + sPlayerbotAIConfig->tooCloseDistance;
|
||||
ranged.PlaceUnits(&placer);
|
||||
ranged.Move(-cos(orientation) * offset, -sin(orientation) * offset);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user