Studium MIN/BTN deliveries

This commit is contained in:
Liza 2024-08-03 19:12:34 +02:00
parent 2a39d053ba
commit ee2b49f566
Signed by: liza
GPG Key ID: 7199F8D727D55F67
17 changed files with 771 additions and 17 deletions

View File

@ -0,0 +1,108 @@
{
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
"Author": "liza",
"TerritoryId": 613,
"AetheryteShortcut": "Ruby Sea - Onokoro",
"Groups": [
{
"Nodes": [
{
"DataId": 32140,
"Locations": [
{
"Position": {
"X": 210.5032,
"Y": 28.51213,
"Z": 718.0732
},
"MinimumAngle": 210,
"MaximumAngle": 325
},
{
"Position": {
"X": 202.0474,
"Y": 30.18633,
"Z": 700.0951
},
"MinimumAngle": 160,
"MaximumAngle": 295
},
{
"Position": {
"X": 195.6331,
"Y": 33.43727,
"Z": 695.2228
},
"MinimumAngle": 150,
"MaximumAngle": 235
}
]
},
{
"DataId": 32139,
"Locations": [
{
"Position": {
"X": 208.3533,
"Y": 28.65312,
"Z": 706.8864
},
"MinimumAngle": 180,
"MaximumAngle": 250
}
]
}
]
},
{
"Nodes": [
{
"DataId": 32135,
"Locations": [
{
"Position": {
"X": 67.65472,
"Y": 25.89518,
"Z": 652.348
},
"MinimumAngle": -105,
"MaximumAngle": 15
}
]
},
{
"DataId": 32136,
"Locations": [
{
"Position": {
"X": 41.55281,
"Y": 27.65364,
"Z": 654.9735
},
"MinimumAngle": -115,
"MaximumAngle": 35
},
{
"Position": {
"X": 52.98101,
"Y": 27.03981,
"Z": 652.5334
},
"MinimumAngle": -45,
"MaximumAngle": 55
},
{
"Position": {
"X": 71.80375,
"Y": 26.55341,
"Z": 644.8627
},
"MinimumAngle": 205,
"MaximumAngle": 335
}
]
}
]
}
]
}

View File

@ -0,0 +1,158 @@
{
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
"Author": "liza",
"TerritoryId": 961,
"AetheryteShortcut": "Elpis - Poieten Oikos",
"Groups": [
{
"Nodes": [
{
"DataId": 33938,
"Locations": [
{
"Position": {
"X": 44.65063,
"Y": 100.2818,
"Z": -531.6971
},
"MinimumAngle": 150,
"MaximumAngle": 310
}
]
},
{
"DataId": 33939,
"Locations": [
{
"Position": {
"X": 33.19277,
"Y": 104.5029,
"Z": -555.932
},
"MinimumAngle": 190,
"MaximumAngle": 350
},
{
"Position": {
"X": 65.9342,
"Y": 97.38677,
"Z": -524.9155
},
"MinimumAngle": 125,
"MaximumAngle": 295
},
{
"Position": {
"X": 74.52164,
"Y": 98.45871,
"Z": -489.864
},
"MinimumAngle": 165,
"MaximumAngle": 300
}
]
}
]
},
{
"Nodes": [
{
"DataId": 33941,
"Locations": [
{
"Position": {
"X": 279.4078,
"Y": 101.9103,
"Z": -511.9555
},
"MinimumAngle": 80,
"MaximumAngle": 215
},
{
"Position": {
"X": 265.2476,
"Y": 100.4918,
"Z": -491.8746
},
"MinimumAngle": 110,
"MaximumAngle": 180
},
{
"Position": {
"X": 290.6152,
"Y": 102.41,
"Z": -549.2336
},
"MinimumAngle": 40,
"MaximumAngle": 185
}
]
},
{
"DataId": 33940,
"Locations": [
{
"Position": {
"X": 288.9601,
"Y": 101.2474,
"Z": -520.9278
},
"MinimumAngle": 35,
"MaximumAngle": 145
}
]
}
]
},
{
"Nodes": [
{
"DataId": 33937,
"Locations": [
{
"Position": {
"X": 124.7882,
"Y": 105.6518,
"Z": -712.3575
},
"MinimumAngle": -45,
"MaximumAngle": 70
},
{
"Position": {
"X": 94.71277,
"Y": 105.52,
"Z": -696.7798
},
"MinimumAngle": -60,
"MaximumAngle": 80
},
{
"Position": {
"X": 172.8746,
"Y": 102.9022,
"Z": -700.0879
},
"MinimumAngle": -50,
"MaximumAngle": 125
}
]
},
{
"DataId": 33936,
"Locations": [
{
"Position": {
"X": 156.3894,
"Y": 103.6386,
"Z": -707.1092
},
"MinimumAngle": -85,
"MaximumAngle": 60
}
]
}
]
}
]
}

