mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-15 01:49:09 +00:00
Improve rpg movement and grind
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user