1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 02:57:45 +00:00

* Add more commands/ability to unlock for mounts

This commit is contained in:
goaaats 2017-12-04 16:53:37 +01:00
parent 8152f67959
commit 9b096c72ff
5 changed files with 46 additions and 0 deletions

View file

@ -678,7 +678,9 @@ namespace Common {
GearSetEquipMsg = 0x321, GearSetEquipMsg = 0x321,
ToggleMountUnlock = 0x387,
ToggleOrchestrionUnlock = 0x396, ToggleOrchestrionUnlock = 0x396,
Dismount = 0x3a0 Dismount = 0x3a0
}; };

View file

@ -619,6 +619,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_orchestrion[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;

View file

@ -381,6 +381,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 */

View file

@ -397,6 +397,17 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::PlayerPtr pPlaye
pPlayer->queuePacket(controlPacket);*/ pPlayer->queuePacket(controlPacket);*/
} }
else if (subCommand == "unlock")
{
int32_t id;
sscanf( params.c_str(), "%d", &id );
pPlayer->learnAction( id );
}
else if (subCommand == "enablecompanion")
{
pPlayer->learnAction( 17 );
}
else else
{ {
pPlayer->sendUrgent( subCommand + " is not a valid ADD command." ); pPlayer->sendUrgent( subCommand + " is not a valid ADD command." );

View file

@ -70,6 +70,7 @@ enum GmCommand
Exp = 0x0068, Exp = 0x0068,
Inv = 0x006A, Inv = 0x006A,
Mount = 0x0071,
Orchestrion = 0x0074, Orchestrion = 0x0074,
Item = 0x00C8, Item = 0x00C8,
@ -298,6 +299,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 );
pPlayer->sendNotice( "All mounts for " + targetPlayer->getName() +
" were turned on." );
}
else
{
targetActor->getAsPlayer()->learnMount( param1 );
pPlayer->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 )