diff --git a/src/world/Action/EffectBuilder.cpp b/src/world/Action/EffectBuilder.cpp index 9b1f1c65..c3593123 100644 --- a/src/world/Action/EffectBuilder.cpp +++ b/src/world/Action/EffectBuilder.cpp @@ -179,7 +179,7 @@ std::shared_ptr< FFXIVPacketBase > EffectBuilder::buildNextEffectPacket( uint32_ for( int i = 0; i < resultList->size(); i++ ) { auto result = resultList->data()[ i ]; - effectPacket->addEffect( result->buildEffectEntry(), static_cast< uint64_t >( firstResult->getTarget()->getId() ) ); + effectPacket->addTargetEffect( result->buildEffectEntry(), static_cast< uint64_t >( firstResult->getTarget()->getId() ) ); m_sourceChara->getCurrentTerritory()->addEffectResult( std::move( result ) ); } diff --git a/src/world/Actor/BNpc.cpp b/src/world/Actor/BNpc.cpp index 08eb7ade..f4401d89 100644 --- a/src/world/Actor/BNpc.cpp +++ b/src/world/Actor/BNpc.cpp @@ -919,7 +919,7 @@ void Sapphire::Entity::BNpc::autoAttack( CharaPtr pTarget ) effectEntry.Arg1 = 7; //effectEntry.Arg2 = 0x71; effectPacket->setSequence( getCurrentTerritory()->getNextEffectSequence() ); - effectPacket->addEffect( effectEntry, static_cast< uint64_t >( pTarget->getId() ) ); + effectPacket->addTargetEffect( effectEntry, static_cast< uint64_t >( pTarget->getId() ) ); sendToInRangeSet( effectPacket ); diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index 4356f324..62357d10 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -1525,7 +1525,7 @@ void Sapphire::Entity::Player::autoAttack( CharaPtr pTarget ) effectPacket->setSequence( getCurrentTerritory()->getNextEffectSequence() ); effectPacket->setRotation( Util::floatToUInt16Rot( getRot() ) ); - effectPacket->addEffect( entry, static_cast< uint64_t >( pTarget->getId() ) ); + effectPacket->addTargetEffect( entry, static_cast< uint64_t >( pTarget->getId() ) ); sendToInRangeSet( effectPacket, true ); diff --git a/src/world/Network/PacketWrappers/EffectPacket1.h b/src/world/Network/PacketWrappers/EffectPacket1.h index dc0ffec1..10f010d9 100644 --- a/src/world/Network/PacketWrappers/EffectPacket1.h +++ b/src/world/Network/PacketWrappers/EffectPacket1.h @@ -12,6 +12,9 @@ namespace Sapphire::Network::Packets::WorldPackets::Server class EffectPacket1 : public ZoneChannelPacket< FFXIVIpcActionResult1 > { + private: + uint8_t m_targetEffectCount{0}; + uint8_t m_sourceEffectCount{0}; public: EffectPacket1( uint64_t sourceId, uint32_t targetId, uint32_t actionId ) : ZoneChannelPacket< FFXIVIpcActionResult1 >( static_cast< uint32_t >( sourceId ), targetId ) @@ -31,9 +34,14 @@ namespace Sapphire::Network::Packets::WorldPackets::Server std::memset( &m_data.CalcResult, 0, sizeof( Common::CalcResult ) ); } - void addEffect( const Common::CalcResultParam& effect, uint64_t targetId = Common::INVALID_GAME_OBJECT_ID64 ) + void addTargetEffect( const Common::CalcResultParam& effect, uint64_t targetId = Common::INVALID_GAME_OBJECT_ID64 ) { - std::memcpy( &m_data.CalcResult.CalcResultTg, &effect, sizeof( Common::CalcResultParam ) ); + std::memcpy( &m_data.CalcResult.CalcResultTg[ m_targetEffectCount++ ], &effect, sizeof( Common::CalcResultParam ) ); + } + + void addSourceEffect( const Common::CalcResultParam& effect, uint64_t targetId = Common::INVALID_GAME_OBJECT_ID64 ) + { + std::memcpy( &m_data.CalcResult.CalcResultCt[ m_sourceEffectCount++ ], &effect, sizeof( Common::CalcResultParam ) ); } void setAnimationId( uint16_t animationId )