mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-17 10:45:43 +00:00
Stay strategy improvement (#1072)
* - Stay Strategy work in combat and with RTSC * - Fixed summon with stay strategy * - Added new stay strategy support for chat commands
This commit is contained in:
@@ -14,6 +14,12 @@ bool ReachTargetAction::Execute(Event event) { return ReachCombatTo(AI_VALUE(Uni
|
||||
|
||||
bool ReachTargetAction::isUseful()
|
||||
{
|
||||
// do not move while staying
|
||||
if (botAI->HasStrategy("stay", botAI->GetState()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// do not move while casting
|
||||
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr)
|
||||
{
|
||||
@@ -30,6 +36,12 @@ std::string const ReachTargetAction::GetTargetName() { return "current target";
|
||||
|
||||
bool CastReachTargetSpellAction::isUseful()
|
||||
{
|
||||
// do not move while staying
|
||||
if (botAI->HasStrategy("stay", botAI->GetState()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "current target"),
|
||||
(distance + sPlayerbotAIConfig->contactDistance));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user