mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-10-06 19:44:38 -04:00
35 lines
1.3 KiB
C++
35 lines
1.3 KiB
C++
#include "Mechanics.hpp"
|
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
#include <apps/openmw-mp/Networking.hpp>
|
|
#include <components/openmw-mp/Log.hpp>
|
|
|
|
#include <iostream>
|
|
using namespace std;
|
|
|
|
void MechanicsFunctions::Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases, const char* jailText) noexcept
|
|
{
|
|
Player *player;
|
|
GET_PLAYER(pid, player, );
|
|
|
|
player->jailDays = jailDays;
|
|
player->ignoreJailTeleportation = ignoreJailTeleportation;
|
|
player->ignoreJailSkillIncreases = ignoreJailSkillIncreases;
|
|
player->jailText = jailText;
|
|
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JAIL)->setPlayer(player);
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JAIL)->Send(false);
|
|
}
|
|
|
|
void MechanicsFunctions::Resurrect(unsigned short pid, unsigned int type) noexcept
|
|
{
|
|
Player *player;
|
|
GET_PLAYER(pid, player, );
|
|
|
|
player->resurrectType = type;
|
|
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT)->setPlayer(player);
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT)->Send(false);
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT)->Send(true);
|
|
}
|