View File

@ -1,6 +1,6 @@
{ {
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json", "$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
"Author": [], "Author": "liza",
"TerritoryId": 958, "TerritoryId": 958,
"AetheryteShortcut": "Garlemald - Camp Broken Glass", "AetheryteShortcut": "Garlemald - Camp Broken Glass",
"Groups": [ "Groups": [

View File

@ -0,0 +1,158 @@
{
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
"Author": "liza",
"TerritoryId": 956,
"AetheryteShortcut": "Labyrinthos - Archeion",
"Groups": [
{
"Nodes": [
{
"DataId": 33902,
"Locations": [
{
"Position": {
"X": 88.60914,
"Y": 73.62239,
"Z": -402.4773
},
"MinimumAngle": 80,
"MaximumAngle": 235
}
]
},
{
"DataId": 33903,
"Locations": [
{
"Position": {
"X": 85.61829,
"Y": 73.2991,
"Z": -400.5821
},
"MinimumAngle": 35,
"MaximumAngle": 225
},
{
"Position": {
"X": 93.23958,
"Y": 73.67628,
"Z": -393.219
},
"MinimumAngle": -80,
"MaximumAngle": 80
},
{
"Position": {
"X": 98.62136,
"Y": 74.0167,
"Z": -394.248
},
"MinimumAngle": -140,
"MaximumAngle": 15
}
]
}
]
},
{
"Nodes": [
{
"DataId": 33905,
"Locations": [
{
"Position": {
"X": 120.6405,
"Y": 84.99234,
"Z": -556.7947
},
"MinimumAngle": -10,
"MaximumAngle": 155
},
{
"Position": {
"X": 90.8064,
"Y": 80.4303,
"Z": -549.3706
},
"MinimumAngle": -45,
"MaximumAngle": 90
},
{
"Position": {
"X": 108.5405,
"Y": 82.52325,
"Z": -552.4589
},
"MinimumAngle": -115,
"MaximumAngle": 65
}
]
},
{
"DataId": 33904,
"Locations": [
{
"Position": {
"X": 102.0981,
"Y": 81.4679,
"Z": -550.4082
},
"MinimumAngle": -90,
"MaximumAngle": 75
}
]
}
]
},
{
"Nodes": [
{
"DataId": 33901,
"Locations": [
{
"Position": {
"X": 2.243042,
"Y": 70.71661,
"Z": -453.1277
},
"MinimumAngle": 85,
"MaximumAngle": 215
},
{
"Position": {
"X": -18.2041,
"Y": 69.83583,
"Z": -464.331
},
"MinimumAngle": -120,
"MaximumAngle": 50
},
{
"Position": {
"X": 1.110765,
"Y": 71.56169,
"Z": -477.9129
},
"MinimumAngle": -135,
"MaximumAngle": 55
}
]
},
{
"DataId": 33900,
"Locations": [
{
"Position": {
"X": -8.431995,
"Y": 70.52238,
"Z": -470.8453
},
"MinimumAngle": -125,
"MaximumAngle": 55
}
]
}
]
}
]
}

View File

@ -1,7 +1,8 @@
{ {
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json", "$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
"Author": [], "Author": "liza",
"TerritoryId": 959, "TerritoryId": 959,
"AetheryteShortcut": "Mare Lamentorum - Sinus Lacrimarum",
"Groups": [ "Groups": [
{ {
"Nodes": [ "Nodes": [
@ -154,4 +155,4 @@
] ]
} }
] ]
} }

View File

@ -156,4 +156,4 @@
] ]
} }
] ]
} }

View File

@ -1,6 +1,6 @@
{ {
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json", "$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
"Author": [], "Author": "liza",
"TerritoryId": 1187, "TerritoryId": 1187,
"AetheryteShortcut": "Urqopacha - Wachunpelo", "AetheryteShortcut": "Urqopacha - Wachunpelo",
"Groups": [ "Groups": [
@ -155,4 +155,4 @@
] ]
} }
] ]
} }

View File

@ -1,6 +1,6 @@
{ {
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json", "$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
"Author": [], "Author": "liza",
"TerritoryId": 1187, "TerritoryId": 1187,
"AetheryteShortcut": "Urqopacha - Wachunpelo", "AetheryteShortcut": "Urqopacha - Wachunpelo",
"Groups": [ "Groups": [
@ -147,4 +147,4 @@
] ]
} }
] ]
} }

View File

@ -1,6 +1,6 @@
{ {
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json", "$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
"Author": [], "Author": "liza",
"TerritoryId": 1187, "TerritoryId": 1187,
"AetheryteShortcut": "Urqopacha - Wachunpelo", "AetheryteShortcut": "Urqopacha - Wachunpelo",
"Groups": [ "Groups": [
@ -145,4 +145,4 @@
] ]
} }
] ]
} }

View File

@ -16,6 +16,149 @@
"InteractionType": "AcceptQuest" "InteractionType": "AcceptQuest"
} }
] ]
},
{
"Sequence": 1,
"Steps": [
{
"DataId": 2011719,
"Position": {
"X": -102.1897,
"Y": -7.0039062,
"Z": -59.92218
},
"TerritoryId": 628,
"InteractionType": "Interact",
"AetheryteShortcut": "Kugane",
"AethernetShortcut": [
"[Kugane] Aetheryte Plaza",
"[Kugane] Shiokaze Hostelry"
]
}
]
},
{
"Sequence": 2,
"Steps": [
{
"DataId": 1038506,
"Position": {
"X": -142.2904,
"Y": -4.7500057,
"Z": 199.6643
},
"TerritoryId": 628,
"InteractionType": "Interact",
"AethernetShortcut": [
"[Kugane] Kogane Dori Markets",
"[Kugane] Pier #1"
]
}
]
},
{
"Sequence": 3,
"Steps": [
{
"DataId": 1038507,
"Position": {
"X": 52.750366,
"Y": 8.02,
"Z": 152.81909
},
"TerritoryId": 628,
"InteractionType": "Interact",
"AethernetShortcut": [
"[Kugane] Pier #1",
"[Kugane] Thavnairian Consulate"
]
}
]
},
{
"Sequence": 4,
"Steps": [
{
"DataId": 2011720,
"Position": {
"X": 129.5033,
"Y": 24.979004,
"Z": 15.701477
},
"TerritoryId": 628,
"InteractionType": "Interact",
"AethernetShortcut": [
"[Kugane] Thavnairian Consulate",
"[Kugane] The Ruby Bazaar"
]
}
]
},
{
"Sequence": 5,
"Steps": [
{
"DataId": 1038508,
"Position": {
"X": 114.70203,
"Y": 12,
"Z": 35.965454
},
"TerritoryId": 628,
"InteractionType": "Interact",
"AetheryteShortcut": "Kugane",
"AethernetShortcut": [
"[Kugane] Aetheryte Plaza",
"[Kugane] The Ruby Bazaar"
],
"RequiredGatheredItems": [
{
"ItemId": 35847,
"ItemCount": 1
}
]
}
]
},
{
"Sequence": 6,
"Steps": [
{
"DataId": 1038510,
"Position": {
"X": -92.24078,
"Y": 11.799999,
"Z": -156.05408
},
"TerritoryId": 628,
"InteractionType": "Interact",
"AethernetShortcut": [
"[Kugane] The Ruby Bazaar",
"[Kugane] Bokairo Inn"
]
}
]
},
{
"Sequence": 255,
"Steps": [
{
"DataId": 1038501,
"Position": {
"X": -367.3305,
"Y": 21.846018,
"Z": -102.983154
},
"TerritoryId": 962,
"InteractionType": "CompleteQuest",
"AetheryteShortcut": "Old Sharlayan",
"AethernetShortcut": [
"[Old Sharlayan] Aetheryte Plaza",
"[Old Sharlayan] The Studium"
],
"NextQuestId": 4158
}
]
} }
] ]
} }

View File

@ -0,0 +1,49 @@
{
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/QuestPaths/quest-v1.json",
"Author": "liza",
"QuestSequence": [
{
"Sequence": 0,
"Steps": [
{
"DataId": 1038501,
"Position": {
"X": -367.3305,
"Y": 21.846018,
"Z": -102.983154
},
"TerritoryId": 962,
"InteractionType": "AcceptQuest"
}
]
},
{
"Sequence": 255,
"Steps": [
{
"DataId": 1038501,
"Position": {
"X": -367.3305,
"Y": 21.846018,
"Z": -102.983154
},
"TerritoryId": 962,
"InteractionType": "CompleteQuest",
"AetheryteShortcut": "Old Sharlayan",
"AethernetShortcut": [
"[Old Sharlayan] Aetheryte Plaza",
"[Old Sharlayan] The Studium"
],
"RequiredGatheredItems": [
{
"ItemId": 35603,
"ItemCount": 6,
"Collectability": 600
}
],
"NextQuestId": 4159
}
]
}
]
}

View File

@ -0,0 +1,102 @@
{
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/QuestPaths/quest-v1.json",
"Author": "liza",
"QuestSequence": [
{
"Sequence": 0,
"Steps": [
{
"DataId": 1038501,
"Position": {
"X": -367.3305,
"Y": 21.846018,
"Z": -102.983154
},
"TerritoryId": 962,
"InteractionType": "AcceptQuest"
}
]
},
{
"Sequence": 1,
"Steps": [
{
"DataId": 1038503,
"Position": {
"X": -367.0863,
"Y": 21.84602,
"Z": -101.701416
},
"TerritoryId": 962,
"InteractionType": "Interact",
"AetheryteShortcut": "Old Sharlayan",
"AethernetShortcut": [
"[Old Sharlayan] Aetheryte Plaza",
"[Old Sharlayan] The Studium"
],
"RequiredGatheredItems": [
{
"ItemId": 35848,
"ItemCount": 1
}
],
"NextQuestId": 4159
}
]
},
{
"Sequence": 2,
"Steps": [
{
"DataId": 1038512,
"Position": {
"X": -73.47223,
"Y": -16.147001,
"Z": 191.27173
},
"TerritoryId": 962,
"InteractionType": "Interact",
"AethernetShortcut": [
"[Old Sharlayan] The Studium",
"[Old Sharlayan] Scholar's Harbor"
]
}
]
},
{
"Sequence": 3,
"Steps": [
{
"DataId": 1038503,
"Position": {
"X": -367.0863,
"Y": 21.84602,
"Z": -101.701416
},
"TerritoryId": 962,
"InteractionType": "Interact",
"AethernetShortcut": [
"[Old Sharlayan] Scholar's Harbor",
"[Old Sharlayan] The Studium"
]
}
]
},
{
"Sequence": 255,
"Steps": [
{
"DataId": 1038501,
"Position": {
"X": -367.3305,
"Y": 21.846018,
"Z": -102.983154
},
"StopDistance": 7,
"TerritoryId": 962,
"InteractionType": "CompleteQuest"
}
]
}
]
}

View File

