mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 16:57:47 +00:00
88 lines
2.4 KiB
C++
88 lines
2.4 KiB
C++
#pragma once
|
|
|
|
#include <Network/GamePacket.h>
|
|
#include <Network/PacketDef/Zone/ServerZoneDef.h>
|
|
#include "Forwards.h"
|
|
#include <string>
|
|
#include <cstring>
|
|
#include <cassert>
|
|
|
|
namespace Sapphire::Network::Packets::WorldPackets::Server
|
|
{
|
|
|
|
class EffectPacket1 : public ZoneChannelPacket< FFXIVIpcActionResult1 >
|
|
{
|
|
public:
|
|
EffectPacket1( uint64_t sourceId, uint32_t targetId, uint32_t actionId ) :
|
|
ZoneChannelPacket< FFXIVIpcActionResult1 >( static_cast< uint32_t >( sourceId ), targetId )
|
|
{
|
|
m_data.Flag = 0;
|
|
m_data.ActionKey = actionId;
|
|
m_data.Action = static_cast< uint16_t >( actionId );
|
|
m_data.ActionKind = 1;
|
|
|
|
m_data.LockTime = 0.6f;
|
|
m_data.MainTarget = static_cast< uint64_t >( targetId );
|
|
m_data.Target = targetId;
|
|
|
|
//m_data.ActionArg = Common::ActionEffectDisplayType::ShowActionName;
|
|
m_data.BallistaEntityId = Common::INVALID_GAME_OBJECT_ID;
|
|
|
|
std::memset( &m_data.CalcResult, 0, sizeof( Common::CalcResult ) );
|
|
}
|
|
|
|
void addTargetEffect( const Common::CalcResultParam& effect )
|
|
{
|
|
std::memcpy( &m_data.CalcResult.CalcResultTg[ m_targetEffectCount++ ], &effect, sizeof( Common::CalcResultParam ) );
|
|
}
|
|
|
|
void addSourceEffect( const Common::CalcResultParam& effect )
|
|
{
|
|
std::memcpy( &m_data.CalcResult.CalcResultCt[ m_sourceEffectCount++ ], &effect, sizeof( Common::CalcResultParam ) );
|
|
}
|
|
|
|
void setAnimationId( uint16_t animationId )
|
|
{
|
|
m_data.Action = animationId;
|
|
}
|
|
|
|
void setDisplayType( Common::ActionEffectDisplayType displayType )
|
|
{
|
|
m_data.ActionArg = displayType;
|
|
}
|
|
|
|
void setEffectFlags( uint32_t effectFlags )
|
|
{
|
|
m_data.Flag = effectFlags;
|
|
}
|
|
|
|
void setRotation( uint16_t rotation )
|
|
{
|
|
m_data.DirTarget = rotation;
|
|
}
|
|
|
|
void setTargetActor( const uint32_t targetId )
|
|
{
|
|
m_data.MainTarget = static_cast< uint64_t >( targetId );
|
|
|
|
FFXIVPacketBase::setTargetActor( targetId );
|
|
}
|
|
|
|
void setSequence( uint32_t sequence, uint16_t sourceSequence = 0 )
|
|
{
|
|
m_data.RequestId = static_cast< uint32_t >( sourceSequence );
|
|
m_data.ResultId = static_cast< uint32_t>( sequence );
|
|
}
|
|
|
|
void setResultId( uint32_t resultId )
|
|
{
|
|
m_data.ResultId = static_cast< uint32_t>( resultId );
|
|
}
|
|
|
|
private:
|
|
uint8_t m_targetEffectCount{ 0 };
|
|
uint8_t m_sourceEffectCount{ 0 };
|
|
};
|
|
|
|
}
|
|
|