[Server] Add SetObjectActivatingPid() script function

pull/484/head
David Cernat 6 years ago
parent 17f13872aa
commit 99f8ef88a5

@ -399,6 +399,15 @@ void ObjectFunctions::SetObjectRotation(double x, double y, double z) noexcept
tempObject.position.rot[2] = z; tempObject.position.rot[2] = z;
} }
void ObjectFunctions::SetObjectActivatingPid(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
tempObject.activatingActor.guid = player->guid;
tempObject.activatingActor.isPlayer = true;
}
void ObjectFunctions::SetObjectDoorState(int doorState) noexcept void ObjectFunctions::SetObjectDoorState(int doorState) noexcept
{ {
tempObject.doorState = doorState; tempObject.doorState = doorState;

@ -85,6 +85,8 @@
{"SetObjectPosition", ObjectFunctions::SetObjectPosition},\ {"SetObjectPosition", ObjectFunctions::SetObjectPosition},\
{"SetObjectRotation", ObjectFunctions::SetObjectRotation},\ {"SetObjectRotation", ObjectFunctions::SetObjectRotation},\
\ \
{"SetObjectActivatingPid", ObjectFunctions::SetObjectActivatingPid},\
\
{"SetObjectDoorState", ObjectFunctions::SetObjectDoorState},\ {"SetObjectDoorState", ObjectFunctions::SetObjectDoorState},\
{"SetObjectDoorTeleportState", ObjectFunctions::SetObjectDoorTeleportState},\ {"SetObjectDoorTeleportState", ObjectFunctions::SetObjectDoorTeleportState},\
{"SetObjectDoorDestinationCell", ObjectFunctions::SetObjectDoorDestinationCell},\ {"SetObjectDoorDestinationCell", ObjectFunctions::SetObjectDoorDestinationCell},\
@ -776,6 +778,15 @@ public:
*/ */
static void SetObjectRotation(double x, double y, double z) noexcept; static void SetObjectRotation(double x, double y, double z) noexcept;
/**
* \brief Set the player ID of the player activating the temporary object stored on the
* server. Currently only used for ObjectActivate packets.
*
* \param pid The pid of the player.
* \return void
*/
static void SetObjectActivatingPid(unsigned short pid) noexcept;
/** /**
* \brief Set the door state of the temporary object stored on the server. * \brief Set the door state of the temporary object stored on the server.
* *

Loading…
Cancel
Save