mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 11:07:45 +00:00
Merge 47bd8cfdea
into dcaffaa68b
This commit is contained in:
commit
1023cfe15b
7 changed files with 84 additions and 36 deletions
|
@ -678,7 +678,9 @@ namespace Common {
|
||||||
|
|
||||||
GearSetEquipMsg = 0x321,
|
GearSetEquipMsg = 0x321,
|
||||||
|
|
||||||
|
ToggleMountUnlock = 0x387,
|
||||||
ToggleOrchestrionUnlock = 0x396,
|
ToggleOrchestrionUnlock = 0x396,
|
||||||
|
|
||||||
Dismount = 0x3a0
|
Dismount = 0x3a0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -621,6 +621,17 @@ void Core::Entity::Player::learnSong( uint8_t songId, uint32_t itemId )
|
||||||
queuePacket( ActorControlPacket143( getId(), ToggleOrchestrionUnlock, songId, 1, itemId ) );
|
queuePacket( ActorControlPacket143( getId(), ToggleOrchestrionUnlock, songId, 1, itemId ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Core::Entity::Player::learnMount( uint8_t mountId )
|
||||||
|
{
|
||||||
|
uint16_t index;
|
||||||
|
uint8_t value;
|
||||||
|
Util::valueToFlagByteIndexValue( mountId, value, index );
|
||||||
|
|
||||||
|
m_mountGuide[index] |= value;
|
||||||
|
|
||||||
|
queuePacket( ActorControlPacket143( getId(), ToggleMountUnlock, mountId, 1 ) );
|
||||||
|
}
|
||||||
|
|
||||||
bool Core::Entity::Player::isActionLearned( uint8_t actionId ) const
|
bool Core::Entity::Player::isActionLearned( uint8_t actionId ) const
|
||||||
{
|
{
|
||||||
uint16_t index;
|
uint16_t index;
|
||||||
|
|
|
@ -385,6 +385,8 @@ public:
|
||||||
void learnAction( uint8_t actionId );
|
void learnAction( uint8_t actionId );
|
||||||
/*! learn a song / update the unlock bitmask. */
|
/*! learn a song / update the unlock bitmask. */
|
||||||
void learnSong( uint8_t songId, uint32_t itemId );
|
void learnSong( uint8_t songId, uint32_t itemId );
|
||||||
|
/*! get a mount / update the unlock bitmask. */
|
||||||
|
void learnMount( uint8_t mountId );
|
||||||
/*! check if an action is already unlocked in the bitmask. */
|
/*! check if an action is already unlocked in the bitmask. */
|
||||||
bool isActionLearned( uint8_t actionId ) const;
|
bool isActionLearned( uint8_t actionId ) const;
|
||||||
/*! return a const pointer to the unlock bitmask array */
|
/*! return a const pointer to the unlock bitmask array */
|
||||||
|
|
|
@ -378,7 +378,7 @@ void Core::Entity::Player::updateSql()
|
||||||
|
|
||||||
std::vector< uint8_t > orchestrionVec( sizeof( m_orchestrion ) );
|
std::vector< uint8_t > orchestrionVec( sizeof( m_orchestrion ) );
|
||||||
memcpy( orchestrionVec.data(), m_orchestrion, sizeof( m_orchestrion ) );
|
memcpy( orchestrionVec.data(), m_orchestrion, sizeof( m_orchestrion ) );
|
||||||
stmt->setBinary( 42, mountsVec );
|
stmt->setBinary( 43, orchestrionVec );
|
||||||
|
|
||||||
stmt->setInt( 44, 0 ); // EquippedMannequin
|
stmt->setInt( 44, 0 ); // EquippedMannequin
|
||||||
|
|
||||||
|
|
|
@ -127,11 +127,12 @@ void Core::DebugCommandHandler::scriptReload( char * data, Entity::Player& playe
|
||||||
void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command )
|
void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command )
|
||||||
{
|
{
|
||||||
player.sendDebug( "Registered debug commands:" );
|
player.sendDebug( "Registered debug commands:" );
|
||||||
for ( auto cmd : m_commandMap )
|
for( auto cmd : m_commandMap )
|
||||||
{
|
{
|
||||||
if ( player.getGmRank( ) >= cmd.second->m_gmLevel )
|
if( player.getGmRank() >= cmd.second->m_gmLevel )
|
||||||
{
|
{
|
||||||
player.sendDebug( " - " + cmd.first + " - " + cmd.second->getHelpText( ) );
|
player.sendDebug( " - " + cmd.first + " - " + cmd.second->getHelpText() );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,26 +237,26 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost:
|
||||||
}
|
}
|
||||||
else if( subCommand == "classjob" )
|
else if( subCommand == "classjob" )
|
||||||
{
|
{
|
||||||
int32_t id;
|
int32_t id;
|
||||||
|
|
||||||
sscanf( params.c_str(), "%d", &id );
|
sscanf( params.c_str(), "%d", &id );
|
||||||
|
|
||||||
if( player.getLevelForClass( static_cast< Common::ClassJob > ( id ) ) == 0 )
|
if( player.getLevelForClass( static_cast< Common::ClassJob > ( id ) ) == 0 )
|
||||||
{
|
{
|
||||||
player.setLevelForClass( 1, static_cast< Common::ClassJob > ( id ) );
|
player.setLevelForClass( 1, static_cast< Common::ClassJob > ( id ) );
|
||||||
player.setClassJob( static_cast< Common::ClassJob > ( id ) );
|
player.setClassJob( static_cast< Common::ClassJob > ( id ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
player.setClassJob( static_cast< Common::ClassJob > ( id ) );
|
player.setClassJob( static_cast< Common::ClassJob > ( id ) );
|
||||||
}
|
}
|
||||||
else if ( subCommand == "cfpenalty" )
|
else if( subCommand == "cfpenalty" )
|
||||||
{
|
{
|
||||||
int32_t minutes;
|
int32_t minutes;
|
||||||
sscanf( params.c_str(), "%d", &minutes );
|
sscanf( params.c_str(), "%d", &minutes );
|
||||||
|
|
||||||
player.setCFPenaltyMinutes( minutes );
|
player.setCFPenaltyMinutes( minutes );
|
||||||
}
|
}
|
||||||
else if ( subCommand == "eorzeatime" )
|
else if( subCommand == "eorzeatime" )
|
||||||
{
|
{
|
||||||
uint64_t timestamp;
|
uint64_t timestamp;
|
||||||
sscanf( params.c_str(), "%" SCNu64, ×tamp );
|
sscanf( params.c_str(), "%" SCNu64, ×tamp );
|
||||||
|
@ -263,7 +264,7 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost:
|
||||||
player.setEorzeaTimeOffset( timestamp );
|
player.setEorzeaTimeOffset( timestamp );
|
||||||
player.sendNotice( "Eorzea time offset: " + std::to_string( timestamp ) );
|
player.sendNotice( "Eorzea time offset: " + std::to_string( timestamp ) );
|
||||||
}
|
}
|
||||||
else if ( subCommand == "model" )
|
else if( subCommand == "model" )
|
||||||
{
|
{
|
||||||
uint32_t slot;
|
uint32_t slot;
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
|
@ -273,7 +274,7 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost:
|
||||||
player.sendModel();
|
player.sendModel();
|
||||||
player.sendDebug( "Model updated" );
|
player.sendDebug( "Model updated" );
|
||||||
}
|
}
|
||||||
else if ( subCommand == "mount" )
|
else if( subCommand == "mount" )
|
||||||
{
|
{
|
||||||
int32_t id;
|
int32_t id;
|
||||||
sscanf( params.c_str(), "%d", &id );
|
sscanf( params.c_str(), "%d", &id );
|
||||||
|
@ -394,6 +395,17 @@ void Core::DebugCommandHandler::add( char * data, Entity::Player& player, boost:
|
||||||
player.queuePacket( controlPacket );*/
|
player.queuePacket( controlPacket );*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if( subCommand == "unlock" )
|
||||||
|
{
|
||||||
|
int32_t id;
|
||||||
|
sscanf( params.c_str(), "%d", &id );
|
||||||
|
|
||||||
|
player.learnAction( id );
|
||||||
|
}
|
||||||
|
else if( subCommand == "enablecompanion" )
|
||||||
|
{
|
||||||
|
player.learnAction( 17 );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.sendUrgent( subCommand + " is not a valid ADD command." );
|
player.sendUrgent( subCommand + " is not a valid ADD command." );
|
||||||
|
@ -426,7 +438,7 @@ void Core::DebugCommandHandler::get( char * data, Entity::Player& player, boost:
|
||||||
"subCommand " + subCommand + " params: " + params );
|
"subCommand " + subCommand + " params: " + params );
|
||||||
|
|
||||||
|
|
||||||
if( ( subCommand == "pos" ) )
|
if( subCommand == "pos" )
|
||||||
{
|
{
|
||||||
|
|
||||||
int16_t map_id = g_exdData.m_zoneInfoMap[player.getCurrentZone()->getId()].map_id;
|
int16_t map_id = g_exdData.m_zoneInfoMap[player.getCurrentZone()->getId()].map_id;
|
||||||
|
@ -516,5 +528,5 @@ void Core::DebugCommandHandler::serverInfo( char * data, Entity::Player& player,
|
||||||
|
|
||||||
void Core::DebugCommandHandler::unlockCharacter( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command )
|
void Core::DebugCommandHandler::unlockCharacter( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command )
|
||||||
{
|
{
|
||||||
player.unlock( );
|
player.unlock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,7 @@ enum GmCommand
|
||||||
Exp = 0x0068,
|
Exp = 0x0068,
|
||||||
Inv = 0x006A,
|
Inv = 0x006A,
|
||||||
|
|
||||||
|
Mount = 0x0071,
|
||||||
Orchestrion = 0x0074,
|
Orchestrion = 0x0074,
|
||||||
|
|
||||||
Item = 0x00C8,
|
Item = 0x00C8,
|
||||||
|
@ -141,7 +142,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
player.sendNotice( "Race for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
player.sendNotice( "Race for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
targetPlayer->spawn( targetPlayer );
|
targetPlayer->spawn( targetPlayer );
|
||||||
auto inRange = targetPlayer->getInRangeActors();
|
auto inRange = targetPlayer->getInRangeActors();
|
||||||
for ( auto actor : inRange )
|
for( auto actor : inRange )
|
||||||
{
|
{
|
||||||
targetPlayer->despawn( actor->getAsPlayer() );
|
targetPlayer->despawn( actor->getAsPlayer() );
|
||||||
targetPlayer->spawn( actor->getAsPlayer() );
|
targetPlayer->spawn( actor->getAsPlayer() );
|
||||||
|
@ -154,7 +155,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
player.sendNotice( "Tribe for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
player.sendNotice( "Tribe for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
targetPlayer->spawn( targetPlayer );
|
targetPlayer->spawn( targetPlayer );
|
||||||
auto inRange = targetPlayer->getInRangeActors();
|
auto inRange = targetPlayer->getInRangeActors();
|
||||||
for ( auto actor : inRange )
|
for( auto actor : inRange )
|
||||||
{
|
{
|
||||||
targetPlayer->despawn( actor->getAsPlayer() );
|
targetPlayer->despawn( actor->getAsPlayer() );
|
||||||
targetPlayer->spawn( actor->getAsPlayer() );
|
targetPlayer->spawn( actor->getAsPlayer() );
|
||||||
|
@ -167,7 +168,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
player.sendNotice( "Sex for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
player.sendNotice( "Sex for " + targetPlayer->getName() + " was set to " + std::to_string( param1 ) );
|
||||||
targetPlayer->spawn( targetPlayer );
|
targetPlayer->spawn( targetPlayer );
|
||||||
auto inRange = targetActor->getInRangeActors();
|
auto inRange = targetActor->getInRangeActors();
|
||||||
for ( auto actor : inRange )
|
for( auto actor : inRange )
|
||||||
{
|
{
|
||||||
targetPlayer->despawn( actor->getAsPlayer() );
|
targetPlayer->despawn( actor->getAsPlayer() );
|
||||||
targetPlayer->spawn( actor->getAsPlayer() );
|
targetPlayer->spawn( actor->getAsPlayer() );
|
||||||
|
@ -189,7 +190,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
}
|
}
|
||||||
case GmCommand::Call:
|
case GmCommand::Call:
|
||||||
{
|
{
|
||||||
if ( targetPlayer->getZoneId() != player.getZoneId() )
|
if( targetPlayer->getZoneId() != player.getZoneId() )
|
||||||
targetPlayer->setZone( player.getZoneId() );
|
targetPlayer->setZone( player.getZoneId() );
|
||||||
|
|
||||||
targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z,
|
targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z,
|
||||||
|
@ -268,7 +269,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
}
|
}
|
||||||
case GmCommand::Inv:
|
case GmCommand::Inv:
|
||||||
{
|
{
|
||||||
if ( targetActor->getInvincibilityType() == Common::InvincibilityType::InvincibilityRefill )
|
if( targetActor->getInvincibilityType() == Common::InvincibilityType::InvincibilityRefill )
|
||||||
targetActor->setInvincibilityType( Common::InvincibilityType::InvincibilityNone );
|
targetActor->setInvincibilityType( Common::InvincibilityType::InvincibilityNone );
|
||||||
else
|
else
|
||||||
targetActor->setInvincibilityType( Common::InvincibilityType::InvincibilityRefill );
|
targetActor->setInvincibilityType( Common::InvincibilityType::InvincibilityRefill );
|
||||||
|
@ -279,11 +280,11 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
}
|
}
|
||||||
case GmCommand::Orchestrion:
|
case GmCommand::Orchestrion:
|
||||||
{
|
{
|
||||||
if ( param1 == 1 )
|
if( param1 == 1 )
|
||||||
{
|
{
|
||||||
if ( param2 == 0 )
|
if( param2 == 0 )
|
||||||
{
|
{
|
||||||
for ( uint8_t i = 0; i < 255; i++ )
|
for( uint8_t i = 0; i < 255; i++ )
|
||||||
targetActor->getAsPlayer()->learnSong( i, 0 );
|
targetActor->getAsPlayer()->learnSong( i, 0 );
|
||||||
|
|
||||||
player.sendNotice( "All Songs for " + targetPlayer->getName() +
|
player.sendNotice( "All Songs for " + targetPlayer->getName() +
|
||||||
|
@ -299,6 +300,25 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case GmCommand::Mount:
|
||||||
|
{
|
||||||
|
if( param2 == 0 )
|
||||||
|
{
|
||||||
|
for( uint8_t i = 0; i < 255; i++ )
|
||||||
|
targetActor->getAsPlayer()->learnMount( i );
|
||||||
|
|
||||||
|
player.sendNotice( "All mounts for " + targetPlayer->getName() +
|
||||||
|
" were turned on." );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetActor->getAsPlayer()->learnMount( param1 );
|
||||||
|
player.sendNotice( "Mount " + std::to_string( param1 ) + " for " + targetPlayer->getName() +
|
||||||
|
" was turned on." );
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case GmCommand::Item:
|
case GmCommand::Item:
|
||||||
{
|
{
|
||||||
if( param2 < 1 || param2 > 99 )
|
if( param2 < 1 || param2 > 99 )
|
||||||
|
@ -306,7 +326,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
param2 = 1;
|
param2 = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( param1 == 0xcccccccc ) )
|
if( param1 == 0xcccccccc )
|
||||||
{
|
{
|
||||||
player.sendUrgent( "Syntaxerror." );
|
player.sendUrgent( "Syntaxerror." );
|
||||||
return;
|
return;
|
||||||
|
@ -326,7 +346,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
{
|
{
|
||||||
uint32_t gil = targetPlayer->getCurrency( 1 );
|
uint32_t gil = targetPlayer->getCurrency( 1 );
|
||||||
|
|
||||||
if ( gil < param1 )
|
if( gil < param1 )
|
||||||
{
|
{
|
||||||
player.sendUrgent( "Player does not have enough Gil(" + std::to_string( gil ) + ")" );
|
player.sendUrgent( "Player does not have enough Gil(" + std::to_string( gil ) + ")" );
|
||||||
}
|
}
|
||||||
|
@ -381,11 +401,11 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
}
|
}
|
||||||
case GmCommand::Aetheryte:
|
case GmCommand::Aetheryte:
|
||||||
{
|
{
|
||||||
if ( param1 == 0 )
|
if( param1 == 0 )
|
||||||
{
|
{
|
||||||
if ( param2 == 0 )
|
if( param2 == 0 )
|
||||||
{
|
{
|
||||||
for ( uint8_t i = 0; i < 255; i++ )
|
for( uint8_t i = 0; i < 255; i++ )
|
||||||
targetActor->getAsPlayer()->registerAetheryte( i );
|
targetActor->getAsPlayer()->registerAetheryte( i );
|
||||||
|
|
||||||
player.sendNotice( "All Aetherytes for " + targetPlayer->getName() +
|
player.sendNotice( "All Aetherytes for " + targetPlayer->getName() +
|
||||||
|
@ -404,7 +424,7 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
case GmCommand::Teri:
|
case GmCommand::Teri:
|
||||||
{
|
{
|
||||||
auto zoneInfo = g_zoneMgr.getZone( param1 );
|
auto zoneInfo = g_zoneMgr.getZone( param1 );
|
||||||
if ( !zoneInfo )
|
if( !zoneInfo )
|
||||||
{
|
{
|
||||||
player.sendUrgent( "Invalid zone " + std::to_string( param1 ) );
|
player.sendUrgent( "Invalid zone " + std::to_string( param1 ) );
|
||||||
}
|
}
|
||||||
|
@ -412,7 +432,8 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
||||||
{
|
{
|
||||||
targetPlayer->setPosition( targetPlayer->getPos() );
|
targetPlayer->setPosition( targetPlayer->getPos() );
|
||||||
targetPlayer->performZoning( param1, targetPlayer->getPos(), 0 );
|
targetPlayer->performZoning( param1, targetPlayer->getPos(), 0 );
|
||||||
player.sendNotice( targetPlayer->getName() + " was warped to zone " + std::to_string( param1 ) + " (" + zoneInfo->getName( ) + ")" );
|
|
||||||
|
player.sendNotice( targetPlayer->getName() + " was warped to zone " + std::to_string( param1 ) + " (" + zoneInfo->getName() + ")" );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue