1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-06-13 19:07:45 +00:00

Merge pull request #754 from Skyliegirl33/gearset-implementation

[3.x]Implement mount unlocking
This commit is contained in:
Mordred 2022-01-16 23:19:48 +01:00 committed by GitHub
commit 7402327d26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 48 additions and 21 deletions

View file

@ -1119,7 +1119,6 @@ namespace Component::Excel
int8_t CNT; int8_t CNT;
int8_t GEN; int8_t GEN;
int8_t DEF; int8_t DEF;
int8_t padding0[2];
}; };
/* 201018 */ /* 201018 */
@ -1141,14 +1140,6 @@ namespace Component::Excel
float RotateSpeed_WOW; float RotateSpeed_WOW;
float RotateSpeed_AutoRun; float RotateSpeed_AutoRun;
float RotateSpeed_LockOn; 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 Model;
int32_t EquipHead; int32_t EquipHead;
int32_t EquipBody; int32_t EquipBody;
@ -1157,19 +1148,12 @@ namespace Component::Excel
uint16_t BGM; uint16_t BGM;
uint16_t Icon; uint16_t Icon;
uint16_t Action[2]; uint16_t Action[2];
uint8_t ExitMoveDist; uint16_t unknown[2];
uint8_t ExitMoveSpeed; uint8_t unknown2[6];
uint8_t UIPriority;
uint8_t RadiusRate; uint8_t RadiusRate;
uint8_t BaseMotionSpeed_Run; uint8_t unknown3[3];
uint8_t BaseMotionSpeed_Walk; int8_t MountOrder;
uint8_t LinkNum; uint8_t unknown4 : 4;
int8_t SaveIndex;
uint8_t padding1 : 5;
uint8_t ExHotbarEnableConfig : 1;
uint8_t IsFloat : 1;
uint8_t IsEmote : 1;
int8_t padding2[3];
}; };
/* 201019 */ /* 201019 */

View file

@ -899,6 +899,7 @@ namespace Sapphire::Common
KeyItemAction = 1, KeyItemAction = 1,
ItemActionVFX = 852, ItemActionVFX = 852,
ItemActionVFX2 = 944, ItemActionVFX2 = 944,
ItemActionMount = 1322,
}; };
enum ActionEffectDisplayType : uint8_t enum ActionEffectDisplayType : uint8_t

View file

@ -278,6 +278,12 @@ namespace Sapphire::Network::ActorControl
*/ */
SetMountSpeed = 0x39F, SetMountSpeed = 0x39F,
/*!
* param1 = mount ID
* param2 = unlock/lock (1/0)
*/
SetMountBitmask = 0x387,
Dismount = 0x3A1, // updated 4.5 Dismount = 0x3A1, // updated 4.5
// Duty Recorder // Duty Recorder

View file

@ -51,6 +51,13 @@ void ItemAction::execute()
break; break;
} }
case Common::ItemActionType::ItemActionMount:
{
handleMountItem();
break;
}
} }
} }
@ -72,4 +79,12 @@ void ItemAction::handleVFXItem()
effectPacket->addTargetEffect( effect, static_cast< uint64_t >( getSourceChara()->getId() ) ); effectPacket->addTargetEffect( effect, static_cast< uint64_t >( getSourceChara()->getId() ) );
m_pSource->sendToInRangeSet( effectPacket, true ); 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 );
} }

View file

@ -27,6 +27,8 @@ namespace Sapphire::World::Action
private: private:
void handleVFXItem(); void handleVFXItem();
void handleMountItem();
private: private:
std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::ItemAction > > m_itemAction; std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::ItemAction > > m_itemAction;

View file

@ -1160,6 +1160,19 @@ const Sapphire::Entity::Player::OrchestrionList& Sapphire::Entity::Player::getOr
return m_orchestrion; 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() Sapphire::Entity::Player::MountList& Sapphire::Entity::Player::getMountGuideBitmask()
{ {
return m_mountGuide; return m_mountGuide;
@ -1379,6 +1392,9 @@ void Sapphire::Entity::Player::setTitle( uint16_t titleId )
void Sapphire::Entity::Player::setMaxGearSets( uint8_t amount ) void Sapphire::Entity::Player::setMaxGearSets( uint8_t amount )
{ {
if( amount == 1 )
amount = 5;
m_equippedMannequin = amount; m_equippedMannequin = amount;
queuePacket( makeActorControlSelf( getId(), SetMaxGearSets, m_equippedMannequin ) ); queuePacket( makeActorControlSelf( getId(), SetMaxGearSets, m_equippedMannequin ) );

View file

@ -464,6 +464,9 @@ namespace Sapphire::Entity
/*! return a const pointer to the orchestrion bitmask array */ /*! return a const pointer to the orchestrion bitmask array */
const OrchestrionList& getOrchestrionBitmask() const; const OrchestrionList& getOrchestrionBitmask() const;
/*! unlock a mount */
void unlockMount( uint32_t mountId );
/*! return a const pointer to the setMount guide bitmask array */ /*! return a const pointer to the setMount guide bitmask array */
MountList& getMountGuideBitmask(); MountList& getMountGuideBitmask();