[Server] Add script functions for getting/setting world object rotation

pull/163/head
David Cernat 8 years ago
parent 920c1113a3
commit 6b9fba7885

@ -78,6 +78,13 @@ void WorldFunctions::SetObjectPosition(unsigned int i, double x, double y, doubl
worldEvent->objectChanges.objects[i].pos.pos[2] = z;
}
void WorldFunctions::SetObjectRotation(unsigned int i, double x, double y, double z) noexcept
{
worldEvent->objectChanges.objects[i].pos.rot[0] = x;
worldEvent->objectChanges.objects[i].pos.rot[1] = y;
worldEvent->objectChanges.objects[i].pos.rot[2] = z;
}
unsigned int WorldFunctions::GetObjectChangesSize() noexcept
{
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.count;
@ -118,6 +125,21 @@ double WorldFunctions::GetObjectPosZ(unsigned int i) noexcept
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].pos.pos[2];
}
double WorldFunctions::GetObjectRotX(unsigned int i) noexcept
{
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].pos.rot[0];
}
double WorldFunctions::GetObjectRotY(unsigned int i) noexcept
{
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].pos.rot[1];
}
double WorldFunctions::GetObjectRotZ(unsigned int i) noexcept
{
return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.objects[i].pos.rot[2];
}
void WorldFunctions::SendObjectDelete() noexcept
{
mwmp::Networking::get().getWorldController()->GetPacket(ID_OBJECT_DELETE)->Send(worldEvent, worldEvent->guid);

@ -12,6 +12,7 @@
{"SetObjectCount", WorldFunctions::SetObjectCount},\
{"SetObjectGoldValue", WorldFunctions::SetObjectGoldValue},\
{"SetObjectPosition", WorldFunctions::SetObjectPosition},\
{"SetObjectRotation", WorldFunctions::SetObjectRotation},\
\
{"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\
\
@ -22,6 +23,9 @@
{"GetObjectPosX", WorldFunctions::GetObjectPosX},\
{"GetObjectPosY", WorldFunctions::GetObjectPosY},\
{"GetObjectPosZ", WorldFunctions::GetObjectPosZ},\
{"GetObjectRotX", WorldFunctions::GetObjectRotX},\
{"GetObjectRotY", WorldFunctions::GetObjectRotY},\
{"GetObjectRotZ", WorldFunctions::GetObjectRotZ},\
\
{"SendObjectDelete", WorldFunctions::SendObjectDelete},\
{"SendObjectPlace", WorldFunctions::SendObjectPlace},\
@ -44,6 +48,7 @@ public:
static void SetObjectCount(unsigned int i, int count) noexcept;
static void SetObjectGoldValue(unsigned int i, int goldValue) noexcept;
static void SetObjectPosition(unsigned int i, double x, double y, double z) noexcept;
static void SetObjectRotation(unsigned int i, double x, double y, double z) noexcept;
static unsigned int GetObjectChangesSize() noexcept;
@ -54,6 +59,9 @@ public:
static double GetObjectPosX(unsigned int i) noexcept;
static double GetObjectPosY(unsigned int i) noexcept;
static double GetObjectPosZ(unsigned int i) noexcept;
static double GetObjectRotX(unsigned int i) noexcept;
static double GetObjectRotY(unsigned int i) noexcept;
static double GetObjectRotZ(unsigned int i) noexcept;
static void SendObjectDelete() noexcept;
static void SendObjectPlace() noexcept;

Loading…
Cancel
Save