2017-07-11 10:34:09 +00:00
|
|
|
#include "Mechanics.hpp"
|
2017-06-26 22:01:45 +00:00
|
|
|
#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;
|
|
|
|
|
2017-07-12 15:24:37 +00:00
|
|
|
void MechanicsFunctions::Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases, const char* jailText) noexcept
|
2017-07-03 12:45:21 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
2017-07-11 10:34:09 +00:00
|
|
|
player->jailDays = jailDays;
|
|
|
|
player->ignoreJailTeleportation = ignoreJailTeleportation;
|
2017-07-12 15:24:37 +00:00
|
|
|
player->ignoreJailSkillIncreases = ignoreJailSkillIncreases;
|
2017-07-12 13:39:31 +00:00
|
|
|
player->jailText = jailText;
|
2017-07-11 10:34:09 +00:00
|
|
|
|
|
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JAIL)->setPlayer(player);
|
|
|
|
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JAIL)->Send(false);
|
2017-07-03 12:45:21 +00:00
|
|
|
}
|
|
|
|
|
2017-07-11 10:34:09 +00:00
|
|
|
void MechanicsFunctions::Resurrect(unsigned short pid, unsigned int type) noexcept
|
2017-06-26 22:01:45 +00:00
|
|
|
{
|
|
|
|
Player *player;
|
|
|
|
GET_PLAYER(pid, player, );
|
|
|
|
|
2017-06-27 06:49:39 +00:00
|
|
|
player->resurrectType = type;
|
2017-07-11 10:34:09 +00:00
|
|
|
|
2017-06-26 22:01:45 +00:00
|
|
|
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);
|
|
|
|
}
|