mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-29 07:37:45 +00:00
Allow setting or target and source effects in single target effect packet
This commit is contained in:
parent
4fccaef569
commit
beca9ccb3b
4 changed files with 13 additions and 5 deletions
|
@ -179,7 +179,7 @@ std::shared_ptr< FFXIVPacketBase > EffectBuilder::buildNextEffectPacket( uint32_
|
||||||
for( int i = 0; i < resultList->size(); i++ )
|
for( int i = 0; i < resultList->size(); i++ )
|
||||||
{
|
{
|
||||||
auto result = resultList->data()[ 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 ) );
|
m_sourceChara->getCurrentTerritory()->addEffectResult( std::move( result ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -919,7 +919,7 @@ void Sapphire::Entity::BNpc::autoAttack( CharaPtr pTarget )
|
||||||
effectEntry.Arg1 = 7;
|
effectEntry.Arg1 = 7;
|
||||||
//effectEntry.Arg2 = 0x71;
|
//effectEntry.Arg2 = 0x71;
|
||||||
effectPacket->setSequence( getCurrentTerritory()->getNextEffectSequence() );
|
effectPacket->setSequence( getCurrentTerritory()->getNextEffectSequence() );
|
||||||
effectPacket->addEffect( effectEntry, static_cast< uint64_t >( pTarget->getId() ) );
|
effectPacket->addTargetEffect( effectEntry, static_cast< uint64_t >( pTarget->getId() ) );
|
||||||
|
|
||||||
sendToInRangeSet( effectPacket );
|
sendToInRangeSet( effectPacket );
|
||||||
|
|
||||||
|
|
|
@ -1525,7 +1525,7 @@ void Sapphire::Entity::Player::autoAttack( CharaPtr pTarget )
|
||||||
effectPacket->setSequence( getCurrentTerritory()->getNextEffectSequence() );
|
effectPacket->setSequence( getCurrentTerritory()->getNextEffectSequence() );
|
||||||
|
|
||||||
effectPacket->setRotation( Util::floatToUInt16Rot( getRot() ) );
|
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 );
|
sendToInRangeSet( effectPacket, true );
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,9 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||||
|
|
||||||
class EffectPacket1 : public ZoneChannelPacket< FFXIVIpcActionResult1 >
|
class EffectPacket1 : public ZoneChannelPacket< FFXIVIpcActionResult1 >
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
uint8_t m_targetEffectCount{0};
|
||||||
|
uint8_t m_sourceEffectCount{0};
|
||||||
public:
|
public:
|
||||||
EffectPacket1( uint64_t sourceId, uint32_t targetId, uint32_t actionId ) :
|
EffectPacket1( uint64_t sourceId, uint32_t targetId, uint32_t actionId ) :
|
||||||
ZoneChannelPacket< FFXIVIpcActionResult1 >( static_cast< uint32_t >( sourceId ), targetId )
|
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 ) );
|
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 )
|
void setAnimationId( uint16_t animationId )
|
||||||
|
|
Loading…
Add table
Reference in a new issue