forked from mirror/openmw-tes3mp
[Server] Add script functions for werewolf states
This commit is contained in:
parent
e3929df38a
commit
f65f996418
3 changed files with 40 additions and 2 deletions
|
@ -55,7 +55,7 @@ int FactionFunctions::GetFactionRank(unsigned short pid, unsigned int i) noexcep
|
||||||
bool FactionFunctions::GetFactionExpelledState(unsigned short pid, unsigned int i) noexcept
|
bool FactionFunctions::GetFactionExpelledState(unsigned short pid, unsigned int i) noexcept
|
||||||
{
|
{
|
||||||
Player *player;
|
Player *player;
|
||||||
GET_PLAYER(pid, player, 0);
|
GET_PLAYER(pid, player, false);
|
||||||
|
|
||||||
return player->factionChanges.factions.at(i).isExpelled;
|
return player->factionChanges.factions.at(i).isExpelled;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,32 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
bool MechanicsFunctions::IsWerewolf(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, 0);
|
||||||
|
|
||||||
|
return player->isWerewolf;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MechanicsFunctions::SetWerewolfState(unsigned short pid, bool isWerewolf)
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
player->isWerewolf = isWerewolf;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MechanicsFunctions::SendShapeshift(unsigned short pid)
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SHAPESHIFT)->setPlayer(player);
|
||||||
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SHAPESHIFT)->Send(false);
|
||||||
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_SHAPESHIFT)->Send(true);
|
||||||
|
}
|
||||||
|
|
||||||
void MechanicsFunctions::Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases,
|
void MechanicsFunctions::Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases,
|
||||||
const char* jailProgressText, const char* jailEndText) noexcept
|
const char* jailProgressText, const char* jailEndText) noexcept
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,13 +4,25 @@
|
||||||
#include "../Types.hpp"
|
#include "../Types.hpp"
|
||||||
|
|
||||||
#define MECHANICSAPI \
|
#define MECHANICSAPI \
|
||||||
{"Jail", MechanicsFunctions::Jail},\
|
{"IsWerewolf", MechanicsFunctions::IsWerewolf},\
|
||||||
\
|
\
|
||||||
|
{"SetWerewolfState", MechanicsFunctions::SetWerewolfState},\
|
||||||
|
\
|
||||||
|
{"SendShapeshift", MechanicsFunctions::SendShapeshift},\
|
||||||
|
\
|
||||||
|
{"Jail", MechanicsFunctions::Jail},\
|
||||||
{"Resurrect", MechanicsFunctions::Resurrect}
|
{"Resurrect", MechanicsFunctions::Resurrect}
|
||||||
|
|
||||||
class MechanicsFunctions
|
class MechanicsFunctions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
static bool IsWerewolf(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
static void SetWerewolfState(unsigned short pid, bool isWerewolf);
|
||||||
|
|
||||||
|
static void SendShapeshift(unsigned short pid);
|
||||||
|
|
||||||
static void Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation = false, bool ignoreJailSkillIncreases = false,
|
static void Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation = false, bool ignoreJailSkillIncreases = false,
|
||||||
const char* jailProgressText = "", const char* jailEndText = "") noexcept;
|
const char* jailProgressText = "", const char* jailEndText = "") noexcept;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue