1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 14:07:46 +00:00

Persistent emotes now show properly to other players on spawn

This commit is contained in:
Mordred 2018-07-09 21:48:42 +02:00
parent df090c0517
commit e7e8977d5b
4 changed files with 39 additions and 5 deletions

View file

@ -1425,12 +1425,19 @@ Core::Data::Emote::Emote( uint32_t row_id, Core::Data::ExdDataGenerated* exdData
auto row = exdData->m_EmoteDat.get_row( row_id );
name = exdData->getField< std::string >( row, 0 );
emoteCategory = exdData->getField< uint8_t >( row, 11 );
emoteMode = exdData->getField< uint8_t >( row, 12 );
textCommand = exdData->getField< int32_t >( row, 18 );
icon = exdData->getField< uint16_t >( row, 19 );
logMessageTargeted = exdData->getField< uint16_t >( row, 20 );
logMessageUntargeted = exdData->getField< uint16_t >( row, 21 );
}
Core::Data::EmoteMode::EmoteMode( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
{
auto row = exdData->m_EmoteDat.get_row( row_id );
}
Core::Data::EmoteCategory::EmoteCategory( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
{
auto row = exdData->m_EmoteCategoryDat.get_row( row_id );
@ -4553,6 +4560,7 @@ bool Core::Data::ExdDataGenerated::init( const std::string& path )
m_DpsChallengeTransientDat = setupDatAccess( "DpsChallengeTransient", xiv::exd::Language::none );
m_EmoteDat = setupDatAccess( "Emote", xiv::exd::Language::en );
m_EmoteCategoryDat = setupDatAccess( "EmoteCategory", xiv::exd::Language::en );
m_EmoteModeDat = setupDatAccess( "EmoteMode", xiv::exd::Language::none );
m_ENpcBaseDat = setupDatAccess( "ENpcBase", xiv::exd::Language::none );
m_ENpcResidentDat = setupDatAccess( "ENpcResident", xiv::exd::Language::en );
m_EObjDat = setupDatAccess( "EObj", xiv::exd::Language::none );

View file

@ -1603,6 +1603,7 @@ struct Emote
uint16_t icon;
uint16_t logMessageTargeted;
uint16_t logMessageUntargeted;
uint8_t emoteMode;
Emote( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
};
@ -1614,6 +1615,19 @@ struct EmoteCategory
EmoteCategory( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
};
struct EmoteMode
{
std::string name;
uint8_t emoteCategory;
int32_t textCommand;
uint16_t icon;
uint16_t logMessageTargeted;
uint16_t logMessageUntargeted;
EmoteMode( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
};
struct ENpcBase
{
std::vector< uint32_t > eNpcData;
@ -4133,6 +4147,7 @@ struct ZoneSharedGroup
xiv::exd::Exd m_DpsChallengeTransientDat;
xiv::exd::Exd m_EmoteDat;
xiv::exd::Exd m_EmoteCategoryDat;
xiv::exd::Exd m_EmoteModeDat;
xiv::exd::Exd m_ENpcBaseDat;
xiv::exd::Exd m_ENpcResidentDat;
xiv::exd::Exd m_EObjDat;
@ -4861,6 +4876,7 @@ struct ZoneSharedGroup
std::set< uint32_t > m_DpsChallengeOfficerIdList;
std::set< uint32_t > m_DpsChallengeTransientIdList;
std::set< uint32_t > m_EmoteIdList;
std::set< uint32_t > m_EmoteModeIdList;
std::set< uint32_t > m_EmoteCategoryIdList;
std::set< uint32_t > m_ENpcBaseIdList;
std::set< uint32_t > m_ENpcResidentIdList;
@ -5823,6 +5839,12 @@ const std::set< uint32_t >& getEmoteIdList()
loadIdList( m_EmoteDat, m_EmoteIdList );
return m_EmoteIdList;
}
const std::set< uint32_t >& getEmoteModeIdList()
{
if( m_EmoteModeIdList.size() == 0 )
loadIdList( m_EmoteModeDat, m_EmoteModeIdList );
return m_EmoteModeIdList;
}
const std::set< uint32_t >& getEmoteCategoryIdList()
{
if( m_EmoteCategoryIdList.size() == 0 )

View file

@ -46,7 +46,9 @@ public:
Crafting = 0x05,
Gathering = 0x06,
Melding = 0x07,
SMachine = 0x08
SMachine = 0x08,
Carry = 0x09,
EmoteMode = 0x0B
};
/*! ModelType as found in eventsystemdefine.exd */

View file

@ -150,15 +150,17 @@ void Core::Network::GameConnection::clientTriggerHandler( const Packets::FFXIVAR
if( !emoteData )
return;
// TODO: This is wrong!! EmoteCategory does not define whether an emote is persistent or not.
// What defines an emote as persistent is EmoteData != 0
bool isPersistent = emoteData->emoteCategory == static_cast< uint8_t >( EmoteCategory::Persistent );
bool isPersistent = emoteData->emoteMode != 0;
if( isPersistent )
{
player.setStance( Entity::Chara::Stance::Passive );
player.setAutoattack( false );
player.setPersistentEmote( emoteId );
player.setPersistentEmote( emoteData->emoteMode );
player.setStatus( Entity::Chara::ActorStatus::EmoteMode );
player.sendToInRangeSet(
boost::make_shared< ActorControlPacket142 >( player.getId(), ActorControlType::SetStatus,
static_cast< uint8_t >( Entity::Chara::ActorStatus::EmoteMode ) ), true );
}
player.emote( emoteId, targetId, isSilent );