2016-01-12 03:41:44 +00:00
|
|
|
//
|
|
|
|
// Created by koncord on 13.01.16.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
2017-02-05 07:01:33 +00:00
|
|
|
#include "PacketPlayerAttack.hpp"
|
2016-01-12 03:41:44 +00:00
|
|
|
|
|
|
|
using namespace mwmp;
|
|
|
|
|
2017-02-05 07:01:33 +00:00
|
|
|
PacketPlayerAttack::PacketPlayerAttack(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2017-02-05 07:01:33 +00:00
|
|
|
packetID = ID_PLAYER_ATTACK;
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2017-03-06 09:44:08 +00:00
|
|
|
void PacketPlayerAttack::Packet(RakNet::BitStream *bs, bool send)
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2017-03-06 09:44:08 +00:00
|
|
|
PlayerPacket::Packet(bs, send);
|
2016-01-12 03:41:44 +00:00
|
|
|
|
2018-04-05 09:48:53 +00:00
|
|
|
RW(player->attack.target.isPlayer, send);
|
|
|
|
|
|
|
|
if (player->attack.target.isPlayer)
|
|
|
|
{
|
|
|
|
RW(player->attack.target.guid, send);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RW(player->attack.target.refId, send, 1);
|
|
|
|
RW(player->attack.target.refNumIndex, send);
|
|
|
|
RW(player->attack.target.mpNum, send);
|
|
|
|
}
|
2017-04-17 14:24:11 +00:00
|
|
|
|
2017-06-02 18:23:23 +00:00
|
|
|
RW(player->attack.spellId, send, 1);
|
2017-01-25 15:06:15 +00:00
|
|
|
RW(player->attack.type, send);
|
|
|
|
RW(player->attack.success, send);
|
2017-06-02 18:23:23 +00:00
|
|
|
RW(player->attack.damage, send, 0); // never compress damage
|
2017-04-18 07:03:58 +00:00
|
|
|
|
2017-01-25 15:06:15 +00:00
|
|
|
RW(player->attack.pressed, send);
|
|
|
|
RW(player->attack.knockdown, send);
|
|
|
|
RW(player->attack.block, send);
|
2018-04-03 07:27:02 +00:00
|
|
|
|
2018-04-03 11:12:27 +00:00
|
|
|
RW(player->attack.applyWeaponEnchantment, send);
|
|
|
|
RW(player->attack.applyProjectileEnchantment, send);
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|