mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 16:11:37 -04:00
[Server] Add script functions for setting actor cells and positions
This commit is contained in:
parent
9c5eb47e90
commit
a71dbc7d09
@ -95,6 +95,11 @@ void ActorFunctions::SetScriptActorListAction(unsigned char action) noexcept
|
|||||||
scriptActorList.action = action;
|
scriptActorList.action = action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SetActorCell(const char* cellDescription) noexcept
|
||||||
|
{
|
||||||
|
tempActor.cell = Utils::getCellFromDescription(cellDescription);
|
||||||
|
}
|
||||||
|
|
||||||
void ActorFunctions::SetActorRefId(const char* refId) noexcept
|
void ActorFunctions::SetActorRefId(const char* refId) noexcept
|
||||||
{
|
{
|
||||||
tempActor.refId = refId;
|
tempActor.refId = refId;
|
||||||
@ -110,6 +115,20 @@ void ActorFunctions::SetActorMpNum(int mpNum) noexcept
|
|||||||
tempActor.mpNum = mpNum;
|
tempActor.mpNum = mpNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SetActorPosition(double x, double y, double z) noexcept
|
||||||
|
{
|
||||||
|
tempActor.position.pos[0] = x;
|
||||||
|
tempActor.position.pos[1] = y;
|
||||||
|
tempActor.position.pos[2] = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SetActorRotation(double x, double y, double z) noexcept
|
||||||
|
{
|
||||||
|
tempActor.position.rot[0] = x;
|
||||||
|
tempActor.position.rot[1] = y;
|
||||||
|
tempActor.position.rot[2] = z;
|
||||||
|
}
|
||||||
|
|
||||||
void ActorFunctions::AddActor() noexcept
|
void ActorFunctions::AddActor() noexcept
|
||||||
{
|
{
|
||||||
scriptActorList.baseActors.push_back(tempActor);
|
scriptActorList.baseActors.push_back(tempActor);
|
||||||
@ -129,3 +148,9 @@ void ActorFunctions::SendActorAuthority() noexcept
|
|||||||
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_AUTHORITY)->Send(scriptActorList.guid);
|
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_AUTHORITY)->Send(scriptActorList.guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SendActorCellChange() noexcept
|
||||||
|
{
|
||||||
|
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_CELL_CHANGE)->setActorList(&scriptActorList);
|
||||||
|
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_CELL_CHANGE)->Send(scriptActorList.guid);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -21,14 +21,18 @@
|
|||||||
{"SetScriptActorListCell", ActorFunctions::SetScriptActorListCell},\
|
{"SetScriptActorListCell", ActorFunctions::SetScriptActorListCell},\
|
||||||
{"SetScriptActorListAction", ActorFunctions::SetScriptActorListAction},\
|
{"SetScriptActorListAction", ActorFunctions::SetScriptActorListAction},\
|
||||||
\
|
\
|
||||||
|
{"SetActorCell", ActorFunctions::SetActorCell},\
|
||||||
{"SetActorRefId", ActorFunctions::SetActorRefId},\
|
{"SetActorRefId", ActorFunctions::SetActorRefId},\
|
||||||
{"SetActorRefNumIndex", ActorFunctions::SetActorRefNumIndex},\
|
{"SetActorRefNumIndex", ActorFunctions::SetActorRefNumIndex},\
|
||||||
{"SetActorMpNum", ActorFunctions::SetActorMpNum},\
|
{"SetActorMpNum", ActorFunctions::SetActorMpNum},\
|
||||||
|
{"SetActorPosition", ActorFunctions::SetActorPosition},\
|
||||||
|
{"SetActorRotation", ActorFunctions::SetActorRotation},\
|
||||||
\
|
\
|
||||||
{"AddActor", ActorFunctions::AddActor},\
|
{"AddActor", ActorFunctions::AddActor},\
|
||||||
\
|
\
|
||||||
{"SendActorList", ActorFunctions::SendActorList},\
|
{"SendActorList", ActorFunctions::SendActorList},\
|
||||||
{"SendActorAuthority", ActorFunctions::SendActorAuthority}
|
{"SendActorAuthority", ActorFunctions::SendActorAuthority},\
|
||||||
|
{"SendActorCellChange", ActorFunctions::SendActorCellChange}
|
||||||
|
|
||||||
class ActorFunctions
|
class ActorFunctions
|
||||||
{
|
{
|
||||||
@ -53,14 +57,18 @@ public:
|
|||||||
static void SetScriptActorListCell(const char* cellDescription) noexcept;
|
static void SetScriptActorListCell(const char* cellDescription) noexcept;
|
||||||
static void SetScriptActorListAction(unsigned char action) noexcept;
|
static void SetScriptActorListAction(unsigned char action) noexcept;
|
||||||
|
|
||||||
|
static void SetActorCell(const char* cellDescription) noexcept;
|
||||||
static void SetActorRefId(const char* refId) noexcept;
|
static void SetActorRefId(const char* refId) noexcept;
|
||||||
static void SetActorRefNumIndex(int refNumIndex) noexcept;
|
static void SetActorRefNumIndex(int refNumIndex) noexcept;
|
||||||
static void SetActorMpNum(int mpNum) noexcept;
|
static void SetActorMpNum(int mpNum) noexcept;
|
||||||
|
static void SetActorPosition(double x, double y, double z) noexcept;
|
||||||
|
static void SetActorRotation(double x, double y, double z) noexcept;
|
||||||
|
|
||||||
static void AddActor() noexcept;
|
static void AddActor() noexcept;
|
||||||
|
|
||||||
static void SendActorList() noexcept;
|
static void SendActorList() noexcept;
|
||||||
static void SendActorAuthority() noexcept;
|
static void SendActorAuthority() noexcept;
|
||||||
|
static void SendActorCellChange() noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user