2018-07-21 23:32:10 +10:00
|
|
|
#ifndef SAPPHIRE_EFFECTPACKET_H
|
|
|
|
#define SAPPHIRE_EFFECTPACKET_H
|
|
|
|
|
|
|
|
#include <Network/GamePacketNew.h>
|
|
|
|
#include <Network/PacketDef/Zone/ServerZoneDef.h>
|
|
|
|
#include "Forwards.h"
|
2018-10-26 14:11:02 +02:00
|
|
|
#include <string>
|
|
|
|
#include <cstring>
|
|
|
|
#include <cassert>
|
2018-07-21 23:32:10 +10:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
namespace Core::Network::Packets::Server
|
2018-07-21 23:32:10 +10:00
|
|
|
{
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
class EffectPacket : public ZoneChannelPacket< FFXIVIpcEffect >
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2018-10-28 21:53:21 +01:00
|
|
|
public:
|
|
|
|
EffectPacket( uint64_t sourceId, uint32_t targetId, uint32_t actionId ) :
|
|
|
|
ZoneChannelPacket< FFXIVIpcEffect >( static_cast< uint32_t >( sourceId ), targetId )
|
|
|
|
{
|
|
|
|
m_data.header.actionId = actionId;
|
|
|
|
m_data.header.actionAnimationId = static_cast< uint16_t >( actionId );
|
|
|
|
|
|
|
|
m_data.header.animationTargetId = targetId;
|
|
|
|
m_data.effectTargetId = targetId;
|
|
|
|
|
|
|
|
m_data.header.effectDisplayType = Common::ActionEffectDisplayType::ShowActionName;
|
|
|
|
}
|
|
|
|
|
|
|
|
void addEffect( const Server::EffectEntry& effect )
|
|
|
|
{
|
|
|
|
assert( m_data.header.effectCount <= 8 );
|
|
|
|
|
|
|
|
std::memcpy( &m_data.effects[ m_data.header.effectCount++ ], &effect, sizeof( Server::EffectEntry ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void setAnimationId( uint16_t animationId )
|
|
|
|
{
|
|
|
|
m_data.header.actionAnimationId = animationId;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setEffectFlags( uint32_t effectFlags )
|
|
|
|
{
|
|
|
|
m_data.effectFlags = effectFlags;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setRotation( uint16_t rotation )
|
|
|
|
{
|
|
|
|
m_data.header.rotation = rotation;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setTargetActor( const uint32_t targetId )
|
|
|
|
{
|
|
|
|
m_data.header.animationTargetId = targetId;
|
|
|
|
m_data.effectTargetId = targetId;
|
|
|
|
|
|
|
|
FFXIVPacketBase::setTargetActor( targetId );
|
|
|
|
}
|
|
|
|
};
|
2018-07-21 23:32:10 +10:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //SAPPHIRE_EFFECTPACKET_H
|