diff --git a/src/servers/Server_Common/Common.h b/src/servers/Server_Common/Common.h index e16f5035..e6030611 100644 --- a/src/servers/Server_Common/Common.h +++ b/src/servers/Server_Common/Common.h @@ -678,7 +678,9 @@ namespace Common { GearSetEquipMsg = 0x321, + ToggleMountUnlock = 0x387, ToggleOrchestrionUnlock = 0x396, + Dismount = 0x3a0 }; diff --git a/src/servers/Server_Zone/Actor/Player.cpp b/src/servers/Server_Zone/Actor/Player.cpp index 2caab4b3..c202f1ed 100644 --- a/src/servers/Server_Zone/Actor/Player.cpp +++ b/src/servers/Server_Zone/Actor/Player.cpp @@ -619,6 +619,17 @@ void Core::Entity::Player::learnSong( uint8_t songId, uint32_t 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 { uint16_t index; diff --git a/src/servers/Server_Zone/Actor/Player.h b/src/servers/Server_Zone/Actor/Player.h index 4688e5a5..63726297 100644 --- a/src/servers/Server_Zone/Actor/Player.h +++ b/src/servers/Server_Zone/Actor/Player.h @@ -381,6 +381,8 @@ public: void learnAction( uint8_t actionId ); /*! learn a song / update the unlock bitmask. */ 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. */ bool isActionLearned( uint8_t actionId ) const; /*! return a const pointer to the unlock bitmask array */ diff --git a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp index f769166b..2940e456 100644 --- a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp +++ b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp @@ -397,6 +397,17 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::PlayerPtr pPlaye 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 { pPlayer->sendUrgent( subCommand + " is not a valid ADD command." ); diff --git a/src/servers/Server_Zone/Network/Handlers/GMCommandHandlers.cpp b/src/servers/Server_Zone/Network/Handlers/GMCommandHandlers.cpp index e9a49c16..6cfd80a2 100644 --- a/src/servers/Server_Zone/Network/Handlers/GMCommandHandlers.cpp +++ b/src/servers/Server_Zone/Network/Handlers/GMCommandHandlers.cpp @@ -70,6 +70,7 @@ enum GmCommand Exp = 0x0068, Inv = 0x006A, + Mount = 0x0071, Orchestrion = 0x0074, Item = 0x00C8, @@ -298,6 +299,25 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac 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: { if( param2 < 1 || param2 > 99 )