mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 09:07:19 +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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user