mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
fix effect packets not showing the action name after the initial cast
This commit is contained in:
parent
9fb1f8c2d5
commit
f9abeee2f7
5 changed files with 30 additions and 3 deletions
|
@ -415,7 +415,7 @@ struct FFXIVIpcEffect : FFXIVIpcBasePacket< Effect >
|
|||
uint64_t animationTargetId; // who the animation targets
|
||||
|
||||
uint32_t actionId; // what the casting player casts, shown in battle log/ui
|
||||
uint32_t globalEffectCounter; // seems to only increment on retail?
|
||||
uint32_t sequence; // seems to only increment on retail?
|
||||
|
||||
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
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include "Actor/Player.h"
|
||||
#include "Actor/BNpc.h"
|
||||
|
||||
#include "Territory/Zone.h"
|
||||
|
||||
#include <Network/CommonActorControl.h>
|
||||
#include "Network/PacketWrappers/ActorControlPacket142.h"
|
||||
#include "Network/PacketWrappers/ActorControlPacket143.h"
|
||||
|
@ -293,11 +295,22 @@ void Sapphire::Action::Action::buildEffectPackets()
|
|||
{
|
||||
auto& packetData = m_effects[ static_cast< EffectPacketIdentity >( i ) ];
|
||||
|
||||
if( packetData.m_hitActors.size() == 1 )
|
||||
auto actorsHit = packetData.m_hitActors.size();
|
||||
if( actorsHit == 0 )
|
||||
continue;
|
||||
|
||||
// get effect sequence
|
||||
auto zone = m_pSource->getCurrentZone();
|
||||
assert( zone );
|
||||
|
||||
auto sequence = zone->getNextEffectSequence();
|
||||
|
||||
if( actorsHit == 1 )
|
||||
{
|
||||
// send normal effect
|
||||
auto effectPacket = std::make_shared< Network::Packets::Server::EffectPacket >( m_pSource->getId(), m_pTarget->getId(), getId() );
|
||||
effectPacket->setTargetActor( packetData.m_hitActors[ 0 ] );
|
||||
effectPacket->setSequence( sequence );
|
||||
effectPacket->setDisplayType( Common::ActionEffectDisplayType::ShowActionName );
|
||||
|
||||
for( auto& effect : packetData.m_entries )
|
||||
|
@ -307,7 +320,7 @@ void Sapphire::Action::Action::buildEffectPackets()
|
|||
|
||||
m_pSource->sendToInRangeSet( effectPacket, true );
|
||||
}
|
||||
else if( packetData.m_hitActors.size() > 1 )
|
||||
else
|
||||
{
|
||||
// todo: aoe effects
|
||||
}
|
||||
|
|
|
@ -63,6 +63,11 @@ namespace Sapphire::Network::Packets::Server
|
|||
|
||||
FFXIVPacketBase::setTargetActor( targetId );
|
||||
}
|
||||
|
||||
void setSequence( uint32_t sequence )
|
||||
{
|
||||
m_data.sequence = sequence;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -864,3 +864,8 @@ void Sapphire::Zone::updateSpawnPoints()
|
|||
|
||||
}
|
||||
|
||||
uint32_t Sapphire::Zone::getNextEffectSequence()
|
||||
{
|
||||
return m_effectCounter++;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,8 @@ namespace Sapphire
|
|||
|
||||
std::vector< Entity::SpawnGroup > m_spawnGroups;
|
||||
|
||||
uint32_t m_effectCounter;
|
||||
|
||||
public:
|
||||
Zone();
|
||||
|
||||
|
@ -161,6 +163,8 @@ namespace Sapphire
|
|||
InstanceContentPtr getAsInstanceContent();
|
||||
|
||||
void updateSpawnPoints();
|
||||
|
||||
uint32_t getNextEffectSequence();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue