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:
kadeshar
2025-03-20 10:53:16 +01:00
committed by GitHub
parent f039e88393
commit 3d6d454337
19 changed files with 244 additions and 44 deletions

View File

@@ -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));
}