2023-02-02 02:30:31 -03:00
|
|
|
#pragma once
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2019-03-08 15:34:38 +01:00
|
|
|
#include <Network/GamePacket.h>
|
2018-03-06 22:22:19 +01:00
|
|
|
#include <Network/PacketDef/Zone/ServerZoneDef.h>
|
|
|
|
#include <Util/UtilMath.h>
|
2017-12-08 23:27:59 +01:00
|
|
|
#include "Actor/Player.h"
|
|
|
|
#include "Forwards.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
namespace Sapphire::Network::Packets::WorldPackets::Server
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
/**
|
|
|
|
* @brief The Client UI Initialization packet. This must be sent to the client
|
|
|
|
* once upon connection to configure the UI.
|
|
|
|
*/
|
2019-04-04 23:29:52 +02:00
|
|
|
class MoveActorPacket : public ZoneChannelPacket< FFXIVIpcActorMove >
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2018-10-28 21:53:21 +01:00
|
|
|
public:
|
2019-02-06 09:27:30 +01:00
|
|
|
MoveActorPacket( Entity::Chara& actor, uint8_t headRotation, uint8_t animationType, uint8_t state, uint16_t animationSpeed, uint8_t unknownRotation = 0 ) :
|
2018-10-28 21:53:21 +01:00
|
|
|
ZoneChannelPacket< FFXIVIpcActorMove >( actor.getId(), actor.getId() )
|
|
|
|
{
|
2019-02-06 09:27:30 +01:00
|
|
|
initialize( actor, headRotation, animationType, state, animationSpeed, unknownRotation );
|
2018-10-28 21:53:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
2019-02-06 09:27:30 +01:00
|
|
|
void initialize( Entity::Chara& actor, uint8_t headRotation, uint8_t animationType, uint8_t state, uint16_t animationSpeed, uint8_t unknownRotation )
|
2018-10-28 21:53:21 +01:00
|
|
|
{
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
m_data.dir = Common::Util::floatToUInt8Rot( actor.getRot() );
|
|
|
|
m_data.dirBeforeSlip = headRotation;
|
|
|
|
m_data.flag = animationType;
|
|
|
|
m_data.flag2 = state;
|
|
|
|
m_data.speed = static_cast< uint8_t >( animationSpeed );
|
|
|
|
m_data.pos[0] = Common::Util::floatToUInt16( actor.getPos().x );
|
|
|
|
m_data.pos[1] = Common::Util::floatToUInt16( actor.getPos().y );
|
|
|
|
m_data.pos[2] = Common::Util::floatToUInt16( actor.getPos().z );
|
2018-10-28 21:53:21 +01:00
|
|
|
|
|
|
|
};
|
2018-08-29 21:40:59 +02:00
|
|
|
};
|
2023-02-02 02:30:31 -03:00
|
|
|
}
|