1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-02 16:57:47 +00:00

proper sequencing now I think

This commit is contained in:
NotAdam 2019-07-26 21:58:13 +10:00
parent 78aade9cea
commit 431948f7f8
3 changed files with 7 additions and 18 deletions

View file

@ -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

View file

@ -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 );
}
}

View file

@ -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;
}
};