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

@@ -11,6 +11,7 @@
#include "GridNotifiersImpl.h"
#include "PlayerbotAIConfig.h"
#include "Playerbots.h"
#include "PositionValue.h"
bool UseMeetingStoneAction::Execute(Event event)
{
@@ -224,6 +225,16 @@ bool SummonAction::Teleport(Player* summoner, Player* player)
player->GetMotionMaster()->Clear();
AI_VALUE(LastMovement&, "last movement").clear();
player->TeleportTo(mapId, x, y, z, 0);
if (botAI->HasStrategy("stay", botAI->GetState()))
{
PositionMap& posMap = AI_VALUE(PositionMap&, "position");
PositionInfo stayPosition = posMap["stay"];
stayPosition.Set(x,y, z, mapId);
posMap["stay"] = stayPosition;
}
return true;
}
}