2016-01-12 03:41:44 +00:00
|
|
|
//
|
|
|
|
// Created by koncord on 29.02.16.
|
|
|
|
//
|
2016-08-30 04:19:49 +00:00
|
|
|
#include "Stats.hpp"
|
2016-01-12 03:41:44 +00:00
|
|
|
|
|
|
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
#include <apps/openmw-mp/Networking.hpp>
|
2016-08-17 21:13:45 +00:00
|
|
|
#include <components/esm/attr.hpp>
|
|
|
|
#include <components/esm/loadskil.hpp>
|
2016-01-12 03:41:44 +00:00
|
|
|
#include <components/misc/stringops.hpp>
|
2016-08-18 17:20:17 +00:00
|
|
|
#include <components/openmw-mp/Log.hpp>
|
2016-01-12 03:41:44 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace std;
|
2016-08-17 21:13:45 +00:00
|
|
|
using namespace ESM;
|
2016-01-12 03:41:44 +00:00
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SetName(unsigned short pid, const char *name) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
2016-09-18 03:51:32 +00:00
|
|
|
if (player->Npc()->mName == name)
|
2016-01-12 03:41:44 +00:00
|
|
|
return;
|
|
|
|
|
2016-09-18 03:51:32 +00:00
|
|
|
player->Npc()->mName = name;
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
const char *StatsFunctions::GetName(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
return player->Npc()->mName.c_str();
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SetBirthsign(unsigned short pid, const char *sign) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
2016-09-18 03:51:32 +00:00
|
|
|
if (*player->BirthSign() == sign)
|
2016-01-12 03:41:44 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
*player->BirthSign() = sign;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
const char *StatsFunctions::GetBirthsign(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
|
|
|
|
return player->BirthSign()->c_str();
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SetRace(unsigned short pid, const char *race) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
if (player->Npc()->mRace == race)
|
|
|
|
return;
|
|
|
|
|
2016-08-26 21:14:50 +00:00
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Setting race for %s: %s -> %s",
|
2016-08-18 17:20:17 +00:00
|
|
|
player->Npc()->mName.c_str(),
|
|
|
|
player->Npc()->mRace.c_str(),
|
|
|
|
race);
|
2016-01-12 03:41:44 +00:00
|
|
|
|
|
|
|
player->Npc()->mRace = race;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
const char *StatsFunctions::GetRace(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
return player->Npc()->mRace.c_str();
|
|
|
|
}
|
|
|
|
|
2016-09-02 03:16:35 +00:00
|
|
|
void StatsFunctions::SetHead(unsigned short pid, const char *head) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
2016-09-02 03:16:35 +00:00
|
|
|
if (player->Npc()->mHead == head)
|
2016-01-12 03:41:44 +00:00
|
|
|
return;
|
|
|
|
|
2016-09-02 03:16:35 +00:00
|
|
|
player->Npc()->mHead = head;
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
const char *StatsFunctions::GetHead(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
return player->Npc()->mHead.c_str();
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SetHairstyle(unsigned short pid, const char *style) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
if (player->Npc()->mHair == style)
|
|
|
|
return;
|
|
|
|
|
|
|
|
player->Npc()->mHair = style;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
const char *StatsFunctions::GetHairstyle(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
|
|
|
return player->Npc()->mHair.c_str();
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
int StatsFunctions::GetIsMale(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,false);
|
|
|
|
|
|
|
|
return player->Npc()->isMale();
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SetIsMale(unsigned short pid, int value) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->Npc()->setIsMale(value == true);
|
|
|
|
}
|
|
|
|
|
2016-09-25 11:28:25 +00:00
|
|
|
int StatsFunctions::GetLevel(unsigned short pid) noexcept
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0.f);
|
|
|
|
|
|
|
|
return player->CreatureStats()->mLevel;
|
|
|
|
}
|
|
|
|
|
|
|
|
void StatsFunctions::SetLevel(unsigned short pid, int value) noexcept
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
|
|
|
player->CreatureStats()->mLevel = value;
|
|
|
|
}
|
2016-01-12 03:41:44 +00:00
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
float StatsFunctions::GetHealthBase(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,0.f);
|
|
|
|
|
|
|
|
return player->CreatureStats()->mDynamic[0].mBase;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
void StatsFunctions::SetHealthBase(unsigned short pid, float value) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->CreatureStats()->mDynamic[0].mBase = value;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
float StatsFunctions::GetHealthCurrent(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0.f);
|
|
|
|
|
|
|
|
return player->CreatureStats()->mDynamic[0].mCurrent;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
void StatsFunctions::SetHealthCurrent(unsigned short pid, float value) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->CreatureStats()->mDynamic[0].mCurrent = 0;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
float StatsFunctions::GetMagickaBase(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,0.f);
|
|
|
|
|
|
|
|
return player->CreatureStats()->mDynamic[1].mBase;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
void StatsFunctions::SetMagickaBase(unsigned short pid, float value) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->CreatureStats()->mDynamic[1].mBase = value;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
float StatsFunctions::GetMagickaCurrent(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0.f);
|
|
|
|
|
|
|
|
return player->CreatureStats()->mDynamic[1].mCurrent;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
void StatsFunctions::SetMagickaCurrent(unsigned short pid, float value) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->CreatureStats()->mDynamic[1].mCurrent = 0;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
float StatsFunctions::GetFatigueBase(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,0.f);
|
|
|
|
|
|
|
|
return player->CreatureStats()->mDynamic[2].mBase;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
void StatsFunctions::SetFatigueBase(unsigned short pid, float value) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->CreatureStats()->mDynamic[2].mBase = value;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
float StatsFunctions::GetFatigueCurrent(unsigned short pid) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0.f);
|
|
|
|
|
|
|
|
return player->CreatureStats()->mDynamic[2].mCurrent;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
void StatsFunctions::SetFatigueCurrent(unsigned short pid, float value) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->CreatureStats()->mDynamic[2].mCurrent = 0;
|
|
|
|
}
|
|
|
|
|
2016-09-27 12:51:10 +00:00
|
|
|
int StatsFunctions::GetAttributeCount() noexcept
|
|
|
|
{
|
|
|
|
return Attribute::Length;
|
|
|
|
}
|
|
|
|
|
|
|
|
int StatsFunctions::GetSkillCount() noexcept
|
|
|
|
{
|
|
|
|
return Skill::Length;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
int StatsFunctions::GetAttributeId(const char *name) noexcept
|
2016-08-17 21:13:45 +00:00
|
|
|
{
|
2016-09-27 12:01:54 +00:00
|
|
|
for (int x = 0; x < Attribute::Length; x++)
|
2016-08-17 21:13:45 +00:00
|
|
|
{
|
|
|
|
if (Misc::StringUtils::ciEqual(name, Attribute::sAttributeNames[x]))
|
|
|
|
{
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
int StatsFunctions::GetSkillId(const char *name) noexcept
|
2016-08-17 21:13:45 +00:00
|
|
|
{
|
2016-09-27 12:01:54 +00:00
|
|
|
for (int x = 0; x < Skill::Length; x++)
|
2016-08-17 21:13:45 +00:00
|
|
|
{
|
|
|
|
if (Misc::StringUtils::ciEqual(name, Skill::sSkillNames[x]))
|
|
|
|
{
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
const char *StatsFunctions::GetAttributeName(unsigned short attribute) noexcept
|
2016-08-17 21:55:35 +00:00
|
|
|
{
|
2016-09-27 12:51:10 +00:00
|
|
|
if (attribute >= Attribute::Length)
|
|
|
|
return "invalid";
|
|
|
|
|
2016-08-17 21:55:35 +00:00
|
|
|
return Attribute::sAttributeNames[attribute].c_str();
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
const char *StatsFunctions::GetSkillName(unsigned short skill) noexcept
|
2016-08-17 21:55:35 +00:00
|
|
|
{
|
2016-09-27 12:51:10 +00:00
|
|
|
if (skill >= Skill::Length)
|
|
|
|
return "invalid";
|
|
|
|
|
2016-08-17 21:55:35 +00:00
|
|
|
return Skill::sSkillNames[skill].c_str();
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
int StatsFunctions::GetAttribute(unsigned short pid, unsigned short attribute) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
2016-09-27 12:01:54 +00:00
|
|
|
if (attribute >= Attribute::Length)
|
2016-01-12 03:41:44 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return player->CreatureStats()->mAttributes[attribute].mBase;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SetAttribute(unsigned short pid, unsigned short attribute, int value) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
2016-09-27 12:01:54 +00:00
|
|
|
if (attribute >= Attribute::Length)
|
2016-01-12 03:41:44 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
player->CreatureStats()->mAttributes[attribute].mBase = value;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
int StatsFunctions::GetAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
2016-09-27 12:01:54 +00:00
|
|
|
if (attribute >= Attribute::Length)
|
2016-01-12 03:41:44 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return player->CreatureStats()->mAttributes[attribute].mCurrent;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
void StatsFunctions::SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
2016-09-27 12:01:54 +00:00
|
|
|
if (attribute >= Attribute::Length)
|
2016-01-12 03:41:44 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
player->CreatureStats()->mAttributes[attribute].mCurrent = value;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
int StatsFunctions::GetSkill(unsigned short pid, unsigned short skill) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
2016-09-27 12:01:54 +00:00
|
|
|
if (skill >= Skill::Length)
|
2016-01-12 03:41:44 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return player->NpcStats()->mSkills[skill].mBase;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SetSkill(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
2016-09-27 12:01:54 +00:00
|
|
|
if (skill >= Skill::Length)
|
2016-01-12 03:41:44 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
player->NpcStats()->mSkills[skill].mBase = value;
|
|
|
|
|
2016-07-21 20:07:37 +00:00
|
|
|
//DEBUG_PRINTF("SetSkill(%d, %d, %d)\n", pid, skill, value);
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
int StatsFunctions::GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
2016-09-27 12:01:54 +00:00
|
|
|
if (skill >= Skill::Length)
|
2016-01-12 03:41:44 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return player->NpcStats()->mSkills[skill].mCurrent;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
void StatsFunctions::SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
2016-09-27 12:01:54 +00:00
|
|
|
if (skill >= Skill::Length)
|
2016-01-12 03:41:44 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
player->NpcStats()->mSkills[skill].mCurrent = value;
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
int StatsFunctions::GetSkillIncrease(unsigned short pid, unsigned int pos) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, 0);
|
|
|
|
|
2016-08-17 15:04:35 +00:00
|
|
|
if (pos > 7)
|
2016-01-12 03:41:44 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return player->NpcStats()->mSkillIncrease[pos];
|
|
|
|
}
|
|
|
|
|
2016-09-27 14:04:04 +00:00
|
|
|
void StatsFunctions::SetSkillIncrease(unsigned short pid, unsigned int pos, int value) noexcept // TODO: need packet for transmit it
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
2016-08-17 15:04:35 +00:00
|
|
|
if (pos > 7)
|
2016-01-12 03:41:44 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
player->NpcStats()->mSkillIncrease[pos] = value;
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SetCharGenStage(unsigned short pid, int start, int end) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
player->CharGenStage()->current = start;
|
|
|
|
player->CharGenStage()->end = end;
|
|
|
|
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CHARGEN)->Send(player, false);
|
|
|
|
}
|
2016-07-12 15:26:53 +00:00
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::Resurrect(unsigned short pid)
|
2016-07-12 15:26:53 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_RESURRECT)->RequestData(player->guid);
|
2016-08-05 06:26:32 +00:00
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SendBaseInfo(unsigned short pid) noexcept
|
2016-08-05 06:26:32 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_BASE_INFO)->Send(player, false);
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_BASE_INFO)->Send(player, true);
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SendAttributes(unsigned short pid) noexcept
|
2016-08-05 06:26:32 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_ATTRIBUTE)->Send(player, false);
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_ATTRIBUTE)->Send(player, true);
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SendBaseStats(unsigned short pid) noexcept
|
2016-08-05 06:26:32 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_BASESTATS)->Send(player, false);
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_BASESTATS)->Send(player, true);
|
|
|
|
}
|
|
|
|
|
2016-08-30 04:19:49 +00:00
|
|
|
void StatsFunctions::SendSkills(unsigned short pid) noexcept
|
2016-08-05 06:26:32 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player,);
|
|
|
|
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_SKILL)->Send(player, false);
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_SKILL)->Send(player, true);
|
|
|
|
}
|
2016-09-26 10:19:01 +00:00
|
|
|
|
|
|
|
void StatsFunctions::SendLevel(unsigned short pid) noexcept
|
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_LEVEL)->Send(player, false);
|
|
|
|
mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_LEVEL)->Send(player, true);
|
|
|
|
}
|