diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index b417a197..d0ad4b92 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -462,7 +462,7 @@ namespace Sapphire::Network::Packets::Server float animationLockTime; // maybe? doesn't seem to do anything uint32_t someTargetId; // always 00 00 00 E0, 0x0E000000 is the internal def for INVALID TARGET ID - uint16_t hiddenAnimation; // if 0, always shows animation, otherwise hides it. counts up by 1 for each animation skipped on a caster + uint16_t sourceSequence; // if 0, always shows animation, otherwise hides it. counts up by 1 for each animation skipped on a caster uint16_t rotation; uint16_t actionAnimationId; // the animation that is played by the casting character uint8_t variation; // variation in the animation diff --git a/src/world/Action/EffectBuilder.cpp b/src/world/Action/EffectBuilder.cpp index d6f206eb..7b070fc0 100644 --- a/src/world/Action/EffectBuilder.cpp +++ b/src/world/Action/EffectBuilder.cpp @@ -76,27 +76,15 @@ void EffectBuilder::buildAndSendPackets() Logger::debug( " - id: {}", result->getTarget()->getId() ); + auto seq = m_sourceChara->getCurrentTerritory()->getNextEffectSequence(); + auto effectPacket = std::make_shared< Server::EffectPacket >( m_sourceChara->getId(), result->getTarget()->getId(), m_actionId ); effectPacket->setRotation( Common::Util::floatToUInt16Rot( m_sourceChara->getRot() ) ); - effectPacket->setSequence( m_sequence ); + effectPacket->setSequence( seq, m_sequence ); effectPacket->addEffect( result->buildEffectEntry() ); - m_sourceChara->sendToInRangeSet( effectPacket, false ); - - // send a dupe packet to the caster with hiddenAnimation field set - if( auto player = m_sourceChara->getAsPlayer() ) - { - auto effectPacket2 = std::make_shared< Server::EffectPacket >( m_sourceChara->getId(), result->getTarget()->getId(), m_actionId ); - effectPacket2->setRotation( Common::Util::floatToUInt16Rot( m_sourceChara->getRot() ) ); - effectPacket2->setSequence( m_sequence ); - - effectPacket2->data().hiddenAnimation = m_sequence; - - effectPacket2->addEffect( result->buildEffectEntry() ); - - player->queuePacket( effectPacket2 ); - } + m_sourceChara->sendToInRangeSet( effectPacket, true ); } } \ No newline at end of file diff --git a/src/world/Network/PacketWrappers/EffectPacket.h b/src/world/Network/PacketWrappers/EffectPacket.h index 7cc07757..ec91133a 100644 --- a/src/world/Network/PacketWrappers/EffectPacket.h +++ b/src/world/Network/PacketWrappers/EffectPacket.h @@ -64,9 +64,10 @@ namespace Sapphire::Network::Packets::Server FFXIVPacketBase::setTargetActor( targetId ); } - void setSequence( uint32_t sequence ) + void setSequence( uint32_t sequence, uint16_t sourceSequence = 0 ) { m_data.sequence = sequence; + m_data.sourceSequence = sourceSequence; } };