Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DrawDataContainer.LoadGearsetData #1277

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using FFXIVClientStructs.FFXIV.Client.Game.Network;
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;

Expand Down Expand Up @@ -70,6 +71,9 @@ public ref EquipmentModelId Equipment(EquipmentSlot slot) {
[MemberFunction("E8 ?? ?? ?? ?? EB 50 44 8B 03")]
public partial void SetGlasses(int index, ushort id);

[MemberFunction("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 44 0F B6 B9")]
public partial void LoadGearsetData(PacketPlayerGearsetData* gearsetData);

public enum EquipmentSlot : uint {
Head = 0,
Body = 1,
Expand Down Expand Up @@ -200,3 +204,11 @@ public struct EquipmentModelId {

[FieldOffset(0), CExportIgnore] public ulong Value;
}

[StructLayout(LayoutKind.Explicit, Size = 4)]
public struct LegacyEquipmentModelId {
[FieldOffset(0)] public ushort Id;
[FieldOffset(2)] public byte Variant;
[FieldOffset(3)] public byte Stain;
// Second Stain id is stored separately
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using FFXIVClientStructs.FFXIV.Client.Game.Character;

namespace FFXIVClientStructs.FFXIV.Client.Game.Network;

[GenerateInterop]
[StructLayout(LayoutKind.Explicit, Size = 0x46)]
public partial struct PacketPlayerGearsetData {
// Stores the weapon data. Includes both dyes in the data. </summary>
[FieldOffset(0x00)] public WeaponModelId MainhandWeaponData;
[FieldOffset(0x08)] public WeaponModelId OffhandWeaponData;
[FieldOffset(0x10)] public byte CrestBitField; // A Bitfield:: ShieldCrest == 1, HeadCrest == 2, Chest Crest == 4
[FieldOffset(0x11)] public byte JobId; // Job ID associated with the gearset change.
[FieldOffset(0x12)] private byte Unk12; // Flicks from 0 to 128 (anywhere inbetween), have yet to associate what it is linked to. Remains the same when flicking between gearsets of the same job.
[FieldOffset(0x13)] private byte Unk13; // I have never seen this be anything other than 0.
[FieldOffset(0x14), FixedSizeArray] internal FixedSizeArray10<LegacyEquipmentModelId> _equipmentModelIds;
[FieldOffset(0x3C), FixedSizeArray] internal FixedSizeArray10<byte> _equipmentSecondaryDyes;
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public unsafe partial struct RaptureGearsetModule {
[MemberFunction("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 48 8B F9 41 0F B6 F0 48 8D 0D")]
public partial int EquipGearset(int gearsetId, byte glamourPlateId = 0);

[MemberFunction("40 55 53 56 57 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4C 63 FA")]
public partial int EquipGearsetInternal(int gearsetId, byte glamourPlateId = 0);

/// <summary>
/// Save the player's current inventory to a new gearset at the next possible ID.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions ida/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ functions:
0x140A03370: ProcessPacketPlayerStateFlags
0x140A03390: ProcessPacketPlayerClassInfo
0x140A034C0: ProcessPacketPlayerBlueMageActions
0x140A034E0: ProcessPacketPlayerGearsetData
0x140A03520: ProcessPacketUpdateRecastTimes
0x140A03570: ProcessPacketActorSetPos
0x140A03590: ProcessPacketActorMove
Expand Down Expand Up @@ -8358,6 +8359,7 @@ classes:
base: Client::Game::Character::ContainerInterface
funcs:
# 0x1413171F0: ctor # inlined at 0x1408CF5D2
0x140842F50: LoadGearsetData
0x140843E20: LoadWeapon
0x140844AE0: HideWeapons
0x1408454C0: LoadEquipment
Expand Down
Loading