|
|
|
@ -15,77 +15,73 @@
|
|
|
|
|
using namespace std;
|
|
|
|
|
using namespace ESM;
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetName(unsigned short pid, const char *name) noexcept
|
|
|
|
|
int StatsFunctions::GetAttributeCount() noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (player->npc.mName == name)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
player->npc.mName = name;
|
|
|
|
|
return Attribute::Length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *StatsFunctions::GetName(unsigned short pid) noexcept
|
|
|
|
|
int StatsFunctions::GetSkillCount() noexcept
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
return player->npc.mName.c_str();
|
|
|
|
|
return Skill::Length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetBirthsign(unsigned short pid, const char *sign) noexcept
|
|
|
|
|
int StatsFunctions::GetAttributeId(const char *name) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (player->birthsign == sign)
|
|
|
|
|
return;
|
|
|
|
|
for (int x = 0; x < Attribute::Length; x++)
|
|
|
|
|
{
|
|
|
|
|
if (Misc::StringUtils::ciEqual(name, Attribute::sAttributeNames[x]))
|
|
|
|
|
{
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
player->birthsign = sign;
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *StatsFunctions::GetBirthsign(unsigned short pid) noexcept
|
|
|
|
|
int StatsFunctions::GetSkillId(const char *name) noexcept
|
|
|
|
|
{
|
|
|
|
|
for (int x = 0; x < Skill::Length; x++)
|
|
|
|
|
{
|
|
|
|
|
if (Misc::StringUtils::ciEqual(name, Skill::sSkillNames[x]))
|
|
|
|
|
{
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
return player->birthsign.c_str();
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetRace(unsigned short pid, const char *race) noexcept
|
|
|
|
|
const char *StatsFunctions::GetAttributeName(unsigned short attribute) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return "invalid";
|
|
|
|
|
|
|
|
|
|
if (player->npc.mRace == race)
|
|
|
|
|
return;
|
|
|
|
|
return Attribute::sAttributeNames[attribute].c_str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Setting race for %s: %s -> %s", player->npc.mName.c_str(),
|
|
|
|
|
player->npc.mRace.c_str(), race);
|
|
|
|
|
const char *StatsFunctions::GetSkillName(unsigned short skill) noexcept
|
|
|
|
|
{
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
return "invalid";
|
|
|
|
|
|
|
|
|
|
player->npc.mRace = race;
|
|
|
|
|
return Skill::sSkillNames[skill].c_str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *StatsFunctions::GetRace(unsigned short pid) noexcept
|
|
|
|
|
const char *StatsFunctions::GetName(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
return player->npc.mRace.c_str();
|
|
|
|
|
return player->npc.mName.c_str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetHead(unsigned short pid, const char *head) noexcept
|
|
|
|
|
const char *StatsFunctions::GetRace(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (player->npc.mHead == head)
|
|
|
|
|
return;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
player->npc.mHead = head;
|
|
|
|
|
return player->npc.mRace.c_str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *StatsFunctions::GetHead(unsigned short pid) noexcept
|
|
|
|
@ -96,17 +92,6 @@ const char *StatsFunctions::GetHead(unsigned short pid) noexcept
|
|
|
|
|
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;
|
|
|
|
@ -118,17 +103,18 @@ const char *StatsFunctions::GetHairstyle(unsigned short pid) noexcept
|
|
|
|
|
int StatsFunctions::GetIsMale(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,false);
|
|
|
|
|
GET_PLAYER(pid, player, false);
|
|
|
|
|
|
|
|
|
|
return player->npc.isMale();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetIsMale(unsigned short pid, int value) noexcept
|
|
|
|
|
const char *StatsFunctions::GetBirthsign(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
player->npc.setIsMale(value == true);
|
|
|
|
|
return player->birthsign.c_str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetLevel(unsigned short pid) noexcept
|
|
|
|
@ -139,256 +125,289 @@ int StatsFunctions::GetLevel(unsigned short pid) noexcept
|
|
|
|
|
return player->creatureStats.mLevel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetLevel(unsigned short pid, int value) noexcept
|
|
|
|
|
int StatsFunctions::GetLevelProgress(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mLevel = value;
|
|
|
|
|
return player->npcStats.mLevelProgress;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetLevelProgress(unsigned short pid) noexcept
|
|
|
|
|
double StatsFunctions::GetHealthBase(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
|
|
|
|
|
return player->npcStats.mLevelProgress;
|
|
|
|
|
return player->creatureStats.mDynamic[0].mBase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetLevelProgress(unsigned short pid, int value) noexcept
|
|
|
|
|
double StatsFunctions::GetHealthCurrent(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
|
|
|
|
|
player->npcStats.mLevelProgress = value;
|
|
|
|
|
return player->creatureStats.mDynamic[0].mCurrent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double StatsFunctions::GetHealthBase(unsigned short pid) noexcept
|
|
|
|
|
double StatsFunctions::GetMagickaBase(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mDynamic[0].mBase;
|
|
|
|
|
return player->creatureStats.mDynamic[1].mBase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetHealthBase(unsigned short pid, double value) noexcept
|
|
|
|
|
double StatsFunctions::GetMagickaCurrent(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mDynamic[0].mBase = value;
|
|
|
|
|
return player->creatureStats.mDynamic[1].mCurrent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double StatsFunctions::GetHealthCurrent(unsigned short pid) noexcept
|
|
|
|
|
double StatsFunctions::GetFatigueBase(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mDynamic[0].mCurrent;
|
|
|
|
|
return player->creatureStats.mDynamic[2].mBase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetHealthCurrent(unsigned short pid, double value) noexcept
|
|
|
|
|
double StatsFunctions::GetFatigueCurrent(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mDynamic[0].mCurrent = value;
|
|
|
|
|
return player->creatureStats.mDynamic[2].mCurrent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double StatsFunctions::GetMagickaBase(unsigned short pid) noexcept
|
|
|
|
|
int StatsFunctions::GetAttributeBase(unsigned short pid, unsigned short attribute) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mDynamic[1].mBase;
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mAttributes[attribute].mBase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetMagickaBase(unsigned short pid, double value) noexcept
|
|
|
|
|
int StatsFunctions::GetAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mDynamic[1].mBase = value;
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mAttributes[attribute].mCurrent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double StatsFunctions::GetMagickaCurrent(unsigned short pid) noexcept
|
|
|
|
|
int StatsFunctions::GetSkillBase(unsigned short pid, unsigned short skill) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mDynamic[1].mCurrent;
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return player->npcStats.mSkills[skill].mBase;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetMagickaCurrent(unsigned short pid, double value) noexcept
|
|
|
|
|
int StatsFunctions::GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mDynamic[1].mCurrent = value;
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return player->npcStats.mSkills[skill].mCurrent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double StatsFunctions::GetFatigueBase(unsigned short pid) noexcept
|
|
|
|
|
double StatsFunctions::GetSkillProgress(unsigned short pid, unsigned short skill) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mDynamic[2].mBase;
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return player->npcStats.mSkills[skill].mProgress;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetFatigueBase(unsigned short pid, double value) noexcept
|
|
|
|
|
int StatsFunctions::GetSkillIncrease(unsigned short pid, unsigned int attribute) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mDynamic[2].mBase = value;
|
|
|
|
|
if (attribute > Attribute::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return player->npcStats.mSkillIncrease[attribute];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double StatsFunctions::GetFatigueCurrent(unsigned short pid) noexcept
|
|
|
|
|
int StatsFunctions::GetBounty(unsigned short pid) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mDynamic[2].mCurrent;
|
|
|
|
|
return player->npcStats.mBounty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetFatigueCurrent(unsigned short pid, double value) noexcept
|
|
|
|
|
void StatsFunctions::SetName(unsigned short pid, const char *name) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mDynamic[2].mCurrent = value;
|
|
|
|
|
if (player->npc.mName == name)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
player->npc.mName = name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetAttributeCount() noexcept
|
|
|
|
|
void StatsFunctions::SetRace(unsigned short pid, const char *race) noexcept
|
|
|
|
|
{
|
|
|
|
|
return Attribute::Length;
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetSkillCount() noexcept
|
|
|
|
|
void StatsFunctions::SetHead(unsigned short pid, const char *head) noexcept
|
|
|
|
|
{
|
|
|
|
|
return Skill::Length;
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (player->npc.mHead == head)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
player->npc.mHead = head;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetAttributeId(const char *name) noexcept
|
|
|
|
|
void StatsFunctions::SetHairstyle(unsigned short pid, const char *style) noexcept
|
|
|
|
|
{
|
|
|
|
|
for (int x = 0; x < Attribute::Length; x++)
|
|
|
|
|
{
|
|
|
|
|
if (Misc::StringUtils::ciEqual(name, Attribute::sAttributeNames[x]))
|
|
|
|
|
{
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
if (player->npc.mHair == style)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
player->npc.mHair = style;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetSkillId(const char *name) noexcept
|
|
|
|
|
void StatsFunctions::SetIsMale(unsigned short pid, int value) noexcept
|
|
|
|
|
{
|
|
|
|
|
for (int x = 0; x < Skill::Length; x++)
|
|
|
|
|
{
|
|
|
|
|
if (Misc::StringUtils::ciEqual(name, Skill::sSkillNames[x]))
|
|
|
|
|
{
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
player->npc.setIsMale(value == true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *StatsFunctions::GetAttributeName(unsigned short attribute) noexcept
|
|
|
|
|
void StatsFunctions::SetBirthsign(unsigned short pid, const char *sign) noexcept
|
|
|
|
|
{
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return "invalid";
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
|
|
|
|
|
return Attribute::sAttributeNames[attribute].c_str();
|
|
|
|
|
if (player->birthsign == sign)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
player->birthsign = sign;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *StatsFunctions::GetSkillName(unsigned short skill) noexcept
|
|
|
|
|
void StatsFunctions::SetLevel(unsigned short pid, int value) noexcept
|
|
|
|
|
{
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
return "invalid";
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
|
|
|
|
|
return Skill::sSkillNames[skill].c_str();
|
|
|
|
|
player->creatureStats.mLevel = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetAttributeBase(unsigned short pid, unsigned short attribute) noexcept
|
|
|
|
|
void StatsFunctions::SetLevelProgress(unsigned short pid, int value) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mAttributes[attribute].mBase;
|
|
|
|
|
player->npcStats.mLevelProgress = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept
|
|
|
|
|
void StatsFunctions::SetHealthBase(unsigned short pid, double value) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mAttributes[attribute].mBase = value;
|
|
|
|
|
player->creatureStats.mDynamic[0].mBase = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept
|
|
|
|
|
void StatsFunctions::SetHealthCurrent(unsigned short pid, double value) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
return player->creatureStats.mAttributes[attribute].mCurrent;
|
|
|
|
|
player->creatureStats.mDynamic[0].mCurrent = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept
|
|
|
|
|
void StatsFunctions::SetMagickaBase(unsigned short pid, double value) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return;
|
|
|
|
|
player->creatureStats.mDynamic[1].mBase = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mAttributes[attribute].mCurrent = value;
|
|
|
|
|
void StatsFunctions::SetMagickaCurrent(unsigned short pid, double value) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mDynamic[1].mCurrent = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetSkillBase(unsigned short pid, unsigned short skill) noexcept
|
|
|
|
|
void StatsFunctions::SetFatigueBase(unsigned short pid, double value) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
player->creatureStats.mDynamic[2].mBase = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return player->npcStats.mSkills[skill].mBase;
|
|
|
|
|
void StatsFunctions::SetFatigueCurrent(unsigned short pid, double value) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
player->creatureStats.mDynamic[2].mCurrent = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
|
|
|
|
|
void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
player->npcStats.mSkills[skill].mBase = value;
|
|
|
|
|
player->creatureStats.mAttributes[attribute].mBase = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept
|
|
|
|
|
void StatsFunctions::SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
return player->npcStats.mSkills[skill].mCurrent;
|
|
|
|
|
player->creatureStats.mAttributes[attribute].mCurrent = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one 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,);
|
|
|
|
@ -396,18 +415,18 @@ void StatsFunctions::SetSkillCurrent(unsigned short pid, unsigned short skill, i
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
player->npcStats.mSkills[skill].mCurrent = value;
|
|
|
|
|
player->npcStats.mSkills[skill].mBase = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double StatsFunctions::GetSkillProgress(unsigned short pid, unsigned short skill) noexcept
|
|
|
|
|
void StatsFunctions::SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0.0f);
|
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
|
|
if (skill >= Skill::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
return player->npcStats.mSkills[skill].mProgress;
|
|
|
|
|
player->npcStats.mSkills[skill].mCurrent = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void StatsFunctions::SetSkillProgress(unsigned short pid, unsigned short skill, double value) noexcept
|
|
|
|
@ -421,17 +440,6 @@ void StatsFunctions::SetSkillProgress(unsigned short pid, unsigned short skill,
|
|
|
|
|
player->npcStats.mSkills[skill].mProgress = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int StatsFunctions::GetSkillIncrease(unsigned short pid, unsigned int attribute) noexcept
|
|
|
|
|
{
|
|
|
|
|
Player *player;
|
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
if (attribute > Attribute::Length)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return player->npcStats.mSkillIncrease[attribute];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|