diff --git a/apps/openmw-mp/Script/Functions/Actors.cpp b/apps/openmw-mp/Script/Functions/Actors.cpp index 4187e2fb1..24e2c5215 100644 --- a/apps/openmw-mp/Script/Functions/Actors.cpp +++ b/apps/openmw-mp/Script/Functions/Actors.cpp @@ -6,6 +6,8 @@ #include #include +#include + #include "Actors.hpp" using namespace mwmp; @@ -88,6 +90,36 @@ double ActorFunctions::GetActorRotZ(unsigned int i) noexcept return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).position.rot[2]; } +double ActorFunctions::GetActorHealthBase(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).creatureStats->mDynamic[0].mBase; +} + +double ActorFunctions::GetActorHealthCurrent(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).creatureStats->mDynamic[0].mCurrent; +} + +double ActorFunctions::GetActorMagickaBase(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).creatureStats->mDynamic[1].mBase; +} + +double ActorFunctions::GetActorMagickaCurrent(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).creatureStats->mDynamic[1].mCurrent; +} + +double ActorFunctions::GetActorFatigueBase(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).creatureStats->mDynamic[2].mBase; +} + +double ActorFunctions::GetActorFatigueCurrent(unsigned int i) noexcept +{ + return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).creatureStats->mDynamic[2].mCurrent; +} + void ActorFunctions::SetScriptActorListCell(const char* cellDescription) noexcept { scriptActorList.cell = Utils::getCellFromDescription(cellDescription); diff --git a/apps/openmw-mp/Script/Functions/Actors.hpp b/apps/openmw-mp/Script/Functions/Actors.hpp index 282074d1d..d0f111a07 100644 --- a/apps/openmw-mp/Script/Functions/Actors.hpp +++ b/apps/openmw-mp/Script/Functions/Actors.hpp @@ -11,6 +11,7 @@ {"GetActorRefId", ActorFunctions::GetActorRefId},\ {"GetActorRefNumIndex", ActorFunctions::GetActorRefNumIndex},\ {"GetActorMpNum", ActorFunctions::GetActorMpNum},\ + \ {"GetActorPosX", ActorFunctions::GetActorPosX},\ {"GetActorPosY", ActorFunctions::GetActorPosY},\ {"GetActorPosZ", ActorFunctions::GetActorPosZ},\ @@ -18,6 +19,13 @@ {"GetActorRotY", ActorFunctions::GetActorRotY},\ {"GetActorRotZ", ActorFunctions::GetActorRotZ},\ \ + {"GetActorHealthBase", ActorFunctions::GetActorHealthBase},\ + {"GetActorHealthCurrent", ActorFunctions::GetActorHealthCurrent},\ + {"GetActorMagickaBase", ActorFunctions::GetActorMagickaBase},\ + {"GetActorMagickaCurrent", ActorFunctions::GetActorMagickaCurrent},\ + {"GetActorFatigueBase", ActorFunctions::GetActorFatigueBase},\ + {"GetActorFatigueCurrent", ActorFunctions::GetActorFatigueCurrent},\ + \ {"SetScriptActorListCell", ActorFunctions::SetScriptActorListCell},\ {"SetScriptActorListAction", ActorFunctions::SetScriptActorListAction},\ \ @@ -47,6 +55,7 @@ public: static const char *GetActorRefId(unsigned int i) noexcept; static int GetActorRefNumIndex(unsigned int i) noexcept; static int GetActorMpNum(unsigned int i) noexcept; + static double GetActorPosX(unsigned int i) noexcept; static double GetActorPosY(unsigned int i) noexcept; static double GetActorPosZ(unsigned int i) noexcept; @@ -54,6 +63,13 @@ public: static double GetActorRotY(unsigned int i) noexcept; static double GetActorRotZ(unsigned int i) noexcept; + static double GetActorHealthBase(unsigned int i) noexcept; + static double GetActorHealthCurrent(unsigned int i) noexcept; + static double GetActorMagickaBase(unsigned int i) noexcept; + static double GetActorMagickaCurrent(unsigned int i) noexcept; + static double GetActorFatigueBase(unsigned int i) noexcept; + static double GetActorFatigueCurrent(unsigned int i) noexcept; + static void SetScriptActorListCell(const char* cellDescription) noexcept; static void SetScriptActorListAction(unsigned char action) noexcept;