[Server] Add script functions for getting and setting actor dynamic stat modifiers

pull/249/merge
David Cernat 8 years ago
parent 79351c737e
commit f02ed0d621

@ -113,6 +113,11 @@ double ActorFunctions::GetActorHealthCurrent(unsigned int i) noexcept
return readActorList->baseActors.at(i).creatureStats.mDynamic[0].mCurrent;
}
double ActorFunctions::GetActorHealthModified(unsigned int i) noexcept
{
return readActorList->baseActors.at(i).creatureStats.mDynamic[0].mMod;
}
double ActorFunctions::GetActorMagickaBase(unsigned int i) noexcept
{
return readActorList->baseActors.at(i).creatureStats.mDynamic[1].mBase;
@ -123,6 +128,11 @@ double ActorFunctions::GetActorMagickaCurrent(unsigned int i) noexcept
return readActorList->baseActors.at(i).creatureStats.mDynamic[1].mCurrent;
}
double ActorFunctions::GetActorMagickaModified(unsigned int i) noexcept
{
return readActorList->baseActors.at(i).creatureStats.mDynamic[1].mMod;
}
double ActorFunctions::GetActorFatigueBase(unsigned int i) noexcept
{
return readActorList->baseActors.at(i).creatureStats.mDynamic[2].mBase;
@ -133,6 +143,11 @@ double ActorFunctions::GetActorFatigueCurrent(unsigned int i) noexcept
return readActorList->baseActors.at(i).creatureStats.mDynamic[2].mCurrent;
}
double ActorFunctions::GetActorFatigueModified(unsigned int i) noexcept
{
return readActorList->baseActors.at(i).creatureStats.mDynamic[2].mMod;
}
const char *ActorFunctions::GetActorEquipmentItemRefId(unsigned int i, unsigned short slot) noexcept
{
return readActorList->baseActors.at(i).equipedItems[slot].refId.c_str();
@ -212,6 +227,11 @@ void ActorFunctions::SetActorHealthCurrent(double value) noexcept
tempActor.creatureStats.mDynamic[0].mCurrent = value;
}
void ActorFunctions::SetActorHealthModified(double value) noexcept
{
tempActor.creatureStats.mDynamic[0].mMod = value;
}
void ActorFunctions::SetActorMagickaBase(double value) noexcept
{
tempActor.creatureStats.mDynamic[1].mBase = value;
@ -222,6 +242,11 @@ void ActorFunctions::SetActorMagickaCurrent(double value) noexcept
tempActor.creatureStats.mDynamic[1].mCurrent = value;
}
void ActorFunctions::SetActorMagickaModified(double value) noexcept
{
tempActor.creatureStats.mDynamic[1].mMod = value;
}
void ActorFunctions::SetActorFatigueBase(double value) noexcept
{
tempActor.creatureStats.mDynamic[2].mBase = value;
@ -232,6 +257,11 @@ void ActorFunctions::SetActorFatigueCurrent(double value) noexcept
tempActor.creatureStats.mDynamic[2].mCurrent = value;
}
void ActorFunctions::SetActorFatigueModified(double value) noexcept
{
tempActor.creatureStats.mDynamic[2].mMod = value;
}
void ActorFunctions::EquipActorItem(unsigned short slot, const char *refId, unsigned int count, int charge) noexcept
{
tempActor.equipedItems[slot].refId = refId;

@ -23,10 +23,13 @@
\
{"GetActorHealthBase", ActorFunctions::GetActorHealthBase},\
{"GetActorHealthCurrent", ActorFunctions::GetActorHealthCurrent},\
{"GetActorHealthModified", ActorFunctions::GetActorHealthModified},\
{"GetActorMagickaBase", ActorFunctions::GetActorMagickaBase},\
{"GetActorMagickaCurrent", ActorFunctions::GetActorMagickaCurrent},\
{"GetActorMagickaModified", ActorFunctions::GetActorMagickaModified},\
{"GetActorFatigueBase", ActorFunctions::GetActorFatigueBase},\
{"GetActorFatigueCurrent", ActorFunctions::GetActorFatigueCurrent},\
{"GetActorFatigueModified", ActorFunctions::GetActorFatigueModified},\
\
{"GetActorEquipmentItemRefId", ActorFunctions::GetActorEquipmentItemRefId},\
{"GetActorEquipmentItemCount", ActorFunctions::GetActorEquipmentItemCount},\
@ -48,10 +51,13 @@
\
{"SetActorHealthBase", ActorFunctions::SetActorHealthBase},\
{"SetActorHealthCurrent", ActorFunctions::SetActorHealthCurrent},\
{"SetActorHealthModified", ActorFunctions::SetActorHealthModified},\
{"SetActorMagickaBase", ActorFunctions::SetActorMagickaBase},\
{"SetActorMagickaCurrent", ActorFunctions::SetActorMagickaCurrent},\
{"SetActorMagickaModified", ActorFunctions::SetActorMagickaModified},\
{"SetActorFatigueBase", ActorFunctions::SetActorFatigueBase},\
{"SetActorFatigueCurrent", ActorFunctions::SetActorFatigueCurrent},\
{"SetActorFatigueModified", ActorFunctions::SetActorFatigueModified},\
\
{"EquipActorItem", ActorFunctions::EquipActorItem},\
{"UnequipActorItem", ActorFunctions::UnequipActorItem},\
@ -90,10 +96,13 @@ public:
static double GetActorHealthBase(unsigned int i) noexcept;
static double GetActorHealthCurrent(unsigned int i) noexcept;
static double GetActorHealthModified(unsigned int i) noexcept;
static double GetActorMagickaBase(unsigned int i) noexcept;
static double GetActorMagickaCurrent(unsigned int i) noexcept;
static double GetActorMagickaModified(unsigned int i) noexcept;
static double GetActorFatigueBase(unsigned int i) noexcept;
static double GetActorFatigueCurrent(unsigned int i) noexcept;
static double GetActorFatigueModified(unsigned int i) noexcept;
static const char *GetActorEquipmentItemRefId(unsigned int i, unsigned short slot) noexcept;
static int GetActorEquipmentItemCount(unsigned int i, unsigned short slot) noexcept;
@ -115,10 +124,13 @@ public:
static void SetActorHealthBase(double value) noexcept;
static void SetActorHealthCurrent(double value) noexcept;
static void SetActorHealthModified(double value) noexcept;
static void SetActorMagickaBase(double value) noexcept;
static void SetActorMagickaCurrent(double value) noexcept;
static void SetActorMagickaModified(double value) noexcept;
static void SetActorFatigueBase(double value) noexcept;
static void SetActorFatigueCurrent(double value) noexcept;
static void SetActorFatigueModified(double value) noexcept;
static void EquipActorItem(unsigned short slot, const char* refId, unsigned int count, int charge) noexcept;
static void UnequipActorItem(unsigned short slot) noexcept;

Loading…
Cancel
Save