|
|
|
@ -4,19 +4,89 @@
|
|
|
|
|
#include "../Types.hpp"
|
|
|
|
|
|
|
|
|
|
#define MECHANICSAPI \
|
|
|
|
|
{"IsWerewolf", MechanicsFunctions::IsWerewolf},\
|
|
|
|
|
{"GetMiscellaneousChangeType", MechanicsFunctions::GetMiscellaneousChangeType},\
|
|
|
|
|
\
|
|
|
|
|
{"SetWerewolfState", MechanicsFunctions::SetWerewolfState},\
|
|
|
|
|
{"GetMarkCell", MechanicsFunctions::GetMarkCell},\
|
|
|
|
|
{"GetMarkPosX", MechanicsFunctions::GetMarkPosX},\
|
|
|
|
|
{"GetMarkPosY", MechanicsFunctions::GetMarkPosY},\
|
|
|
|
|
{"GetMarkPosZ", MechanicsFunctions::GetMarkPosZ},\
|
|
|
|
|
{"GetMarkRotX", MechanicsFunctions::GetMarkRotX},\
|
|
|
|
|
{"GetMarkRotZ", MechanicsFunctions::GetMarkRotZ},\
|
|
|
|
|
\
|
|
|
|
|
{"SendShapeshift", MechanicsFunctions::SendShapeshift},\
|
|
|
|
|
{"IsWerewolf", MechanicsFunctions::IsWerewolf},\
|
|
|
|
|
\
|
|
|
|
|
{"Jail", MechanicsFunctions::Jail},\
|
|
|
|
|
{"Resurrect", MechanicsFunctions::Resurrect}
|
|
|
|
|
{"SetMarkCell", MechanicsFunctions::SetMarkCell},\
|
|
|
|
|
{"SetMarkPos", MechanicsFunctions::SetMarkPos},\
|
|
|
|
|
{"SetMarkRot", MechanicsFunctions::SetMarkRot},\
|
|
|
|
|
\
|
|
|
|
|
{"SetWerewolfState", MechanicsFunctions::SetWerewolfState},\
|
|
|
|
|
\
|
|
|
|
|
{"SendMarkLocation", MechanicsFunctions::SendMarkLocation},\
|
|
|
|
|
{"SendShapeshift", MechanicsFunctions::SendShapeshift},\
|
|
|
|
|
\
|
|
|
|
|
{"Jail", MechanicsFunctions::Jail},\
|
|
|
|
|
{"Resurrect", MechanicsFunctions::Resurrect}
|
|
|
|
|
|
|
|
|
|
class MechanicsFunctions
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Get the type of a PlayerMiscellaneous packet.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \return The type.
|
|
|
|
|
*/
|
|
|
|
|
static unsigned char GetMiscellaneousChangeType(unsigned short pid) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Get the cell description of a player's Mark cell.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \return The cell description.
|
|
|
|
|
*/
|
|
|
|
|
static const char *GetMarkCell(unsigned short pid) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Get the X position of a player's Mark.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \return The X position.
|
|
|
|
|
*/
|
|
|
|
|
static double GetMarkPosX(unsigned short pid) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Get the Y position of a player's Mark.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \return The Y position.
|
|
|
|
|
*/
|
|
|
|
|
static double GetMarkPosY(unsigned short pid) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Get the Z position of a player's Mark.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \return The Z position.
|
|
|
|
|
*/
|
|
|
|
|
static double GetMarkPosZ(unsigned short pid) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Get the X rotation of a player's Mark.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \return The X rotation.
|
|
|
|
|
*/
|
|
|
|
|
static double GetMarkRotX(unsigned short pid) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Get the Z rotation of a player's Mark.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \return The X rotation.
|
|
|
|
|
*/
|
|
|
|
|
static double GetMarkRotZ(unsigned short pid) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Check whether a player is a werewolf.
|
|
|
|
|
*
|
|
|
|
@ -27,6 +97,48 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
static bool IsWerewolf(unsigned short pid) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Set the Mark cell of a player.
|
|
|
|
|
*
|
|
|
|
|
* This changes the Mark cell recorded for that player in the server memory, but does not by itself
|
|
|
|
|
* send a packet.
|
|
|
|
|
*
|
|
|
|
|
* The cell is determined to be an exterior cell if it fits the pattern of a number followed
|
|
|
|
|
* by a comma followed by another number.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \param cellDescription The cell description.
|
|
|
|
|
* \return void
|
|
|
|
|
*/
|
|
|
|
|
static void SetMarkCell(unsigned short pid, const char *cellDescription) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Set the Mark position of a player.
|
|
|
|
|
*
|
|
|
|
|
* This changes the Mark positional coordinates recorded for that player in the server memory, but
|
|
|
|
|
* does not by itself send a packet.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \param x The X position.
|
|
|
|
|
* \param y The Y position.
|
|
|
|
|
* \param z The Z position.
|
|
|
|
|
* \return void
|
|
|
|
|
*/
|
|
|
|
|
static void SetMarkPos(unsigned short pid, double x, double y, double z) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Set the Mark rotation of a player.
|
|
|
|
|
*
|
|
|
|
|
* This changes the Mark positional coordinates recorded for that player in the server memory, but
|
|
|
|
|
* does not by itself send a packet.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \param x The X rotation.
|
|
|
|
|
* \param z The Z rotation.
|
|
|
|
|
* \return void
|
|
|
|
|
*/
|
|
|
|
|
static void SetMarkRot(unsigned short pid, double x, double z) noexcept;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Set the werewolf state of a player.
|
|
|
|
|
*
|
|
|
|
@ -39,6 +151,14 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
static void SetWerewolfState(unsigned short pid, bool isWerewolf);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Send a PlayerMiscellaneous packet with a Mark location to a player.
|
|
|
|
|
*
|
|
|
|
|
* \param pid The player ID.
|
|
|
|
|
* \return void
|
|
|
|
|
*/
|
|
|
|
|
static void SendMarkLocation(unsigned short pid);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Send a PlayerShapeshift packet about a player.
|
|
|
|
|
*
|
|
|
|
|