mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-18 03:05:43 +00:00
Allow spell casting during movement
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "LastMovementValue.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
#include "Timer.h"
|
||||
|
||||
LastMovement::LastMovement() { clear(); }
|
||||
|
||||
@@ -38,17 +39,19 @@ void LastMovement::clear()
|
||||
lastAreaTrigger = 0;
|
||||
lastFlee = 0;
|
||||
nextTeleport = 0;
|
||||
msTime = 0;
|
||||
lastdelayTime = 0;
|
||||
}
|
||||
|
||||
void LastMovement::Set(Unit* follow)
|
||||
{
|
||||
Set(0, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
Set(0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
setShort(WorldPosition());
|
||||
setPath(TravelPath());
|
||||
lastFollow = follow;
|
||||
}
|
||||
|
||||
void LastMovement::Set(uint32 mapId, float x, float y, float z, float ori)
|
||||
void LastMovement::Set(uint32 mapId, float x, float y, float z, float ori, float delayTime)
|
||||
{
|
||||
lastMoveToMapId = mapId;
|
||||
lastMoveToX = x;
|
||||
@@ -57,6 +60,8 @@ void LastMovement::Set(uint32 mapId, float x, float y, float z, float ori)
|
||||
lastMoveToOri = ori;
|
||||
lastFollow = nullptr;
|
||||
lastMoveShort = WorldPosition(mapId, x, y, z, ori);
|
||||
msTime = getMSTime();
|
||||
lastdelayTime = delayTime;
|
||||
}
|
||||
|
||||
void LastMovement::setShort(WorldPosition point)
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
void clear();
|
||||
|
||||
void Set(Unit* follow);
|
||||
void Set(uint32 mapId, float x, float y, float z, float ori);
|
||||
void Set(uint32 mapId, float x, float y, float z, float ori, float delayTime);
|
||||
|
||||
void setShort(WorldPosition point);
|
||||
void setPath(TravelPath path);
|
||||
@@ -50,7 +50,9 @@ public:
|
||||
float lastMoveToY;
|
||||
float lastMoveToZ;
|
||||
float lastMoveToOri;
|
||||
float lastdelayTime;
|
||||
WorldPosition lastMoveShort;
|
||||
uint32 msTime;
|
||||
TravelPath lastPath;
|
||||
time_t nextTeleport;
|
||||
std::future<TravelPath> future;
|
||||
|
||||
@@ -82,8 +82,7 @@ bool PartyMemberToHeal::Check(Unit* player)
|
||||
// sServerFacade->GetDistance2d(bot, player) < (player->IsPlayer() && botAI->IsTank((Player*)player) ? 50.0f
|
||||
// : 40.0f);
|
||||
return player->GetMapId() == bot->GetMapId() && !player->IsCharmed() &&
|
||||
bot->GetDistance2d(player) < sPlayerbotAIConfig->healDistance * 2 &&
|
||||
bot->IsWithinLOS(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
bot->GetDistance2d(player) < sPlayerbotAIConfig->healDistance * 2 && bot->IsWithinLOSInMap(player);
|
||||
}
|
||||
|
||||
Unit* PartyMemberToProtect::Calculate()
|
||||
|
||||
Reference in New Issue
Block a user