forked from mirror/openmw-tes3mp
[Server] Add script functions for setting actor dynamic stats
This commit is contained in:
parent
9d7142f684
commit
6ff9091afd
2 changed files with 54 additions and 0 deletions
|
@ -164,6 +164,36 @@ void ActorFunctions::SetActorRotation(double x, double y, double z) noexcept
|
||||||
tempActor.position.rot[2] = z;
|
tempActor.position.rot[2] = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SetActorHealthBase(double value) noexcept
|
||||||
|
{
|
||||||
|
tempActor.creatureStats->mDynamic[0].mBase = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SetActorHealthCurrent(double value) noexcept
|
||||||
|
{
|
||||||
|
tempActor.creatureStats->mDynamic[0].mCurrent = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SetActorMagickaBase(double value) noexcept
|
||||||
|
{
|
||||||
|
tempActor.creatureStats->mDynamic[1].mBase = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SetActorMagickaCurrent(double value) noexcept
|
||||||
|
{
|
||||||
|
tempActor.creatureStats->mDynamic[1].mCurrent = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SetActorFatigueBase(double value) noexcept
|
||||||
|
{
|
||||||
|
tempActor.creatureStats->mDynamic[2].mBase = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActorFunctions::SetActorFatigueCurrent(double value) noexcept
|
||||||
|
{
|
||||||
|
tempActor.creatureStats->mDynamic[2].mCurrent = value;
|
||||||
|
}
|
||||||
|
|
||||||
void ActorFunctions::AddActor() noexcept
|
void ActorFunctions::AddActor() noexcept
|
||||||
{
|
{
|
||||||
scriptActorList.baseActors.push_back(tempActor);
|
scriptActorList.baseActors.push_back(tempActor);
|
||||||
|
@ -183,6 +213,12 @@ 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::SendActorStatsDynamic() noexcept
|
||||||
|
{
|
||||||
|
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_STATS_DYNAMIC)->setActorList(&scriptActorList);
|
||||||
|
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_STATS_DYNAMIC)->Send(scriptActorList.guid);
|
||||||
|
}
|
||||||
|
|
||||||
void ActorFunctions::SendActorCellChange() noexcept
|
void ActorFunctions::SendActorCellChange() noexcept
|
||||||
{
|
{
|
||||||
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_CELL_CHANGE)->setActorList(&scriptActorList);
|
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_CELL_CHANGE)->setActorList(&scriptActorList);
|
||||||
|
|
|
@ -33,13 +33,22 @@
|
||||||
{"SetActorRefId", ActorFunctions::SetActorRefId},\
|
{"SetActorRefId", ActorFunctions::SetActorRefId},\
|
||||||
{"SetActorRefNumIndex", ActorFunctions::SetActorRefNumIndex},\
|
{"SetActorRefNumIndex", ActorFunctions::SetActorRefNumIndex},\
|
||||||
{"SetActorMpNum", ActorFunctions::SetActorMpNum},\
|
{"SetActorMpNum", ActorFunctions::SetActorMpNum},\
|
||||||
|
\
|
||||||
{"SetActorPosition", ActorFunctions::SetActorPosition},\
|
{"SetActorPosition", ActorFunctions::SetActorPosition},\
|
||||||
{"SetActorRotation", ActorFunctions::SetActorRotation},\
|
{"SetActorRotation", ActorFunctions::SetActorRotation},\
|
||||||
\
|
\
|
||||||
|
{"SetActorHealthBase", ActorFunctions::SetActorHealthBase},\
|
||||||
|
{"SetActorHealthCurrent", ActorFunctions::SetActorHealthCurrent},\
|
||||||
|
{"SetActorMagickaBase", ActorFunctions::SetActorMagickaBase},\
|
||||||
|
{"SetActorMagickaCurrent", ActorFunctions::SetActorMagickaCurrent},\
|
||||||
|
{"SetActorFatigueBase", ActorFunctions::SetActorFatigueBase},\
|
||||||
|
{"SetActorFatigueCurrent", ActorFunctions::SetActorFatigueCurrent},\
|
||||||
|
\
|
||||||
{"AddActor", ActorFunctions::AddActor},\
|
{"AddActor", ActorFunctions::AddActor},\
|
||||||
\
|
\
|
||||||
{"SendActorList", ActorFunctions::SendActorList},\
|
{"SendActorList", ActorFunctions::SendActorList},\
|
||||||
{"SendActorAuthority", ActorFunctions::SendActorAuthority},\
|
{"SendActorAuthority", ActorFunctions::SendActorAuthority},\
|
||||||
|
{"SendActorStatsDynamic", ActorFunctions::SendActorStatsDynamic},\
|
||||||
{"SendActorCellChange", ActorFunctions::SendActorCellChange}
|
{"SendActorCellChange", ActorFunctions::SendActorCellChange}
|
||||||
|
|
||||||
class ActorFunctions
|
class ActorFunctions
|
||||||
|
@ -77,13 +86,22 @@ public:
|
||||||
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 SetActorPosition(double x, double y, double z) noexcept;
|
||||||
static void SetActorRotation(double x, double y, double z) noexcept;
|
static void SetActorRotation(double x, double y, double z) noexcept;
|
||||||
|
|
||||||
|
static void SetActorHealthBase(double value) noexcept;
|
||||||
|
static void SetActorHealthCurrent(double value) noexcept;
|
||||||
|
static void SetActorMagickaBase(double value) noexcept;
|
||||||
|
static void SetActorMagickaCurrent(double value) noexcept;
|
||||||
|
static void SetActorFatigueBase(double value) noexcept;
|
||||||
|
static void SetActorFatigueCurrent(double value) 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 SendActorStatsDynamic() noexcept;
|
||||||
static void SendActorCellChange() noexcept;
|
static void SendActorCellChange() noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue