Skip to content

Commit 5e4fcb8

Browse files
authored
Merge pull request #1414 from Haselnussbomber/wks-events
Add WKSMechaEventModule
2 parents 377ddb3 + 89ddae7 commit 5e4fcb8

File tree

9 files changed

+174
-13
lines changed

9 files changed

+174
-13
lines changed

FFXIVClientStructs/FFXIV/Client/Game/Fate/FateContext.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Numerics;
2+
using FFXIVClientStructs.FFXIV.Client.Game.UI;
23
using FFXIVClientStructs.FFXIV.Client.System.String;
34

45
namespace FFXIVClientStructs.FFXIV.Client.Game.Fate;
@@ -78,10 +79,11 @@ public struct FateObjective {
7879
[StructLayout(LayoutKind.Explicit, Size = 0xD0)]
7980
public struct FateMapMarker {
8081
[FieldOffset(0x10)] public Utf8String Name;
81-
[FieldOffset(0x88)] public uint IconId;
82-
[FieldOffset(0x94)] public Vector3 Position;
83-
[FieldOffset(0xA0)] public float Radius;
84-
[FieldOffset(0xBA)] public ushort TerritoryId;
82+
[FieldOffset(0x78)] public MapMarkerData MapMarkerData;
83+
[FieldOffset(0x88), Obsolete("Use MapMarkerData.IconId")] public uint IconId;
84+
[FieldOffset(0x94), Obsolete("Use MapMarkerData.Position")] public Vector3 Position;
85+
[FieldOffset(0xA0), Obsolete("Use MapMarkerData.Radius")] public float Radius;
86+
[FieldOffset(0xBA), Obsolete("Use MapMarkerData.TerritoryTypeId")] public ushort TerritoryId;
8587
}
8688
}
8789

FFXIVClientStructs/FFXIV/Client/Game/UI/Map.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ public unsafe partial struct MapMarkerData {
4848
[FieldOffset(0x08)] public Utf8String* TooltipString;
4949
[FieldOffset(0x10)] public uint IconId;
5050

51-
[FieldOffset(0x1C)] public float X;
52-
[FieldOffset(0x20)] public float Y;
53-
[FieldOffset(0x24)] public float Z;
51+
[FieldOffset(0x1C)] public global::System.Numerics.Vector3 Position;
52+
[FieldOffset(0x1C), Obsolete("Use Position.X")] public float X;
53+
[FieldOffset(0x20), Obsolete("Use Position.Y")] public float Y;
54+
[FieldOffset(0x24), Obsolete("Use Position.Z")] public float Z;
5455
[FieldOffset(0x28)] public float Radius;
5556

5657
[FieldOffset(0x30)] public uint MapId;
@@ -63,6 +64,7 @@ public unsafe partial struct MapMarkerData {
6364
[FieldOffset(0x44)] public ushort DataId;
6465
[FieldOffset(0x46)] public byte MarkerType;
6566
[FieldOffset(0x47)] public sbyte EventState;
67+
[FieldOffset(0x48)] public byte Flags; // & 1 == IsHidden?
6668

6769
[MemberFunction("E8 ?? ?? ?? ?? 48 8B 53 ?? 8B 86")]
6870
public partial MapMarkerData* SetData(

FFXIVClientStructs/FFXIV/Client/Game/WKS/WKSManager.cs

+10-3
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,29 @@ public unsafe partial struct WKSManager {
1414

1515
[FieldOffset(0x18)] public ushort TerritoryId;
1616

17+
/// <remarks> RowId of WKSDevGrade sheet. </remarks>
1718
[FieldOffset(0x4A)] public ushort DevGrade;
1819

20+
/// <remarks> For Hub upgrades. RowId of WKSFateControl sheet. </remarks>
21+
[FieldOffset(0x50)] public ushort CurrentFateControlRowId;
22+
/// <remarks> For Hub upgrades. Id of Fate in FateManager. </remarks>
23+
[FieldOffset(0x52)] public ushort CurrentFateId;
24+
25+
/// <remarks> RowId of WKSMissionUnit sheet. </remarks>
1926
[FieldOffset(0xC60)] public ushort CurrentMissionUnitRowId;
2027

2128
[FieldOffset(0xC9C)] public uint FishingBait;
2229

2330
[FieldOffset(0xDB0)] private void* UnkStructDB0; // size: 0x3A8
2431
[FieldOffset(0xDB8)] private void* UnkStructDB8; // size: 0x1D0
25-
[FieldOffset(0xDC0)] private void* UnkStructDC0; // size: 0xA110
32+
[FieldOffset(0xDC0)] public WKSMechaEventModule* MechaEventModule;
2633
[FieldOffset(0xDC8)] private void* UnkStructDC8; // size: 0x10
2734
[FieldOffset(0xDD0)] private void* UnkStructDD0; // size: 0x90
28-
[FieldOffset(0xDD8)] private void* UnkStructDD8; // size: 0x2D8
35+
[FieldOffset(0xDD8)] private void* UnkStructDD8; // size: 0x2D8 - EmergencyInfo (Red Alert)
2936
[FieldOffset(0xDE0)] private void* UnkStructDE0; // size: 0x198
3037
[FieldOffset(0xDE8)] private void* UnkStructDE8; // size: 0x328
3138
[FieldOffset(0xDF0)] private void* UnkStructDF0; // size: 0x18
32-
[FieldOffset(0xDF8)] public WKSResearch* Research;
39+
[FieldOffset(0xDF8)] public WKSResearch* Research; // TODO: add suffix "Module" at some point
3340
[FieldOffset(0xE00)] private void* UnkStructE00; // size: 0x40
3441

3542
[FieldOffset(0xE08)] public StdVector<Pointer<WKSModuleBase>> Modules;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
namespace FFXIVClientStructs.FFXIV.Client.Game.WKS;
2+
3+
[GenerateInterop]
4+
[StructLayout(LayoutKind.Explicit, Size = 0x5060)]
5+
public unsafe partial struct WKSMechaEvent {
6+
[FieldOffset(0x0000)] private WKSMechaEventStageHandlerBase StageHandler1;
7+
[FieldOffset(0x0010)] private WKSMechaEventStageHandlerBase StageHandler2;
8+
[FieldOffset(0x0020)] private WKSMechaEventStageHandlerBase StageHandler3;
9+
[FieldOffset(0x0030)] private WKSMechaEventStageHandlerBase StageHandler4;
10+
[FieldOffset(0x0040)] private WKSMechaEventStageHandlerBase StageHandler5;
11+
[FieldOffset(0x0050)] private WKSMechaEventStageHandlerBase StageHandler6;
12+
[FieldOffset(0x0060)] private WKSMechaEventStageHandlerBase StageHandler7;
13+
14+
[FieldOffset(0x3850)] public StdVector<Pointer<WKSMechaEventMapMarker>> MapMarkerPtrs;
15+
[FieldOffset(0x3868), FixedSizeArray] internal FixedSizeArray30<WKSMechaEventMapMarker> _mapMarkers;
16+
17+
[FieldOffset(0x5000)] public uint YesNoAddonId;
18+
[FieldOffset(0x5004)] public uint YesNoShown;
19+
[FieldOffset(0x5008)] public WKSMechaEventStageHandlerBase* CurrentStateHandler;
20+
[FieldOffset(0x5010), CExporterExcel("WKSMechaEventData")] public nint WKSMechaEventDataRowPtr;
21+
[FieldOffset(0x5018)] public uint WKSMechaEventDataRowId;
22+
[FieldOffset(0x501C)] public WKSMechaEventFlag Flags;
23+
[FieldOffset(0x5020)] public int EventStartTimestamp;
24+
[FieldOffset(0x5024)] public int EventEndTimestamp;
25+
[FieldOffset(0x5028)] public int PilotRegistrationStartTimestamp;
26+
[FieldOffset(0x502C)] public int PilotRegistrationEndTimestamp;
27+
[FieldOffset(0x5030)] public int TeleportStartTimestamp;
28+
29+
[FieldOffset(0x5044)] public int EventProgress;
30+
[FieldOffset(0x5048)] public int EventProgressMax;
31+
[FieldOffset(0x504C)] public int Contribution;
32+
33+
[FieldOffset(0x5054)] public int PersonalProgress;
34+
[FieldOffset(0x5058)] public int PersonalProgressMax;
35+
[FieldOffset(0x505C)] public bool EnabledAutoTargeting; // currently only true for WKSMechaEventDataRowId == 1
36+
}
37+
38+
[Flags]
39+
public enum WKSMechaEventFlag : uint {
40+
// Each stage of the event has a flag
41+
42+
IsEventActive = 1 << 7
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using FFXIVClientStructs.FFXIV.Client.Game.UI;
2+
using FFXIVClientStructs.FFXIV.Client.System.String;
3+
4+
namespace FFXIVClientStructs.FFXIV.Client.Game.WKS;
5+
6+
[StructLayout(LayoutKind.Explicit, Size = 0xC8)]
7+
public struct WKSMechaEventMapMarker {
8+
[FieldOffset(0x00)] public Utf8String Name;
9+
[FieldOffset(0x68)] public MapMarkerData MapMarkerData;
10+
[FieldOffset(0xB8)] public uint WKSMechaEventDataRowId;
11+
[FieldOffset(0xBC)] public uint LayoutId;
12+
[FieldOffset(0xC0)] public uint Icon;
13+
/// <remarks>
14+
/// Type 1 = Icon 60493<br/>
15+
/// Type 2 = Icon 63889<br/>
16+
/// Type 3 + 4 = Icon 60492<br/>
17+
/// Type 5 = Icon 63884
18+
/// </remarks>
19+
[FieldOffset(0xC4)] public byte Type;
20+
[FieldOffset(0xC5)] public byte Flags;
21+
[FieldOffset(0xC6)] public byte MapMarkerDataFlags;
22+
[FieldOffset(0xC7)] public byte UnkC7;
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace FFXIVClientStructs.FFXIV.Client.Game.WKS;
2+
3+
// Client::Game::WKS::WKSMechaEventModule
4+
// Client::Game::WKS::WKSModuleBase
5+
// MechaEvent
6+
[GenerateInterop]
7+
[Inherits<WKSModuleBase>]
8+
[StructLayout(LayoutKind.Explicit, Size = 0xA110)]
9+
public unsafe partial struct WKSMechaEventModule {
10+
[FieldOffset(0x30), FixedSizeArray] internal FixedSizeArray2<WKSMechaEvent> _events;
11+
[FieldOffset(0xA0F0)] public WKSMechaEvent* CurrentEvent;
12+
13+
[FieldOffset(0xA104)] public WKSEventModuleFlag Flags;
14+
}
15+
16+
[Flags]
17+
public enum WKSEventModuleFlag : uint {
18+
HasCurrentEvent = 1 << 0,
19+
IsJoined = 1 << 7,
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace FFXIVClientStructs.FFXIV.Client.Game.WKS;
2+
3+
[GenerateInterop(isInherited: true)]
4+
[StructLayout(LayoutKind.Explicit, Size = 0x10)]
5+
public unsafe partial struct WKSMechaEventStageHandlerBase {
6+
[FieldOffset(0x08)] public WKSMechaEvent* OwnerEvent;
7+
8+
[VirtualFunction(4)]
9+
public partial int GetStageIndex();
10+
}

FFXIVClientStructs/FFXIV/Client/Game/WKS/WKSModuleBase.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ public unsafe partial struct WKSModuleBase {
77
[VirtualFunction(0)]
88
public partial WKSModuleBase* Dtor(byte freeFlags);
99

10-
// [VirtualFunction(1)]
11-
// public partial bool SetData(int a2, int a3, int a4, int a5, int a6, int a7); // ?
10+
[VirtualFunction(1)]
11+
public partial bool SetIntData(int a2, int a3, int a4, int a5, int a6, int a7);
1212

1313
[VirtualFunction(2)]
1414
public partial bool ProcessPacket(byte* packet);

ida/data.yml

+55-1
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ classes:
12881288
- ea: 0x142952168
12891289
pointer: true
12901290
funcs:
1291-
#fail 0x1415B6400: HasInstance
1291+
0x14164CAC0: HasInstance
12921292
0x14164CAE0: GetInstance
12931293
#fail 0x1415B6430: ctor
12941294
#fail 0x1415B64E0: Dtor
@@ -1910,13 +1910,15 @@ classes:
19101910
0x140D0F430: GetInstance
19111911
0x140D0F440: Load
19121912
0x140D0F8C0: Update
1913+
0x140D10370: IsFunctionUnlocked
19131914
0x140D10450: AddModule
19141915
0x140D105F0: RemoveModule
19151916
Client::Game::WKS::WKSModuleBase:
19161917
vtbls:
19171918
- ea: 0x1422915E0
19181919
vfuncs:
19191920
0: Dtor
1921+
1: SetIntData
19201922
2: ProcessPacket
19211923
Client::Game::WKS::WKSResearch: # Cosmic Research Information
19221924
vtbls:
@@ -1935,6 +1937,56 @@ classes:
19351937
0x14199C5A0: GetRatePercentage
19361938
0x14199C850: GetUnlockedStage
19371939
0x14199CD20: GetClassJobLevel
1940+
Client::Game::WKS::WKSMechaEventModule: # Mecha Events
1941+
vtbls:
1942+
- ea: 0x142291620
1943+
base: Client::Game::WKS::WKSModuleBase
1944+
funcs:
1945+
0x14194EED0: ctor
1946+
0x141951DB0: PrintLogMessage<int>
1947+
Client::Game::WKS::WKSMechaEvent:
1948+
funcs:
1949+
0x1419A0EC0: Initialize
1950+
0x1419A1590: Finalizer
1951+
0x1419A2100: IsPilotRegistrationTimeframeOpen
1952+
0x1419A2140: IsTeleportTimeframeOpen
1953+
0x1419A2190: GetEventProgressPercentage
1954+
Client::Game::WKS::WKSMechaEventStageHandlerBase:
1955+
vtbls:
1956+
- ea: 0x1422DA330
1957+
vfuncs:
1958+
0: SetOwnerEvent
1959+
4: GetStageIndex
1960+
funcs:
1961+
0x141B2F790: ctor
1962+
Client::Game::WKS::WKSMechaEventStageHandler1:
1963+
vtbls:
1964+
- ea: 0x1422DA380
1965+
base: Client::Game::WKS::WKSMechaEventStageHandlerBase
1966+
Client::Game::WKS::WKSMechaEventStageHandler2:
1967+
vtbls:
1968+
- ea: 0x1422DA3D0
1969+
base: Client::Game::WKS::WKSMechaEventStageHandlerBase
1970+
Client::Game::WKS::WKSMechaEventStageHandler3:
1971+
vtbls:
1972+
- ea: 0x1422DA420
1973+
base: Client::Game::WKS::WKSMechaEventStageHandlerBase
1974+
Client::Game::WKS::WKSMechaEventStageHandler4:
1975+
vtbls:
1976+
- ea: 0x1422DA470
1977+
base: Client::Game::WKS::WKSMechaEventStageHandlerBase
1978+
Client::Game::WKS::WKSMechaEventStageHandler5:
1979+
vtbls:
1980+
- ea: 0x1422DA4C0
1981+
base: Client::Game::WKS::WKSMechaEventStageHandlerBase
1982+
Client::Game::WKS::WKSMechaEventStageHandler6:
1983+
vtbls:
1984+
- ea: 0x1422DA510
1985+
base: Client::Game::WKS::WKSMechaEventStageHandlerBase
1986+
Client::Game::WKS::WKSMechaEventStageHandler7:
1987+
vtbls:
1988+
- ea: 0x1422DA560
1989+
base: Client::Game::WKS::WKSMechaEventStageHandlerBase
19381990
Client::System::String::Utf8String:
19391991
funcs:
19401992
0x14005A330: ctor # empty string ctor
@@ -2421,6 +2473,7 @@ classes:
24212473
funcs:
24222474
0x140C6A350: SetCondition
24232475
0x140C6A3D0: ReadPacket
2476+
0x140C6A490: HasPermission
24242477
0x140C6A610: HasPermissionCondition
24252478
0x140C6A790: GetPermissionLogMessage
24262479
0x140C6A820: GetConditionLogMessage
@@ -13523,6 +13576,7 @@ classes:
1352313576
funcs:
1352413577
0x1417315E0: ctor
1352513578
0x141731C40: Dtor
13579+
0x141738D70: ShowScreenImage
1352613580
Client::Game::Event::EventSceneModule::UISkipListener:
1352713581
vtbls:
1352813582
- ea: 0x1421B1928

0 commit comments

Comments
 (0)