Movement priority

This commit is contained in:
Yunfan Li
2024-08-14 18:23:24 +08:00
parent 765d0305ef
commit 7b0bb20078
12 changed files with 216 additions and 183 deletions

View File

@@ -32,7 +32,7 @@ bool FollowChatShortcutAction::Execute(Event event)
if (!master)
return false;
botAI->Reset();
// botAI->Reset();
botAI->ChangeStrategy("+follow,-passive,-grind", BOT_STATE_NON_COMBAT);
botAI->ChangeStrategy("-follow,-passive,-grind", BOT_STATE_COMBAT);
botAI->GetAiObjectContext()->GetValue<GuidVector>("prioritized targets")->Set({});
@@ -57,7 +57,9 @@ bool FollowChatShortcutAction::Execute(Event event)
if (Formation::IsNullLocation(loc) || loc.GetMapId() == -1)
return false;
moved = MoveTo(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ());
MovementPriority priority = botAI->GetState() == BOT_STATE_COMBAT ? MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_NORMAL;
moved = MoveTo(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ(), false, false, false,
true, priority);
}
if (moved)