razuvious strategy

This commit is contained in:
Yunfan Li
2023-07-18 21:00:49 +08:00
parent 67a23fae3f
commit 9c1bb63d10
21 changed files with 326 additions and 265 deletions

View File

@@ -7,6 +7,7 @@
#include "Formations.h"
#include "Playerbots.h"
#include "ServerFacade.h"
#include <cstddef>
bool FollowAction::Execute(Event event)
{
@@ -23,8 +24,8 @@ bool FollowAction::Execute(Event event)
WorldLocation loc = formation->GetLocation();
if (Formation::IsNullLocation(loc) || loc.GetMapId() == -1)
return false;
moved = MoveTo(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ());
moved = MoveTo(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ() + 2.0f);
}
if (Pet* pet = bot->GetPet())
@@ -47,6 +48,9 @@ bool FollowAction::Execute(Event event)
bool FollowAction::isUseful()
{
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr) {
return false;
}
Formation* formation = AI_VALUE(Formation*, "formation");
std::string const target = formation->GetTargetName();

View File

@@ -1255,6 +1255,14 @@ bool FleeAction::Execute(Event event)
return MoveAway(AI_VALUE(Unit*, "current target"));
}
bool FleeAction::isUseful()
{
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr) {
return false;
}
return true;
}
bool FleeWithPetAction::Execute(Event event)
{
if (Pet* pet = bot->GetPet())

View File

@@ -48,6 +48,7 @@ class FleeAction : public MovementAction
FleeAction(PlayerbotAI* botAI, float distance = sPlayerbotAIConfig->spellDistance) : MovementAction(botAI, "flee"), distance(distance) { }
bool Execute(Event event) override;
bool isUseful() override;
private:
float distance;