mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 16:57:47 +00:00
move common effect struct members into a shared struct for single target/aoe
This commit is contained in:
parent
1789a21b96
commit
b54ff95388
2 changed files with 17 additions and 31 deletions
|
@ -310,7 +310,7 @@ struct EffectEntry
|
|||
int16_t value;
|
||||
};
|
||||
|
||||
struct FFXIVIpcEffect : FFXIVIpcBasePacket<Effect>
|
||||
struct EffectHeader
|
||||
{
|
||||
uint64_t animationTargetId; // who the animation targets
|
||||
uint32_t actionId; // what the casting player casts, shown in battle log/ui
|
||||
|
@ -333,6 +333,11 @@ struct FFXIVIpcEffect : FFXIVIpcBasePacket<Effect>
|
|||
uint8_t effectCount; // ignores effects if 0, otherwise parses all of them
|
||||
|
||||
uint32_t padding_22[2];
|
||||
};
|
||||
|
||||
struct FFXIVIpcEffect : FFXIVIpcBasePacket<Effect>
|
||||
{
|
||||
EffectHeader header;
|
||||
|
||||
EffectEntry effects[8];
|
||||
|
||||
|
@ -347,33 +352,14 @@ struct FFXIVIpcEffect : FFXIVIpcBasePacket<Effect>
|
|||
template< int size >
|
||||
struct FFXIVIpcAoeEffect
|
||||
{
|
||||
uint64_t animationTargetId;
|
||||
uint32_t actionId;
|
||||
|
||||
uint32_t globalEffectCounter;
|
||||
float animationLockTime;
|
||||
|
||||
uint32_t someTargetId;
|
||||
|
||||
uint16_t hiddenAnimation;
|
||||
|
||||
uint16_t rotation;
|
||||
|
||||
uint16_t actionAnimationId;
|
||||
uint8_t unknown1E;
|
||||
|
||||
Common::ActionEffectDisplayType effectDisplayType;
|
||||
|
||||
uint8_t unknown20;
|
||||
uint8_t effectCount;
|
||||
|
||||
uint32_t padding_22[2];
|
||||
EffectHeader header;
|
||||
|
||||
EffectEntry effects[size];
|
||||
|
||||
uint16_t padding_6A[3];
|
||||
|
||||
uint32_t effectTargetId[size];
|
||||
Common::FFXIVARR_POSITION3 position;
|
||||
uint32_t effectFlags;
|
||||
|
||||
uint32_t padding_78;
|
||||
|
|
|
@ -17,25 +17,25 @@ public:
|
|||
EffectPacket( uint64_t sourceId, uint32_t targetId, uint32_t actionId ) :
|
||||
ZoneChannelPacket< FFXIVIpcEffect >( sourceId, targetId )
|
||||
{
|
||||
m_data.actionId = actionId;
|
||||
m_data.actionAnimationId = static_cast< uint16_t >( actionId );
|
||||
m_data.header.actionId = actionId;
|
||||
m_data.header.actionAnimationId = static_cast< uint16_t >( actionId );
|
||||
|
||||
m_data.animationTargetId = targetId;
|
||||
m_data.header.animationTargetId = targetId;
|
||||
m_data.effectTargetId = targetId;
|
||||
|
||||
m_data.effectDisplayType = Common::ActionEffectDisplayType::ShowActionName;
|
||||
m_data.header.effectDisplayType = Common::ActionEffectDisplayType::ShowActionName;
|
||||
}
|
||||
|
||||
void addEffect( const Server::EffectEntry& effect )
|
||||
{
|
||||
assert( m_data.effectCount <= 8 );
|
||||
assert( m_data.header.effectCount <= 8 );
|
||||
|
||||
std::memcpy( &m_data.effects[m_data.effectCount++], &effect, sizeof( Server::EffectEntry ) );
|
||||
std::memcpy( &m_data.effects[m_data.header.effectCount++], &effect, sizeof( Server::EffectEntry ) );
|
||||
}
|
||||
|
||||
void setAnimationId( const uint16_t animationId )
|
||||
{
|
||||
m_data.actionAnimationId = animationId;
|
||||
m_data.header.actionAnimationId = animationId;
|
||||
}
|
||||
|
||||
void setEffectFlags( const uint32_t effectFlags )
|
||||
|
@ -45,12 +45,12 @@ public:
|
|||
|
||||
void setRotation( const uint16_t rotation )
|
||||
{
|
||||
m_data.rotation = rotation;
|
||||
m_data.header.rotation = rotation;
|
||||
}
|
||||
|
||||
void setTargetActor( const uint32_t targetId )
|
||||
{
|
||||
m_data.animationTargetId = targetId;
|
||||
m_data.header.animationTargetId = targetId;
|
||||
m_data.effectTargetId = targetId;
|
||||
|
||||
FFXIVPacketBase::setTargetActor( targetId );
|
||||
|
|
Loading…
Add table
Reference in a new issue