diff --git a/deps/datReader/Exd/Structs.h b/deps/datReader/Exd/Structs.h index 688eb16e..1f437056 100644 --- a/deps/datReader/Exd/Structs.h +++ b/deps/datReader/Exd/Structs.h @@ -1119,7 +1119,6 @@ namespace Component::Excel int8_t CNT; int8_t GEN; int8_t DEF; - int8_t padding0[2]; }; /* 201018 */ @@ -1141,14 +1140,6 @@ namespace Component::Excel float RotateSpeed_WOW; float RotateSpeed_AutoRun; float RotateSpeed_LockOn; - float RotateAccel_FFXIVRun; - float RotateAccel_FFXIVWalk; - float RotateAccel_LockOn; - float BattleMoveSpeed_Run; - float BattleMoveSpeed_RunLR; - float BattleMoveSpeed_Back; - float ScaleMale[6]; - float ScaleFemale[6]; int32_t Model; int32_t EquipHead; int32_t EquipBody; @@ -1157,19 +1148,12 @@ namespace Component::Excel uint16_t BGM; uint16_t Icon; uint16_t Action[2]; - uint8_t ExitMoveDist; - uint8_t ExitMoveSpeed; - uint8_t UIPriority; + uint16_t unknown[2]; + uint8_t unknown2[6]; uint8_t RadiusRate; - uint8_t BaseMotionSpeed_Run; - uint8_t BaseMotionSpeed_Walk; - uint8_t LinkNum; - int8_t SaveIndex; - uint8_t padding1 : 5; - uint8_t ExHotbarEnableConfig : 1; - uint8_t IsFloat : 1; - uint8_t IsEmote : 1; - int8_t padding2[3]; + uint8_t unknown3[3]; + int8_t MountOrder; + uint8_t unknown4 : 4; }; /* 201019 */ diff --git a/src/common/Common.h b/src/common/Common.h index 64f66173..5375c46c 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -899,6 +899,7 @@ namespace Sapphire::Common KeyItemAction = 1, ItemActionVFX = 852, ItemActionVFX2 = 944, + ItemActionMount = 1322, }; enum ActionEffectDisplayType : uint8_t diff --git a/src/common/Network/CommonActorControl.h b/src/common/Network/CommonActorControl.h index dd40b518..1b0629c9 100644 --- a/src/common/Network/CommonActorControl.h +++ b/src/common/Network/CommonActorControl.h @@ -278,6 +278,12 @@ namespace Sapphire::Network::ActorControl */ SetMountSpeed = 0x39F, + /*! + * param1 = mount ID + * param2 = unlock/lock (1/0) + */ + SetMountBitmask = 0x387, + Dismount = 0x3A1, // updated 4.5 // Duty Recorder diff --git a/src/world/Action/ItemAction.cpp b/src/world/Action/ItemAction.cpp index 89d57a26..15edc483 100644 --- a/src/world/Action/ItemAction.cpp +++ b/src/world/Action/ItemAction.cpp @@ -51,6 +51,13 @@ void ItemAction::execute() break; } + + case Common::ItemActionType::ItemActionMount: + { + handleMountItem(); + + break; + } } } @@ -72,4 +79,12 @@ void ItemAction::handleVFXItem() effectPacket->addTargetEffect( effect, static_cast< uint64_t >( getSourceChara()->getId() ) ); m_pSource->sendToInRangeSet( effectPacket, true ); +} + +void ItemAction::handleMountItem() +{ + auto player = getSourceChara()->getAsPlayer(); + + player->unlockMount( m_itemAction->data().Calcu0Arg[ 0 ] ); + player->dropInventoryItem ( static_cast< Common::InventoryType >( m_itemSourceContainer ), m_itemSourceSlot ); } \ No newline at end of file diff --git a/src/world/Action/ItemAction.h b/src/world/Action/ItemAction.h index a3b60faa..d4a3d394 100644 --- a/src/world/Action/ItemAction.h +++ b/src/world/Action/ItemAction.h @@ -27,6 +27,8 @@ namespace Sapphire::World::Action private: void handleVFXItem(); + void handleMountItem(); + private: std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::ItemAction > > m_itemAction; diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index ceab1ebc..976d9b8d 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -1160,6 +1160,19 @@ const Sapphire::Entity::Player::OrchestrionList& Sapphire::Entity::Player::getOr return m_orchestrion; } +void Sapphire::Entity::Player::unlockMount( uint32_t mountId ) +{ + auto& exdData = Common::Service< Data::ExdData >::ref(); + auto mount = exdData.getRow< Component::Excel::Mount >( mountId ); + + if( mount->data().MountOrder == -1 ) + return; + + m_mountGuide[ mount->data().MountOrder / 8 ] |= ( 1 << ( mount->data().MountOrder % 8 ) ); + + queuePacket( makeActorControlSelf( getId(), Network::ActorControl::SetMountBitmask, mount->data().MountOrder, 1 ) ); +} + Sapphire::Entity::Player::MountList& Sapphire::Entity::Player::getMountGuideBitmask() { return m_mountGuide; @@ -1379,6 +1392,9 @@ void Sapphire::Entity::Player::setTitle( uint16_t titleId ) void Sapphire::Entity::Player::setMaxGearSets( uint8_t amount ) { + if( amount == 1 ) + amount = 5; + m_equippedMannequin = amount; queuePacket( makeActorControlSelf( getId(), SetMaxGearSets, m_equippedMannequin ) ); diff --git a/src/world/Actor/Player.h b/src/world/Actor/Player.h index 3c072ed9..d65a6195 100644 --- a/src/world/Actor/Player.h +++ b/src/world/Actor/Player.h @@ -464,6 +464,9 @@ namespace Sapphire::Entity /*! return a const pointer to the orchestrion bitmask array */ const OrchestrionList& getOrchestrionBitmask() const; + /*! unlock a mount */ + void unlockMount( uint32_t mountId ); + /*! return a const pointer to the setMount guide bitmask array */ MountList& getMountGuideBitmask();