forked from mirror/openmw-tes3mp
[Server] Clean up order for StatsFunctions
This commit is contained in:
parent
03c56e01f9
commit
9d7142f684
2 changed files with 392 additions and 394 deletions
|
@ -15,250 +15,6 @@
|
|||
using namespace std;
|
||||
using namespace ESM;
|
||||
|
||||
void StatsFunctions::SetName(unsigned short pid, const char *name) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (player->npc.mName == name)
|
||||
return;
|
||||
|
||||
player->npc.mName = name;
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetName(unsigned short pid) noexcept
|
||||
{
|
||||
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npc.mName.c_str();
|
||||
}
|
||||
|
||||
void StatsFunctions::SetBirthsign(unsigned short pid, const char *sign) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (player->birthsign == sign)
|
||||
return;
|
||||
|
||||
player->birthsign = sign;
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetBirthsign(unsigned short pid) noexcept
|
||||
{
|
||||
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->birthsign.c_str();
|
||||
}
|
||||
|
||||
void StatsFunctions::SetRace(unsigned short pid, const char *race) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (player->npc.mRace == race)
|
||||
return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Setting race for %s: %s -> %s", player->npc.mName.c_str(),
|
||||
player->npc.mRace.c_str(), race);
|
||||
|
||||
player->npc.mRace = race;
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetRace(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npc.mRace.c_str();
|
||||
}
|
||||
|
||||
void StatsFunctions::SetHead(unsigned short pid, const char *head) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (player->npc.mHead == head)
|
||||
return;
|
||||
|
||||
player->npc.mHead = head;
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetHead(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npc.mHead.c_str();
|
||||
}
|
||||
|
||||
void StatsFunctions::SetHairstyle(unsigned short pid, const char *style) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (player->npc.mHair == style)
|
||||
return;
|
||||
|
||||
player->npc.mHair = style;
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetHairstyle(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npc.mHair.c_str();
|
||||
}
|
||||
|
||||
int StatsFunctions::GetIsMale(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,false);
|
||||
|
||||
return player->npc.isMale();
|
||||
}
|
||||
|
||||
void StatsFunctions::SetIsMale(unsigned short pid, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->npc.setIsMale(value == true);
|
||||
}
|
||||
|
||||
int StatsFunctions::GetLevel(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->creatureStats.mLevel;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetLevel(unsigned short pid, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
player->creatureStats.mLevel = value;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetLevelProgress(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npcStats.mLevelProgress;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetLevelProgress(unsigned short pid, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
player->npcStats.mLevelProgress = value;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetHealthBase(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[0].mBase;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetHealthBase(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[0].mBase = value;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetHealthCurrent(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[0].mCurrent;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetHealthCurrent(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[0].mCurrent = value;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetMagickaBase(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[1].mBase;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetMagickaBase(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[1].mBase = value;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetMagickaCurrent(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[1].mCurrent;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetMagickaCurrent(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[1].mCurrent = value;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetFatigueBase(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[2].mBase;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetFatigueBase(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[2].mBase = value;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetFatigueCurrent(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[2].mCurrent;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetFatigueCurrent(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[2].mCurrent = value;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetAttributeCount() noexcept
|
||||
{
|
||||
return Attribute::Length;
|
||||
|
@ -311,6 +67,120 @@ const char *StatsFunctions::GetSkillName(unsigned short skill) noexcept
|
|||
return Skill::sSkillNames[skill].c_str();
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetName(unsigned short pid) noexcept
|
||||
{
|
||||
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npc.mName.c_str();
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetRace(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npc.mRace.c_str();
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetHead(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npc.mHead.c_str();
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetHairstyle(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npc.mHair.c_str();
|
||||
}
|
||||
|
||||
int StatsFunctions::GetIsMale(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, false);
|
||||
|
||||
return player->npc.isMale();
|
||||
}
|
||||
|
||||
const char *StatsFunctions::GetBirthsign(unsigned short pid) noexcept
|
||||
{
|
||||
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->birthsign.c_str();
|
||||
}
|
||||
|
||||
int StatsFunctions::GetLevel(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->creatureStats.mLevel;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetLevelProgress(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npcStats.mLevelProgress;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetHealthBase(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[0].mBase;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetHealthCurrent(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[0].mCurrent;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetMagickaBase(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[1].mBase;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetMagickaCurrent(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[1].mCurrent;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetFatigueBase(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[2].mBase;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetFatigueCurrent(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0.0f);
|
||||
|
||||
return player->creatureStats.mDynamic[2].mCurrent;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetAttributeBase(unsigned short pid, unsigned short attribute) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -322,17 +192,6 @@ int StatsFunctions::GetAttributeBase(unsigned short pid, unsigned short attribut
|
|||
return player->creatureStats.mAttributes[attribute].mBase;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (attribute >= Attribute::Length)
|
||||
return;
|
||||
|
||||
player->creatureStats.mAttributes[attribute].mBase = value;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -344,17 +203,6 @@ int StatsFunctions::GetAttributeCurrent(unsigned short pid, unsigned short attri
|
|||
return player->creatureStats.mAttributes[attribute].mCurrent;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (attribute >= Attribute::Length)
|
||||
return;
|
||||
|
||||
player->creatureStats.mAttributes[attribute].mCurrent = value;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetSkillBase(unsigned short pid, unsigned short skill) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -366,17 +214,6 @@ int StatsFunctions::GetSkillBase(unsigned short pid, unsigned short skill) noexc
|
|||
return player->npcStats.mSkills[skill].mBase;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (skill >= Skill::Length)
|
||||
return;
|
||||
|
||||
player->npcStats.mSkills[skill].mBase = value;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -388,17 +225,6 @@ int StatsFunctions::GetSkillCurrent(unsigned short pid, unsigned short skill) no
|
|||
return player->npcStats.mSkills[skill].mCurrent;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (skill >= Skill::Length)
|
||||
return;
|
||||
|
||||
player->npcStats.mSkills[skill].mCurrent = value;
|
||||
}
|
||||
|
||||
double StatsFunctions::GetSkillProgress(unsigned short pid, unsigned short skill) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -410,17 +236,6 @@ double StatsFunctions::GetSkillProgress(unsigned short pid, unsigned short skill
|
|||
return player->npcStats.mSkills[skill].mProgress;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillProgress(unsigned short pid, unsigned short skill, double 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 attribute) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -432,6 +247,199 @@ int StatsFunctions::GetSkillIncrease(unsigned short pid, unsigned int attribute)
|
|||
return player->npcStats.mSkillIncrease[attribute];
|
||||
}
|
||||
|
||||
int StatsFunctions::GetBounty(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npcStats.mBounty;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetName(unsigned short pid, const char *name) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (player->npc.mName == name)
|
||||
return;
|
||||
|
||||
player->npc.mName = name;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetRace(unsigned short pid, const char *race) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (player->npc.mRace == race)
|
||||
return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Setting race for %s: %s -> %s", player->npc.mName.c_str(),
|
||||
player->npc.mRace.c_str(), race);
|
||||
|
||||
player->npc.mRace = race;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetHead(unsigned short pid, const char *head) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (player->npc.mHead == head)
|
||||
return;
|
||||
|
||||
player->npc.mHead = head;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetHairstyle(unsigned short pid, const char *style) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (player->npc.mHair == style)
|
||||
return;
|
||||
|
||||
player->npc.mHair = style;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetIsMale(unsigned short pid, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->npc.setIsMale(value == true);
|
||||
}
|
||||
|
||||
void StatsFunctions::SetBirthsign(unsigned short pid, const char *sign) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
if (player->birthsign == sign)
|
||||
return;
|
||||
|
||||
player->birthsign = sign;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetLevel(unsigned short pid, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
player->creatureStats.mLevel = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetLevelProgress(unsigned short pid, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
player->npcStats.mLevelProgress = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetHealthBase(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[0].mBase = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetHealthCurrent(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[0].mCurrent = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetMagickaBase(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[1].mBase = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetMagickaCurrent(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[1].mCurrent = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetFatigueBase(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[2].mBase = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetFatigueCurrent(unsigned short pid, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
player->creatureStats.mDynamic[2].mCurrent = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (attribute >= Attribute::Length)
|
||||
return;
|
||||
|
||||
player->creatureStats.mAttributes[attribute].mBase = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (attribute >= Attribute::Length)
|
||||
return;
|
||||
|
||||
player->creatureStats.mAttributes[attribute].mCurrent = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (skill >= Skill::Length)
|
||||
return;
|
||||
|
||||
player->npcStats.mSkills[skill].mBase = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player,);
|
||||
|
||||
if (skill >= Skill::Length)
|
||||
return;
|
||||
|
||||
player->npcStats.mSkills[skill].mCurrent = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillProgress(unsigned short pid, unsigned short skill, double value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, );
|
||||
|
||||
if (skill >= Skill::Length)
|
||||
return;
|
||||
|
||||
player->npcStats.mSkills[skill].mProgress = value;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetSkillIncrease(unsigned short pid, unsigned int attribute, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
@ -443,14 +451,6 @@ void StatsFunctions::SetSkillIncrease(unsigned short pid, unsigned int attribute
|
|||
player->npcStats.mSkillIncrease[attribute] = value;
|
||||
}
|
||||
|
||||
int StatsFunctions::GetBounty(unsigned short pid) noexcept
|
||||
{
|
||||
Player *player;
|
||||
GET_PLAYER(pid, player, 0);
|
||||
|
||||
return player->npcStats.mBounty;
|
||||
}
|
||||
|
||||
void StatsFunctions::SetBounty(unsigned short pid, int value) noexcept
|
||||
{
|
||||
Player *player;
|
||||
|
|
|
@ -6,29 +6,6 @@
|
|||
#define OPENMW_STATAPI_HPP
|
||||
|
||||
#define STATAPI \
|
||||
{"GetName", StatsFunctions::GetName},\
|
||||
{"SetName", StatsFunctions::SetName},\
|
||||
\
|
||||
{"GetRace", StatsFunctions::GetRace},\
|
||||
{"SetRace", StatsFunctions::SetRace},\
|
||||
\
|
||||
{"GetHead", StatsFunctions::GetHead},\
|
||||
{"SetHead", StatsFunctions::SetHead},\
|
||||
\
|
||||
{"GetHair", StatsFunctions::GetHairstyle},\
|
||||
{"SetHair", StatsFunctions::SetHairstyle},\
|
||||
\
|
||||
{"GetIsMale", StatsFunctions::GetIsMale},\
|
||||
{"SetIsMale", StatsFunctions::SetIsMale},\
|
||||
\
|
||||
{"GetLevel", StatsFunctions::GetLevel},\
|
||||
{"SetLevel", StatsFunctions::SetLevel},\
|
||||
{"GetLevelProgress", StatsFunctions::GetLevelProgress},\
|
||||
{"SetLevelProgress", StatsFunctions::SetLevelProgress},\
|
||||
\
|
||||
{"GetBirthsign", StatsFunctions::GetBirthsign},\
|
||||
{"SetBirthsign", StatsFunctions::SetBirthsign},\
|
||||
\
|
||||
{"GetAttributeCount", StatsFunctions::GetAttributeCount},\
|
||||
{"GetSkillCount", StatsFunctions::GetSkillCount},\
|
||||
{"GetAttributeId", StatsFunctions::GetAttributeId},\
|
||||
|
@ -36,40 +13,63 @@
|
|||
{"GetAttributeName", StatsFunctions::GetAttributeName},\
|
||||
{"GetSkillName", StatsFunctions::GetSkillName},\
|
||||
\
|
||||
{"GetAttributeBase", StatsFunctions::GetAttributeBase},\
|
||||
{"SetAttributeBase", StatsFunctions::SetAttributeBase},\
|
||||
{"GetAttributeCurrent", StatsFunctions::GetAttributeCurrent},\
|
||||
{"SetAttributeCurrent", StatsFunctions::SetAttributeCurrent},\
|
||||
{"GetName", StatsFunctions::GetName},\
|
||||
{"GetRace", StatsFunctions::GetRace},\
|
||||
{"GetHead", StatsFunctions::GetHead},\
|
||||
{"GetHair", StatsFunctions::GetHairstyle},\
|
||||
{"GetIsMale", StatsFunctions::GetIsMale},\
|
||||
{"GetBirthsign", StatsFunctions::GetBirthsign},\
|
||||
\
|
||||
{"GetSkillBase", StatsFunctions::GetSkillBase},\
|
||||
{"SetSkillBase", StatsFunctions::SetSkillBase},\
|
||||
{"GetSkillCurrent", StatsFunctions::GetSkillCurrent},\
|
||||
{"SetSkillCurrent", StatsFunctions::SetSkillCurrent},\
|
||||
{"GetSkillProgress", StatsFunctions::GetSkillProgress},\
|
||||
{"SetSkillProgress", StatsFunctions::SetSkillProgress},\
|
||||
{"GetLevel", StatsFunctions::GetLevel},\
|
||||
{"GetLevelProgress", StatsFunctions::GetLevelProgress},\
|
||||
\
|
||||
{"GetHealthBase", StatsFunctions::GetHealthBase},\
|
||||
{"SetHealthBase", StatsFunctions::SetHealthBase},\
|
||||
{"GetHealthCurrent", StatsFunctions::GetHealthCurrent},\
|
||||
{"SetHealthCurrent", StatsFunctions::SetHealthCurrent},\
|
||||
\
|
||||
{"GetMagickaBase", StatsFunctions::GetMagickaBase},\
|
||||
{"SetMagickaBase", StatsFunctions::SetMagickaBase},\
|
||||
{"GetMagickaCurrent", StatsFunctions::GetMagickaCurrent},\
|
||||
{"SetMagickaCurrent", StatsFunctions::SetMagickaCurrent},\
|
||||
\
|
||||
{"GetFatigueBase", StatsFunctions::GetFatigueBase},\
|
||||
{"SetFatigueBase", StatsFunctions::SetFatigueBase},\
|
||||
{"GetFatigueCurrent", StatsFunctions::GetFatigueCurrent},\
|
||||
{"SetFatigueCurrent", StatsFunctions::SetFatigueCurrent},\
|
||||
\
|
||||
{"GetAttributeBase", StatsFunctions::GetAttributeBase},\
|
||||
{"GetAttributeCurrent", StatsFunctions::GetAttributeCurrent},\
|
||||
\
|
||||
{"GetSkillBase", StatsFunctions::GetSkillBase},\
|
||||
{"GetSkillCurrent", StatsFunctions::GetSkillCurrent},\
|
||||
{"GetSkillProgress", StatsFunctions::GetSkillProgress},\
|
||||
{"GetSkillIncrease", StatsFunctions::GetSkillIncrease},\
|
||||
{"SetSkillIncrease", StatsFunctions::SetSkillIncrease},\
|
||||
\
|
||||
{"GetBounty", StatsFunctions::GetBounty},\
|
||||
{"SetBounty", StatsFunctions::SetBounty},\
|
||||
\
|
||||
{"SetName", StatsFunctions::SetName},\
|
||||
{"SetRace", StatsFunctions::SetRace},\
|
||||
{"SetHead", StatsFunctions::SetHead},\
|
||||
{"SetHair", StatsFunctions::SetHairstyle},\
|
||||
{"SetIsMale", StatsFunctions::SetIsMale},\
|
||||
{"SetBirthsign", StatsFunctions::SetBirthsign},\
|
||||
\
|
||||
{"SetLevel", StatsFunctions::SetLevel},\
|
||||
{"SetLevelProgress", StatsFunctions::SetLevelProgress},\
|
||||
\
|
||||
{"SetHealthBase", StatsFunctions::SetHealthBase},\
|
||||
{"SetHealthCurrent", StatsFunctions::SetHealthCurrent},\
|
||||
{"SetMagickaBase", StatsFunctions::SetMagickaBase},\
|
||||
{"SetMagickaCurrent", StatsFunctions::SetMagickaCurrent},\
|
||||
{"SetFatigueBase", StatsFunctions::SetFatigueBase},\
|
||||
{"SetFatigueCurrent", StatsFunctions::SetFatigueCurrent},\
|
||||
\
|
||||
{"SetAttributeBase", StatsFunctions::SetAttributeBase},\
|
||||
{"SetAttributeCurrent", StatsFunctions::SetAttributeCurrent},\
|
||||
\
|
||||
{"SetSkillBase", StatsFunctions::SetSkillBase},\
|
||||
{"SetSkillCurrent", StatsFunctions::SetSkillCurrent},\
|
||||
{"SetSkillProgress", StatsFunctions::SetSkillProgress},\
|
||||
{"SetSkillIncrease", StatsFunctions::SetSkillIncrease},\
|
||||
\
|
||||
{"SetBounty", StatsFunctions::SetBounty},\
|
||||
{"SetCharGenStage", StatsFunctions::SetCharGenStage},\
|
||||
\
|
||||
{"Resurrect", StatsFunctions::Resurrect},\
|
||||
{"SendBaseInfo", StatsFunctions::SendBaseInfo},\
|
||||
\
|
||||
|
@ -82,44 +82,6 @@
|
|||
class StatsFunctions
|
||||
{
|
||||
public:
|
||||
static void SetName(unsigned short pid, const char *name) noexcept;
|
||||
static const char *GetName(unsigned short pid) noexcept;
|
||||
|
||||
static void SetBirthsign(unsigned short pid, const char *name) noexcept;
|
||||
static const char *GetBirthsign(unsigned short pid) noexcept;
|
||||
|
||||
static void SetRace(unsigned short pid, const char *race) noexcept;
|
||||
static const char *GetRace(unsigned short pid) noexcept;
|
||||
|
||||
static void SetHead(unsigned short pid, const char *head) noexcept;
|
||||
static const char *GetHead(unsigned short pid) noexcept;
|
||||
|
||||
static void SetHairstyle(unsigned short pid, const char *style) noexcept;
|
||||
static const char *GetHairstyle(unsigned short pid) noexcept;
|
||||
|
||||
static void SetIsMale(unsigned short pid, int male) noexcept;
|
||||
static int GetIsMale(unsigned short pid) noexcept;
|
||||
|
||||
static int GetLevel(unsigned short pid) noexcept;
|
||||
static void SetLevel(unsigned short pid, int value) noexcept;
|
||||
static int GetLevelProgress(unsigned short pid) noexcept;
|
||||
static void SetLevelProgress(unsigned short pid, int value) noexcept;
|
||||
|
||||
static double GetHealthBase(unsigned short pid) noexcept;
|
||||
static void SetHealthBase(unsigned short pid, double value) noexcept;
|
||||
static double GetHealthCurrent(unsigned short pid) noexcept;
|
||||
static void SetHealthCurrent(unsigned short pid, double value) noexcept;
|
||||
|
||||
static double GetMagickaBase(unsigned short pid) noexcept;
|
||||
static void SetMagickaBase(unsigned short pid, double value) noexcept;
|
||||
static double GetMagickaCurrent(unsigned short pid) noexcept;
|
||||
static void SetMagickaCurrent(unsigned short pid, double value) noexcept;
|
||||
|
||||
static double GetFatigueBase(unsigned short pid) noexcept;
|
||||
static void SetFatigueBase(unsigned short pid, double value) noexcept;
|
||||
static double GetFatigueCurrent(unsigned short pid) noexcept;
|
||||
static void SetFatigueCurrent(unsigned short pid, double value) noexcept;
|
||||
|
||||
static int GetAttributeCount() noexcept;
|
||||
static int GetSkillCount() noexcept;
|
||||
static int GetAttributeId(const char *name) noexcept;
|
||||
|
@ -127,26 +89,62 @@ public:
|
|||
static const char *GetAttributeName(unsigned short attribute) noexcept;
|
||||
static const char *GetSkillName(unsigned short skill) noexcept;
|
||||
|
||||
static const char *GetName(unsigned short pid) noexcept;
|
||||
static const char *GetRace(unsigned short pid) noexcept;
|
||||
static const char *GetHead(unsigned short pid) noexcept;
|
||||
static const char *GetHairstyle(unsigned short pid) noexcept;
|
||||
static int GetIsMale(unsigned short pid) noexcept;
|
||||
static const char *GetBirthsign(unsigned short pid) noexcept;
|
||||
|
||||
static int GetLevel(unsigned short pid) noexcept;
|
||||
static int GetLevelProgress(unsigned short pid) noexcept;
|
||||
|
||||
static double GetHealthBase(unsigned short pid) noexcept;
|
||||
static double GetHealthCurrent(unsigned short pid) noexcept;
|
||||
static double GetMagickaBase(unsigned short pid) noexcept;
|
||||
static double GetMagickaCurrent(unsigned short pid) noexcept;
|
||||
static double GetFatigueBase(unsigned short pid) noexcept;
|
||||
static double GetFatigueCurrent(unsigned short pid) noexcept;
|
||||
|
||||
static int GetAttributeBase(unsigned short pid, unsigned short attribute) noexcept;
|
||||
static void SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept;
|
||||
static int GetAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept;
|
||||
static void SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept;
|
||||
|
||||
static int GetSkillBase(unsigned short pid, unsigned short skill) noexcept;
|
||||
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 double GetSkillProgress(unsigned short pid, unsigned short skill) noexcept;
|
||||
static void SetSkillProgress(unsigned short pid, unsigned short skill, double value) noexcept;
|
||||
|
||||
static int GetSkillIncrease(unsigned short pid, unsigned int pos) noexcept;
|
||||
static void SetSkillIncrease(unsigned short pid, unsigned int pos, int value) noexcept;
|
||||
|
||||
static int GetBounty(unsigned short pid) noexcept;
|
||||
|
||||
static void SetName(unsigned short pid, const char *name) noexcept;
|
||||
static void SetRace(unsigned short pid, const char *race) noexcept;
|
||||
static void SetHead(unsigned short pid, const char *head) noexcept;
|
||||
static void SetHairstyle(unsigned short pid, const char *style) noexcept;
|
||||
static void SetIsMale(unsigned short pid, int male) noexcept;
|
||||
static void SetBirthsign(unsigned short pid, const char *name) noexcept;
|
||||
|
||||
static void SetLevel(unsigned short pid, int value) noexcept;
|
||||
static void SetLevelProgress(unsigned short pid, int value) noexcept;
|
||||
|
||||
static void SetHealthBase(unsigned short pid, double value) noexcept;
|
||||
static void SetHealthCurrent(unsigned short pid, double value) noexcept;
|
||||
static void SetMagickaBase(unsigned short pid, double value) noexcept;
|
||||
static void SetMagickaCurrent(unsigned short pid, double value) noexcept;
|
||||
static void SetFatigueBase(unsigned short pid, double value) noexcept;
|
||||
static void SetFatigueCurrent(unsigned short pid, double value) noexcept;
|
||||
|
||||
static void SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept;
|
||||
static void SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept;
|
||||
|
||||
static void SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept;
|
||||
static void SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept;
|
||||
static void SetSkillProgress(unsigned short pid, unsigned short skill, double value) noexcept;
|
||||
static void SetSkillIncrease(unsigned short pid, unsigned int pos, int value) noexcept;
|
||||
|
||||
static void SetBounty(unsigned short pid, int value) noexcept;
|
||||
static void SetCharGenStage(unsigned short pid, int start, int end) noexcept;
|
||||
|
||||
static void Resurrect(unsigned short pid);
|
||||
static void SetCharGenStage(unsigned short pid, int start, int end) noexcept;
|
||||
static void SendBaseInfo(unsigned short pid) noexcept;
|
||||
|
||||
static void SendStatsDynamic(unsigned short pid) noexcept;
|
||||
|
|
Loading…
Reference in a new issue