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
|
||||||
|
|
||||||
|
|
|
@ -132,6 +132,7 @@ void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost:
|
||||||
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() );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
|
|
@ -70,6 +70,7 @@ enum GmCommand
|
||||||
Exp = 0x0068,
|
Exp = 0x0068,
|
||||||
Inv = 0x006A,
|
Inv = 0x006A,
|
||||||
|
|
||||||
|
Mount = 0x0071,
|
||||||
Orchestrion = 0x0074,
|
Orchestrion = 0x0074,
|
||||||
|
|
||||||
Item = 0x00C8,
|
Item = 0x00C8,
|
||||||
|
@ -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;
|
||||||
|
@ -412,6 +432,7 @@ 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