forked from teamnwah/openmw-tes3coop
Add server stat functions for getting and setting skill progress
This commit is contained in:
parent
6ae4cc15e4
commit
ae4950ce49
2 changed files with 27 additions and 0 deletions
|
@ -386,6 +386,28 @@ void StatsFunctions::SetSkillCurrent(unsigned short pid, unsigned short skill, i
|
|||
player->NpcStats()->mSkills[skill].mCurrent = value;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetSkillProgress(unsigned short pid, unsigned short skill) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
if (skill >= Skill::Length)
|
||||
return 0;
|
||||
|
||||
return player->NpcStats()->mSkills[skill].mProgress;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillProgress(unsigned short pid, unsigned short skill, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
if (skill >= Skill::Length)
|
||||
return;
|
||||
|
||||
player->NpcStats()->mSkills[skill].mProgress = value;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetSkillIncrease(unsigned short pid, unsigned int pos) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
|
|
@ -38,10 +38,13 @@
|
|||
{"SetAttributeBase", StatsFunctions::SetAttributeBase},\
|
||||
{"GetAttributeCurrent", StatsFunctions::GetAttributeCurrent},\
|
||||
{"SetAttributeCurrent", StatsFunctions::SetAttributeCurrent},\
|
||||
\
|
||||
{"GetSkillBase", StatsFunctions::GetSkillBase},\
|
||||
{"SetSkillBase", StatsFunctions::SetSkillBase},\
|
||||
{"GetSkillCurrent", StatsFunctions::GetSkillCurrent},\
|
||||
{"SetSkillCurrent", StatsFunctions::SetSkillCurrent},\
|
||||
{"GetSkillProgress", StatsFunctions::GetSkillProgress},\
|
||||
{"SetSkillProgress", StatsFunctions::SetSkillProgress},\
|
||||
\
|
||||
{"GetHealthBase", StatsFunctions::GetHealthBase},\
|
||||
{"SetHealthBase", StatsFunctions::SetHealthBase},\
|
||||
|
@ -125,6 +128,8 @@ public:
|
|||
static void SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept;
|
||||
static int GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept;
|
||||
static void SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept;
|
||||
static int GetSkillProgress(unsigned short pid, unsigned short skill) noexcept;
|
||||
static void SetSkillProgress(unsigned short pid, unsigned short skill, int value) noexcept;
|
||||
|
||||
static int GetSkillIncrease(unsigned short pid, unsigned int pos) noexcept;
|
||||
static void SetSkillIncrease(unsigned short pid, unsigned int pos, int value) noexcept;
|
||||
|
|
Loading…
Reference in a new issue