mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-09 12:17:45 +00:00
Screenmessage when zoning, some effect packet 1 cleanup
This commit is contained in:
parent
beca9ccb3b
commit
3b02afe99b
8 changed files with 47 additions and 15 deletions
|
@ -117,7 +117,8 @@ namespace Sapphire::Network::ActorControl
|
|||
|
||||
TeleportDone = 0xCD,
|
||||
TeleportDoneFadeOut = 0xCE,
|
||||
DespawnZoneScreenMsg = 0xCF,
|
||||
|
||||
WarpStart = 0xCF,
|
||||
|
||||
InstanceSelectDlg = 0xD2,
|
||||
ActorDespawnEffect = 0xD4,
|
||||
|
|
|
@ -12,14 +12,22 @@
|
|||
namespace Sapphire::Network::Packets::WorldPackets::Server
|
||||
{
|
||||
|
||||
struct ZoneProtoDownServerPos
|
||||
{
|
||||
uint32_t originEntityId;
|
||||
float pos[3];
|
||||
float dir;
|
||||
};
|
||||
|
||||
/**
|
||||
* Structural representation of the packet sent by the server as response
|
||||
* to a ping packet
|
||||
*/
|
||||
struct FFXIVIpcSync : FFXIVIpcBasePacket< SyncReply >
|
||||
{
|
||||
/* 0000 */ uint64_t timeInMilliseconds;
|
||||
/* 0008 */ uint8_t unknown_8[0x38];
|
||||
uint32_t clientTimeValue;
|
||||
uint32_t transmissionInterval;
|
||||
ZoneProtoDownServerPos position;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1643,6 +1651,19 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
|||
/* 0004 */ uint32_t mapId;
|
||||
};
|
||||
|
||||
struct FFXIVIpcMoveTerritory : FFXIVIpcBasePacket< MoveTerritory >
|
||||
{
|
||||
int16_t index;
|
||||
uint8_t territoryType;
|
||||
uint8_t zoneId;
|
||||
uint16_t worldId;
|
||||
uint16_t worldId1;
|
||||
int64_t landSetId;
|
||||
int64_t landId;
|
||||
int64_t landTerritoryId;
|
||||
char worldName[32];
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -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->addTargetEffect( result->buildEffectEntry(), static_cast< uint64_t >( firstResult->getTarget()->getId() ) );
|
||||
effectPacket->addTargetEffect( result->buildEffectEntry() );
|
||||
m_sourceChara->getCurrentTerritory()->addEffectResult( std::move( result ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -335,7 +335,7 @@ void Sapphire::Entity::BNpc::despawn( PlayerPtr pTarget )
|
|||
|
||||
auto& server = Common::Service< World::WorldServer >::ref();
|
||||
|
||||
server.queueForPlayer( pTarget->getCharacterId(), makeActorControlSelf( m_id, DespawnZoneScreenMsg, 0x04, getId(), 0x01 ) );
|
||||
server.queueForPlayer( pTarget->getCharacterId(), makeActorControlSelf( m_id, WarpStart, 0x04, getId(), 0x01 ) );
|
||||
}
|
||||
|
||||
Sapphire::Entity::BNpcState Sapphire::Entity::BNpc::getState() const
|
||||
|
@ -919,7 +919,7 @@ void Sapphire::Entity::BNpc::autoAttack( CharaPtr pTarget )
|
|||
effectEntry.Arg1 = 7;
|
||||
//effectEntry.Arg2 = 0x71;
|
||||
effectPacket->setSequence( getCurrentTerritory()->getNextEffectSequence() );
|
||||
effectPacket->addTargetEffect( effectEntry, static_cast< uint64_t >( pTarget->getId() ) );
|
||||
effectPacket->addTargetEffect( effectEntry );
|
||||
|
||||
sendToInRangeSet( effectPacket );
|
||||
|
||||
|
|
|
@ -1009,7 +1009,7 @@ void Sapphire::Entity::Player::despawn( Entity::PlayerPtr pTarget )
|
|||
|
||||
pPlayer->freePlayerSpawnId( getId() );
|
||||
|
||||
pPlayer->queuePacket( makeActorControlSelf( getId(), DespawnZoneScreenMsg, 0x04, getId(), 0x01 ) );
|
||||
pPlayer->queuePacket( makeActorControlSelf( getId(), WarpStart, 0x04, getId(), 0x01 ) );
|
||||
}
|
||||
|
||||
Sapphire::Entity::GameObjectPtr Sapphire::Entity::Player::lookupTargetById( uint64_t targetId )
|
||||
|
@ -1525,7 +1525,7 @@ void Sapphire::Entity::Player::autoAttack( CharaPtr pTarget )
|
|||
effectPacket->setSequence( getCurrentTerritory()->getNextEffectSequence() );
|
||||
|
||||
effectPacket->setRotation( Util::floatToUInt16Rot( getRot() ) );
|
||||
effectPacket->addTargetEffect( entry, static_cast< uint64_t >( pTarget->getId() ) );
|
||||
effectPacket->addTargetEffect( entry );
|
||||
|
||||
sendToInRangeSet( effectPacket, true );
|
||||
|
||||
|
|
|
@ -332,7 +332,7 @@ void Sapphire::Network::GameConnection::zoneJumpHandler( const Packets::FFXIVARR
|
|||
if( pExitRange )
|
||||
{
|
||||
auto pPopRange = instanceObjectCache.getPopRange( pExitRange->data.destTerritoryType,
|
||||
pExitRange->data.destInstanceObjectId );
|
||||
pExitRange->data.destInstanceObjectId );
|
||||
if( pPopRange )
|
||||
{
|
||||
targetZone = pExitRange->data.destTerritoryType;
|
||||
|
@ -355,10 +355,19 @@ void Sapphire::Network::GameConnection::zoneJumpHandler( const Packets::FFXIVARR
|
|||
pPopRange->header.transform.rotation.z,
|
||||
rotation );
|
||||
|
||||
// auto preparePacket = makeZonePacket< FFXIVIpcPrepareZoning >( player.getId() );
|
||||
// preparePacket->data().targetZone = pExitRange->data.destTerritoryType;
|
||||
server.queueForPlayer( player.getCharacterId(), makeActorControlSelf( player.getId(), WarpStart, 0x03, player.getId(), 0x01, targetZone ) );
|
||||
|
||||
//server.queueForPlayer( player.getCharacterId(), preparePacket );
|
||||
auto moveTerritoryPacket = makeZonePacket< FFXIVIpcMoveTerritory >( player.getId() );
|
||||
moveTerritoryPacket->data().index = -1;
|
||||
moveTerritoryPacket->data().territoryType = targetZone;
|
||||
moveTerritoryPacket->data().zoneId = player.getZoneId();
|
||||
moveTerritoryPacket->data().worldId = server.getWorldId();
|
||||
moveTerritoryPacket->data().worldId1 = server.getWorldId();
|
||||
moveTerritoryPacket->data().landId = -1;
|
||||
moveTerritoryPacket->data().landSetId = -1;
|
||||
moveTerritoryPacket->data().landTerritoryId = -1;
|
||||
strcpy( moveTerritoryPacket->data().worldName, "Sapphire" );
|
||||
server.queueForPlayer( player.getCharacterId(), moveTerritoryPacket );
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,12 +34,12 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
|||
std::memset( &m_data.CalcResult, 0, sizeof( Common::CalcResult ) );
|
||||
}
|
||||
|
||||
void addTargetEffect( const Common::CalcResultParam& effect, uint64_t targetId = Common::INVALID_GAME_OBJECT_ID64 )
|
||||
void addTargetEffect( const Common::CalcResultParam& effect )
|
||||
{
|
||||
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 )
|
||||
void addSourceEffect( const Common::CalcResultParam& effect )
|
||||
{
|
||||
std::memcpy( &m_data.CalcResult.CalcResultCt[ m_sourceEffectCount++ ], &effect, sizeof( Common::CalcResultParam ) );
|
||||
}
|
||||
|
|
|
@ -23,7 +23,8 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
|
|||
private:
|
||||
void initialize( Entity::Player& player, int32_t inVal )
|
||||
{
|
||||
m_data.timeInMilliseconds = 0x000014D00000000 + inVal;
|
||||
m_data.clientTimeValue = inVal;
|
||||
m_data.transmissionInterval = 333;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue