-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edc7543
commit 276d636
Showing
2 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
139 changes: 139 additions & 0 deletions
139
FFXIVClientStructs/FFXIV/Client/Game/CurrencyManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
namespace FFXIVClientStructs.FFXIV.Client.Game; | ||
|
||
[StructLayout(LayoutKind.Explicit, Size = 0x30)] | ||
public unsafe partial struct CurrencyManager { | ||
[StaticAddress("48 8B 1D ?? ?? ?? ?? 48 85 DB 74 15 48 8B CB E8 ?? ?? ?? ?? BA ?? ?? ?? ?? 48 8B CB E8 ?? ?? ?? ?? 33 D2", 3, isPointer: true)] | ||
public static partial CurrencyManager* Instance(); | ||
|
||
/// <remarks> | ||
/// This bucket holds the following items:<br/> | ||
/// <code> | ||
/// |-----------|--------|-------------------------|<br/> | ||
/// | SpecialId | ItemId | Item Name |<br/> | ||
/// |-----------|--------|-------------------------|<br/> | ||
/// | 1 | 17833 | Yellow Crafters' Scrip |<br/> | ||
/// | 2 | 25199 | White Crafters' Scrip |<br/> | ||
/// | 3 | 17834 | Yellow Gatherers' Scrip |<br/> | ||
/// | 4 | 25200 | White Gatherers' Scrip |<br/> | ||
/// | 5 | 10307 | Centurio Seal |<br/> | ||
/// | 6 | 33913 | Purple Crafters' Scrip |<br/> | ||
/// | 7 | 33914 | Purple Gatherers' Scrip |<br/> | ||
/// |-----------|--------|-------------------------| | ||
/// </code> | ||
/// </remarks> | ||
[FieldOffset(0x0)] public StdMap<uint, SpecialCurrencyItem> SpecialItemBucket; | ||
|
||
/// <remarks> | ||
/// This bucket holds the following items:<br/> | ||
/// <code> | ||
/// |--------|-------------------------|<br/> | ||
/// | ItemId | Item Name |<br/> | ||
/// |--------|-------------------------|<br/> | ||
/// | 30341 | Faux Leaf |<br/> | ||
/// | 38534 | Sil'dihn Silver |<br/> | ||
/// | 39885 | Shishu Coin |<br/> | ||
/// | 21072 | Venture |<br/> | ||
/// | 21073 | Ixali Oaknot |<br/> | ||
/// | 21074 | Vanu Whitebone |<br/> | ||
/// | 21075 | Sylphic Goldleaf |<br/> | ||
/// | 21076 | Steel Amalj'ok |<br/> | ||
/// | 21077 | Rainbowtide Psashp |<br/> | ||
/// | 21078 | Titan Cobaltpiece |<br/> | ||
/// | 21079 | Black Copper Gil |<br/> | ||
/// | 21080 | Carved Kupo Nut |<br/> | ||
/// | 21081 | Kojin Sango |<br/> | ||
/// | 28186 | Fae Fancy |<br/> | ||
/// | 28187 | Qitari Compliment |<br/> | ||
/// | 28188 | Hammered Frogment |<br/> | ||
/// | 41629 | MGF |<br/> | ||
/// | 37854 | Omicron Omnitoken |<br/> | ||
/// | 28063 | Skybuilders' Scrip |<br/> | ||
/// | 26533 | Sack of Nuts |<br/> | ||
/// | 38952 | Loporrit Carat |<br/> | ||
/// | 21935 | Ananta Dreamstaff |<br/> | ||
/// | 36656 | Trophy Crystal |<br/> | ||
/// | 36657 | Arkasodara Pana |<br/> | ||
/// | 21172 | Achievement Certificate |<br/> | ||
/// | 21173 | |<br/> | ||
/// | 26807 | Bicolor Gemstone |<br/> | ||
/// | 41079 | Aloalo Coin |<br/> | ||
/// | 22525 | Namazu Koban |<br/> | ||
/// |--------|-------------------------| | ||
/// </code> | ||
/// </remarks> | ||
[FieldOffset(0x10)] public StdMap<uint, CurrencyItem> ItemBucket; | ||
|
||
/// <remarks> | ||
/// This bucket holds the following items:<br/> | ||
/// <code> | ||
/// |--------|-------------------------|<br/> | ||
/// | ItemId | Item Name |<br/> | ||
/// |--------|-------------------------|<br/> | ||
/// | 33138 | |<br/> | ||
/// |--------|-------------------------| | ||
/// </code> | ||
/// </remarks> | ||
[FieldOffset(0x20)] public StdMap<uint, UnknownItem> UnknownItemBucket; | ||
|
||
/// <remarks> | ||
/// Used for items in <see cref="SpecialItemBucket"/> only. | ||
/// </remarks> | ||
[MemberFunction("E8 ?? ?? ?? ?? 8B D8 EB 11")] | ||
public partial uint GetItemIdBySpecialId(byte specialId); | ||
|
||
[MemberFunction("E8 ?? ?? ?? ?? 3B C3 76 0A")] | ||
public partial uint GetItemCount(uint itemId); | ||
|
||
[MemberFunction("E8 ?? ?? ?? ?? 0F B7 CF 03 CB")] | ||
public partial uint GetItemMaxCount(uint itemId); | ||
|
||
[MemberFunction("E8 ?? ?? ?? ?? 39 06")] | ||
public partial uint GetItemCountRemaining(uint itemId); // returns maxCount - count | ||
|
||
/// <remarks>Checks if the item is in any bucket, regardless of its Count.</remarks> | ||
/// <returns>Returns <c>true</c> when the player has owned this item before, <c>false</c> otherwise.</returns> | ||
[MemberFunction("E8 ?? ?? ?? ?? 84 C0 41 8B CD")] | ||
public partial bool IsItemKnown(uint itemId); | ||
|
||
[MemberFunction("E8 ?? ?? ?? ?? 84 C0 75 32 8B D7")] | ||
public partial bool IsItemLimited(uint itemId); | ||
|
||
/// <summary> | ||
/// Fills data for a currency item. | ||
/// </summary> | ||
/// <remarks>Only used in ProcessActorControlPacket.</remarks> | ||
/// <param name="specialId"> | ||
/// If -1, <see cref="UnknownItemBucket"/> is used.<br/> | ||
/// If 0, <see cref="ItemBucket"/> is used.<br/> | ||
/// Otherwise, <see cref="SpecialItemBucket"/> is used and this value is assigned to <see cref="SpecialCurrencyItem.SpecialId"/>. | ||
/// </param> | ||
/// <param name="itemId">The ID of the Item.</param> | ||
/// <param name="maxCount">The maximum amount of this currency a player can have.</param> | ||
/// <param name="count">The amount of this currency currently held by the player.</param> | ||
/// <param name="isUnlimited">Wether the currency has a limit or not.</param> | ||
[MemberFunction("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 40 41 8B D8")] | ||
public partial void SetItemData(sbyte specialId, uint itemId, uint maxCount, uint count, bool isUnlimited); | ||
|
||
[StructLayout(LayoutKind.Explicit, Size = 0x20)] | ||
public struct SpecialCurrencyItem { | ||
[FieldOffset(0x0)] public byte SpecialId; | ||
[FieldOffset(0x4)] public uint MaxCount; | ||
[FieldOffset(0x8)] public uint Count; | ||
} | ||
|
||
[StructLayout(LayoutKind.Explicit, Size = 0x20)] | ||
public struct CurrencyItem { | ||
[FieldOffset(0x0)] public ushort MaxCount; | ||
[FieldOffset(0x2)] public ushort Count; | ||
[FieldOffset(0x4)] public bool IsUnlimited; | ||
// [FieldOffset(0x5)] public byte Unk5; | ||
} | ||
|
||
// unknown struct | ||
[StructLayout(LayoutKind.Explicit, Size = 0x20)] | ||
public struct UnknownItem { | ||
[FieldOffset(0x0)] public uint MaxCount; | ||
[FieldOffset(0x4)] public ushort Count; | ||
[FieldOffset(0x8)] public bool IsUnlimited; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters