Improve rpg movement and grind

This commit is contained in:
Yunfan Li
2025-01-01 20:41:40 +08:00
parent da1c3effb7
commit 9d34a58435
3 changed files with 16 additions and 14 deletions

View File

@@ -8,6 +8,7 @@
#include "ChooseRpgTargetAction.h"
#include "Event.h"
#include "LootObjectStack.h"
#include "NewRpgStrategy.h"
#include "Playerbots.h"
#include "PossibleRpgTargetsValue.h"
#include "PvpTriggers.h"
@@ -35,19 +36,24 @@ bool AttackAnythingAction::isUseful()
if (!AI_VALUE(bool, "can move around"))
return false;
if (context->GetValue<TravelTarget*>("travel target")->Get()->isTraveling() &&
ChooseRpgTargetAction::isFollowValid(
bot, *context->GetValue<TravelTarget*>("travel target")->Get()->getPosition())) // Bot is traveling
return false;
// if (bot->IsInCombat()) {
// if (context->GetValue<TravelTarget*>("travel target")->Get()->isTraveling() &&
// ChooseRpgTargetAction::isFollowValid(
// bot, *context->GetValue<TravelTarget*>("travel target")->Get()->getPosition())) // Bot is traveling
// return false;
// }
Unit* target = GetTarget();
if (!target)
return false;
bool rpgGoStatus = botAI->rpgInfo.status == NewRpgStatus::GO_GRIND ||
botAI->rpgInfo.status == NewRpgStatus::GO_INNKEEPER;
if (rpgGoStatus && bot->GetDistance(target) > 25.0f)
return false;
std::string const name = std::string(target->GetName());
// Check for invalid targets: Dummy, Charge Target, Melee Target, Ranged Target
if (!name.empty() &&
@@ -59,10 +65,6 @@ bool AttackAnythingAction::isUseful()
return false; // Target is one of the disallowed types
}
// if (!ChooseRpgTargetAction::isFollowValid(bot, target)) //Do not grind mobs far
// away from master.
// return false;
return true;
}