|
|
@ -6,7 +6,7 @@
|
|
|
|
#include <apps/openmw-mp/Utils.hpp>
|
|
|
|
#include <apps/openmw-mp/Utils.hpp>
|
|
|
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
|
|
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
#include "World.hpp"
|
|
|
|
#include "Objects.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
using namespace mwmp;
|
|
|
|
using namespace mwmp;
|
|
|
|
|
|
|
|
|
|
|
@ -19,12 +19,12 @@ const BaseObject emptyObject = {};
|
|
|
|
ContainerItem tempContainerItem;
|
|
|
|
ContainerItem tempContainerItem;
|
|
|
|
const ContainerItem emptyContainerItem = {};
|
|
|
|
const ContainerItem emptyContainerItem = {};
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::ReadLastObjectList() noexcept
|
|
|
|
void ObjectFunctions::ReadLastObjectList() noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
readObjectList = mwmp::Networking::getPtr()->getLastObjectList();
|
|
|
|
readObjectList = mwmp::Networking::getPtr()->getLastObjectList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::InitializeObjectList(unsigned short pid) noexcept
|
|
|
|
void ObjectFunctions::InitializeObjectList(unsigned short pid) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
@ -34,259 +34,259 @@ void WorldFunctions::InitializeObjectList(unsigned short pid) noexcept
|
|
|
|
writeObjectList.guid = player->guid;
|
|
|
|
writeObjectList.guid = player->guid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int WorldFunctions::GetObjectChangesSize() noexcept
|
|
|
|
unsigned int ObjectFunctions::GetObjectChangesSize() noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjectCount;
|
|
|
|
return readObjectList->baseObjectCount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char WorldFunctions::GetObjectListAction() noexcept
|
|
|
|
unsigned char ObjectFunctions::GetObjectListAction() noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->action;
|
|
|
|
return readObjectList->action;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char WorldFunctions::GetObjectListContainerSubAction() noexcept
|
|
|
|
unsigned char ObjectFunctions::GetObjectListContainerSubAction() noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->containerSubAction;
|
|
|
|
return readObjectList->containerSubAction;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const char *WorldFunctions::GetObjectRefId(unsigned int i) noexcept
|
|
|
|
const char *ObjectFunctions::GetObjectRefId(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).refId.c_str();
|
|
|
|
return readObjectList->baseObjects.at(i).refId.c_str();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetObjectRefNumIndex(unsigned int i) noexcept
|
|
|
|
int ObjectFunctions::GetObjectRefNumIndex(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).refNumIndex;
|
|
|
|
return readObjectList->baseObjects.at(i).refNumIndex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetObjectMpNum(unsigned int i) noexcept
|
|
|
|
int ObjectFunctions::GetObjectMpNum(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).mpNum;
|
|
|
|
return readObjectList->baseObjects.at(i).mpNum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetObjectCount(unsigned int i) noexcept
|
|
|
|
int ObjectFunctions::GetObjectCount(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).count;
|
|
|
|
return readObjectList->baseObjects.at(i).count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetObjectCharge(unsigned int i) noexcept
|
|
|
|
int ObjectFunctions::GetObjectCharge(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).charge;
|
|
|
|
return readObjectList->baseObjects.at(i).charge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double WorldFunctions::GetObjectEnchantmentCharge(unsigned int i) noexcept
|
|
|
|
double ObjectFunctions::GetObjectEnchantmentCharge(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).enchantmentCharge;
|
|
|
|
return readObjectList->baseObjects.at(i).enchantmentCharge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetObjectGoldValue(unsigned int i) noexcept
|
|
|
|
int ObjectFunctions::GetObjectGoldValue(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).goldValue;
|
|
|
|
return readObjectList->baseObjects.at(i).goldValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double WorldFunctions::GetObjectScale(unsigned int i) noexcept
|
|
|
|
double ObjectFunctions::GetObjectScale(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).scale;
|
|
|
|
return readObjectList->baseObjects.at(i).scale;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool WorldFunctions::GetObjectState(unsigned int i) noexcept
|
|
|
|
bool ObjectFunctions::GetObjectState(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).objectState;
|
|
|
|
return readObjectList->baseObjects.at(i).objectState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetObjectDoorState(unsigned int i) noexcept
|
|
|
|
int ObjectFunctions::GetObjectDoorState(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).doorState;
|
|
|
|
return readObjectList->baseObjects.at(i).doorState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetObjectLockLevel(unsigned int i) noexcept
|
|
|
|
int ObjectFunctions::GetObjectLockLevel(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).lockLevel;
|
|
|
|
return readObjectList->baseObjects.at(i).lockLevel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double WorldFunctions::GetObjectPosX(unsigned int i) noexcept
|
|
|
|
double ObjectFunctions::GetObjectPosX(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).position.pos[0];
|
|
|
|
return readObjectList->baseObjects.at(i).position.pos[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double WorldFunctions::GetObjectPosY(unsigned int i) noexcept
|
|
|
|
double ObjectFunctions::GetObjectPosY(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).position.pos[1];
|
|
|
|
return readObjectList->baseObjects.at(i).position.pos[1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double WorldFunctions::GetObjectPosZ(unsigned int i) noexcept
|
|
|
|
double ObjectFunctions::GetObjectPosZ(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).position.pos[2];
|
|
|
|
return readObjectList->baseObjects.at(i).position.pos[2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double WorldFunctions::GetObjectRotX(unsigned int i) noexcept
|
|
|
|
double ObjectFunctions::GetObjectRotX(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).position.rot[0];
|
|
|
|
return readObjectList->baseObjects.at(i).position.rot[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double WorldFunctions::GetObjectRotY(unsigned int i) noexcept
|
|
|
|
double ObjectFunctions::GetObjectRotY(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).position.rot[1];
|
|
|
|
return readObjectList->baseObjects.at(i).position.rot[1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double WorldFunctions::GetObjectRotZ(unsigned int i) noexcept
|
|
|
|
double ObjectFunctions::GetObjectRotZ(unsigned int i) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(i).position.rot[2];
|
|
|
|
return readObjectList->baseObjects.at(i).position.rot[2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int WorldFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
|
|
|
|
unsigned int ObjectFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(objectIndex).containerItemCount;
|
|
|
|
return readObjectList->baseObjects.at(objectIndex).containerItemCount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const char *WorldFunctions::GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
const char *ObjectFunctions::GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
.containerItems.at(itemIndex).refId.c_str();
|
|
|
|
.containerItems.at(itemIndex).refId.c_str();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
int ObjectFunctions::GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
.containerItems.at(itemIndex).count;
|
|
|
|
.containerItems.at(itemIndex).count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
int ObjectFunctions::GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
.containerItems.at(itemIndex).charge;
|
|
|
|
.containerItems.at(itemIndex).charge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double WorldFunctions::GetContainerItemEnchantmentCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
double ObjectFunctions::GetContainerItemEnchantmentCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
.containerItems.at(itemIndex).enchantmentCharge;
|
|
|
|
.containerItems.at(itemIndex).enchantmentCharge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WorldFunctions::GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
int ObjectFunctions::GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
return readObjectList->baseObjects.at(objectIndex)
|
|
|
|
.containerItems.at(itemIndex).actionCount;
|
|
|
|
.containerItems.at(itemIndex).actionCount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectListCell(const char* cellDescription) noexcept
|
|
|
|
void ObjectFunctions::SetObjectListCell(const char* cellDescription) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
writeObjectList.cell = Utils::getCellFromDescription(cellDescription);
|
|
|
|
writeObjectList.cell = Utils::getCellFromDescription(cellDescription);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectListAction(unsigned char action) noexcept
|
|
|
|
void ObjectFunctions::SetObjectListAction(unsigned char action) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
writeObjectList.action = action;
|
|
|
|
writeObjectList.action = action;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectListConsoleCommand(const char* consoleCommand) noexcept
|
|
|
|
void ObjectFunctions::SetObjectListConsoleCommand(const char* consoleCommand) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
writeObjectList.consoleCommand = consoleCommand;
|
|
|
|
writeObjectList.consoleCommand = consoleCommand;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectRefId(const char* refId) noexcept
|
|
|
|
void ObjectFunctions::SetObjectRefId(const char* refId) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.refId = refId;
|
|
|
|
tempObject.refId = refId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectRefNumIndex(int refNumIndex) noexcept
|
|
|
|
void ObjectFunctions::SetObjectRefNumIndex(int refNumIndex) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.refNumIndex = refNumIndex;
|
|
|
|
tempObject.refNumIndex = refNumIndex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectMpNum(int mpNum) noexcept
|
|
|
|
void ObjectFunctions::SetObjectMpNum(int mpNum) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.mpNum = mpNum;
|
|
|
|
tempObject.mpNum = mpNum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectCount(int count) noexcept
|
|
|
|
void ObjectFunctions::SetObjectCount(int count) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.count = count;
|
|
|
|
tempObject.count = count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectCharge(int charge) noexcept
|
|
|
|
void ObjectFunctions::SetObjectCharge(int charge) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.charge = charge;
|
|
|
|
tempObject.charge = charge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectEnchantmentCharge(double enchantmentCharge) noexcept
|
|
|
|
void ObjectFunctions::SetObjectEnchantmentCharge(double enchantmentCharge) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.enchantmentCharge = enchantmentCharge;
|
|
|
|
tempObject.enchantmentCharge = enchantmentCharge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectGoldValue(int goldValue) noexcept
|
|
|
|
void ObjectFunctions::SetObjectGoldValue(int goldValue) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.goldValue = goldValue;
|
|
|
|
tempObject.goldValue = goldValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectScale(double scale) noexcept
|
|
|
|
void ObjectFunctions::SetObjectScale(double scale) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.scale = scale;
|
|
|
|
tempObject.scale = scale;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectState(bool objectState) noexcept
|
|
|
|
void ObjectFunctions::SetObjectState(bool objectState) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.objectState = objectState;
|
|
|
|
tempObject.objectState = objectState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectLockLevel(int lockLevel) noexcept
|
|
|
|
void ObjectFunctions::SetObjectLockLevel(int lockLevel) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.lockLevel = lockLevel;
|
|
|
|
tempObject.lockLevel = lockLevel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectDisarmState(bool disarmState) noexcept
|
|
|
|
void ObjectFunctions::SetObjectDisarmState(bool disarmState) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.isDisarmed = disarmState;
|
|
|
|
tempObject.isDisarmed = disarmState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectMasterState(bool masterState) noexcept
|
|
|
|
void ObjectFunctions::SetObjectMasterState(bool masterState) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.hasMaster = masterState;
|
|
|
|
tempObject.hasMaster = masterState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectPosition(double x, double y, double z) noexcept
|
|
|
|
void ObjectFunctions::SetObjectPosition(double x, double y, double z) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.position.pos[0] = x;
|
|
|
|
tempObject.position.pos[0] = x;
|
|
|
|
tempObject.position.pos[1] = y;
|
|
|
|
tempObject.position.pos[1] = y;
|
|
|
|
tempObject.position.pos[2] = z;
|
|
|
|
tempObject.position.pos[2] = z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectRotation(double x, double y, double z) noexcept
|
|
|
|
void ObjectFunctions::SetObjectRotation(double x, double y, double z) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.position.rot[0] = x;
|
|
|
|
tempObject.position.rot[0] = x;
|
|
|
|
tempObject.position.rot[1] = y;
|
|
|
|
tempObject.position.rot[1] = y;
|
|
|
|
tempObject.position.rot[2] = z;
|
|
|
|
tempObject.position.rot[2] = z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectDoorState(int doorState) noexcept
|
|
|
|
void ObjectFunctions::SetObjectDoorState(int doorState) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.doorState = doorState;
|
|
|
|
tempObject.doorState = doorState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectDoorTeleportState(bool teleportState) noexcept
|
|
|
|
void ObjectFunctions::SetObjectDoorTeleportState(bool teleportState) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.teleportState = teleportState;
|
|
|
|
tempObject.teleportState = teleportState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectDoorDestinationCell(const char* cellDescription) noexcept
|
|
|
|
void ObjectFunctions::SetObjectDoorDestinationCell(const char* cellDescription) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.destinationCell = Utils::getCellFromDescription(cellDescription);
|
|
|
|
tempObject.destinationCell = Utils::getCellFromDescription(cellDescription);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectDoorDestinationPosition(double x, double y, double z) noexcept
|
|
|
|
void ObjectFunctions::SetObjectDoorDestinationPosition(double x, double y, double z) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.destinationPosition.pos[0] = x;
|
|
|
|
tempObject.destinationPosition.pos[0] = x;
|
|
|
|
tempObject.destinationPosition.pos[1] = y;
|
|
|
|
tempObject.destinationPosition.pos[1] = y;
|
|
|
|
tempObject.destinationPosition.pos[2] = z;
|
|
|
|
tempObject.destinationPosition.pos[2] = z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetObjectDoorDestinationRotation(double x, double z) noexcept
|
|
|
|
void ObjectFunctions::SetObjectDoorDestinationRotation(double x, double z) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.destinationPosition.rot[0] = x;
|
|
|
|
tempObject.destinationPosition.rot[0] = x;
|
|
|
|
tempObject.destinationPosition.rot[2] = z;
|
|
|
|
tempObject.destinationPosition.rot[2] = z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetPlayerAsObject(unsigned short pid) noexcept
|
|
|
|
void ObjectFunctions::SetPlayerAsObject(unsigned short pid) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
@ -295,32 +295,32 @@ void WorldFunctions::SetPlayerAsObject(unsigned short pid) noexcept
|
|
|
|
tempObject.isPlayer = true;
|
|
|
|
tempObject.isPlayer = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetContainerItemRefId(const char* refId) noexcept
|
|
|
|
void ObjectFunctions::SetContainerItemRefId(const char* refId) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempContainerItem.refId = refId;
|
|
|
|
tempContainerItem.refId = refId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetContainerItemCount(int count) noexcept
|
|
|
|
void ObjectFunctions::SetContainerItemCount(int count) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempContainerItem.count = count;
|
|
|
|
tempContainerItem.count = count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetContainerItemCharge(int charge) noexcept
|
|
|
|
void ObjectFunctions::SetContainerItemCharge(int charge) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempContainerItem.charge = charge;
|
|
|
|
tempContainerItem.charge = charge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept
|
|
|
|
void ObjectFunctions::SetContainerItemEnchantmentCharge(double enchantmentCharge) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempContainerItem.enchantmentCharge = enchantmentCharge;
|
|
|
|
tempContainerItem.enchantmentCharge = enchantmentCharge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetReceivedContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex, int actionCount) noexcept
|
|
|
|
void ObjectFunctions::SetReceivedContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex, int actionCount) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
readObjectList->baseObjects.at(objectIndex).containerItems.at(itemIndex).actionCount = actionCount;
|
|
|
|
readObjectList->baseObjects.at(objectIndex).containerItems.at(itemIndex).actionCount = actionCount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::AddObject() noexcept
|
|
|
|
void ObjectFunctions::AddObject() noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.droppedByPlayer = false;
|
|
|
|
tempObject.droppedByPlayer = false;
|
|
|
|
writeObjectList.baseObjects.push_back(tempObject);
|
|
|
|
writeObjectList.baseObjects.push_back(tempObject);
|
|
|
@ -328,14 +328,14 @@ void WorldFunctions::AddObject() noexcept
|
|
|
|
tempObject = emptyObject;
|
|
|
|
tempObject = emptyObject;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::AddContainerItem() noexcept
|
|
|
|
void ObjectFunctions::AddContainerItem() noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tempObject.containerItems.push_back(tempContainerItem);
|
|
|
|
tempObject.containerItems.push_back(tempContainerItem);
|
|
|
|
|
|
|
|
|
|
|
|
tempContainerItem = emptyContainerItem;
|
|
|
|
tempContainerItem = emptyContainerItem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendObjectPlace(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendObjectPlace(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_PLACE);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_PLACE);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -345,7 +345,7 @@ void WorldFunctions::SendObjectPlace(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendObjectSpawn(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SPAWN);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SPAWN);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -355,7 +355,7 @@ void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendObjectDelete(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendObjectDelete(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_DELETE);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_DELETE);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -365,7 +365,7 @@ void WorldFunctions::SendObjectDelete(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendObjectLock(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendObjectLock(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_LOCK);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_LOCK);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -375,7 +375,7 @@ void WorldFunctions::SendObjectLock(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendObjectTrap(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendObjectTrap(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_TRAP);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_TRAP);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -385,7 +385,7 @@ void WorldFunctions::SendObjectTrap(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendObjectScale(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendObjectScale(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SCALE);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SCALE);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -395,7 +395,7 @@ void WorldFunctions::SendObjectScale(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendObjectState(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendObjectState(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_STATE);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_STATE);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -405,7 +405,7 @@ void WorldFunctions::SendObjectState(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendDoorState(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendDoorState(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_STATE);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_STATE);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -415,7 +415,7 @@ void WorldFunctions::SendDoorState(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendDoorDestination(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendDoorDestination(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_DESTINATION);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_DESTINATION);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -425,7 +425,7 @@ void WorldFunctions::SendDoorDestination(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendContainer(bool broadcast, bool useLastReadObjectList) noexcept
|
|
|
|
void ObjectFunctions::SendContainer(bool broadcast, bool useLastReadObjectList) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
|
|
|
|
|
|
|
|
|
|
|
@ -440,7 +440,7 @@ void WorldFunctions::SendContainer(bool broadcast, bool useLastReadObjectList) n
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SendConsoleCommand(bool broadcast) noexcept
|
|
|
|
void ObjectFunctions::SendConsoleCommand(bool broadcast) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONSOLE_COMMAND);
|
|
|
|
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONSOLE_COMMAND);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
|
packet->setObjectList(&writeObjectList);
|
|
|
@ -450,7 +450,7 @@ void WorldFunctions::SendConsoleCommand(bool broadcast) noexcept
|
|
|
|
packet->Send(true);
|
|
|
|
packet->Send(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetHour(unsigned short pid, double hour) noexcept
|
|
|
|
void ObjectFunctions::SetHour(unsigned short pid, double hour) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
@ -463,7 +463,7 @@ void WorldFunctions::SetHour(unsigned short pid, double hour) noexcept
|
|
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GAME_TIME)->Send(false);
|
|
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GAME_TIME)->Send(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetMonth(unsigned short pid, int month) noexcept
|
|
|
|
void ObjectFunctions::SetMonth(unsigned short pid, int month) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
@ -477,7 +477,7 @@ void WorldFunctions::SetMonth(unsigned short pid, int month) noexcept
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WorldFunctions::SetDay(unsigned short pid, int day) noexcept
|
|
|
|
void ObjectFunctions::SetDay(unsigned short pid, int day) noexcept
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
GET_PLAYER(pid, player,);
|