@ -148,7 +148,7 @@ internal sealed unsafe class GatheringController : MiniTaskController<GatheringC
} }
} }
private bool HasRequestedItems() public bool HasRequestedItems()
{ {
if (_currentRequest == null) if (_currentRequest == null)
return true; return true;

View File

@ -42,9 +42,16 @@ internal sealed class DoGather(
if (gameGui.TryGetAddonByName("Gathering", out AtkUnitBase* atkUnitBase)) if (gameGui.TryGetAddonByName("Gathering", out AtkUnitBase* atkUnitBase))
{ {
_slots ??= ReadSlots(atkUnitBase); if (gatheringController.HasRequestedItems())
var slot = _slots.Single(x => x.ItemId == _currentRequest.ItemId); {
atkUnitBase->FireCallbackInt(slot.Index); atkUnitBase->FireCallbackInt(-1);
}
else
{
_slots ??= ReadSlots(atkUnitBase);
var slot = _slots.Single(x => x.ItemId == _currentRequest.ItemId);
atkUnitBase->FireCallbackInt(slot.Index);
}
} }
} }

View File

@ -29,11 +29,26 @@ internal sealed class DoGatherCollectable(
public bool Start() => true; public bool Start() => true;
public ETaskResult Update() public unsafe ETaskResult Update()
{ {
if (gatheringController.HasNodeDisappeared(_currentNode)) if (gatheringController.HasNodeDisappeared(_currentNode))
return ETaskResult.TaskComplete; return ETaskResult.TaskComplete;
if (gatheringController.HasRequestedItems())
{
if (gameGui.TryGetAddonByName("GatheringMasterpiece", out AtkUnitBase* atkUnitBase))
{
atkUnitBase->FireCallbackInt(1);
return ETaskResult.StillRunning;
}
if (gameGui.TryGetAddonByName("Gathering", out atkUnitBase))
{
atkUnitBase->FireCallbackInt(-1);
return ETaskResult.TaskComplete;
}
}
NodeCondition? nodeCondition = GetNodeCondition(); NodeCondition? nodeCondition = GetNodeCondition();
if (nodeCondition == null) if (nodeCondition == null)
return ETaskResult.TaskComplete; return ETaskResult.TaskComplete;
@ -84,7 +99,7 @@ internal sealed class DoGatherCollectable(
return null; return null;
} }
private Queue<EAction>? GetNextActions(NodeCondition nodeCondition) private Queue<EAction> GetNextActions(NodeCondition nodeCondition)
{ {
uint gp = clientState.LocalPlayer!.CurrentGp; uint gp = clientState.LocalPlayer!.CurrentGp;
Queue<EAction> actions = new(); Queue<EAction> actions = new();

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using Dalamud.Game.Text; using Dalamud.Game.Text;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Questionable.Data; using Questionable.Data;
using Questionable.GatheringPaths; using Questionable.GatheringPaths;
@ -30,6 +31,9 @@ internal static class GatheringRequiredItems
.TryGetValue(gatheringPointId, out GatheringRoot? gatheringRoot)) .TryGetValue(gatheringPointId, out GatheringRoot? gatheringRoot))
throw new TaskException("No path found for gathering point"); throw new TaskException("No path found for gathering point");
if (HasRequiredItems(requiredGatheredItems))
continue;
if (gatheringRoot.AetheryteShortcut != null && clientState.TerritoryType != gatheringRoot.TerritoryId) if (gatheringRoot.AetheryteShortcut != null && clientState.TerritoryType != gatheringRoot.TerritoryId)
{ {
yield return serviceProvider.GetRequiredService<AetheryteShortcut.UseAetheryteShortcut>() yield return serviceProvider.GetRequiredService<AetheryteShortcut.UseAetheryteShortcut>()
@ -41,6 +45,14 @@ internal static class GatheringRequiredItems
} }
} }
private unsafe bool HasRequiredItems(GatheredItem requiredGatheredItems)
{
InventoryManager* inventoryManager = InventoryManager.Instance();
return inventoryManager != null &&
inventoryManager->GetInventoryItemCount(requiredGatheredItems.ItemId,
minCollectability: (short)requiredGatheredItems.Collectability) >= requiredGatheredItems.ItemCount;
}
public ITask CreateTask(Quest quest, QuestSequence sequence, QuestStep step) public ITask CreateTask(Quest quest, QuestSequence sequence, QuestStep step)
=> throw new NotImplementedException(); => throw new NotImplementedException();
} }
@ -76,7 +88,8 @@ internal static class GatheringRequiredItems
if (_gatheredItem.Collectability == 0) if (_gatheredItem.Collectability == 0)
return $"Gather({_gatheredItem.ItemCount}x {_gatheredItem.ItemId})"; return $"Gather({_gatheredItem.ItemCount}x {_gatheredItem.ItemId})";
else else
return $"Gather({_gatheredItem.ItemCount}x {_gatheredItem.ItemId} {SeIconChar.Collectible.ToIconString()} {_gatheredItem.Collectability})"; return
$"Gather({_gatheredItem.ItemCount}x {_gatheredItem.ItemId} {SeIconChar.Collectible.ToIconString()} {_gatheredItem.Collectability})";
} }
} }
} }