mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
2e9985c1a3
More robust in case the target changes cell or there are multiple targets with the same RefId
46 lines
1.5 KiB
C++
46 lines
1.5 KiB
C++
#ifndef GAME_MWMECHANICS_AIESCORT_H
|
|
#define GAME_MWMECHANICS_AIESCORT_H
|
|
|
|
#include "aipackage.hpp"
|
|
#include <string>
|
|
|
|
#include "pathfinding.hpp"
|
|
|
|
namespace MWMechanics
|
|
{
|
|
/// \brief AI Package to have an NPC lead the player to a specific point
|
|
class AiEscort : public AiPackage
|
|
{
|
|
public:
|
|
/// Implementation of AiEscort
|
|
/** The Actor will escort the specified actor to the world position x, y, z until they reach their position, or they run out of time
|
|
\implement AiEscort **/
|
|
AiEscort(const MWWorld::Ptr& actor,int duration, float x, float y, float z);
|
|
/// Implementation of AiEscortCell
|
|
/** The Actor will escort the specified actor to the cell position x, y, z until they reach their position, or they run out of time
|
|
\implement AiEscortCell **/
|
|
AiEscort(const MWWorld::Ptr& actor,const std::string &cellId,int duration, float x, float y, float z);
|
|
|
|
virtual AiEscort *clone() const;
|
|
|
|
virtual bool execute (const MWWorld::Ptr& actor,float duration);
|
|
|
|
virtual int getTypeId() const;
|
|
|
|
private:
|
|
int mActorId;
|
|
std::string mCellId;
|
|
float mX;
|
|
float mY;
|
|
float mZ;
|
|
float mMaxDist;
|
|
unsigned int mStartingSecond;
|
|
unsigned int mDuration;
|
|
|
|
PathFinder mPathFinder;
|
|
int mCellX;
|
|
int mCellY;
|
|
};
|
|
}
|
|
#endif
|