forked from mirror/openmw-tes3mp
[Server] Add StatsFunctions that get/set damage to attributes/skills
This commit is contained in:
parent
9fc4c83858
commit
bd677726bf
2 changed files with 96 additions and 0 deletions
|
@ -201,6 +201,17 @@ int StatsFunctions::GetAttributeModifier(unsigned short pid, unsigned short attr
|
|||
return player->creatureStats.mAttributes[attributeId].mMod;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetAttributeDamage(unsigned short pid, unsigned short attributeId) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
if (attributeId >= Attribute::Length)
|
||||
return 0;
|
||||
|
||||
return player->creatureStats.mAttributes[attributeId].mDamage;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetSkillBase(unsigned short pid, unsigned short skillId) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -223,6 +234,17 @@ int StatsFunctions::GetSkillModifier(unsigned short pid, unsigned short skillId)
|
|||
return player->npcStats.mSkills[skillId].mMod;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetSkillDamage(unsigned short pid, unsigned short skillId) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
if (skillId >= Skill::Length)
|
||||
return 0;
|
||||
|
||||
return player->npcStats.mSkills[skillId].mDamage;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetSkillProgress(unsigned short pid, unsigned short skillId) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -437,6 +459,20 @@ void StatsFunctions::ClearAttributeModifier(unsigned short pid, unsigned short a
|
|||
player->attributeIndexChanges.push_back(attributeId);
|
||||
}
|
||||
|
||||
void StatsFunctions::SetAttributeDamage(unsigned short pid, unsigned short attributeId, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
if (attributeId >= Attribute::Length)
|
||||
return;
|
||||
|
||||
player->creatureStats.mAttributes[attributeId].mDamage = value;
|
||||
|
||||
if (!Utils::vectorContains(player->attributeIndexChanges, attributeId))
|
||||
player->attributeIndexChanges.push_back(attributeId);
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillBase(unsigned short pid, unsigned short skillId, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -465,6 +501,20 @@ void StatsFunctions::ClearSkillModifier(unsigned short pid, unsigned short skill
|
|||
player->skillIndexChanges.push_back(skillId);
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillDamage(unsigned short pid, unsigned short skillId, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
if (skillId >= Skill::Length)
|
||||
return;
|
||||
|
||||
player->npcStats.mSkills[skillId].mDamage = value;
|
||||
|
||||
if (!Utils::vectorContains(player->skillIndexChanges, skillId))
|
||||
player->skillIndexChanges.push_back(skillId);
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillProgress(unsigned short pid, unsigned short skillId, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
|
|
@ -30,9 +30,11 @@
|
|||
\
|
||||
{"GetAttributeBase", StatsFunctions::GetAttributeBase},\
|
||||
{"GetAttributeModifier", StatsFunctions::GetAttributeModifier},\
|
||||
{"GetAttributeDamage", StatsFunctions::GetAttributeDamage},\
|
||||
\
|
||||
{"GetSkillBase", StatsFunctions::GetSkillBase},\
|
||||
{"GetSkillModifier", StatsFunctions::GetSkillModifier},\
|
||||
{"GetSkillDamage", StatsFunctions::GetSkillDamage},\
|
||||
{"GetSkillProgress", StatsFunctions::GetSkillProgress},\
|
||||
{"GetSkillIncrease", StatsFunctions::GetSkillIncrease},\
|
||||
\
|
||||
|
@ -58,9 +60,11 @@
|
|||
\
|
||||
{"SetAttributeBase", StatsFunctions::SetAttributeBase},\
|
||||
{"ClearAttributeModifier", StatsFunctions::ClearAttributeModifier},\
|
||||
{"SetAttributeDamage", StatsFunctions::SetAttributeDamage},\
|
||||
\
|
||||
{"SetSkillBase", StatsFunctions::SetSkillBase},\
|
||||
{"ClearSkillModifier", StatsFunctions::ClearSkillModifier},\
|
||||
{"SetSkillDamage", StatsFunctions::SetSkillDamage},\
|
||||
{"SetSkillProgress", StatsFunctions::SetSkillProgress},\
|
||||
{"SetSkillIncrease", StatsFunctions::SetSkillIncrease},\
|
||||
\
|
||||
|
@ -267,6 +271,16 @@ public:
|
|||
*/
|
||||
static int GetAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Get the amount of damage (as caused through the Damage Attribute effect)
|
||||
* to a player's attribute.
|
||||
*
|
||||
* \param pid The player ID.
|
||||
* \param attributeId The attribute ID.
|
||||
* \return The amount of damage to the attribute.
|
||||
*/
|
||||
static double GetAttributeDamage(unsigned short pid, unsigned short attributeId) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Get the base value of a player's skill.
|
||||
*
|
||||
|
@ -285,6 +299,16 @@ public:
|
|||
*/
|
||||
static int GetSkillModifier(unsigned short pid, unsigned short skillId) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Get the amount of damage (as caused through the Damage Skill effect)
|
||||
* to a player's skill.
|
||||
*
|
||||
* \param pid The player ID.
|
||||
* \param skillId The skill ID.
|
||||
* \return The amount of damage to the skill.
|
||||
*/
|
||||
static double GetSkillDamage(unsigned short pid, unsigned short skillId) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Get the progress the player has made towards increasing a certain skill by 1.
|
||||
*
|
||||
|
@ -477,6 +501,17 @@ public:
|
|||
*/
|
||||
static void ClearAttributeModifier(unsigned short pid, unsigned short attributeId) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Set the amount of damage (as caused through the Damage Attribute effect) to
|
||||
* a player's attribute.
|
||||
*
|
||||
* \param pid The player ID.
|
||||
* \param attributeId The attribute ID.
|
||||
* \param value The amount of damage to the player's attribute.
|
||||
* \return void
|
||||
*/
|
||||
static void SetAttributeDamage(unsigned short pid, unsigned short attributeId, double value) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Set the base value of a player's skill.
|
||||
*
|
||||
|
@ -501,6 +536,17 @@ public:
|
|||
*/
|
||||
static void ClearSkillModifier(unsigned short pid, unsigned short skillId) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Set the amount of damage (as caused through the Damage Skill effect) to
|
||||
* a player's skill.
|
||||
*
|
||||
* \param pid The player ID.
|
||||
* \param skillId The skill ID.
|
||||
* \param value The amount of damage to the player's skill.
|
||||
* \return void
|
||||
*/
|
||||
static void SetSkillDamage(unsigned short pid, unsigned short skillId, double value) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Set the progress the player has made towards increasing a certain skill by 1.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue