diff --git a/QuestPaths/Questionable.QuestPaths/AssemblyQuestLoader.cs b/QuestPaths/Questionable.QuestPaths/AssemblyQuestLoader.cs index bae8bf3..e8d89ee 100644 --- a/QuestPaths/Questionable.QuestPaths/AssemblyQuestLoader.cs +++ b/QuestPaths/Questionable.QuestPaths/AssemblyQuestLoader.cs @@ -3213,6 +3213,13 @@ public static class AssemblyQuestLoader From = EAetheryteLocation.Gridania, To = EAetheryteLocation.GridaniaArcher }, + SkipConditions = new SkipConditions + { + AetheryteShortcutIf = new SkipAetheryteCondition + { + InSameTerritory = true + } + }, NextQuestId = new QuestId(46) }; obj81.Steps = list161; @@ -15194,6 +15201,13 @@ public static class AssemblyQuestLoader { From = EAetheryteLocation.Gridania, To = EAetheryteLocation.GridaniaAirship + }, + SkipConditions = new SkipConditions + { + AetheryteShortcutIf = new SkipAetheryteCondition + { + InSameTerritory = true + } } }; obj119.Steps = list188; @@ -67147,7 +67161,7 @@ public static class AssemblyQuestLoader { Sequence = 1 }; - index2 = 5; + index2 = 6; List list31 = new List(index2); CollectionsMarshal.SetCount(list31, index2); span3 = CollectionsMarshal.AsSpan(list31); @@ -67178,10 +67192,13 @@ public static class AssemblyQuestLoader reference20 = questStep2; num2++; ref QuestStep reference21 = ref span3[num2]; - QuestStep obj20 = new QuestStep(EInteractionType.Interact, 1006500u, new Vector3(321.1565f, -15.187395f, 253.52856f), 138) + QuestStep obj20 = new QuestStep(EInteractionType.WalkTo, null, new Vector3(319.13077f, -15.189108f, 254.49236f), 138) { - StopDistance = 5f + DisableNavmesh = true, + Mount = false }; + SkipConditions skipConditions2 = new SkipConditions(); + SkipStepConditions skipStepConditions2 = new SkipStepConditions(); num3 = 6; List list33 = new List(num3); CollectionsMarshal.SetCount(list33, num3); @@ -67198,21 +67215,15 @@ public static class AssemblyQuestLoader span4[num4] = null; num4++; span4[num4] = new QuestWorkValue((byte)2, 0, EQuestWorkMode.Bitwise); - obj20.CompletionQuestVariablesFlags = list33; + skipStepConditions2.CompletionQuestVariablesFlags = list33; + skipConditions2.StepIf = skipStepConditions2; + obj20.SkipConditions = skipConditions2; reference21 = obj20; num2++; - span3[num2] = new QuestStep(EInteractionType.Jump, null, new Vector3(317.62387f, -15.190073f, 252.21808f), 138) - { - JumpDestination = new JumpDestination - { - Position = new Vector3(313.6114f, -24.333132f, 252.43187f) - } - }; - num2++; ref QuestStep reference22 = ref span3[num2]; - QuestStep obj21 = new QuestStep(EInteractionType.Interact, 1006499u, new Vector3(260.88342f, -24.975f, 249.04248f), 138) + QuestStep obj21 = new QuestStep(EInteractionType.Interact, 1006500u, new Vector3(321.1565f, -15.187395f, 253.52856f), 138) { - AetheryteShortcut = EAetheryteLocation.WesternLaNosceaAleport + StopDistance = 5f }; num4 = 6; List list34 = new List(num4); @@ -67229,12 +67240,23 @@ public static class AssemblyQuestLoader num3++; span4[num3] = null; num3++; - span4[num3] = new QuestWorkValue((byte)4, 0, EQuestWorkMode.Bitwise); + span4[num3] = new QuestWorkValue((byte)2, 0, EQuestWorkMode.Bitwise); obj21.CompletionQuestVariablesFlags = list34; reference22 = obj21; num2++; + span3[num2] = new QuestStep(EInteractionType.Jump, null, new Vector3(317.62387f, -15.190073f, 252.21808f), 138) + { + JumpDestination = new JumpDestination + { + Position = new Vector3(313.6114f, -24.333132f, 252.43187f) + } + }; + num2++; ref QuestStep reference23 = ref span3[num2]; - QuestStep questStep3 = new QuestStep(EInteractionType.Interact, 1006498u, new Vector3(178.78992f, -41.131824f, 257.16016f), 138); + QuestStep obj22 = new QuestStep(EInteractionType.Interact, 1006499u, new Vector3(260.88342f, -24.975f, 249.04248f), 138) + { + AetheryteShortcut = EAetheryteLocation.WesternLaNosceaAleport + }; num3 = 6; List list35 = new List(num3); CollectionsMarshal.SetCount(list35, num3); @@ -67250,52 +67272,73 @@ public static class AssemblyQuestLoader num4++; span4[num4] = null; num4++; - span4[num4] = new QuestWorkValue((byte)8, 0, EQuestWorkMode.Bitwise); - questStep3.CompletionQuestVariablesFlags = list35; - reference23 = questStep3; + span4[num4] = new QuestWorkValue((byte)4, 0, EQuestWorkMode.Bitwise); + obj22.CompletionQuestVariablesFlags = list35; + reference23 = obj22; + num2++; + ref QuestStep reference24 = ref span3[num2]; + QuestStep questStep3 = new QuestStep(EInteractionType.Interact, 1006498u, new Vector3(178.78992f, -41.131824f, 257.16016f), 138); + num4 = 6; + List list36 = new List(num4); + CollectionsMarshal.SetCount(list36, num4); + span4 = CollectionsMarshal.AsSpan(list36); + num3 = 0; + span4[num3] = null; + num3++; + span4[num3] = null; + num3++; + span4[num3] = null; + num3++; + span4[num3] = null; + num3++; + span4[num3] = null; + num3++; + span4[num3] = new QuestWorkValue((byte)8, 0, EQuestWorkMode.Bitwise); + questStep3.CompletionQuestVariablesFlags = list36; + reference24 = questStep3; obj19.Steps = list31; reference19 = obj19; num++; - ref QuestSequence reference24 = ref span2[num]; - QuestSequence obj22 = new QuestSequence + ref QuestSequence reference25 = ref span2[num]; + QuestSequence obj23 = new QuestSequence { Sequence = byte.MaxValue }; num2 = 2; - List list36 = new List(num2); - CollectionsMarshal.SetCount(list36, num2); - span3 = CollectionsMarshal.AsSpan(list36); + List list37 = new List(num2); + CollectionsMarshal.SetCount(list37, num2); + span3 = CollectionsMarshal.AsSpan(list37); index2 = 0; span3[index2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(293.98203f, -24.988865f, 240.63774f), 138); index2++; span3[index2] = new QuestStep(EInteractionType.CompleteQuest, 1006497u, new Vector3(321.1565f, -18.197807f, 276.5697f), 138); - obj22.Steps = list36; - reference24 = obj22; + obj23.Steps = list37; + reference25 = obj23; questRoot6.QuestSequence = list29; AddQuest(questId6, questRoot6); QuestId questId7 = new QuestId(961); QuestRoot questRoot7 = new QuestRoot(); num = 1; - List list37 = new List(num); - CollectionsMarshal.SetCount(list37, num); - span = CollectionsMarshal.AsSpan(list37); + List list38 = new List(num); + CollectionsMarshal.SetCount(list38, num); + span = CollectionsMarshal.AsSpan(list38); index = 0; span[index] = "JerryWester"; - questRoot7.Author = list37; + questRoot7.Author = list38; index = 5; - List list38 = new List(index); - CollectionsMarshal.SetCount(list38, index); - span2 = CollectionsMarshal.AsSpan(list38); + List list39 = new List(index); + CollectionsMarshal.SetCount(list39, index); + span2 = CollectionsMarshal.AsSpan(list39); num = 0; - ref QuestSequence reference25 = ref span2[num]; - QuestSequence obj23 = new QuestSequence + ref QuestSequence reference26 = ref span2[num]; + QuestSequence obj24 = new QuestSequence { Sequence = 0 }; index2 = 1; - List list39 = new List(index2); - CollectionsMarshal.SetCount(list39, index2); - span3 = CollectionsMarshal.AsSpan(list39); + List list40 = new List(index2); + CollectionsMarshal.SetCount(list40, index2); + span3 = CollectionsMarshal.AsSpan(list40); num2 = 0; span3[num2] = new QuestStep(EInteractionType.AcceptQuest, 1006497u, new Vector3(321.1565f, -18.197807f, 276.5697f), 138) { @@ -67308,66 +67351,66 @@ public static class AssemblyQuestLoader } } }; - obj23.Steps = list39; - reference25 = obj23; - num++; - ref QuestSequence reference26 = ref span2[num]; - QuestSequence obj24 = new QuestSequence - { - Sequence = 1 - }; - num2 = 2; - List list40 = new List(num2); - CollectionsMarshal.SetCount(list40, num2); - span3 = CollectionsMarshal.AsSpan(list40); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(293.98203f, -24.988865f, 240.63774f), 138); - index2++; - span3[index2] = new QuestStep(EInteractionType.Interact, 1006502u, new Vector3(182.39111f, -41.0828f, 260.151f), 138); obj24.Steps = list40; reference26 = obj24; num++; ref QuestSequence reference27 = ref span2[num]; QuestSequence obj25 = new QuestSequence { - Sequence = 2 + Sequence = 1 }; - index2 = 2; - List list41 = new List(index2); - CollectionsMarshal.SetCount(list41, index2); + num2 = 2; + List list41 = new List(num2); + CollectionsMarshal.SetCount(list41, num2); span3 = CollectionsMarshal.AsSpan(list41); - num2 = 0; - span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(293.98203f, -24.988865f, 240.63774f), 138); - num2++; - span3[num2] = new QuestStep(EInteractionType.Interact, 1006497u, new Vector3(321.1565f, -18.197807f, 276.5697f), 138); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(293.98203f, -24.988865f, 240.63774f), 138); + index2++; + span3[index2] = new QuestStep(EInteractionType.Interact, 1006502u, new Vector3(182.39111f, -41.0828f, 260.151f), 138); obj25.Steps = list41; reference27 = obj25; num++; ref QuestSequence reference28 = ref span2[num]; QuestSequence obj26 = new QuestSequence { - Sequence = 3 + Sequence = 2 }; - num2 = 2; - List list42 = new List(num2); - CollectionsMarshal.SetCount(list42, num2); + index2 = 2; + List list42 = new List(index2); + CollectionsMarshal.SetCount(list42, index2); span3 = CollectionsMarshal.AsSpan(list42); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(303.96317f, -36.40591f, 316.74185f), 138); - index2++; - span3[index2] = new QuestStep(EInteractionType.Interact, 1006501u, new Vector3(311.4214f, -36.405907f, 333.54688f), 138); + num2 = 0; + span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(293.98203f, -24.988865f, 240.63774f), 138); + num2++; + span3[num2] = new QuestStep(EInteractionType.Interact, 1006497u, new Vector3(321.1565f, -18.197807f, 276.5697f), 138); obj26.Steps = list42; reference28 = obj26; num++; ref QuestSequence reference29 = ref span2[num]; QuestSequence obj27 = new QuestSequence + { + Sequence = 3 + }; + num2 = 2; + List list43 = new List(num2); + CollectionsMarshal.SetCount(list43, num2); + span3 = CollectionsMarshal.AsSpan(list43); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(303.96317f, -36.40591f, 316.74185f), 138); + index2++; + span3[index2] = new QuestStep(EInteractionType.Interact, 1006501u, new Vector3(311.4214f, -36.405907f, 333.54688f), 138); + obj27.Steps = list43; + reference29 = obj27; + num++; + ref QuestSequence reference30 = ref span2[num]; + QuestSequence obj28 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 2; - List list43 = new List(index2); - CollectionsMarshal.SetCount(list43, index2); - span3 = CollectionsMarshal.AsSpan(list43); + List list44 = new List(index2); + CollectionsMarshal.SetCount(list44, index2); + span3 = CollectionsMarshal.AsSpan(list44); num2 = 0; span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(305.6621f, -36.405907f, 320.81702f), 138) { @@ -67375,33 +67418,33 @@ public static class AssemblyQuestLoader }; num2++; span3[num2] = new QuestStep(EInteractionType.CompleteQuest, 1006497u, new Vector3(321.1565f, -18.197807f, 276.5697f), 138); - obj27.Steps = list43; - reference29 = obj27; - questRoot7.QuestSequence = list38; + obj28.Steps = list44; + reference30 = obj28; + questRoot7.QuestSequence = list39; AddQuest(questId7, questRoot7); QuestId questId8 = new QuestId(962); QuestRoot questRoot8 = new QuestRoot(); num = 1; - List list44 = new List(num); - CollectionsMarshal.SetCount(list44, num); - span = CollectionsMarshal.AsSpan(list44); + List list45 = new List(num); + CollectionsMarshal.SetCount(list45, num); + span = CollectionsMarshal.AsSpan(list45); index = 0; span[index] = "JerryWester"; - questRoot8.Author = list44; + questRoot8.Author = list45; index = 4; - List list45 = new List(index); - CollectionsMarshal.SetCount(list45, index); - span2 = CollectionsMarshal.AsSpan(list45); + List list46 = new List(index); + CollectionsMarshal.SetCount(list46, index); + span2 = CollectionsMarshal.AsSpan(list46); num = 0; - ref QuestSequence reference30 = ref span2[num]; - QuestSequence obj28 = new QuestSequence + ref QuestSequence reference31 = ref span2[num]; + QuestSequence obj29 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list46 = new List(num2); - CollectionsMarshal.SetCount(list46, num2); - span3 = CollectionsMarshal.AsSpan(list46); + List list47 = new List(num2); + CollectionsMarshal.SetCount(list47, num2); + span3 = CollectionsMarshal.AsSpan(list47); index2 = 0; span3[index2] = new QuestStep(EInteractionType.AcceptQuest, 1006497u, new Vector3(321.1565f, -18.197807f, 276.5697f), 138) { @@ -67414,118 +67457,97 @@ public static class AssemblyQuestLoader } } }; - obj28.Steps = list46; - reference30 = obj28; - num++; - ref QuestSequence reference31 = ref span2[num]; - QuestSequence obj29 = new QuestSequence - { - Sequence = 1 - }; - index2 = 2; - List list47 = new List(index2); - CollectionsMarshal.SetCount(list47, index2); - span3 = CollectionsMarshal.AsSpan(list47); - num2 = 0; - span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(303.96317f, -36.40591f, 316.74185f), 138); - num2++; - span3[num2] = new QuestStep(EInteractionType.Interact, 1007640u, new Vector3(317.95215f, -40.425003f, 374.10547f), 138); obj29.Steps = list47; reference31 = obj29; num++; ref QuestSequence reference32 = ref span2[num]; QuestSequence obj30 = new QuestSequence { - Sequence = 2 + Sequence = 1 }; - num2 = 1; - List list48 = new List(num2); - CollectionsMarshal.SetCount(list48, num2); + index2 = 2; + List list48 = new List(index2); + CollectionsMarshal.SetCount(list48, index2); span3 = CollectionsMarshal.AsSpan(list48); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.Interact, 1007540u, new Vector3(-285.96942f, -40.868286f, 410.39136f), 138) - { - StopDistance = 7f - }; + num2 = 0; + span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(303.96317f, -36.40591f, 316.74185f), 138); + num2++; + span3[num2] = new QuestStep(EInteractionType.Interact, 1007640u, new Vector3(317.95215f, -40.425003f, 374.10547f), 138); obj30.Steps = list48; reference32 = obj30; num++; ref QuestSequence reference33 = ref span2[num]; QuestSequence obj31 = new QuestSequence + { + Sequence = 2 + }; + num2 = 1; + List list49 = new List(num2); + CollectionsMarshal.SetCount(list49, num2); + span3 = CollectionsMarshal.AsSpan(list49); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.Interact, 1007540u, new Vector3(-285.96942f, -40.868286f, 410.39136f), 138) + { + StopDistance = 7f + }; + obj31.Steps = list49; + reference33 = obj31; + num++; + ref QuestSequence reference34 = ref span2[num]; + QuestSequence obj32 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 1; - List list49 = new List(index2); - CollectionsMarshal.SetCount(list49, index2); - span3 = CollectionsMarshal.AsSpan(list49); + List list50 = new List(index2); + CollectionsMarshal.SetCount(list50, index2); + span3 = CollectionsMarshal.AsSpan(list50); num2 = 0; span3[num2] = new QuestStep(EInteractionType.CompleteQuest, 1006503u, new Vector3(-266.5904f, -40.040386f, 461.72266f), 138); - obj31.Steps = list49; - reference33 = obj31; - questRoot8.QuestSequence = list45; + obj32.Steps = list50; + reference34 = obj32; + questRoot8.QuestSequence = list46; AddQuest(questId8, questRoot8); QuestId questId9 = new QuestId(963); QuestRoot questRoot9 = new QuestRoot(); num = 1; - List list50 = new List(num); - CollectionsMarshal.SetCount(list50, num); - span = CollectionsMarshal.AsSpan(list50); + List list51 = new List(num); + CollectionsMarshal.SetCount(list51, num); + span = CollectionsMarshal.AsSpan(list51); index = 0; span[index] = "JerryWester"; - questRoot9.Author = list50; + questRoot9.Author = list51; index = 3; - List list51 = new List(index); - CollectionsMarshal.SetCount(list51, index); - span2 = CollectionsMarshal.AsSpan(list51); + List list52 = new List(index); + CollectionsMarshal.SetCount(list52, index); + span2 = CollectionsMarshal.AsSpan(list52); num = 0; - ref QuestSequence reference34 = ref span2[num]; - QuestSequence obj32 = new QuestSequence + ref QuestSequence reference35 = ref span2[num]; + QuestSequence obj33 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list52 = new List(num2); - CollectionsMarshal.SetCount(list52, num2); - span3 = CollectionsMarshal.AsSpan(list52); + List list53 = new List(num2); + CollectionsMarshal.SetCount(list53, num2); + span3 = CollectionsMarshal.AsSpan(list53); index2 = 0; span3[index2] = new QuestStep(EInteractionType.AcceptQuest, 1006503u, new Vector3(-266.5904f, -40.040386f, 461.72266f), 138); - obj32.Steps = list52; - reference34 = obj32; + obj33.Steps = list53; + reference35 = obj33; num++; - ref QuestSequence reference35 = ref span2[num]; - QuestSequence obj33 = new QuestSequence + ref QuestSequence reference36 = ref span2[num]; + QuestSequence obj34 = new QuestSequence { Sequence = 1 }; index2 = 3; - List list53 = new List(index2); - CollectionsMarshal.SetCount(list53, index2); - span3 = CollectionsMarshal.AsSpan(list53); + List list54 = new List(index2); + CollectionsMarshal.SetCount(list54, index2); + span3 = CollectionsMarshal.AsSpan(list54); num2 = 0; - ref QuestStep reference36 = ref span3[num2]; - QuestStep questStep4 = new QuestStep(EInteractionType.Interact, 1007639u, new Vector3(-196.82617f, -40.651188f, 499.9618f), 138); - num4 = 6; - List list54 = new List(num4); - CollectionsMarshal.SetCount(list54, num4); - span4 = CollectionsMarshal.AsSpan(list54); - num3 = 0; - span4[num3] = null; - num3++; - span4[num3] = null; - num3++; - span4[num3] = null; - num3++; - span4[num3] = null; - num3++; - span4[num3] = null; - num3++; - span4[num3] = new QuestWorkValue((byte)4, 0, EQuestWorkMode.Bitwise); - questStep4.CompletionQuestVariablesFlags = list54; - reference36 = questStep4; - num2++; ref QuestStep reference37 = ref span3[num2]; - QuestStep questStep5 = new QuestStep(EInteractionType.Interact, 1006506u, new Vector3(-198.47418f, -40.461403f, 499.9923f), 138); + QuestStep questStep4 = new QuestStep(EInteractionType.Interact, 1007639u, new Vector3(-196.82617f, -40.651188f, 499.9618f), 138); num3 = 6; List list55 = new List(num3); CollectionsMarshal.SetCount(list55, num3); @@ -67541,12 +67563,12 @@ public static class AssemblyQuestLoader num4++; span4[num4] = null; num4++; - span4[num4] = new QuestWorkValue((byte)8, 0, EQuestWorkMode.Bitwise); - questStep5.CompletionQuestVariablesFlags = list55; - reference37 = questStep5; + span4[num4] = new QuestWorkValue((byte)4, 0, EQuestWorkMode.Bitwise); + questStep4.CompletionQuestVariablesFlags = list55; + reference37 = questStep4; num2++; ref QuestStep reference38 = ref span3[num2]; - QuestStep questStep6 = new QuestStep(EInteractionType.Interact, 1006505u, new Vector3(-200.36627f, -40.340702f, 503.19666f), 138); + QuestStep questStep5 = new QuestStep(EInteractionType.Interact, 1006506u, new Vector3(-198.47418f, -40.461403f, 499.9923f), 138); num4 = 6; List list56 = new List(num4); CollectionsMarshal.SetCount(list56, num4); @@ -67562,92 +67584,113 @@ public static class AssemblyQuestLoader num3++; span4[num3] = null; num3++; - span4[num3] = new QuestWorkValue((byte)2, 0, EQuestWorkMode.Bitwise); - questStep6.CompletionQuestVariablesFlags = list56; - reference38 = questStep6; - obj33.Steps = list53; - reference35 = obj33; + span4[num3] = new QuestWorkValue((byte)8, 0, EQuestWorkMode.Bitwise); + questStep5.CompletionQuestVariablesFlags = list56; + reference38 = questStep5; + num2++; + ref QuestStep reference39 = ref span3[num2]; + QuestStep questStep6 = new QuestStep(EInteractionType.Interact, 1006505u, new Vector3(-200.36627f, -40.340702f, 503.19666f), 138); + num3 = 6; + List list57 = new List(num3); + CollectionsMarshal.SetCount(list57, num3); + span4 = CollectionsMarshal.AsSpan(list57); + num4 = 0; + span4[num4] = null; + num4++; + span4[num4] = null; + num4++; + span4[num4] = null; + num4++; + span4[num4] = null; + num4++; + span4[num4] = null; + num4++; + span4[num4] = new QuestWorkValue((byte)2, 0, EQuestWorkMode.Bitwise); + questStep6.CompletionQuestVariablesFlags = list57; + reference39 = questStep6; + obj34.Steps = list54; + reference36 = obj34; num++; - ref QuestSequence reference39 = ref span2[num]; - QuestSequence obj34 = new QuestSequence + ref QuestSequence reference40 = ref span2[num]; + QuestSequence obj35 = new QuestSequence { Sequence = byte.MaxValue }; num2 = 1; - List list57 = new List(num2); - CollectionsMarshal.SetCount(list57, num2); - span3 = CollectionsMarshal.AsSpan(list57); + List list58 = new List(num2); + CollectionsMarshal.SetCount(list58, num2); + span3 = CollectionsMarshal.AsSpan(list58); index2 = 0; span3[index2] = new QuestStep(EInteractionType.CompleteQuest, 1006503u, new Vector3(-266.5904f, -40.040386f, 461.72266f), 138); - obj34.Steps = list57; - reference39 = obj34; - questRoot9.QuestSequence = list51; + obj35.Steps = list58; + reference40 = obj35; + questRoot9.QuestSequence = list52; AddQuest(questId9, questRoot9); QuestId questId10 = new QuestId(967); QuestRoot questRoot10 = new QuestRoot(); num = 1; - List list58 = new List(num); - CollectionsMarshal.SetCount(list58, num); - span = CollectionsMarshal.AsSpan(list58); + List list59 = new List(num); + CollectionsMarshal.SetCount(list59, num); + span = CollectionsMarshal.AsSpan(list59); index = 0; span[index] = "JerryWester"; - questRoot10.Author = list58; + questRoot10.Author = list59; index = 7; - List list59 = new List(index); - CollectionsMarshal.SetCount(list59, index); - span2 = CollectionsMarshal.AsSpan(list59); + List list60 = new List(index); + CollectionsMarshal.SetCount(list60, index); + span2 = CollectionsMarshal.AsSpan(list60); num = 0; - ref QuestSequence reference40 = ref span2[num]; - QuestSequence obj35 = new QuestSequence + ref QuestSequence reference41 = ref span2[num]; + QuestSequence obj36 = new QuestSequence { Sequence = 0 }; index2 = 1; - List list60 = new List(index2); - CollectionsMarshal.SetCount(list60, index2); - span3 = CollectionsMarshal.AsSpan(list60); + List list61 = new List(index2); + CollectionsMarshal.SetCount(list61, index2); + span3 = CollectionsMarshal.AsSpan(list61); num2 = 0; span3[num2] = new QuestStep(EInteractionType.AcceptQuest, 1006503u, new Vector3(-266.5904f, -40.040386f, 461.72266f), 138); - obj35.Steps = list60; - reference40 = obj35; - num++; - ref QuestSequence reference41 = ref span2[num]; - QuestSequence obj36 = new QuestSequence - { - Sequence = 1 - }; - num2 = 1; - List list61 = new List(num2); - CollectionsMarshal.SetCount(list61, num2); - span3 = CollectionsMarshal.AsSpan(list61); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.Interact, 1006507u, new Vector3(-287.22064f, -40.98314f, 407.64465f), 138); obj36.Steps = list61; reference41 = obj36; num++; ref QuestSequence reference42 = ref span2[num]; QuestSequence obj37 = new QuestSequence { - Sequence = 2 + Sequence = 1 }; - index2 = 1; - List list62 = new List(index2); - CollectionsMarshal.SetCount(list62, index2); + num2 = 1; + List list62 = new List(num2); + CollectionsMarshal.SetCount(list62, num2); span3 = CollectionsMarshal.AsSpan(list62); - num2 = 0; - span3[num2] = new QuestStep(EInteractionType.Interact, 1007716u, new Vector3(-312.03174f, -41.36315f, 682.70386f), 138); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.Interact, 1006507u, new Vector3(-287.22064f, -40.98314f, 407.64465f), 138); obj37.Steps = list62; reference42 = obj37; num++; ref QuestSequence reference43 = ref span2[num]; QuestSequence obj38 = new QuestSequence + { + Sequence = 2 + }; + index2 = 1; + List list63 = new List(index2); + CollectionsMarshal.SetCount(list63, index2); + span3 = CollectionsMarshal.AsSpan(list63); + num2 = 0; + span3[num2] = new QuestStep(EInteractionType.Interact, 1007716u, new Vector3(-312.03174f, -41.36315f, 682.70386f), 138); + obj38.Steps = list63; + reference43 = obj38; + num++; + ref QuestSequence reference44 = ref span2[num]; + QuestSequence obj39 = new QuestSequence { Sequence = 3 }; num2 = 1; - List list63 = new List(num2); - CollectionsMarshal.SetCount(list63, num2); - span3 = CollectionsMarshal.AsSpan(list63); + List list64 = new List(num2); + CollectionsMarshal.SetCount(list64, num2); + span3 = CollectionsMarshal.AsSpan(list64); index2 = 0; span3[index2] = new QuestStep(EInteractionType.SinglePlayerDuty, 2002189u, new Vector3(-307.75922f, -41.672424f, 695.3993f), 138) { @@ -67656,46 +67699,46 @@ public static class AssemblyQuestLoader Enabled = true } }; - obj38.Steps = list63; - reference43 = obj38; - num++; - ref QuestSequence reference44 = ref span2[num]; - QuestSequence obj39 = new QuestSequence - { - Sequence = 4 - }; - index2 = 1; - List list64 = new List(index2); - CollectionsMarshal.SetCount(list64, index2); - span3 = CollectionsMarshal.AsSpan(list64); - num2 = 0; - span3[num2] = new QuestStep(EInteractionType.Interact, 1007716u, new Vector3(-312.03174f, -41.36315f, 682.70386f), 138); obj39.Steps = list64; reference44 = obj39; num++; ref QuestSequence reference45 = ref span2[num]; QuestSequence obj40 = new QuestSequence { - Sequence = 5 + Sequence = 4 }; - num2 = 1; - List list65 = new List(num2); - CollectionsMarshal.SetCount(list65, num2); + index2 = 1; + List list65 = new List(index2); + CollectionsMarshal.SetCount(list65, index2); span3 = CollectionsMarshal.AsSpan(list65); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.Interact, 1006503u, new Vector3(-266.5904f, -40.040386f, 461.72266f), 138); + num2 = 0; + span3[num2] = new QuestStep(EInteractionType.Interact, 1007716u, new Vector3(-312.03174f, -41.36315f, 682.70386f), 138); obj40.Steps = list65; reference45 = obj40; num++; ref QuestSequence reference46 = ref span2[num]; QuestSequence obj41 = new QuestSequence + { + Sequence = 5 + }; + num2 = 1; + List list66 = new List(num2); + CollectionsMarshal.SetCount(list66, num2); + span3 = CollectionsMarshal.AsSpan(list66); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.Interact, 1006503u, new Vector3(-266.5904f, -40.040386f, 461.72266f), 138); + obj41.Steps = list66; + reference46 = obj41; + num++; + ref QuestSequence reference47 = ref span2[num]; + QuestSequence obj42 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 2; - List list66 = new List(index2); - CollectionsMarshal.SetCount(list66, index2); - span3 = CollectionsMarshal.AsSpan(list66); + List list67 = new List(index2); + CollectionsMarshal.SetCount(list67, index2); + span3 = CollectionsMarshal.AsSpan(list67); num2 = 0; span3[num2] = new QuestStep(EInteractionType.Interact, 1005239u, new Vector3(-289.9062f, -41.2455f, 406.51562f), 138) { @@ -67704,36 +67747,36 @@ public static class AssemblyQuestLoader }; num2++; span3[num2] = new QuestStep(EInteractionType.CompleteQuest, 1006497u, new Vector3(321.1565f, -18.197807f, 276.5697f), 138); - obj41.Steps = list66; - reference46 = obj41; - questRoot10.QuestSequence = list59; + obj42.Steps = list67; + reference47 = obj42; + questRoot10.QuestSequence = list60; AddQuest(questId10, questRoot10); QuestId questId11 = new QuestId(969); QuestRoot questRoot11 = new QuestRoot(); num = 1; - List list67 = new List(num); - CollectionsMarshal.SetCount(list67, num); - span = CollectionsMarshal.AsSpan(list67); + List list68 = new List(num); + CollectionsMarshal.SetCount(list68, num); + span = CollectionsMarshal.AsSpan(list68); index = 0; span[index] = "UcanPatates"; - questRoot11.Author = list67; + questRoot11.Author = list68; index = 2; - List list68 = new List(index); - CollectionsMarshal.SetCount(list68, index); - span2 = CollectionsMarshal.AsSpan(list68); + List list69 = new List(index); + CollectionsMarshal.SetCount(list69, index); + span2 = CollectionsMarshal.AsSpan(list69); num = 0; - ref QuestSequence reference47 = ref span2[num]; - QuestSequence obj42 = new QuestSequence + ref QuestSequence reference48 = ref span2[num]; + QuestSequence obj43 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list69 = new List(num2); - CollectionsMarshal.SetCount(list69, num2); - span3 = CollectionsMarshal.AsSpan(list69); + List list70 = new List(num2); + CollectionsMarshal.SetCount(list70, num2); + span3 = CollectionsMarshal.AsSpan(list70); index2 = 0; - ref QuestStep reference48 = ref span3[index2]; - QuestStep obj43 = new QuestStep(EInteractionType.AcceptQuest, 1006711u, new Vector3(-140.39832f, 7.8986163f, -142.99237f), 133) + ref QuestStep reference49 = ref span3[index2]; + QuestStep obj44 = new QuestStep(EInteractionType.AcceptQuest, 1006711u, new Vector3(-140.39832f, 7.8986163f, -142.99237f), 133) { AetheryteShortcut = EAetheryteLocation.Gridania, AethernetShortcut = new AethernetShortcut @@ -67742,36 +67785,36 @@ public static class AssemblyQuestLoader To = EAetheryteLocation.GridaniaAmphitheatre } }; - SkipConditions skipConditions2 = new SkipConditions(); + SkipConditions skipConditions3 = new SkipConditions(); SkipAetheryteCondition skipAetheryteCondition = new SkipAetheryteCondition(); - num3 = 2; - List list70 = new List(num3); - CollectionsMarshal.SetCount(list70, num3); - Span span5 = CollectionsMarshal.AsSpan(list70); - num4 = 0; - span5[num4] = 132; - num4++; - span5[num4] = 133; - skipAetheryteCondition.InTerritory = list70; - skipConditions2.AetheryteShortcutIf = skipAetheryteCondition; - skipConditions2.AethernetShortcutIf = new SkipAetheryteCondition + num4 = 2; + List list71 = new List(num4); + CollectionsMarshal.SetCount(list71, num4); + Span span5 = CollectionsMarshal.AsSpan(list71); + num3 = 0; + span5[num3] = 132; + num3++; + span5[num3] = 133; + skipAetheryteCondition.InTerritory = list71; + skipConditions3.AetheryteShortcutIf = skipAetheryteCondition; + skipConditions3.AethernetShortcutIf = new SkipAetheryteCondition { InSameTerritory = true }; - obj43.SkipConditions = skipConditions2; + obj44.SkipConditions = skipConditions3; + reference49 = obj44; + obj43.Steps = list70; reference48 = obj43; - obj42.Steps = list69; - reference47 = obj42; num++; - ref QuestSequence reference49 = ref span2[num]; - QuestSequence obj44 = new QuestSequence + ref QuestSequence reference50 = ref span2[num]; + QuestSequence obj45 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 1; - List list71 = new List(index2); - CollectionsMarshal.SetCount(list71, index2); - span3 = CollectionsMarshal.AsSpan(list71); + List list72 = new List(index2); + CollectionsMarshal.SetCount(list72, index2); + span3 = CollectionsMarshal.AsSpan(list72); num2 = 0; span3[num2] = new QuestStep(EInteractionType.CompleteQuest, 1000617u, new Vector3(5.722107f, -7.2786255f, 270.95447f), 152) { @@ -67786,33 +67829,33 @@ public static class AssemblyQuestLoader }, NextQuestId = new QuestId(970) }; - obj44.Steps = list71; - reference49 = obj44; - questRoot11.QuestSequence = list68; + obj45.Steps = list72; + reference50 = obj45; + questRoot11.QuestSequence = list69; AddQuest(questId11, questRoot11); QuestId questId12 = new QuestId(970); QuestRoot questRoot12 = new QuestRoot(); num = 1; - List list72 = new List(num); - CollectionsMarshal.SetCount(list72, num); - span = CollectionsMarshal.AsSpan(list72); + List list73 = new List(num); + CollectionsMarshal.SetCount(list73, num); + span = CollectionsMarshal.AsSpan(list73); index = 0; span[index] = "UcanPatates"; - questRoot12.Author = list72; + questRoot12.Author = list73; index = 4; - List list73 = new List(index); - CollectionsMarshal.SetCount(list73, index); - span2 = CollectionsMarshal.AsSpan(list73); + List list74 = new List(index); + CollectionsMarshal.SetCount(list74, index); + span2 = CollectionsMarshal.AsSpan(list74); num = 0; - ref QuestSequence reference50 = ref span2[num]; - QuestSequence obj45 = new QuestSequence + ref QuestSequence reference51 = ref span2[num]; + QuestSequence obj46 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list74 = new List(num2); - CollectionsMarshal.SetCount(list74, num2); - span3 = CollectionsMarshal.AsSpan(list74); + List list75 = new List(num2); + CollectionsMarshal.SetCount(list75, num2); + span3 = CollectionsMarshal.AsSpan(list75); index2 = 0; span3[index2] = new QuestStep(EInteractionType.AcceptQuest, 1000617u, new Vector3(5.722107f, -7.2786255f, 270.95447f), 152) { @@ -67826,48 +67869,21 @@ public static class AssemblyQuestLoader } } }; - obj45.Steps = list74; - reference50 = obj45; - num++; - ref QuestSequence reference51 = ref span2[num]; - QuestSequence obj46 = new QuestSequence - { - Sequence = 1 - }; - index2 = 1; - List list75 = new List(index2); - CollectionsMarshal.SetCount(list75, index2); - span3 = CollectionsMarshal.AsSpan(list75); - num2 = 0; - span3[num2] = new QuestStep(EInteractionType.Interact, 1000587u, new Vector3(-7.248047f, -8.407776f, 268.23828f), 152) - { - AetheryteShortcut = EAetheryteLocation.EastShroudHawthorneHut, - SkipConditions = new SkipConditions - { - AetheryteShortcutIf = new SkipAetheryteCondition - { - InSameTerritory = true - } - } - }; obj46.Steps = list75; reference51 = obj46; num++; ref QuestSequence reference52 = ref span2[num]; QuestSequence obj47 = new QuestSequence { - Sequence = 2 + Sequence = 1 }; - num2 = 3; - List list76 = new List(num2); - CollectionsMarshal.SetCount(list76, num2); + index2 = 1; + List list76 = new List(index2); + CollectionsMarshal.SetCount(list76, index2); span3 = CollectionsMarshal.AsSpan(list76); - index2 = 0; - ref QuestStep reference53 = ref span3[index2]; - QuestStep obj48 = new QuestStep(EInteractionType.Interact, 2002191u, new Vector3(189.6543f, 7.94989f, 133.65369f), 152) + num2 = 0; + span3[num2] = new QuestStep(EInteractionType.Interact, 1000587u, new Vector3(-7.248047f, -8.407776f, 268.23828f), 152) { - StopDistance = 0.25f, - Fly = true, AetheryteShortcut = EAetheryteLocation.EastShroudHawthorneHut, SkipConditions = new SkipConditions { @@ -67877,27 +67893,21 @@ public static class AssemblyQuestLoader } } }; - num4 = 6; - List list77 = new List(num4); - CollectionsMarshal.SetCount(list77, num4); - span4 = CollectionsMarshal.AsSpan(list77); - num3 = 0; - span4[num3] = null; - num3++; - span4[num3] = null; - num3++; - span4[num3] = null; - num3++; - span4[num3] = null; - num3++; - span4[num3] = null; - num3++; - span4[num3] = new QuestWorkValue((byte)4, 0, EQuestWorkMode.Bitwise); - obj48.CompletionQuestVariablesFlags = list77; - reference53 = obj48; - index2++; + obj47.Steps = list76; + reference52 = obj47; + num++; + ref QuestSequence reference53 = ref span2[num]; + QuestSequence obj48 = new QuestSequence + { + Sequence = 2 + }; + num2 = 3; + List list77 = new List(num2); + CollectionsMarshal.SetCount(list77, num2); + span3 = CollectionsMarshal.AsSpan(list77); + index2 = 0; ref QuestStep reference54 = ref span3[index2]; - QuestStep obj49 = new QuestStep(EInteractionType.Interact, 2002192u, new Vector3(181.04822f, 0.07623291f, 43.289795f), 152) + QuestStep obj49 = new QuestStep(EInteractionType.Interact, 2002191u, new Vector3(189.6543f, 7.94989f, 133.65369f), 152) { StopDistance = 0.25f, Fly = true, @@ -67925,12 +67935,12 @@ public static class AssemblyQuestLoader num4++; span4[num4] = null; num4++; - span4[num4] = new QuestWorkValue((byte)2, 0, EQuestWorkMode.Bitwise); + span4[num4] = new QuestWorkValue((byte)4, 0, EQuestWorkMode.Bitwise); obj49.CompletionQuestVariablesFlags = list78; reference54 = obj49; index2++; ref QuestStep reference55 = ref span3[index2]; - QuestStep obj50 = new QuestStep(EInteractionType.Interact, 2002190u, new Vector3(233.66138f, 6.42395f, 199.11487f), 152) + QuestStep obj50 = new QuestStep(EInteractionType.Interact, 2002192u, new Vector3(181.04822f, 0.07623291f, 43.289795f), 152) { StopDistance = 0.25f, Fly = true, @@ -67958,21 +67968,54 @@ public static class AssemblyQuestLoader num3++; span4[num3] = null; num3++; - span4[num3] = new QuestWorkValue((byte)8, 0, EQuestWorkMode.Bitwise); + span4[num3] = new QuestWorkValue((byte)2, 0, EQuestWorkMode.Bitwise); obj50.CompletionQuestVariablesFlags = list79; reference55 = obj50; - obj47.Steps = list76; - reference52 = obj47; + index2++; + ref QuestStep reference56 = ref span3[index2]; + QuestStep obj51 = new QuestStep(EInteractionType.Interact, 2002190u, new Vector3(233.66138f, 6.42395f, 199.11487f), 152) + { + StopDistance = 0.25f, + Fly = true, + AetheryteShortcut = EAetheryteLocation.EastShroudHawthorneHut, + SkipConditions = new SkipConditions + { + AetheryteShortcutIf = new SkipAetheryteCondition + { + InSameTerritory = true + } + } + }; + num3 = 6; + List list80 = new List(num3); + CollectionsMarshal.SetCount(list80, num3); + span4 = CollectionsMarshal.AsSpan(list80); + num4 = 0; + span4[num4] = null; + num4++; + span4[num4] = null; + num4++; + span4[num4] = null; + num4++; + span4[num4] = null; + num4++; + span4[num4] = null; + num4++; + span4[num4] = new QuestWorkValue((byte)8, 0, EQuestWorkMode.Bitwise); + obj51.CompletionQuestVariablesFlags = list80; + reference56 = obj51; + obj48.Steps = list77; + reference53 = obj48; num++; - ref QuestSequence reference56 = ref span2[num]; - QuestSequence obj51 = new QuestSequence + ref QuestSequence reference57 = ref span2[num]; + QuestSequence obj52 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 2; - List list80 = new List(index2); - CollectionsMarshal.SetCount(list80, index2); - span3 = CollectionsMarshal.AsSpan(list80); + List list81 = new List(index2); + CollectionsMarshal.SetCount(list81, index2); + span3 = CollectionsMarshal.AsSpan(list81); num2 = 0; span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(124.74073f, 6.729165f, 190.69174f), 152) { @@ -67991,33 +68034,33 @@ public static class AssemblyQuestLoader Fly = true, NextQuestId = new QuestId(972) }; - obj51.Steps = list80; - reference56 = obj51; - questRoot12.QuestSequence = list73; + obj52.Steps = list81; + reference57 = obj52; + questRoot12.QuestSequence = list74; AddQuest(questId12, questRoot12); QuestId questId13 = new QuestId(972); QuestRoot questRoot13 = new QuestRoot(); num = 1; - List list81 = new List(num); - CollectionsMarshal.SetCount(list81, num); - span = CollectionsMarshal.AsSpan(list81); + List list82 = new List(num); + CollectionsMarshal.SetCount(list82, num); + span = CollectionsMarshal.AsSpan(list82); index = 0; span[index] = "UcanPatates"; - questRoot13.Author = list81; + questRoot13.Author = list82; index = 3; - List list82 = new List(index); - CollectionsMarshal.SetCount(list82, index); - span2 = CollectionsMarshal.AsSpan(list82); + List list83 = new List(index); + CollectionsMarshal.SetCount(list83, index); + span2 = CollectionsMarshal.AsSpan(list83); num = 0; - ref QuestSequence reference57 = ref span2[num]; - QuestSequence obj52 = new QuestSequence + ref QuestSequence reference58 = ref span2[num]; + QuestSequence obj53 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list83 = new List(num2); - CollectionsMarshal.SetCount(list83, num2); - span3 = CollectionsMarshal.AsSpan(list83); + List list84 = new List(num2); + CollectionsMarshal.SetCount(list84, num2); + span3 = CollectionsMarshal.AsSpan(list84); index2 = 0; span3[index2] = new QuestStep(EInteractionType.AcceptQuest, 1006715u, new Vector3(-170.67218f, 56.713512f, -255.9701f), 152) { @@ -68031,18 +68074,18 @@ public static class AssemblyQuestLoader } } }; - obj52.Steps = list83; - reference57 = obj52; + obj53.Steps = list84; + reference58 = obj53; num++; - ref QuestSequence reference58 = ref span2[num]; - QuestSequence obj53 = new QuestSequence + ref QuestSequence reference59 = ref span2[num]; + QuestSequence obj54 = new QuestSequence { Sequence = 1 }; index2 = 2; - List list84 = new List(index2); - CollectionsMarshal.SetCount(list84, index2); - span3 = CollectionsMarshal.AsSpan(list84); + List list85 = new List(index2); + CollectionsMarshal.SetCount(list85, index2); + span3 = CollectionsMarshal.AsSpan(list85); num2 = 0; span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(-193.69008f, 55.59636f, -177.57457f), 152) { @@ -68057,18 +68100,18 @@ public static class AssemblyQuestLoader }; num2++; span3[num2] = new QuestStep(EInteractionType.Interact, 1007568u, new Vector3(-183.88647f, 57.451885f, -143.93835f), 152); - obj53.Steps = list84; - reference58 = obj53; + obj54.Steps = list85; + reference59 = obj54; num++; - ref QuestSequence reference59 = ref span2[num]; - QuestSequence obj54 = new QuestSequence + ref QuestSequence reference60 = ref span2[num]; + QuestSequence obj55 = new QuestSequence { Sequence = byte.MaxValue }; num2 = 1; - List list85 = new List(num2); - CollectionsMarshal.SetCount(list85, num2); - span3 = CollectionsMarshal.AsSpan(list85); + List list86 = new List(num2); + CollectionsMarshal.SetCount(list86, num2); + span3 = CollectionsMarshal.AsSpan(list86); index2 = 0; span3[index2] = new QuestStep(EInteractionType.CompleteQuest, 1006715u, new Vector3(-170.67218f, 56.713512f, -255.9701f), 152) { @@ -68082,108 +68125,108 @@ public static class AssemblyQuestLoader } } }; - obj54.Steps = list85; - reference59 = obj54; - questRoot13.QuestSequence = list82; + obj55.Steps = list86; + reference60 = obj55; + questRoot13.QuestSequence = list83; AddQuest(questId13, questRoot13); QuestId questId14 = new QuestId(973); QuestRoot questRoot14 = new QuestRoot(); num = 1; - List list86 = new List(num); - CollectionsMarshal.SetCount(list86, num); - span = CollectionsMarshal.AsSpan(list86); + List list87 = new List(num); + CollectionsMarshal.SetCount(list87, num); + span = CollectionsMarshal.AsSpan(list87); index = 0; span[index] = "croizat"; - questRoot14.Author = list86; + questRoot14.Author = list87; index = 3; - List list87 = new List(index); - CollectionsMarshal.SetCount(list87, index); - span2 = CollectionsMarshal.AsSpan(list87); + List list88 = new List(index); + CollectionsMarshal.SetCount(list88, index); + span2 = CollectionsMarshal.AsSpan(list88); num = 0; - ref QuestSequence reference60 = ref span2[num]; - QuestSequence obj55 = new QuestSequence + ref QuestSequence reference61 = ref span2[num]; + QuestSequence obj56 = new QuestSequence { Sequence = 0 }; index2 = 1; - List list88 = new List(index2); - CollectionsMarshal.SetCount(list88, index2); - span3 = CollectionsMarshal.AsSpan(list88); + List list89 = new List(index2); + CollectionsMarshal.SetCount(list89, index2); + span3 = CollectionsMarshal.AsSpan(list89); num2 = 0; span3[num2] = new QuestStep(EInteractionType.AcceptQuest, 1006717u, new Vector3(-236.2555f, 51.499146f, -193.13348f), 152); - obj55.Steps = list88; - reference60 = obj55; + obj56.Steps = list89; + reference61 = obj56; num++; - ref QuestSequence reference61 = ref span2[num]; - QuestSequence obj56 = new QuestSequence + ref QuestSequence reference62 = ref span2[num]; + QuestSequence obj57 = new QuestSequence { Sequence = 1 }; num2 = 1; - List list89 = new List(num2); - CollectionsMarshal.SetCount(list89, num2); - span3 = CollectionsMarshal.AsSpan(list89); + List list90 = new List(num2); + CollectionsMarshal.SetCount(list90, num2); + span3 = CollectionsMarshal.AsSpan(list90); index2 = 0; - ref QuestStep reference62 = ref span3[index2]; - QuestStep obj57 = new QuestStep(EInteractionType.Combat, null, new Vector3(-9.741034f, 18.766914f, -0.8730635f), 152) + ref QuestStep reference63 = ref span3[index2]; + QuestStep obj58 = new QuestStep(EInteractionType.Combat, null, new Vector3(-9.741034f, 18.766914f, -0.8730635f), 152) { EnemySpawnType = EEnemySpawnType.OverworldEnemies }; - num3 = 1; - List list90 = new List(num3); - CollectionsMarshal.SetCount(list90, num3); - Span span6 = CollectionsMarshal.AsSpan(list90); - num4 = 0; - span6[num4] = new ComplexCombatData + num4 = 1; + List list91 = new List(num4); + CollectionsMarshal.SetCount(list91, num4); + Span span6 = CollectionsMarshal.AsSpan(list91); + num3 = 0; + span6[num3] = new ComplexCombatData { DataId = 133u, MinimumKillCount = 4u, RewardItemId = 2000751u, RewardItemCount = 4 }; - obj57.ComplexCombatData = list90; + obj58.ComplexCombatData = list91; + reference63 = obj58; + obj57.Steps = list90; reference62 = obj57; - obj56.Steps = list89; - reference61 = obj56; num++; - ref QuestSequence reference63 = ref span2[num]; - QuestSequence obj58 = new QuestSequence + ref QuestSequence reference64 = ref span2[num]; + QuestSequence obj59 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 1; - List list91 = new List(index2); - CollectionsMarshal.SetCount(list91, index2); - span3 = CollectionsMarshal.AsSpan(list91); + List list92 = new List(index2); + CollectionsMarshal.SetCount(list92, index2); + span3 = CollectionsMarshal.AsSpan(list92); num2 = 0; span3[num2] = new QuestStep(EInteractionType.CompleteQuest, 1006717u, new Vector3(-236.2555f, 51.499146f, -193.13348f), 152); - obj58.Steps = list91; - reference63 = obj58; - questRoot14.QuestSequence = list87; + obj59.Steps = list92; + reference64 = obj59; + questRoot14.QuestSequence = list88; AddQuest(questId14, questRoot14); QuestId questId15 = new QuestId(975); QuestRoot questRoot15 = new QuestRoot(); num = 1; - List list92 = new List(num); - CollectionsMarshal.SetCount(list92, num); - span = CollectionsMarshal.AsSpan(list92); + List list93 = new List(num); + CollectionsMarshal.SetCount(list93, num); + span = CollectionsMarshal.AsSpan(list93); index = 0; span[index] = "JerryWester"; - questRoot15.Author = list92; + questRoot15.Author = list93; index = 2; - List list93 = new List(index); - CollectionsMarshal.SetCount(list93, index); - span2 = CollectionsMarshal.AsSpan(list93); + List list94 = new List(index); + CollectionsMarshal.SetCount(list94, index); + span2 = CollectionsMarshal.AsSpan(list94); num = 0; - ref QuestSequence reference64 = ref span2[num]; - QuestSequence obj59 = new QuestSequence + ref QuestSequence reference65 = ref span2[num]; + QuestSequence obj60 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list94 = new List(num2); - CollectionsMarshal.SetCount(list94, num2); - span3 = CollectionsMarshal.AsSpan(list94); + List list95 = new List(num2); + CollectionsMarshal.SetCount(list95, num2); + span3 = CollectionsMarshal.AsSpan(list95); index2 = 0; span3[index2] = new QuestStep(EInteractionType.AcceptQuest, 1006710u, new Vector3(-123.73547f, 7.0426483f, -149.98096f), 133) { @@ -68193,21 +68236,21 @@ public static class AssemblyQuestLoader To = EAetheryteLocation.GridaniaAmphitheatre } }; - obj59.Steps = list94; - reference64 = obj59; + obj60.Steps = list95; + reference65 = obj60; num++; - ref QuestSequence reference65 = ref span2[num]; - QuestSequence obj60 = new QuestSequence + ref QuestSequence reference66 = ref span2[num]; + QuestSequence obj61 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 2; - List list95 = new List(index2); - CollectionsMarshal.SetCount(list95, index2); - span3 = CollectionsMarshal.AsSpan(list95); + List list96 = new List(index2); + CollectionsMarshal.SetCount(list96, index2); + span3 = CollectionsMarshal.AsSpan(list96); num2 = 0; - ref QuestStep reference66 = ref span3[num2]; - QuestStep obj61 = new QuestStep(EInteractionType.Interact, 1000106u, new Vector3(29.007324f, -19.000002f, 105.485596f), 132) + ref QuestStep reference67 = ref span3[num2]; + QuestStep obj62 = new QuestStep(EInteractionType.Interact, 1000106u, new Vector3(29.007324f, -19.000002f, 105.485596f), 132) { AethernetShortcut = new AethernetShortcut { @@ -68215,280 +68258,280 @@ public static class AssemblyQuestLoader To = EAetheryteLocation.GridaniaAirship } }; - num4 = 1; - List list96 = new List(num4); - CollectionsMarshal.SetCount(list96, num4); - Span span7 = CollectionsMarshal.AsSpan(list96); - num3 = 0; - span7[num3] = new DialogueChoice + num3 = 1; + List list97 = new List(num3); + CollectionsMarshal.SetCount(list97, num3); + Span span7 = CollectionsMarshal.AsSpan(list97); + num4 = 0; + span7[num4] = new DialogueChoice { Type = EDialogChoiceType.YesNo, Prompt = new ExcelRef("TEXT_GAIUSC308_00975_Q1_000_040") }; - obj61.DialogueChoices = list96; - reference66 = obj61; + obj62.DialogueChoices = list97; + reference67 = obj62; num2++; span3[num2] = new QuestStep(EInteractionType.CompleteQuest, 1006492u, new Vector3(7.3395386f, -21.970974f, 121.934814f), 132); - obj60.Steps = list95; - reference65 = obj60; - questRoot15.QuestSequence = list93; + obj61.Steps = list96; + reference66 = obj61; + questRoot15.QuestSequence = list94; AddQuest(questId15, questRoot15); QuestId questId16 = new QuestId(978); QuestRoot questRoot16 = new QuestRoot(); num = 1; - List list97 = new List(num); - CollectionsMarshal.SetCount(list97, num); - span = CollectionsMarshal.AsSpan(list97); + List list98 = new List(num); + CollectionsMarshal.SetCount(list98, num); + span = CollectionsMarshal.AsSpan(list98); index = 0; span[index] = "JerryWester"; - questRoot16.Author = list97; + questRoot16.Author = list98; index = 2; - List list98 = new List(index); - CollectionsMarshal.SetCount(list98, index); - span2 = CollectionsMarshal.AsSpan(list98); + List list99 = new List(index); + CollectionsMarshal.SetCount(list99, index); + span2 = CollectionsMarshal.AsSpan(list99); num = 0; - ref QuestSequence reference67 = ref span2[num]; - QuestSequence obj62 = new QuestSequence + ref QuestSequence reference68 = ref span2[num]; + QuestSequence obj63 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list99 = new List(num2); - CollectionsMarshal.SetCount(list99, num2); - span3 = CollectionsMarshal.AsSpan(list99); + List list100 = new List(num2); + CollectionsMarshal.SetCount(list100, num2); + span3 = CollectionsMarshal.AsSpan(list100); index2 = 0; span3[index2] = new QuestStep(EInteractionType.AcceptQuest, 1007473u, new Vector3(37.308228f, 1.2000015f, 2.9144287f), 212) { StopDistance = 7f }; - obj62.Steps = list99; - reference67 = obj62; + obj63.Steps = list100; + reference68 = obj63; num++; - ref QuestSequence reference68 = ref span2[num]; - QuestSequence obj63 = new QuestSequence + ref QuestSequence reference69 = ref span2[num]; + QuestSequence obj64 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 1; - List list100 = new List(index2); - CollectionsMarshal.SetCount(list100, index2); - span3 = CollectionsMarshal.AsSpan(list100); + List list101 = new List(index2); + CollectionsMarshal.SetCount(list101, index2); + span3 = CollectionsMarshal.AsSpan(list101); num2 = 0; span3[num2] = new QuestStep(EInteractionType.CompleteQuest, 1006380u, new Vector3(169.48193f, 223.03537f, 366.26233f), 155) { AetheryteShortcut = EAetheryteLocation.CoerthasCentralHighlandsCampDragonhead }; - obj63.Steps = list100; - reference68 = obj63; - questRoot16.QuestSequence = list98; + obj64.Steps = list101; + reference69 = obj64; + questRoot16.QuestSequence = list99; AddQuest(questId16, questRoot16); QuestId questId17 = new QuestId(979); QuestRoot questRoot17 = new QuestRoot(); num = 1; - List list101 = new List(num); - CollectionsMarshal.SetCount(list101, num); - span = CollectionsMarshal.AsSpan(list101); + List list102 = new List(num); + CollectionsMarshal.SetCount(list102, num); + span = CollectionsMarshal.AsSpan(list102); index = 0; span[index] = "liza"; - questRoot17.Author = list101; + questRoot17.Author = list102; index = 2; - List list102 = new List(index); - CollectionsMarshal.SetCount(list102, index); - span2 = CollectionsMarshal.AsSpan(list102); + List list103 = new List(index); + CollectionsMarshal.SetCount(list103, index); + span2 = CollectionsMarshal.AsSpan(list103); num = 0; - ref QuestSequence reference69 = ref span2[num]; - QuestSequence obj64 = new QuestSequence + ref QuestSequence reference70 = ref span2[num]; + QuestSequence obj65 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list103 = new List(num2); - CollectionsMarshal.SetCount(list103, num2); - span3 = CollectionsMarshal.AsSpan(list103); + List list104 = new List(num2); + CollectionsMarshal.SetCount(list104, num2); + span3 = CollectionsMarshal.AsSpan(list104); index2 = 0; span3[index2] = new QuestStep(EInteractionType.AcceptQuest, 1006382u, new Vector3(165.20935f, 222.99998f, 367.72717f), 155); - obj64.Steps = list103; - reference69 = obj64; + obj65.Steps = list104; + reference70 = obj65; num++; - ref QuestSequence reference70 = ref span2[num]; - QuestSequence obj65 = new QuestSequence + ref QuestSequence reference71 = ref span2[num]; + QuestSequence obj66 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 1; - List list104 = new List(index2); - CollectionsMarshal.SetCount(list104, index2); - span3 = CollectionsMarshal.AsSpan(list104); + List list105 = new List(index2); + CollectionsMarshal.SetCount(list105, index2); + span3 = CollectionsMarshal.AsSpan(list105); num2 = 0; span3[num2] = new QuestStep(EInteractionType.CompleteQuest, 1006516u, new Vector3(-82.68872f, 233.23743f, 317.1892f), 155); - obj65.Steps = list104; - reference70 = obj65; - questRoot17.QuestSequence = list102; + obj66.Steps = list105; + reference71 = obj66; + questRoot17.QuestSequence = list103; AddQuest(questId17, questRoot17); QuestId questId18 = new QuestId(980); QuestRoot questRoot18 = new QuestRoot(); num = 1; - List list105 = new List(num); - CollectionsMarshal.SetCount(list105, num); - span = CollectionsMarshal.AsSpan(list105); + List list106 = new List(num); + CollectionsMarshal.SetCount(list106, num); + span = CollectionsMarshal.AsSpan(list106); index = 0; span[index] = "JerryWester"; - questRoot18.Author = list105; + questRoot18.Author = list106; index = 3; - List list106 = new List(index); - CollectionsMarshal.SetCount(list106, index); - span2 = CollectionsMarshal.AsSpan(list106); + List list107 = new List(index); + CollectionsMarshal.SetCount(list107, index); + span2 = CollectionsMarshal.AsSpan(list107); num = 0; - ref QuestSequence reference71 = ref span2[num]; - QuestSequence obj66 = new QuestSequence + ref QuestSequence reference72 = ref span2[num]; + QuestSequence obj67 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list107 = new List(num2); - CollectionsMarshal.SetCount(list107, num2); - span3 = CollectionsMarshal.AsSpan(list107); + List list108 = new List(num2); + CollectionsMarshal.SetCount(list108, num2); + span3 = CollectionsMarshal.AsSpan(list108); index2 = 0; span3[index2] = new QuestStep(EInteractionType.AcceptQuest, 1006380u, new Vector3(169.48193f, 223.03537f, 366.26233f), 155); - obj66.Steps = list107; - reference71 = obj66; - num++; - ref QuestSequence reference72 = ref span2[num]; - QuestSequence obj67 = new QuestSequence - { - Sequence = 1 - }; - index2 = 1; - List list108 = new List(index2); - CollectionsMarshal.SetCount(list108, index2); - span3 = CollectionsMarshal.AsSpan(list108); - num2 = 0; - span3[num2] = new QuestStep(EInteractionType.Interact, 1006517u, new Vector3(-49.607117f, 223.60161f, 350.57593f), 155); obj67.Steps = list108; reference72 = obj67; num++; ref QuestSequence reference73 = ref span2[num]; QuestSequence obj68 = new QuestSequence + { + Sequence = 1 + }; + index2 = 1; + List list109 = new List(index2); + CollectionsMarshal.SetCount(list109, index2); + span3 = CollectionsMarshal.AsSpan(list109); + num2 = 0; + span3[num2] = new QuestStep(EInteractionType.Interact, 1006517u, new Vector3(-49.607117f, 223.60161f, 350.57593f), 155); + obj68.Steps = list109; + reference73 = obj68; + num++; + ref QuestSequence reference74 = ref span2[num]; + QuestSequence obj69 = new QuestSequence { Sequence = byte.MaxValue }; num2 = 1; - List list109 = new List(num2); - CollectionsMarshal.SetCount(list109, num2); - span3 = CollectionsMarshal.AsSpan(list109); + List list110 = new List(num2); + CollectionsMarshal.SetCount(list110, num2); + span3 = CollectionsMarshal.AsSpan(list110); index2 = 0; span3[index2] = new QuestStep(EInteractionType.CompleteQuest, 1006518u, new Vector3(-354.84857f, 214.79114f, 687.5867f), 155); - obj68.Steps = list109; - reference73 = obj68; - questRoot18.QuestSequence = list106; + obj69.Steps = list110; + reference74 = obj69; + questRoot18.QuestSequence = list107; AddQuest(questId18, questRoot18); QuestId questId19 = new QuestId(981); QuestRoot questRoot19 = new QuestRoot(); num = 1; - List list110 = new List(num); - CollectionsMarshal.SetCount(list110, num); - span = CollectionsMarshal.AsSpan(list110); + List list111 = new List(num); + CollectionsMarshal.SetCount(list111, num); + span = CollectionsMarshal.AsSpan(list111); index = 0; span[index] = "JerryWester"; - questRoot19.Author = list110; + questRoot19.Author = list111; index = 8; - List list111 = new List(index); - CollectionsMarshal.SetCount(list111, index); - span2 = CollectionsMarshal.AsSpan(list111); + List list112 = new List(index); + CollectionsMarshal.SetCount(list112, index); + span2 = CollectionsMarshal.AsSpan(list112); num = 0; - ref QuestSequence reference74 = ref span2[num]; - QuestSequence obj69 = new QuestSequence + ref QuestSequence reference75 = ref span2[num]; + QuestSequence obj70 = new QuestSequence { Sequence = 0 }; index2 = 1; - List list112 = new List(index2); - CollectionsMarshal.SetCount(list112, index2); - span3 = CollectionsMarshal.AsSpan(list112); + List list113 = new List(index2); + CollectionsMarshal.SetCount(list113, index2); + span3 = CollectionsMarshal.AsSpan(list113); num2 = 0; span3[num2] = new QuestStep(EInteractionType.AcceptQuest, 1006518u, new Vector3(-354.84857f, 214.79114f, 687.5867f), 155); - obj69.Steps = list112; - reference74 = obj69; - num++; - ref QuestSequence reference75 = ref span2[num]; - QuestSequence obj70 = new QuestSequence - { - Sequence = 1 - }; - num2 = 1; - List list113 = new List(num2); - CollectionsMarshal.SetCount(list113, num2); - span3 = CollectionsMarshal.AsSpan(list113); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.Interact, 2002196u, new Vector3(-322.80463f, 216.54077f, 655.8479f), 155); obj70.Steps = list113; reference75 = obj70; num++; ref QuestSequence reference76 = ref span2[num]; QuestSequence obj71 = new QuestSequence { - Sequence = 2 + Sequence = 1 }; - index2 = 1; - List list114 = new List(index2); - CollectionsMarshal.SetCount(list114, index2); + num2 = 1; + List list114 = new List(num2); + CollectionsMarshal.SetCount(list114, num2); span3 = CollectionsMarshal.AsSpan(list114); - num2 = 0; - span3[num2] = new QuestStep(EInteractionType.Interact, 2002197u, new Vector3(-290.9438f, 223.25464f, 590.5393f), 155); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.Interact, 2002196u, new Vector3(-322.80463f, 216.54077f, 655.8479f), 155); obj71.Steps = list114; reference76 = obj71; num++; ref QuestSequence reference77 = ref span2[num]; QuestSequence obj72 = new QuestSequence { - Sequence = 3 + Sequence = 2 }; - num2 = 1; - List list115 = new List(num2); - CollectionsMarshal.SetCount(list115, num2); + index2 = 1; + List list115 = new List(index2); + CollectionsMarshal.SetCount(list115, index2); span3 = CollectionsMarshal.AsSpan(list115); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.Interact, 2002198u, new Vector3(-316.15173f, 228.93103f, 540.917f), 155); + num2 = 0; + span3[num2] = new QuestStep(EInteractionType.Interact, 2002197u, new Vector3(-290.9438f, 223.25464f, 590.5393f), 155); obj72.Steps = list115; reference77 = obj72; num++; ref QuestSequence reference78 = ref span2[num]; QuestSequence obj73 = new QuestSequence { - Sequence = 4 + Sequence = 3 }; - index2 = 1; - List list116 = new List(index2); - CollectionsMarshal.SetCount(list116, index2); + num2 = 1; + List list116 = new List(num2); + CollectionsMarshal.SetCount(list116, num2); span3 = CollectionsMarshal.AsSpan(list116); - num2 = 0; - span3[num2] = new QuestStep(EInteractionType.Interact, 2002199u, new Vector3(-338.2467f, 235.21777f, 525.5664f), 155); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.Interact, 2002198u, new Vector3(-316.15173f, 228.93103f, 540.917f), 155); obj73.Steps = list116; reference78 = obj73; num++; ref QuestSequence reference79 = ref span2[num]; QuestSequence obj74 = new QuestSequence { - Sequence = 5 + Sequence = 4 }; - num2 = 1; - List list117 = new List(num2); - CollectionsMarshal.SetCount(list117, num2); + index2 = 1; + List list117 = new List(index2); + CollectionsMarshal.SetCount(list117, index2); span3 = CollectionsMarshal.AsSpan(list117); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.Interact, 2002200u, new Vector3(-358.29712f, 236.71313f, 506.27905f), 155); + num2 = 0; + span3[num2] = new QuestStep(EInteractionType.Interact, 2002199u, new Vector3(-338.2467f, 235.21777f, 525.5664f), 155); obj74.Steps = list117; reference79 = obj74; num++; ref QuestSequence reference80 = ref span2[num]; QuestSequence obj75 = new QuestSequence + { + Sequence = 5 + }; + num2 = 1; + List list118 = new List(num2); + CollectionsMarshal.SetCount(list118, num2); + span3 = CollectionsMarshal.AsSpan(list118); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.Interact, 2002200u, new Vector3(-358.29712f, 236.71313f, 506.27905f), 155); + obj75.Steps = list118; + reference80 = obj75; + num++; + ref QuestSequence reference81 = ref span2[num]; + QuestSequence obj76 = new QuestSequence { Sequence = 6 }; index2 = 2; - List list118 = new List(index2); - CollectionsMarshal.SetCount(list118, index2); - span3 = CollectionsMarshal.AsSpan(list118); + List list119 = new List(index2); + CollectionsMarshal.SetCount(list119, index2); + span3 = CollectionsMarshal.AsSpan(list119); num2 = 0; span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(-399.05286f, 228.68446f, 445.9758f), 155); num2++; @@ -68497,18 +68540,18 @@ public static class AssemblyQuestLoader StopDistance = 7f, DisableNavmesh = true }; - obj75.Steps = list118; - reference80 = obj75; + obj76.Steps = list119; + reference81 = obj76; num++; - ref QuestSequence reference81 = ref span2[num]; - QuestSequence obj76 = new QuestSequence + ref QuestSequence reference82 = ref span2[num]; + QuestSequence obj77 = new QuestSequence { Sequence = byte.MaxValue }; num2 = 3; - List list119 = new List(num2); - CollectionsMarshal.SetCount(list119, num2); - span3 = CollectionsMarshal.AsSpan(list119); + List list120 = new List(num2); + CollectionsMarshal.SetCount(list120, num2); + span3 = CollectionsMarshal.AsSpan(list120); index2 = 0; span3[index2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(-688.1699f, 241.99994f, 355.80283f), 155); index2++; @@ -68518,64 +68561,64 @@ public static class AssemblyQuestLoader }; index2++; span3[index2] = new QuestStep(EInteractionType.CompleteQuest, 1006521u, new Vector3(-697.04736f, 242.18399f, 380.63623f), 155); - obj76.Steps = list119; - reference81 = obj76; - questRoot19.QuestSequence = list111; + obj77.Steps = list120; + reference82 = obj77; + questRoot19.QuestSequence = list112; AddQuest(questId19, questRoot19); QuestId questId20 = new QuestId(982); QuestRoot questRoot20 = new QuestRoot(); num = 1; - List list120 = new List(num); - CollectionsMarshal.SetCount(list120, num); - span = CollectionsMarshal.AsSpan(list120); + List list121 = new List(num); + CollectionsMarshal.SetCount(list121, num); + span = CollectionsMarshal.AsSpan(list121); index = 0; span[index] = "JerryWester"; - questRoot20.Author = list120; + questRoot20.Author = list121; index = 4; - List list121 = new List(index); - CollectionsMarshal.SetCount(list121, index); - span2 = CollectionsMarshal.AsSpan(list121); + List list122 = new List(index); + CollectionsMarshal.SetCount(list122, index); + span2 = CollectionsMarshal.AsSpan(list122); num = 0; - ref QuestSequence reference82 = ref span2[num]; - QuestSequence obj77 = new QuestSequence + ref QuestSequence reference83 = ref span2[num]; + QuestSequence obj78 = new QuestSequence { Sequence = 0 }; index2 = 1; - List list122 = new List(index2); - CollectionsMarshal.SetCount(list122, index2); - span3 = CollectionsMarshal.AsSpan(list122); + List list123 = new List(index2); + CollectionsMarshal.SetCount(list123, index2); + span3 = CollectionsMarshal.AsSpan(list123); num2 = 0; span3[num2] = new QuestStep(EInteractionType.AcceptQuest, 1006520u, new Vector3(-699.51935f, 242.184f, 373.495f), 155) { StopDistance = 7f }; - obj77.Steps = list122; - reference82 = obj77; - num++; - ref QuestSequence reference83 = ref span2[num]; - QuestSequence obj78 = new QuestSequence - { - Sequence = 1 - }; - num2 = 1; - List list123 = new List(num2); - CollectionsMarshal.SetCount(list123, num2); - span3 = CollectionsMarshal.AsSpan(list123); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.Interact, 1006521u, new Vector3(-697.04736f, 242.18399f, 380.63623f), 155); obj78.Steps = list123; reference83 = obj78; num++; ref QuestSequence reference84 = ref span2[num]; QuestSequence obj79 = new QuestSequence + { + Sequence = 1 + }; + num2 = 1; + List list124 = new List(num2); + CollectionsMarshal.SetCount(list124, num2); + span3 = CollectionsMarshal.AsSpan(list124); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.Interact, 1006521u, new Vector3(-697.04736f, 242.18399f, 380.63623f), 155); + obj79.Steps = list124; + reference84 = obj79; + num++; + ref QuestSequence reference85 = ref span2[num]; + QuestSequence obj80 = new QuestSequence { Sequence = 2 }; index2 = 3; - List list124 = new List(index2); - CollectionsMarshal.SetCount(list124, index2); - span3 = CollectionsMarshal.AsSpan(list124); + List list125 = new List(index2); + CollectionsMarshal.SetCount(list125, index2); + span3 = CollectionsMarshal.AsSpan(list125); num2 = 0; span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(-692.2779f, 242.18399f, 366.4715f), 155); num2++; @@ -68585,18 +68628,18 @@ public static class AssemblyQuestLoader }; num2++; span3[num2] = new QuestStep(EInteractionType.Interact, 2002265u, new Vector3(-693.01904f, 253.86426f, 506.98096f), 155); - obj79.Steps = list124; - reference84 = obj79; + obj80.Steps = list125; + reference85 = obj80; num++; - ref QuestSequence reference85 = ref span2[num]; - QuestSequence obj80 = new QuestSequence + ref QuestSequence reference86 = ref span2[num]; + QuestSequence obj81 = new QuestSequence { Sequence = byte.MaxValue }; num2 = 4; - List list125 = new List(num2); - CollectionsMarshal.SetCount(list125, num2); - span3 = CollectionsMarshal.AsSpan(list125); + List list126 = new List(num2); + CollectionsMarshal.SetCount(list126, num2); + span3 = CollectionsMarshal.AsSpan(list126); index2 = 0; span3[index2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(-690.43774f, 261.3325f, 433.44107f), 155) { @@ -68615,61 +68658,61 @@ public static class AssemblyQuestLoader }; index2++; span3[index2] = new QuestStep(EInteractionType.CompleteQuest, 1006520u, new Vector3(-699.51935f, 242.184f, 373.495f), 155); - obj80.Steps = list125; - reference85 = obj80; - questRoot20.QuestSequence = list121; + obj81.Steps = list126; + reference86 = obj81; + questRoot20.QuestSequence = list122; AddQuest(questId20, questRoot20); QuestId questId21 = new QuestId(983); QuestRoot questRoot21 = new QuestRoot(); num = 1; - List list126 = new List(num); - CollectionsMarshal.SetCount(list126, num); - span = CollectionsMarshal.AsSpan(list126); + List list127 = new List(num); + CollectionsMarshal.SetCount(list127, num); + span = CollectionsMarshal.AsSpan(list127); index = 0; span[index] = "JerryWester"; - questRoot21.Author = list126; + questRoot21.Author = list127; index = 4; - List list127 = new List(index); - CollectionsMarshal.SetCount(list127, index); - span2 = CollectionsMarshal.AsSpan(list127); + List list128 = new List(index); + CollectionsMarshal.SetCount(list128, index); + span2 = CollectionsMarshal.AsSpan(list128); num = 0; - ref QuestSequence reference86 = ref span2[num]; - QuestSequence obj81 = new QuestSequence + ref QuestSequence reference87 = ref span2[num]; + QuestSequence obj82 = new QuestSequence { Sequence = 0 }; index2 = 1; - List list128 = new List(index2); - CollectionsMarshal.SetCount(list128, index2); - span3 = CollectionsMarshal.AsSpan(list128); + List list129 = new List(index2); + CollectionsMarshal.SetCount(list129, index2); + span3 = CollectionsMarshal.AsSpan(list129); num2 = 0; span3[num2] = new QuestStep(EInteractionType.AcceptQuest, 1006520u, new Vector3(-699.51935f, 242.184f, 373.495f), 155); - obj81.Steps = list128; - reference86 = obj81; - num++; - ref QuestSequence reference87 = ref span2[num]; - QuestSequence obj82 = new QuestSequence - { - Sequence = 1 - }; - num2 = 1; - List list129 = new List(num2); - CollectionsMarshal.SetCount(list129, num2); - span3 = CollectionsMarshal.AsSpan(list129); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.Interact, 1006522u, new Vector3(-694.42285f, 300.96927f, 372.1521f), 155); obj82.Steps = list129; reference87 = obj82; num++; ref QuestSequence reference88 = ref span2[num]; QuestSequence obj83 = new QuestSequence + { + Sequence = 1 + }; + num2 = 1; + List list130 = new List(num2); + CollectionsMarshal.SetCount(list130, num2); + span3 = CollectionsMarshal.AsSpan(list130); + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.Interact, 1006522u, new Vector3(-694.42285f, 300.96927f, 372.1521f), 155); + obj83.Steps = list130; + reference88 = obj83; + num++; + ref QuestSequence reference89 = ref span2[num]; + QuestSequence obj84 = new QuestSequence { Sequence = 2 }; index2 = 3; - List list130 = new List(index2); - CollectionsMarshal.SetCount(list130, index2); - span3 = CollectionsMarshal.AsSpan(list130); + List list131 = new List(index2); + CollectionsMarshal.SetCount(list131, index2); + span3 = CollectionsMarshal.AsSpan(list131); num2 = 0; span3[num2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(-692.2779f, 242.18399f, 366.4715f), 155); num2++; @@ -68685,18 +68728,18 @@ public static class AssemblyQuestLoader Enabled = true } }; - obj83.Steps = list130; - reference88 = obj83; + obj84.Steps = list131; + reference89 = obj84; num++; - ref QuestSequence reference89 = ref span2[num]; - QuestSequence obj84 = new QuestSequence + ref QuestSequence reference90 = ref span2[num]; + QuestSequence obj85 = new QuestSequence { Sequence = byte.MaxValue }; num2 = 3; - List list131 = new List(num2); - CollectionsMarshal.SetCount(list131, num2); - span3 = CollectionsMarshal.AsSpan(list131); + List list132 = new List(num2); + CollectionsMarshal.SetCount(list132, num2); + span3 = CollectionsMarshal.AsSpan(list132); index2 = 0; span3[index2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(-688.1699f, 241.99994f, 355.80283f), 155) { @@ -68709,50 +68752,50 @@ public static class AssemblyQuestLoader }; index2++; span3[index2] = new QuestStep(EInteractionType.CompleteQuest, 1006520u, new Vector3(-699.51935f, 242.184f, 373.495f), 155); - obj84.Steps = list131; - reference89 = obj84; - questRoot21.QuestSequence = list127; + obj85.Steps = list132; + reference90 = obj85; + questRoot21.QuestSequence = list128; AddQuest(questId21, questRoot21); QuestId questId22 = new QuestId(984); QuestRoot questRoot22 = new QuestRoot(); num = 1; - List list132 = new List(num); - CollectionsMarshal.SetCount(list132, num); - span = CollectionsMarshal.AsSpan(list132); + List list133 = new List(num); + CollectionsMarshal.SetCount(list133, num); + span = CollectionsMarshal.AsSpan(list133); index = 0; span[index] = "JerryWester"; - questRoot22.Author = list132; + questRoot22.Author = list133; index = 3; - List list133 = new List(index); - CollectionsMarshal.SetCount(list133, index); - span2 = CollectionsMarshal.AsSpan(list133); + List list134 = new List(index); + CollectionsMarshal.SetCount(list134, index); + span2 = CollectionsMarshal.AsSpan(list134); num = 0; - ref QuestSequence reference90 = ref span2[num]; - QuestSequence obj85 = new QuestSequence + ref QuestSequence reference91 = ref span2[num]; + QuestSequence obj86 = new QuestSequence { Sequence = 0 }; index2 = 1; - List list134 = new List(index2); - CollectionsMarshal.SetCount(list134, index2); - span3 = CollectionsMarshal.AsSpan(list134); + List list135 = new List(index2); + CollectionsMarshal.SetCount(list135, index2); + span3 = CollectionsMarshal.AsSpan(list135); num2 = 0; span3[num2] = new QuestStep(EInteractionType.AcceptQuest, 1006528u, new Vector3(-698.51227f, 242.18399f, 375.17358f), 155) { StopDistance = 5f }; - obj85.Steps = list134; - reference90 = obj85; + obj86.Steps = list135; + reference91 = obj86; num++; - ref QuestSequence reference91 = ref span2[num]; - QuestSequence obj86 = new QuestSequence + ref QuestSequence reference92 = ref span2[num]; + QuestSequence obj87 = new QuestSequence { Sequence = 1 }; num2 = 5; - List list135 = new List(num2); - CollectionsMarshal.SetCount(list135, num2); - span3 = CollectionsMarshal.AsSpan(list135); + List list136 = new List(num2); + CollectionsMarshal.SetCount(list136, num2); + span3 = CollectionsMarshal.AsSpan(list136); index2 = 0; span3[index2] = new QuestStep(EInteractionType.WalkTo, null, new Vector3(-692.2779f, 242.18399f, 366.4715f), 155); index2++; @@ -68770,61 +68813,61 @@ public static class AssemblyQuestLoader }; index2++; span3[index2] = new QuestStep(EInteractionType.Interact, 1006530u, new Vector3(21.927185f, 20.746975f, -682.06305f), 156); - obj86.Steps = list135; - reference91 = obj86; + obj87.Steps = list136; + reference92 = obj87; num++; - ref QuestSequence reference92 = ref span2[num]; - QuestSequence obj87 = new QuestSequence + ref QuestSequence reference93 = ref span2[num]; + QuestSequence obj88 = new QuestSequence { Sequence = byte.MaxValue }; index2 = 1; - List list136 = new List(index2); - CollectionsMarshal.SetCount(list136, index2); - span3 = CollectionsMarshal.AsSpan(list136); + List list137 = new List(index2); + CollectionsMarshal.SetCount(list137, index2); + span3 = CollectionsMarshal.AsSpan(list137); num2 = 0; span3[num2] = new QuestStep(EInteractionType.CompleteQuest, 1006531u, new Vector3(53.81848f, 25.009521f, -697.0779f), 156); - obj87.Steps = list136; - reference92 = obj87; - questRoot22.QuestSequence = list133; + obj88.Steps = list137; + reference93 = obj88; + questRoot22.QuestSequence = list134; AddQuest(questId22, questRoot22); QuestId questId23 = new QuestId(986); QuestRoot questRoot23 = new QuestRoot(); num = 1; - List list137 = new List(num); - CollectionsMarshal.SetCount(list137, num); - span = CollectionsMarshal.AsSpan(list137); + List list138 = new List(num); + CollectionsMarshal.SetCount(list138, num); + span = CollectionsMarshal.AsSpan(list138); index = 0; span[index] = "JerryWester"; - questRoot23.Author = list137; + questRoot23.Author = list138; index = 5; - List list138 = new List(index); - CollectionsMarshal.SetCount(list138, index); - span2 = CollectionsMarshal.AsSpan(list138); + List list139 = new List(index); + CollectionsMarshal.SetCount(list139, index); + span2 = CollectionsMarshal.AsSpan(list139); num = 0; - ref QuestSequence reference93 = ref span2[num]; - QuestSequence obj88 = new QuestSequence + ref QuestSequence reference94 = ref span2[num]; + QuestSequence obj89 = new QuestSequence { Sequence = 0 }; num2 = 1; - List list139 = new List(num2); - CollectionsMarshal.SetCount(list139, num2); - span3 = CollectionsMarshal.AsSpan(list139); + List list140 = new List(num2); + CollectionsMarshal.SetCount(list140, num2); + span3 = CollectionsMarshal.AsSpan(list140); index2 = 0; span3[index2] = new QuestStep(EInteractionType.AcceptQuest, 1006531u, new Vector3(53.81848f, 25.009521f, -697.0779f), 156); - obj88.Steps = list139; - reference93 = obj88; + obj89.Steps = list140; + reference94 = obj89; num++; - ref QuestSequence reference94 = ref span2[num]; - QuestSequence obj89 = new QuestSequence + ref QuestSequence reference95 = ref span2[num]; + QuestSequence obj90 = new QuestSequence { Sequence = 1 }; index2 = 2; - List list140 = new List(index2); - CollectionsMarshal.SetCount(list140, index2); - span3 = CollectionsMarshal.AsSpan(list140); + List list141 = new List(index2); + CollectionsMarshal.SetCount(list141, index2); + span3 = CollectionsMarshal.AsSpan(list141); num2 = 0; span3[num2] = new QuestStep(EInteractionType.Combat, null, new Vector3(-420.5539f, -16.922302f, -325.30713f), 156) { @@ -68832,67 +68875,67 @@ public static class AssemblyQuestLoader CombatDelaySecondsAtStart = 2f }; num2++; - ref QuestStep reference95 = ref span3[num2]; - QuestStep obj90 = new QuestStep(EInteractionType.Combat, 2002201u, new Vector3(-420.5539f, -16.922302f, -325.30713f), 156) + ref QuestStep reference96 = ref span3[num2]; + QuestStep obj91 = new QuestStep(EInteractionType.Combat, 2002201u, new Vector3(-420.5539f, -16.922302f, -325.30713f), 156) { EnemySpawnType = EEnemySpawnType.AfterInteraction }; - num3 = 1; - List list141 = new List(num3); - CollectionsMarshal.SetCount(list141, num3); - Span span8 = CollectionsMarshal.AsSpan(list141); - num4 = 0; - span8[num4] = 43u; - obj90.KillEnemyDataIds = list141; - reference95 = obj90; - obj89.Steps = list140; - reference94 = obj89; - num++; - ref QuestSequence reference96 = ref span2[num]; - QuestSequence obj91 = new QuestSequence - { - Sequence = 2 - }; - num2 = 1; - List list142 = new List(num2); - CollectionsMarshal.SetCount(list142, num2); - span3 = CollectionsMarshal.AsSpan(list142); - index2 = 0; - span3[index2] = new QuestStep(EInteractionType.Interact, 2002202u, new Vector3(-420.52344f, -16.922302f, -325.30713f), 156); - obj91.Steps = list142; + num4 = 1; + List list142 = new List(num4); + CollectionsMarshal.SetCount(list142, num4); + Span span8 = CollectionsMarshal.AsSpan(list142); + num3 = 0; + span8[num3] = 43u; + obj91.KillEnemyDataIds = list142; reference96 = obj91; + obj90.Steps = list141; + reference95 = obj90; num++; ref QuestSequence reference97 = ref span2[num]; QuestSequence obj92 = new QuestSequence { - Sequence = 3 + Sequence = 2 }; - index2 = 1; - List list143 = new List(index2); - CollectionsMarshal.SetCount(list143, index2); + num2 = 1; + List list143 = new List(num2); + CollectionsMarshal.SetCount(list143, num2); span3 = CollectionsMarshal.AsSpan(list143); - num2 = 0; - span3[num2] = new QuestStep(EInteractionType.Interact, 1006534u, new Vector3(28.213867f, 20.662334f, -688.4413f), 156) - { - AetheryteShortcut = EAetheryteLocation.MorDhona - }; + index2 = 0; + span3[index2] = new QuestStep(EInteractionType.Interact, 2002202u, new Vector3(-420.52344f, -16.922302f, -325.30713f), 156); obj92.Steps = list143; reference97 = obj92; num++; ref QuestSequence reference98 = ref span2[num]; QuestSequence obj93 = new QuestSequence + { + Sequence = 3 + }; + index2 = 1; + List list144 = new List(index2); + CollectionsMarshal.SetCount(list144, index2); + span3 = CollectionsMarshal.AsSpan(list144); + num2 = 0; + span3[num2] = new QuestStep(EInteractionType.Interact, 1006534u, new Vector3(28.213867f, 20.662334f, -688.4413f), 156) + { + AetheryteShortcut = EAetheryteLocation.MorDhona + }; + obj93.Steps = list144; + reference98 = obj93; + num++; + ref QuestSequence reference99 = ref span2[num]; + QuestSequence obj94 = new QuestSequence { Sequence = byte.MaxValue }; num2 = 1; - List list144 = new List(num2); - CollectionsMarshal.SetCount(list144, num2); - span3 = CollectionsMarshal.AsSpan(list144); + List list145 = new List(num2); + CollectionsMarshal.SetCount(list145, num2); + span3 = CollectionsMarshal.AsSpan(list145); index2 = 0; span3[index2] = new QuestStep(EInteractionType.CompleteQuest, 1006535u, new Vector3(26.901611f, 20.543928f, -687.4037f), 156); - obj93.Steps = list144; - reference98 = obj93; - questRoot23.QuestSequence = list138; + obj94.Steps = list145; + reference99 = obj94; + questRoot23.QuestSequence = list139; AddQuest(questId23, questRoot23); } diff --git a/Questionable/Questionable.Controller.DebugCommands/AbandonDutyCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/AbandonDutyCommandHandler.cs new file mode 100644 index 0000000..f3e7452 --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/AbandonDutyCommandHandler.cs @@ -0,0 +1,20 @@ +using Questionable.Functions; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class AbandonDutyCommandHandler : IDebugCommandHandler +{ + private readonly GameFunctions _gameFunctions; + + public string CommandName => "abandon-duty"; + + public AbandonDutyCommandHandler(GameFunctions gameFunctions) + { + _gameFunctions = gameFunctions; + } + + public void Execute(string[] arguments) + { + _gameFunctions.AbandonDuty(); + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/AethernetCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/AethernetCommandHandler.cs new file mode 100644 index 0000000..f56905b --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/AethernetCommandHandler.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Dalamud.Plugin.Services; +using Questionable.Data; +using Questionable.Functions; +using Questionable.Model.Common; +using Questionable.Model.Questing.Converter; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class AethernetCommandHandler : IDebugCommandHandler +{ + private readonly IDataManager _dataManager; + + private readonly IClientState _clientState; + + private readonly AetheryteFunctions _aetheryteFunctions; + + private readonly IChatGui _chatGui; + + public string CommandName => "aethernet"; + + public AethernetCommandHandler(IDataManager dataManager, IClientState clientState, AetheryteFunctions aetheryteFunctions, IChatGui chatGui) + { + _dataManager = dataManager; + _clientState = clientState; + _aetheryteFunctions = aetheryteFunctions; + _chatGui = chatGui; + } + + public void Execute(string[] arguments) + { + ushort territoryType = _clientState.TerritoryType; + Dictionary values = AethernetShardConverter.Values; + AetheryteData aetheryteData = new AetheryteData(_dataManager); + HashSet hashSet = new HashSet(); + Dictionary> dictionary = new Dictionary>(); + EAetheryteLocation key; + string value; + foreach (KeyValuePair item3 in values) + { + item3.Deconstruct(out key, out value); + EAetheryteLocation key2 = key; + string text = value; + if (aetheryteData.TerritoryIds.TryGetValue(key2, out var value2) && value2 == territoryType) + { + int num = text.IndexOf(']', StringComparison.Ordinal); + if (num > 0) + { + string item = text.Substring(1, num - 1); + hashSet.Add(item); + } + } + } + if (hashSet.Count == 0) + { + _chatGui.Print("No aethernet shards found in current zone.", "Questionable", 576); + return; + } + foreach (KeyValuePair item4 in values) + { + item4.Deconstruct(out key, out value); + EAetheryteLocation eAetheryteLocation = key; + string text2 = value; + int num2 = text2.IndexOf(']', StringComparison.Ordinal); + if (num2 <= 0) + { + continue; + } + string text3 = text2.Substring(1, num2 - 1); + if (hashSet.Contains(text3)) + { + if (!dictionary.ContainsKey(text3)) + { + dictionary[text3] = new List<(EAetheryteLocation, string, bool)>(); + } + bool item2 = _aetheryteFunctions.IsAetheryteUnlocked(eAetheryteLocation); + dictionary[text3].Add((eAetheryteLocation, text2, item2)); + } + } + foreach (KeyValuePair> item5 in dictionary.OrderBy>, string>((KeyValuePair> x) => x.Key)) + { + item5.Deconstruct(out value, out var value3); + string value4 = value; + List<(EAetheryteLocation, string, bool)> list = value3; + List<(EAetheryteLocation, string, bool)> list2 = list.Where<(EAetheryteLocation, string, bool)>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => x.Unlocked).ToList(); + List<(EAetheryteLocation, string, bool)> list3 = list.Where<(EAetheryteLocation, string, bool)>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => !x.Unlocked).ToList(); + _chatGui.Print($"Aethernet Shards in {value4} ({list.Count} total):", "Questionable", 576); + _chatGui.Print($" Unlocked: {list2.Count}", "Questionable", 576); + _chatGui.Print($" Missing: {list3.Count}", "Questionable", 576); + _chatGui.Print("", "Questionable", 576); + if (list3.Count > 0) + { + _chatGui.Print("Missing/Unattuned Aethernet Shards:", "Questionable", 576); + foreach (var item6 in list3.OrderBy<(EAetheryteLocation, string, bool), string>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => x.Name)) + { + _chatGui.Print(" " + item6.Item2, "Questionable", 576); + } + _chatGui.Print("", "Questionable", 576); + } + if (list2.Count > 0) + { + _chatGui.Print("Unlocked Aethernet Shards:", "Questionable", 576); + foreach (var item7 in list2.OrderBy<(EAetheryteLocation, string, bool), string>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => x.Name)) + { + _chatGui.Print(" " + item7.Item2, "Questionable", 576); + } + } + if (dictionary.Count > 1) + { + _chatGui.Print("", "Questionable", 576); + } + } + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/DebugCommandExecutor.cs b/Questionable/Questionable.Controller.DebugCommands/DebugCommandExecutor.cs new file mode 100644 index 0000000..b2fd9fd --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/DebugCommandExecutor.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class DebugCommandExecutor +{ + private readonly Dictionary _handlers; + + public DebugCommandExecutor(IEnumerable handlers) + { + _handlers = handlers.ToDictionary((IDebugCommandHandler h) => h.CommandName, StringComparer.OrdinalIgnoreCase); + } + + public bool TryExecute(string command, string[] arguments) + { + if (_handlers.TryGetValue(command, out IDebugCommandHandler value)) + { + value.Execute(arguments); + return true; + } + return false; + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/DebugOverlayCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/DebugOverlayCommandHandler.cs new file mode 100644 index 0000000..abdca92 --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/DebugOverlayCommandHandler.cs @@ -0,0 +1,50 @@ +using Dalamud.Plugin.Services; +using Questionable.Model; +using Questionable.Model.Questing; +using Questionable.Windows; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class DebugOverlayCommandHandler : IDebugCommandHandler +{ + private readonly DebugOverlay _debugOverlay; + + private readonly QuestRegistry _questRegistry; + + private readonly IChatGui _chatGui; + + public string CommandName => "do"; + + public DebugOverlayCommandHandler(DebugOverlay debugOverlay, QuestRegistry questRegistry, IChatGui chatGui) + { + _debugOverlay = debugOverlay; + _questRegistry = questRegistry; + _chatGui = chatGui; + } + + public void Execute(string[] arguments) + { + ElementId elementId; + if (!_debugOverlay.DrawConditions()) + { + _chatGui.PrintError("You don't have the debug overlay enabled.", "Questionable", 576); + } + else if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out elementId) && elementId != null) + { + if (_questRegistry.TryGetQuest(elementId, out Quest quest)) + { + _debugOverlay.HighlightedQuest = quest.Id; + _chatGui.Print($"Set highlighted quest to {elementId} ({quest.Info.Name}).", "Questionable", 576); + } + else + { + _chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576); + } + } + else + { + _debugOverlay.HighlightedQuest = null; + _chatGui.Print("Cleared highlighted quest.", "Questionable", 576); + } + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/FestivalsCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/FestivalsCommandHandler.cs new file mode 100644 index 0000000..b855864 --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/FestivalsCommandHandler.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using Dalamud.Plugin.Services; +using FFXIVClientStructs.FFXIV.Client.Game; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class FestivalsCommandHandler : IDebugCommandHandler +{ + private readonly IChatGui _chatGui; + + public string CommandName => "festivals"; + + public FestivalsCommandHandler(IChatGui chatGui) + { + _chatGui = chatGui; + } + + public unsafe void Execute(string[] arguments) + { + List list = new List(); + for (byte b = 0; b < 4; b++) + { + GameMain.Festival festival = GameMain.Instance()->ActiveFestivals[b]; + if (festival.Id == 0) + { + list.Add($"Slot {b}: None"); + } + else + { + list.Add($"Slot {b}: {festival.Id}({festival.Phase})"); + } + } + _chatGui.Print("Festival slots:", "Questionable", 576); + foreach (string item in list) + { + _chatGui.Print(" " + item, "Questionable", 576); + } + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/IDebugCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/IDebugCommandHandler.cs new file mode 100644 index 0000000..7662992 --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/IDebugCommandHandler.cs @@ -0,0 +1,8 @@ +namespace Questionable.Controller.DebugCommands; + +internal interface IDebugCommandHandler +{ + string CommandName { get; } + + void Execute(string[] arguments); +} diff --git a/Questionable/Questionable.Controller.DebugCommands/MountIdCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/MountIdCommandHandler.cs new file mode 100644 index 0000000..29962f3 --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/MountIdCommandHandler.cs @@ -0,0 +1,37 @@ +using Dalamud.Plugin.Services; +using Lumina.Excel.Sheets; +using Questionable.Functions; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class MountIdCommandHandler : IDebugCommandHandler +{ + private readonly GameFunctions _gameFunctions; + + private readonly IDataManager _dataManager; + + private readonly IChatGui _chatGui; + + public string CommandName => "mountid"; + + public MountIdCommandHandler(GameFunctions gameFunctions, IDataManager dataManager, IChatGui chatGui) + { + _gameFunctions = gameFunctions; + _dataManager = dataManager; + _chatGui = chatGui; + } + + public void Execute(string[] arguments) + { + ushort? mountId = _gameFunctions.GetMountId(); + if (mountId.HasValue) + { + Mount? rowOrDefault = _dataManager.GetExcelSheet().GetRowOrDefault(mountId.Value); + _chatGui.Print($"Mount ID: {mountId}, Name: {rowOrDefault?.Singular}, Obtainable: {((rowOrDefault?.Order == -1) ? "No" : "Yes")}", "Questionable", 576); + } + else + { + _chatGui.Print("You are not mounted.", "Questionable", 576); + } + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/NextQuestCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/NextQuestCommandHandler.cs new file mode 100644 index 0000000..bf640eb --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/NextQuestCommandHandler.cs @@ -0,0 +1,53 @@ +using Dalamud.Plugin.Services; +using Questionable.Functions; +using Questionable.Model; +using Questionable.Model.Questing; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class NextQuestCommandHandler : IDebugCommandHandler +{ + private readonly QuestController _questController; + + private readonly QuestRegistry _questRegistry; + + private readonly QuestFunctions _questFunctions; + + private readonly IChatGui _chatGui; + + public string CommandName => "next"; + + public NextQuestCommandHandler(QuestController questController, QuestRegistry questRegistry, QuestFunctions questFunctions, IChatGui chatGui) + { + _questController = questController; + _questRegistry = questRegistry; + _questFunctions = questFunctions; + _chatGui = chatGui; + } + + public void Execute(string[] arguments) + { + if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out ElementId elementId) && elementId != null) + { + Quest quest; + if (_questFunctions.IsQuestLocked(elementId)) + { + _chatGui.PrintError($"Quest {elementId} is locked.", "Questionable", 576); + } + else if (_questRegistry.TryGetQuest(elementId, out quest)) + { + _questController.SetNextQuest(quest); + _chatGui.Print($"Set next quest to {elementId} ({quest.Info.Name}).", "Questionable", 576); + } + else + { + _chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576); + } + } + else + { + _questController.SetNextQuest(null); + _chatGui.Print("Cleared next quest.", "Questionable", 576); + } + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/QuestKillsCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/QuestKillsCommandHandler.cs new file mode 100644 index 0000000..72c9403 --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/QuestKillsCommandHandler.cs @@ -0,0 +1,220 @@ +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Dalamud.Game.ClientState.Objects.Types; +using Dalamud.Plugin.Services; +using Lumina.Excel; +using Lumina.Excel.Sheets; +using Questionable.Functions; +using Questionable.Model; +using Questionable.Model.Questing; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class QuestKillsCommandHandler : IDebugCommandHandler +{ + private readonly QuestController _questController; + + private readonly QuestFunctions _questFunctions; + + private readonly IDataManager _dataManager; + + private readonly IObjectTable _objectTable; + + private readonly IChatGui _chatGui; + + public string CommandName => "quest-kills"; + + public QuestKillsCommandHandler(QuestController questController, QuestFunctions questFunctions, IDataManager dataManager, IObjectTable objectTable, IChatGui chatGui) + { + _questController = questController; + _questFunctions = questFunctions; + _dataManager = dataManager; + _objectTable = objectTable; + _chatGui = chatGui; + } + + public void Execute(string[] arguments) + { + (QuestController.QuestProgress, QuestController.ECurrentQuestType)? currentQuestDetails = _questController.CurrentQuestDetails; + if (!currentQuestDetails.HasValue) + { + _chatGui.PrintError("No active quest.", "Questionable", 576); + return; + } + QuestController.QuestProgress item = currentQuestDetails.Value.Item1; + Questionable.Model.Quest quest = item.Quest; + QuestProgressInfo questProgressInfo = null; + if (quest.Id is QuestId elementId) + { + questProgressInfo = _questFunctions.GetQuestProgressInfo(elementId); + } + if (questProgressInfo == null) + { + _chatGui.PrintError("Unable to retrieve quest progress information.", "Questionable", 576); + return; + } + QuestSequence questSequence = quest.FindSequence(item.Sequence); + if (questSequence == null) + { + _chatGui.PrintError($"Sequence {item.Sequence} not found for quest {quest.Id}.", "Questionable", 576); + return; + } + QuestStep questStep = ((item.Step < questSequence.Steps.Count) ? questSequence.Steps[item.Step] : null); + if (questStep == null) + { + _chatGui.PrintError($"Step {item.Step} not found in sequence {item.Sequence}.", "Questionable", 576); + return; + } + _chatGui.Print($"Quest: {quest.Info.Name} ({quest.Id})", "Questionable", 576); + _chatGui.Print($"Sequence: {item.Sequence}, Step: {item.Step}", "Questionable", 576); + _chatGui.Print("", "Questionable", 576); + _chatGui.Print("Quest Variables: " + string.Join(", ", questProgressInfo.Variables.Select((byte v, int i) => $"[{i}]={v}")), "Questionable", 576); + _chatGui.Print("", "Questionable", 576); + ExcelSheet bnpcNameSheet = _dataManager.GetExcelSheet(); + HashSet hashSet = new HashSet(questStep.KillEnemyDataIds); + foreach (ComplexCombatData complexCombatDatum in questStep.ComplexCombatData) + { + hashSet.Add(complexCombatDatum.DataId); + } + if (hashSet.Count > 0) + { + _chatGui.Print($"All Enemy DataIds Found: {hashSet.Count}", "Questionable", 576); + foreach (uint item3 in hashSet.OrderBy((uint x) => x)) + { + (string Name, bool Found) tuple = GetEnemyName(item3); + var (value, _) = tuple; + if (tuple.Found) + { + _chatGui.Print($" - {value} (DataId: {item3})", "Questionable", 576); + } + else + { + _chatGui.Print($" - DataId: {item3}", "Questionable", 576); + } + } + _chatGui.Print("", "Questionable", 576); + } + if (questStep.ComplexCombatData.Count > 0) + { + _chatGui.Print($"Complex Combat Data Entries: {questStep.ComplexCombatData.Count}", "Questionable", 576); + _chatGui.Print("Kill Progress:", "Questionable", 576); + if (questStep.ComplexCombatData.Count == 1 && hashSet.Count > 1) + { + ComplexCombatData complexCombatData = questStep.ComplexCombatData[0]; + int num = -1; + byte? b = null; + for (int num2 = 0; num2 < complexCombatData.CompletionQuestVariablesFlags.Count; num2++) + { + QuestWorkValue questWorkValue = complexCombatData.CompletionQuestVariablesFlags[num2]; + if (questWorkValue != null && questWorkValue.Low.HasValue) + { + num = num2; + b = questWorkValue.Low; + break; + } + } + byte b2 = (byte)(((num >= 0 && num < questProgressInfo.Variables.Count) ? questProgressInfo.Variables[num] : 0) & 0xF); + string value2 = (b.HasValue ? $" {b2}/{b}" : ""); + string value3 = ((b.HasValue && b2 >= b) ? "✓" : "○"); + foreach (uint item4 in hashSet.OrderBy((uint x) => x)) + { + (string Name, bool Found) tuple3 = GetEnemyName(item4); + var (value4, _) = tuple3; + if (tuple3.Found) + { + _chatGui.Print($" {value3} Slay {value4}.{value2} (DataId: {item4})", "Questionable", 576); + } + else + { + _chatGui.Print($" {value3} Slay enemy.{value2} (DataId: {item4})", "Questionable", 576); + } + } + } + else + { + for (int num3 = 0; num3 < questStep.ComplexCombatData.Count; num3++) + { + ComplexCombatData complexCombatData2 = questStep.ComplexCombatData[num3]; + int num4 = -1; + byte? b3 = null; + bool flag = false; + for (int num5 = 0; num5 < complexCombatData2.CompletionQuestVariablesFlags.Count; num5++) + { + QuestWorkValue questWorkValue2 = complexCombatData2.CompletionQuestVariablesFlags[num5]; + if (questWorkValue2 != null) + { + if (questWorkValue2.Low.HasValue) + { + num4 = num5; + b3 = questWorkValue2.Low; + flag = false; + break; + } + if (questWorkValue2.High.HasValue) + { + num4 = num5; + b3 = questWorkValue2.High; + flag = true; + break; + } + } + } + byte b4 = (byte)((num4 >= 0 && num4 < questProgressInfo.Variables.Count) ? questProgressInfo.Variables[num4] : 0); + byte b5 = (flag ? ((byte)(b4 >> 4)) : ((byte)(b4 & 0xF))); + string value5; + if (complexCombatData2.NameId.HasValue) + { + BNpcName? bNpcName = bnpcNameSheet?.GetRowOrDefault(complexCombatData2.NameId.Value); + value5 = ((!bNpcName.HasValue || string.IsNullOrEmpty(bNpcName.Value.Singular.ToString())) ? "enemy" : bNpcName.Value.Singular.ToString()); + } + else + { + (string Name, bool Found) tuple5 = GetEnemyName(complexCombatData2.DataId); + string item2 = tuple5.Name; + value5 = (tuple5.Found ? item2 : "enemy"); + } + string value6 = (b3.HasValue ? $" {b5}/{b3}" : ""); + string value7 = ((b3.HasValue && b5 >= b3) ? "✓" : "○"); + string value8 = (complexCombatData2.NameId.HasValue ? $" (DataId: {complexCombatData2.DataId}, NameId: {complexCombatData2.NameId})" : $" (DataId: {complexCombatData2.DataId})"); + _chatGui.Print($" {value7} Slay {value5}.{value6}{value8}", "Questionable", 576); + } + } + _chatGui.Print("", "Questionable", 576); + } + else if (questStep.KillEnemyDataIds.Count == 0) + { + _chatGui.Print("No kill enemy data for this step.", "Questionable", 576); + _chatGui.Print("", "Questionable", 576); + } + if (questStep.CompletionQuestVariablesFlags.Count <= 0 || !questStep.CompletionQuestVariablesFlags.Any((QuestWorkValue x) => x != null)) + { + return; + } + _chatGui.Print("Completion Flags (Debug):", "Questionable", 576); + for (int num6 = 0; num6 < questStep.CompletionQuestVariablesFlags.Count; num6++) + { + QuestWorkValue questWorkValue3 = questStep.CompletionQuestVariablesFlags[num6]; + if (questWorkValue3 != null) + { + int num7 = ((num6 < questProgressInfo.Variables.Count) ? questProgressInfo.Variables[num6] : 0); + byte b6 = (byte)(num7 >> 4); + byte b7 = (byte)(num7 & 0xF); + string value9 = (((!questWorkValue3.High.HasValue || questWorkValue3.High == b6) && (!questWorkValue3.Low.HasValue || questWorkValue3.Low == b7)) ? " ✓" : " ✗"); + _chatGui.Print($" [{num6}] Expected: H={questWorkValue3.High?.ToString(CultureInfo.InvariantCulture) ?? "any"} L={questWorkValue3.Low?.ToString(CultureInfo.InvariantCulture) ?? "any"} | Actual: H={b6.ToString(CultureInfo.InvariantCulture)} L={b7.ToString(CultureInfo.InvariantCulture)}{value9}", "Questionable", 576); + } + } + (string Name, bool Found) GetEnemyName(uint dataId) + { + if (_objectTable.FirstOrDefault((IGameObject x) => x is IBattleNpc battleNpc2 && battleNpc2.BaseId == dataId) is IBattleNpc { NameId: not 0u } battleNpc) + { + BNpcName? bNpcName2 = bnpcNameSheet?.GetRowOrDefault(battleNpc.NameId); + if (bNpcName2.HasValue && !string.IsNullOrEmpty(bNpcName2.Value.Singular.ToString())) + { + return (Name: bNpcName2.Value.Singular.ToString(), Found: true); + } + } + return (Name: string.Empty, Found: false); + } + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/SequencesCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/SequencesCommandHandler.cs new file mode 100644 index 0000000..330300c --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/SequencesCommandHandler.cs @@ -0,0 +1,20 @@ +using Questionable.Windows; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class SequencesCommandHandler : IDebugCommandHandler +{ + private readonly QuestSequenceWindow _questSequenceWindow; + + public string CommandName => "seq"; + + public SequencesCommandHandler(QuestSequenceWindow questSequenceWindow) + { + _questSequenceWindow = questSequenceWindow; + } + + public void Execute(string[] arguments) + { + _questSequenceWindow.ToggleOrUncollapse(); + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/SetupCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/SetupCommandHandler.cs new file mode 100644 index 0000000..685b435 --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/SetupCommandHandler.cs @@ -0,0 +1,20 @@ +using Questionable.Windows; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class SetupCommandHandler : IDebugCommandHandler +{ + private readonly OneTimeSetupWindow _oneTimeSetupWindow; + + public string CommandName => "setup"; + + public SetupCommandHandler(OneTimeSetupWindow oneTimeSetupWindow) + { + _oneTimeSetupWindow = oneTimeSetupWindow; + } + + public void Execute(string[] arguments) + { + _oneTimeSetupWindow.IsOpenAndUncollapsed = true; + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/SimulateQuestCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/SimulateQuestCommandHandler.cs new file mode 100644 index 0000000..da762f3 --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/SimulateQuestCommandHandler.cs @@ -0,0 +1,58 @@ +using Dalamud.Plugin.Services; +using Questionable.Model; +using Questionable.Model.Questing; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class SimulateQuestCommandHandler : IDebugCommandHandler +{ + private readonly QuestController _questController; + + private readonly QuestRegistry _questRegistry; + + private readonly IChatGui _chatGui; + + public string CommandName => "sim"; + + public SimulateQuestCommandHandler(QuestController questController, QuestRegistry questRegistry, IChatGui chatGui) + { + _questController = questController; + _questRegistry = questRegistry; + _chatGui = chatGui; + } + + public void Execute(string[] arguments) + { + if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out ElementId elementId) && elementId != null) + { + if (_questRegistry.TryGetQuest(elementId, out Quest quest)) + { + byte sequence = 0; + int step = 0; + if (arguments.Length >= 2 && byte.TryParse(arguments[1], out var result)) + { + QuestSequence questSequence = quest.FindSequence(result); + if (questSequence != null) + { + sequence = questSequence.Sequence; + if (arguments.Length >= 3 && int.TryParse(arguments[2], out var result2) && questSequence.FindStep(result2) != null) + { + step = result2; + } + } + } + _questController.SimulateQuest(quest, sequence, step); + _chatGui.Print($"Simulating quest {elementId} ({quest.Info.Name}).", "Questionable", 576); + } + else + { + _chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576); + } + } + else + { + _questController.SimulateQuest(null, 0, 0); + _chatGui.Print("Cleared simulated quest.", "Questionable", 576); + } + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/TaxiCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/TaxiCommandHandler.cs new file mode 100644 index 0000000..45de1dc --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/TaxiCommandHandler.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; +using Dalamud.Plugin.Services; +using FFXIVClientStructs.FFXIV.Client.Game.UI; +using Lumina.Excel; +using Lumina.Excel.Sheets; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class TaxiCommandHandler : IDebugCommandHandler +{ + private readonly IDataManager _dataManager; + + private readonly IClientState _clientState; + + private readonly IChatGui _chatGui; + + public string CommandName => "taxi"; + + public TaxiCommandHandler(IDataManager dataManager, IClientState clientState, IChatGui chatGui) + { + _dataManager = dataManager; + _clientState = clientState; + _chatGui = chatGui; + } + + public unsafe void Execute(string[] arguments) + { + List list = new List(); + ExcelSheet excelSheet = _dataManager.GetExcelSheet(); + UIState* ptr = UIState.Instance(); + if (ptr == null) + { + _chatGui.PrintError("UIState is null", "Questionable", 576); + return; + } + for (int i = 0; i < 192; i++) + { + uint num = (uint)(i + 1179648); + try + { + if (excelSheet.HasRow(num) && ptr->IsChocoboTaxiStandUnlocked(num)) + { + string value = excelSheet.GetRow(num).PlaceName.ToString(); + if (string.IsNullOrEmpty(value)) + { + value = "Unknown"; + } + list.Add($"{value} (ID: {i}, Row: 0x{num:X})"); + } + } + catch + { + } + } + _chatGui.Print($"Unlocked taxi stands ({list.Count}):", "Questionable", 576); + if (list.Count == 0) + { + _chatGui.Print(" (No unlocked taxi stands found)", "Questionable", 576); + return; + } + foreach (string item in list) + { + _chatGui.Print(" - " + item, "Questionable", 576); + } + } +} diff --git a/Questionable/Questionable.Controller.DebugCommands/UnlockLinksCommandHandler.cs b/Questionable/Questionable.Controller.DebugCommands/UnlockLinksCommandHandler.cs new file mode 100644 index 0000000..06dc43d --- /dev/null +++ b/Questionable/Questionable.Controller.DebugCommands/UnlockLinksCommandHandler.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Dalamud.Plugin.Services; +using Questionable.Functions; + +namespace Questionable.Controller.DebugCommands; + +internal sealed class UnlockLinksCommandHandler : IDebugCommandHandler +{ + private readonly GameFunctions _gameFunctions; + + private readonly IChatGui _chatGui; + + private IReadOnlyList _previouslyUnlockedUnlockLinks = Array.Empty(); + + public string CommandName => "unlock-links"; + + public UnlockLinksCommandHandler(GameFunctions gameFunctions, IChatGui chatGui) + { + _gameFunctions = gameFunctions; + _chatGui = chatGui; + } + + public void Execute(string[] arguments) + { + IReadOnlyList unlockLinks = _gameFunctions.GetUnlockLinks(); + if (unlockLinks.Count >= 0) + { + _chatGui.Print($"Saved {unlockLinks.Count} unlock links to log.", "Questionable", 576); + List list = unlockLinks.Except(_previouslyUnlockedUnlockLinks).ToList(); + if (_previouslyUnlockedUnlockLinks.Count > 0 && list.Count > 0) + { + _chatGui.Print("New unlock links: " + string.Join(", ", list), "Questionable", 576); + } + } + else + { + _chatGui.PrintError("Could not query unlock links.", "Questionable", 576); + } + _previouslyUnlockedUnlockLinks = unlockLinks; + } + + public void Reset() + { + _previouslyUnlockedUnlockLinks = Array.Empty(); + } +} diff --git a/Questionable/Questionable.Controller.GameUi/InteractionUiController.cs b/Questionable/Questionable.Controller.GameUi/InteractionUiController.cs index 2d42f14..bdfec60 100644 --- a/Questionable/Questionable.Controller.GameUi/InteractionUiController.cs +++ b/Questionable/Questionable.Controller.GameUi/InteractionUiController.cs @@ -58,6 +58,8 @@ internal sealed class InteractionUiController : IDisposable private readonly IClientState _clientState; + private readonly IObjectTable _objectTable; + private readonly ShopController _shopController; private readonly BossModIpc _bossModIpc; @@ -84,7 +86,7 @@ internal sealed class InteractionUiController : IDisposable } } - public unsafe InteractionUiController(IAddonLifecycle addonLifecycle, IDataManager dataManager, QuestFunctions questFunctions, AetheryteFunctions aetheryteFunctions, ExcelFunctions excelFunctions, QuestController questController, GatheringPointRegistry gatheringPointRegistry, QuestRegistry questRegistry, QuestData questData, TerritoryData territoryData, IGameGui gameGui, ITargetManager targetManager, IPluginLog pluginLog, IClientState clientState, ShopController shopController, BossModIpc bossModIpc, Configuration configuration, ILogger logger) + public unsafe InteractionUiController(IAddonLifecycle addonLifecycle, IDataManager dataManager, QuestFunctions questFunctions, AetheryteFunctions aetheryteFunctions, ExcelFunctions excelFunctions, QuestController questController, GatheringPointRegistry gatheringPointRegistry, QuestRegistry questRegistry, QuestData questData, TerritoryData territoryData, IGameGui gameGui, ITargetManager targetManager, IPluginLog pluginLog, IClientState clientState, IObjectTable objectTable, ShopController shopController, BossModIpc bossModIpc, Configuration configuration, ILogger logger) { _addonLifecycle = addonLifecycle; _dataManager = dataManager; @@ -99,6 +101,7 @@ internal sealed class InteractionUiController : IDisposable _gameGui = gameGui; _targetManager = targetManager; _clientState = clientState; + _objectTable = objectTable; _shopController = shopController; _bossModIpc = bossModIpc; _configuration = configuration; @@ -857,14 +860,18 @@ internal sealed class InteractionUiController : IDisposable { _logger.LogTrace("FindTargetTerritoryFromQuestStep (current): {CurrentTerritory}, {TargetTerritory}", questStep.TerritoryId, questStep.TargetTerritoryId); } - if (questStep != null && (questStep.TerritoryId != _clientState.TerritoryType || !questStep.TargetTerritoryId.HasValue) && questStep.InteractionType == EInteractionType.Gather && _gatheringPointRegistry.TryGetGatheringPointId(questStep.ItemsToGather[0].ItemId, ((EClassJob?)_clientState.LocalPlayer?.ClassJob.RowId).GetValueOrDefault(), out GatheringPointId gatheringPointId) && _gatheringPointRegistry.TryGetGatheringPoint(gatheringPointId, out GatheringRoot gatheringRoot)) + if (questStep != null && (questStep.TerritoryId != _clientState.TerritoryType || !questStep.TargetTerritoryId.HasValue) && questStep.InteractionType == EInteractionType.Gather) { - foreach (QuestStep step in gatheringRoot.Steps) + IGameObject gameObject = _objectTable[0]; + if (_gatheringPointRegistry.TryGetGatheringPointId(questStep.ItemsToGather[0].ItemId, ((EClassJob?)(gameObject as ICharacter)?.ClassJob.RowId).GetValueOrDefault(), out GatheringPointId gatheringPointId) && _gatheringPointRegistry.TryGetGatheringPoint(gatheringPointId, out GatheringRoot gatheringRoot)) { - if (step.TerritoryId == _clientState.TerritoryType && step.TargetTerritoryId.HasValue) + foreach (QuestStep step in gatheringRoot.Steps) { - _logger.LogTrace("FindTargetTerritoryFromQuestStep (gathering): {CurrentTerritory}, {TargetTerritory}", step.TerritoryId, step.TargetTerritoryId); - return step.TargetTerritoryId; + if (step.TerritoryId == _clientState.TerritoryType && step.TargetTerritoryId.HasValue) + { + _logger.LogTrace("FindTargetTerritoryFromQuestStep (gathering): {CurrentTerritory}, {TargetTerritory}", step.TerritoryId, step.TargetTerritoryId); + return step.TargetTerritoryId; + } } } } diff --git a/Questionable/Questionable.Controller.Steps.Common/Mount.cs b/Questionable/Questionable.Controller.Steps.Common/Mount.cs index 7819d05..449dd38 100644 --- a/Questionable/Questionable.Controller.Steps.Common/Mount.cs +++ b/Questionable/Questionable.Controller.Steps.Common/Mount.cs @@ -50,7 +50,7 @@ internal static class Mount } } - internal sealed class MountEvaluator(GameFunctions gameFunctions, ICondition condition, TerritoryData territoryData, IClientState clientState, ILogger logger) + internal sealed class MountEvaluator(GameFunctions gameFunctions, ICondition condition, TerritoryData territoryData, IClientState clientState, IObjectTable objectTable, ILogger logger) { public unsafe MountResult EvaluateMountState(MountTask task, bool dryRun, ref DateTime retryAt) { @@ -71,7 +71,7 @@ internal static class Mount } if (task.MountIf == EMountIf.AwayFromPosition) { - float num = System.Numerics.Vector3.Distance((FFXIVClientStructs.FFXIV.Common.Math.Vector3)(clientState.LocalPlayer?.Position ?? ((System.Numerics.Vector3)FFXIVClientStructs.FFXIV.Common.Math.Vector3.Zero)), task.Position.GetValueOrDefault()); + float num = System.Numerics.Vector3.Distance((FFXIVClientStructs.FFXIV.Common.Math.Vector3)(objectTable[0]?.Position ?? ((System.Numerics.Vector3)FFXIVClientStructs.FFXIV.Common.Math.Vector3.Zero)), task.Position.GetValueOrDefault()); if (task.TerritoryId == clientState.TerritoryType && num < 30f && !Conditions.Instance()->Diving) { logger.Log(logLevel, "Not using mount, as we're close to the target"); @@ -159,7 +159,7 @@ internal static class Mount } } - internal sealed class UnmountExecutor(ICondition condition, ILogger logger, GameFunctions gameFunctions, IClientState clientState) : TaskExecutor() + internal sealed class UnmountExecutor(ICondition condition, ILogger logger, GameFunctions gameFunctions, IObjectTable objectTable) : TaskExecutor() { private bool _unmountTriggered; @@ -221,10 +221,9 @@ internal static class Mount private unsafe bool IsUnmounting() { - IPlayerCharacter localPlayer = clientState.LocalPlayer; - if (localPlayer != null) + if (objectTable[0] is IPlayerCharacter playerCharacter) { - BattleChara* address = (BattleChara*)localPlayer.Address; + BattleChara* address = (BattleChara*)playerCharacter.Address; return (address->Mount.Flags & 1) == 1; } return false; diff --git a/Questionable/Questionable.Controller.Steps.Gathering/DoGather.cs b/Questionable/Questionable.Controller.Steps.Gathering/DoGather.cs index f3c04bd..1ae0405 100644 --- a/Questionable/Questionable.Controller.Steps.Gathering/DoGather.cs +++ b/Questionable/Questionable.Controller.Steps.Gathering/DoGather.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using Dalamud.Game.ClientState.Conditions; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.UI; @@ -30,7 +31,7 @@ internal static class DoGather } } - internal sealed class GatherExecutor(GatheringController gatheringController, GameFunctions gameFunctions, IGameGui gameGui, IClientState clientState, ICondition condition, ILogger logger) : TaskExecutor() + internal sealed class GatherExecutor(GatheringController gatheringController, GameFunctions gameFunctions, IGameGui gameGui, IObjectTable objectTable, ICondition condition, ILogger logger) : TaskExecutor() { private bool _wasGathering; @@ -268,7 +269,7 @@ internal static class DoGather private EAction PickAction(EAction minerAction, EAction botanistAction) { - if (clientState.LocalPlayer?.ClassJob.RowId == 16) + if ((objectTable[0] as ICharacter)?.ClassJob.RowId == 16) { return minerAction; } diff --git a/Questionable/Questionable.Controller.Steps.Gathering/DoGatherCollectable.cs b/Questionable/Questionable.Controller.Steps.Gathering/DoGatherCollectable.cs index c6ef831..e6cb13a 100644 --- a/Questionable/Questionable.Controller.Steps.Gathering/DoGatherCollectable.cs +++ b/Questionable/Questionable.Controller.Steps.Gathering/DoGatherCollectable.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Game.Text; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Component.GUI; @@ -27,7 +28,7 @@ internal static class DoGatherCollectable } } - internal sealed class GatherCollectableExecutor(GatheringController gatheringController, GameFunctions gameFunctions, IClientState clientState, IGameGui gameGui, ILogger logger) : TaskExecutor() + internal sealed class GatherCollectableExecutor(GatheringController gatheringController, GameFunctions gameFunctions, IObjectTable objectTable, IGameGui gameGui, ILogger logger) : TaskExecutor() { private Queue? _actionQueue; @@ -137,42 +138,42 @@ internal static class DoGatherCollectable private Queue GetNextActions(NodeCondition nodeCondition) { - uint currentGp = clientState.LocalPlayer.CurrentGp; - logger.LogTrace("Getting next actions (with {GP} GP, {MeticulousCollectability}~ meticulous, {ScourCollectability}~ scour)", currentGp, nodeCondition.CollectabilityFromMeticulous, nodeCondition.CollectabilityFromScour); + uint num = (objectTable[0] as ICharacter)?.CurrentGp ?? 0; + logger.LogTrace("Getting next actions (with {GP} GP, {MeticulousCollectability}~ meticulous, {ScourCollectability}~ scour)", num, nodeCondition.CollectabilityFromMeticulous, nodeCondition.CollectabilityFromScour); Queue queue = new Queue(); - uint num = nodeCondition.CollectabilityToGoal(base.Task.Request.Collectability); - if (num <= nodeCondition.CollectabilityFromMeticulous) + uint num2 = nodeCondition.CollectabilityToGoal(base.Task.Request.Collectability); + if (num2 <= nodeCondition.CollectabilityFromMeticulous) { - logger.LogTrace("Can get all needed {NeededCollectability} from {Collectability}~ meticulous", num, nodeCondition.CollectabilityFromMeticulous); + logger.LogTrace("Can get all needed {NeededCollectability} from {Collectability}~ meticulous", num2, nodeCondition.CollectabilityFromMeticulous); queue.Enqueue(PickAction(EAction.MeticulousMiner, EAction.MeticulousBotanist)); return queue; } - if (num <= nodeCondition.CollectabilityFromScour) + if (num2 <= nodeCondition.CollectabilityFromScour) { - logger.LogTrace("Can get all needed {NeededCollectability} from {Collectability}~ scour", num, nodeCondition.CollectabilityFromScour); + logger.LogTrace("Can get all needed {NeededCollectability} from {Collectability}~ scour", num2, nodeCondition.CollectabilityFromScour); queue.Enqueue(PickAction(EAction.ScourMiner, EAction.ScourBotanist)); return queue; } - if (!nodeCondition.ScrutinyActive && currentGp >= 200) + if (!nodeCondition.ScrutinyActive && num >= 200) { - logger.LogTrace("Still missing {NeededCollectability} collectability, scrutiny inactive", num); + logger.LogTrace("Still missing {NeededCollectability} collectability, scrutiny inactive", num2); queue.Enqueue(PickAction(EAction.ScrutinyMiner, EAction.ScrutinyBotanist)); return queue; } if (nodeCondition.ScrutinyActive) { - logger.LogTrace("Scrutiny active, need {NeededCollectability} and we expect {Collectability}~ meticulous", num, nodeCondition.CollectabilityFromMeticulous); + logger.LogTrace("Scrutiny active, need {NeededCollectability} and we expect {Collectability}~ meticulous", num2, nodeCondition.CollectabilityFromMeticulous); queue.Enqueue(PickAction(EAction.MeticulousMiner, EAction.MeticulousBotanist)); return queue; } - logger.LogTrace("Scrutiny active, need {NeededCollectability} and we expect {Collectability}~ scour", num, nodeCondition.CollectabilityFromScour); + logger.LogTrace("Scrutiny active, need {NeededCollectability} and we expect {Collectability}~ scour", num2, nodeCondition.CollectabilityFromScour); queue.Enqueue(PickAction(EAction.ScourMiner, EAction.ScourBotanist)); return queue; } private EAction PickAction(EAction minerAction, EAction botanistAction) { - if (clientState.LocalPlayer?.ClassJob.RowId == 16) + if ((objectTable[0] as ICharacter)?.ClassJob.RowId == 16) { return minerAction; } diff --git a/Questionable/Questionable.Controller.Steps.Interactions/EquipRecommended.cs b/Questionable/Questionable.Controller.Steps.Interactions/EquipRecommended.cs index a403649..e1bd631 100644 --- a/Questionable/Questionable.Controller.Steps.Interactions/EquipRecommended.cs +++ b/Questionable/Questionable.Controller.Steps.Interactions/EquipRecommended.cs @@ -1,5 +1,6 @@ using System; using Dalamud.Game.ClientState.Conditions; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.UI.Misc; @@ -43,7 +44,7 @@ internal static class EquipRecommended } } - internal sealed class DoEquipRecommended(IClientState clientState, IChatGui chatGui, ICondition condition) : TaskExecutor() + internal sealed class DoEquipRecommended(IObjectTable objectTable, IChatGui chatGui, ICondition condition) : TaskExecutor() { private bool _checkedOrTriggeredEquipmentUpdate; @@ -55,7 +56,11 @@ internal static class EquipRecommended { return false; } - RecommendEquipModule.Instance()->SetupForClassJob((byte)clientState.LocalPlayer.ClassJob.RowId); + if (!(objectTable[0] is ICharacter character)) + { + return false; + } + RecommendEquipModule.Instance()->SetupForClassJob((byte)character.ClassJob.RowId); return true; } diff --git a/Questionable/Questionable.Controller.Steps.Interactions/Jump.cs b/Questionable/Questionable.Controller.Steps.Interactions/Jump.cs index cced3bf..b05028b 100644 --- a/Questionable/Questionable.Controller.Steps.Interactions/Jump.cs +++ b/Questionable/Questionable.Controller.Steps.Interactions/Jump.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Numerics; using System.Runtime.InteropServices; using Dalamud.Game.ClientState.Conditions; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Client.Game; using Microsoft.Extensions.Logging; @@ -47,12 +48,17 @@ internal static class Jump } } - internal abstract class JumpBase(MovementController movementController, IClientState clientState, IFramework framework) : TaskExecutor() where T : class, IJumpTask + internal abstract class JumpBase(MovementController movementController, IObjectTable objectTable, IFramework framework) : TaskExecutor() where T : class, IJumpTask { protected unsafe override bool Start() { + IGameObject gameObject = _003CobjectTable_003EP[0]; + if (gameObject == null) + { + return false; + } float num = base.Task.JumpDestination.CalculateStopDistance(); - if ((_003CclientState_003EP.LocalPlayer.Position - base.Task.JumpDestination.Position).Length() <= num) + if ((gameObject.Position - base.Task.JumpDestination.Position).Length() <= num) { return false; } @@ -94,8 +100,8 @@ internal static class Jump internal sealed class DoSingleJump : JumpBase { - public DoSingleJump(MovementController movementController, IClientState clientState, IFramework framework) - : base(movementController, clientState, framework) + public DoSingleJump(MovementController movementController, IObjectTable objectTable, IFramework framework) + : base(movementController, objectTable, framework) { } } @@ -110,19 +116,19 @@ internal static class Jump internal sealed class DoRepeatedJumps : JumpBase { - private readonly IClientState _clientState; + private readonly IObjectTable _objectTable; private DateTime _continueAt; private int _attempts; - public DoRepeatedJumps(MovementController movementController, IClientState clientState, IFramework framework, ICondition condition, ILogger logger) + public DoRepeatedJumps(MovementController movementController, IObjectTable objectTable, IFramework framework, ICondition condition, ILogger logger) { _003Ccondition_003EP = condition; _003Clogger_003EP = logger; - _clientState = clientState; + _objectTable = objectTable; _continueAt = DateTime.MinValue; - base._002Ector(movementController, clientState, framework); + base._002Ector(movementController, objectTable, framework); } protected override bool Start() @@ -137,12 +143,17 @@ internal static class Jump { return ETaskResult.StillRunning; } - float num = base.Task.JumpDestination.CalculateStopDistance(); - if ((_clientState.LocalPlayer.Position - base.Task.JumpDestination.Position).Length() <= num || _clientState.LocalPlayer.Position.Y >= base.Task.JumpDestination.Position.Y - 0.5f) + IGameObject gameObject = _objectTable[0]; + if (gameObject == null) { return ETaskResult.TaskComplete; } - _003Clogger_003EP.LogTrace("Y-Heights for jumps: player={A}, target={B}", _clientState.LocalPlayer.Position.Y, base.Task.JumpDestination.Position.Y - 0.5f); + float num = base.Task.JumpDestination.CalculateStopDistance(); + if ((gameObject.Position - base.Task.JumpDestination.Position).Length() <= num || gameObject.Position.Y >= base.Task.JumpDestination.Position.Y - 0.5f) + { + return ETaskResult.TaskComplete; + } + _003Clogger_003EP.LogTrace("Y-Heights for jumps: player={A}, target={B}", gameObject.Position.Y, base.Task.JumpDestination.Position.Y - 0.5f); if (ActionManager.Instance()->UseAction(ActionType.GeneralAction, 2u, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null)) { _attempts++; diff --git a/Questionable/Questionable.Controller.Steps.Interactions/SinglePlayerDuty.cs b/Questionable/Questionable.Controller.Steps.Interactions/SinglePlayerDuty.cs index ceec543..da963d0 100644 --- a/Questionable/Questionable.Controller.Steps.Interactions/SinglePlayerDuty.cs +++ b/Questionable/Questionable.Controller.Steps.Interactions/SinglePlayerDuty.cs @@ -29,7 +29,7 @@ internal static class SinglePlayerDuty public const ushort Naadam = 688; } - internal sealed class Factory(BossModIpc bossModIpc, TerritoryData territoryData, ICondition condition, IClientState clientState) : ITaskFactory + internal sealed class Factory(BossModIpc bossModIpc, TerritoryData territoryData, ICondition condition, IClientState clientState, IObjectTable objectTable) : ITaskFactory { public IEnumerable CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step) { @@ -70,7 +70,7 @@ internal static class SinglePlayerDuty { return true; } - Vector3 vector = clientState.LocalPlayer?.Position ?? default(Vector3); + Vector3 vector = objectTable[0]?.Position ?? default(Vector3); return (new Vector3(352.01f, -1.45f, 288.59f) - vector).Length() < 10f; }, "Wait(moving to Ovoo)"); yield return new Mount.UnmountTask(); diff --git a/Questionable/Questionable.Controller.Steps.Movement/LandExecutor.cs b/Questionable/Questionable.Controller.Steps.Movement/LandExecutor.cs index 348c077..090f096 100644 --- a/Questionable/Questionable.Controller.Steps.Movement/LandExecutor.cs +++ b/Questionable/Questionable.Controller.Steps.Movement/LandExecutor.cs @@ -7,7 +7,7 @@ using Microsoft.Extensions.Logging; namespace Questionable.Controller.Steps.Movement; -internal sealed class LandExecutor(IClientState clientState, ICondition condition, ILogger logger) : TaskExecutor() +internal sealed class LandExecutor(IObjectTable objectTable, ICondition condition, ILogger logger) : TaskExecutor() { private bool _landing; @@ -45,7 +45,7 @@ internal sealed class LandExecutor(IClientState clientState, ICondition conditio private unsafe bool AttemptLanding() { - Character* ptr = (Character*)(clientState.LocalPlayer?.Address ?? 0); + Character* ptr = (Character*)(objectTable[0]?.Address ?? 0); if (ptr != null && ActionManager.Instance()->GetActionStatus(ActionType.GeneralAction, 23u, 3758096384uL, checkRecastActive: true, checkCastingActive: true, null) == 0) { logger.LogInformation("Attempting to land"); diff --git a/Questionable/Questionable.Controller.Steps.Movement/MoveExecutor.cs b/Questionable/Questionable.Controller.Steps.Movement/MoveExecutor.cs index 1488b04..9ea2fcf 100644 --- a/Questionable/Questionable.Controller.Steps.Movement/MoveExecutor.cs +++ b/Questionable/Questionable.Controller.Steps.Movement/MoveExecutor.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Numerics; using System.Runtime.InteropServices; using Dalamud.Game.ClientState.Conditions; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Game.Text.SeStringHandling; using Dalamud.Plugin.Services; using LLib; @@ -28,6 +29,8 @@ internal sealed class MoveExecutor : TaskExecutor, IToastAware, ITaskE private readonly IClientState _clientState; + private readonly IObjectTable _objectTable; + private readonly ICondition _condition; private readonly Questionable.Controller.Steps.Common.Mount.MountEvaluator _mountEvaluator; @@ -46,12 +49,13 @@ internal sealed class MoveExecutor : TaskExecutor, IToastAware, ITaskE private (Questionable.Controller.Steps.Common.Mount.MountExecutor Executor, Questionable.Controller.Steps.Common.Mount.MountTask Task)? _mountDuringMovement; - public MoveExecutor(MovementController movementController, GameFunctions gameFunctions, ILogger logger, IClientState clientState, ICondition condition, IDataManager dataManager, Questionable.Controller.Steps.Common.Mount.MountEvaluator mountEvaluator, IServiceProvider serviceProvider) + public MoveExecutor(MovementController movementController, GameFunctions gameFunctions, ILogger logger, IClientState clientState, IObjectTable objectTable, ICondition condition, IDataManager dataManager, Questionable.Controller.Steps.Common.Mount.MountEvaluator mountEvaluator, IServiceProvider serviceProvider) { _movementController = movementController; _gameFunctions = gameFunctions; _logger = logger; _clientState = clientState; + _objectTable = objectTable; _condition = condition; _serviceProvider = serviceProvider; _mountEvaluator = mountEvaluator; @@ -95,7 +99,7 @@ internal sealed class MoveExecutor : TaskExecutor, IToastAware, ITaskE _canRestart = base.Task.RestartNavigation; _destination = base.Task.Destination; float num = base.Task.StopDistance ?? 3f; - Vector3? vector = _clientState.LocalPlayer?.Position; + Vector3? vector = _objectTable[0]?.Position; float num2 = ((!vector.HasValue) ? float.MaxValue : Vector3.Distance(vector.Value, _destination)); if (num2 > num) { @@ -170,7 +174,8 @@ internal sealed class MoveExecutor : TaskExecutor, IToastAware, ITaskE { return ETaskResult.StillRunning; } - if (_canRestart && Vector3.Distance(_clientState.LocalPlayer.Position, _destination) > (base.Task.StopDistance ?? 3f) + 5f) + IGameObject gameObject = _objectTable[0]; + if (_canRestart && gameObject != null && Vector3.Distance(gameObject.Position, _destination) > (base.Task.StopDistance ?? 3f) + 5f) { _canRestart = false; if (_clientState.TerritoryType == base.Task.TerritoryId) diff --git a/Questionable/Questionable.Controller.Steps.Movement/MoveTo.cs b/Questionable/Questionable.Controller.Steps.Movement/MoveTo.cs index a87e3f9..b44606b 100644 --- a/Questionable/Questionable.Controller.Steps.Movement/MoveTo.cs +++ b/Questionable/Questionable.Controller.Steps.Movement/MoveTo.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Numerics; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using Microsoft.Extensions.Logging; using Questionable.Controller.Steps.Common; @@ -13,7 +14,7 @@ namespace Questionable.Controller.Steps.Movement; internal static class MoveTo { - internal sealed class Factory(IClientState clientState, AetheryteData aetheryteData, TerritoryData territoryData, ILogger logger) : ITaskFactory + internal sealed class Factory(IClientState clientState, IObjectTable objectTable, AetheryteData aetheryteData, TerritoryData territoryData, ILogger logger) : ITaskFactory { public IEnumerable CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step) { @@ -62,7 +63,8 @@ internal static class MoveTo private IEnumerable CreateMoveTasks(QuestStep step, Vector3 destination) { - if (step.InteractionType == EInteractionType.Jump && step.JumpDestination != null && (clientState.LocalPlayer.Position - step.JumpDestination.Position).Length() <= (step.JumpDestination.StopDistance ?? 1f)) + IGameObject gameObject = objectTable[0]; + if (step.InteractionType == EInteractionType.Jump && step.JumpDestination != null && gameObject != null && (gameObject.Position - step.JumpDestination.Position).Length() <= (step.JumpDestination.StopDistance ?? 1f)) { logger.LogInformation("We're at the jump destination, skipping movement"); yield break; diff --git a/Questionable/Questionable.Controller.Steps.Movement/WaitForNearDataIdExecutor.cs b/Questionable/Questionable.Controller.Steps.Movement/WaitForNearDataIdExecutor.cs index 3047e12..e35ffe5 100644 --- a/Questionable/Questionable.Controller.Steps.Movement/WaitForNearDataIdExecutor.cs +++ b/Questionable/Questionable.Controller.Steps.Movement/WaitForNearDataIdExecutor.cs @@ -4,7 +4,7 @@ using Questionable.Functions; namespace Questionable.Controller.Steps.Movement; -internal sealed class WaitForNearDataIdExecutor(GameFunctions gameFunctions, IClientState clientState) : TaskExecutor() +internal sealed class WaitForNearDataIdExecutor(GameFunctions gameFunctions, IObjectTable objectTable) : TaskExecutor() { protected override bool Start() { @@ -14,7 +14,8 @@ internal sealed class WaitForNearDataIdExecutor(GameFunctions gameFunctions, ICl public override ETaskResult Update() { IGameObject gameObject = gameFunctions.FindObjectByDataId(base.Task.DataId); - if (gameObject == null || (gameObject.Position - clientState.LocalPlayer.Position).Length() > base.Task.StopDistance) + IGameObject gameObject2 = objectTable[0]; + if (gameObject == null || gameObject2 == null || (gameObject.Position - gameObject2.Position).Length() > base.Task.StopDistance) { throw new TaskException("Object not found or too far away, no position so we can't move"); } diff --git a/Questionable/Questionable.Controller.Steps.Shared/AethernetShortcut.cs b/Questionable/Questionable.Controller.Steps.Shared/AethernetShortcut.cs index 19c4e37..6bd2b25 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/AethernetShortcut.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/AethernetShortcut.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Numerics; using System.Runtime.InteropServices; using Dalamud.Game.ClientState.Conditions; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using Microsoft.Extensions.Logging; using Questionable.Controller.Steps.Common; @@ -50,7 +51,7 @@ internal static class AethernetShortcut } } - internal sealed class UseAethernetShortcut(ILogger logger, AetheryteFunctions aetheryteFunctions, GameFunctions gameFunctions, QuestFunctions questFunctions, IClientState clientState, AetheryteData aetheryteData, TerritoryData territoryData, LifestreamIpc lifestreamIpc, MovementController movementController, ICondition condition) : TaskExecutor() + internal sealed class UseAethernetShortcut(ILogger logger, AetheryteFunctions aetheryteFunctions, GameFunctions gameFunctions, QuestFunctions questFunctions, IClientState clientState, IObjectTable objectTable, AetheryteData aetheryteData, TerritoryData territoryData, LifestreamIpc lifestreamIpc, MovementController movementController, ICondition condition) : TaskExecutor() { private bool _moving; @@ -98,7 +99,12 @@ internal static class AethernetShortcut if (aetheryteFunctions.IsAetheryteUnlocked(base.Task.From) && aetheryteFunctions.IsAetheryteUnlocked(base.Task.To)) { ushort territoryType = clientState.TerritoryType; - Vector3 playerPosition = clientState.LocalPlayer.Position; + IGameObject gameObject = objectTable[0]; + if (gameObject == null) + { + return false; + } + Vector3 playerPosition = gameObject.Position; if (aetheryteData.CalculateDistance(playerPosition, territoryType, base.Task.From) < aetheryteData.CalculateDistance(playerPosition, territoryType, base.Task.To)) { if (aetheryteData.CalculateDistance(playerPosition, territoryType, base.Task.From) < (base.Task.From.IsFirmamentAetheryte() ? 11f : 4f)) @@ -202,7 +208,7 @@ internal static class AethernetShortcut DoTeleport(); return ETaskResult.StillRunning; } - Vector3? vector = clientState.LocalPlayer?.Position; + Vector3? vector = objectTable[0]?.Position; if (!vector.HasValue) { return ETaskResult.StillRunning; diff --git a/Questionable/Questionable.Controller.Steps.Shared/AetheryteShortcut.cs b/Questionable/Questionable.Controller.Steps.Shared/AetheryteShortcut.cs index 0d90d65..ba92346 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/AetheryteShortcut.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/AetheryteShortcut.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Numerics; using System.Runtime.InteropServices; using Dalamud.Game.ClientState.Conditions; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using Microsoft.Extensions.Logging; using Questionable.Controller.Steps.Common; @@ -45,7 +46,7 @@ internal static class AetheryteShortcut } } - internal sealed class UseAetheryteShortcut(ILogger logger, AetheryteFunctions aetheryteFunctions, QuestFunctions questFunctions, IClientState clientState, IChatGui chatGui, ICondition condition, AetheryteData aetheryteData, ExtraConditionUtils extraConditionUtils) : TaskExecutor() + internal sealed class UseAetheryteShortcut(ILogger logger, AetheryteFunctions aetheryteFunctions, QuestFunctions questFunctions, IClientState clientState, IObjectTable objectTable, IChatGui chatGui, ICondition condition, AetheryteData aetheryteData, ExtraConditionUtils extraConditionUtils) : TaskExecutor() { private bool _teleported; @@ -116,14 +117,15 @@ internal static class AetheryteShortcut return true; } } + IGameObject gameObject = objectTable[0]; NearPositionCondition nearPosition = skipAetheryteCondition.NearPosition; - if (nearPosition != null && clientState.TerritoryType == nearPosition.TerritoryId && Vector3.Distance(nearPosition.Position, clientState.LocalPlayer.Position) <= nearPosition.MaximumDistance) + if (nearPosition != null && clientState.TerritoryType == nearPosition.TerritoryId && gameObject != null && Vector3.Distance(nearPosition.Position, gameObject.Position) <= nearPosition.MaximumDistance) { logger.LogInformation("Skipping aetheryte shortcut, as we're near the position"); return true; } NearPositionCondition notNearPosition = skipAetheryteCondition.NotNearPosition; - if (notNearPosition != null && clientState.TerritoryType == notNearPosition.TerritoryId && notNearPosition.MaximumDistance <= Vector3.Distance(notNearPosition.Position, clientState.LocalPlayer.Position)) + if (notNearPosition != null && clientState.TerritoryType == notNearPosition.TerritoryId && gameObject != null && notNearPosition.MaximumDistance <= Vector3.Distance(notNearPosition.Position, gameObject.Position)) { logger.LogInformation("Skipping aetheryte shortcut, as we're not near the position"); return true; @@ -134,23 +136,27 @@ internal static class AetheryteShortcut return true; } } - if (base.Task.ExpectedTerritoryId == territoryType && !skipAetheryteCondition.Never) + if (base.Task.ExpectedTerritoryId == territoryType) { - if (skipAetheryteCondition != null && skipAetheryteCondition.InSameTerritory) + IGameObject gameObject2 = objectTable[0]; + if (gameObject2 != null && !skipAetheryteCondition.Never) { - logger.LogInformation("Skipping aetheryte teleport due to SkipCondition (InSameTerritory)"); - return true; - } - Vector3 position = clientState.LocalPlayer.Position; - if (base.Task.Step.Position.HasValue && (position - base.Task.Step.Position.Value).Length() < base.Task.Step.CalculateActualStopDistance()) - { - logger.LogInformation("Skipping aetheryte teleport, we're near the target"); - return true; - } - if (aetheryteData.CalculateDistance(position, territoryType, base.Task.TargetAetheryte) < 20f || (base.Task.Step.AethernetShortcut != null && (aetheryteData.CalculateDistance(position, territoryType, base.Task.Step.AethernetShortcut.From) < 20f || aetheryteData.CalculateDistance(position, territoryType, base.Task.Step.AethernetShortcut.To) < 20f))) - { - logger.LogInformation("Skipping aetheryte teleport"); - return true; + if (skipAetheryteCondition != null && skipAetheryteCondition.InSameTerritory) + { + logger.LogInformation("Skipping aetheryte teleport due to SkipCondition (InSameTerritory)"); + return true; + } + Vector3 position = gameObject2.Position; + if (base.Task.Step.Position.HasValue && (position - base.Task.Step.Position.Value).Length() < base.Task.Step.CalculateActualStopDistance()) + { + logger.LogInformation("Skipping aetheryte teleport, we're near the target"); + return true; + } + if (aetheryteData.CalculateDistance(position, territoryType, base.Task.TargetAetheryte) < 20f || (base.Task.Step.AethernetShortcut != null && (aetheryteData.CalculateDistance(position, territoryType, base.Task.Step.AethernetShortcut.From) < 20f || aetheryteData.CalculateDistance(position, territoryType, base.Task.Step.AethernetShortcut.To) < 20f))) + { + logger.LogInformation("Skipping aetheryte teleport"); + return true; + } } } } @@ -208,7 +214,7 @@ internal static class AetheryteShortcut } } - internal sealed class MoveAwayFromAetheryteExecutor(MoveExecutor moveExecutor, AetheryteData aetheryteData, IClientState clientState) : TaskExecutor() + internal sealed class MoveAwayFromAetheryteExecutor(MoveExecutor moveExecutor, AetheryteData aetheryteData, IClientState clientState, IObjectTable objectTable) : TaskExecutor() { private static readonly Dictionary> AetherytesToMoveFrom; @@ -219,7 +225,12 @@ internal static class AetheryteShortcut protected override bool Start() { - Vector3 playerPosition = clientState.LocalPlayer.Position; + IGameObject gameObject = objectTable[0]; + if (gameObject == null) + { + return false; + } + Vector3 playerPosition = gameObject.Position; if (aetheryteData.CalculateDistance(playerPosition, clientState.TerritoryType, base.Task.TargetAetheryte) >= 20f) { return false; diff --git a/Questionable/Questionable.Controller.Steps.Shared/Craft.cs b/Questionable/Questionable.Controller.Steps.Shared/Craft.cs index f94829e..282765f 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/Craft.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/Craft.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.UI.Agent; @@ -43,7 +44,7 @@ internal static class Craft } } - internal sealed class DoCraft(IDataManager dataManager, IClientState clientState, ArtisanIpc artisanIpc, ILogger logger) : TaskExecutor() + internal sealed class DoCraft(IDataManager dataManager, IObjectTable objectTable, ArtisanIpc artisanIpc, ILogger logger) : TaskExecutor() { protected override bool Start() { @@ -57,7 +58,7 @@ internal static class Craft { throw new TaskException($"Item {base.Task.ItemId} is not craftable"); } - uint num = (EClassJob)clientState.LocalPlayer.ClassJob.RowId switch + uint num = (EClassJob?)(objectTable[0] as ICharacter)?.ClassJob.RowId switch { EClassJob.Carpenter => rowOrDefault.Value.CRP.RowId, EClassJob.Blacksmith => rowOrDefault.Value.BSM.RowId, diff --git a/Questionable/Questionable.Controller.Steps.Shared/ExtraConditionUtils.cs b/Questionable/Questionable.Controller.Steps.Shared/ExtraConditionUtils.cs index b629f1c..0f12b04 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/ExtraConditionUtils.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/ExtraConditionUtils.cs @@ -9,14 +9,17 @@ internal sealed class ExtraConditionUtils { private readonly IClientState _clientState; - public ExtraConditionUtils(IClientState clientState) + private readonly IObjectTable _objectTable; + + public ExtraConditionUtils(IClientState clientState, IObjectTable objectTable) { _clientState = clientState; + _objectTable = objectTable; } public bool MatchesExtraCondition(EExtraSkipCondition skipCondition) { - Vector3? vector = _clientState.LocalPlayer?.Position; + Vector3? vector = _objectTable[0]?.Position; if (vector.HasValue && _clientState.TerritoryType != 0) { return MatchesExtraCondition(skipCondition, vector.Value, _clientState.TerritoryType); diff --git a/Questionable/Questionable.Controller.Steps.Shared/Gather.cs b/Questionable/Questionable.Controller.Steps.Shared/Gather.cs index 366255d..ef618eb 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/Gather.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/Gather.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Game.Text; using Dalamud.Game.Text.SeStringHandling; using Dalamud.Plugin.Services; @@ -42,7 +43,7 @@ internal static class Gather } } - internal sealed class DelayedGatheringExecutor(GatheringPointRegistry gatheringPointRegistry, TerritoryData territoryData, IClientState clientState, IServiceProvider serviceProvider, ILogger logger) : TaskExecutor(), IExtraTaskCreator, ITaskExecutor + internal sealed class DelayedGatheringExecutor(GatheringPointRegistry gatheringPointRegistry, TerritoryData territoryData, IClientState clientState, IObjectTable objectTable, IServiceProvider serviceProvider, ILogger logger) : TaskExecutor(), IExtraTaskCreator, ITaskExecutor { protected override bool Start() { @@ -56,8 +57,8 @@ internal static class Gather public IEnumerable CreateExtraTasks() { - EClassJob rowId = (EClassJob)clientState.LocalPlayer.ClassJob.RowId; - if (!gatheringPointRegistry.TryGetGatheringPointId(base.Task.GatheredItem.ItemId, rowId, out GatheringPointId gatheringPointId)) + EClassJob valueOrDefault = ((EClassJob?)(objectTable[0] as ICharacter)?.ClassJob.RowId).GetValueOrDefault(); + if (!gatheringPointRegistry.TryGetGatheringPointId(base.Task.GatheredItem.ItemId, valueOrDefault, out GatheringPointId gatheringPointId)) { throw new TaskException($"No gathering point found for item {base.Task.GatheredItem.ItemId}"); } @@ -69,7 +70,7 @@ internal static class Gather { yield break; } - switch (rowId) + switch (valueOrDefault) { case EClassJob.Miner: yield return new Questionable.Controller.Steps.Interactions.Action.TriggerStatusIfMissing(EStatus.Prospect, EAction.Prospect); diff --git a/Questionable/Questionable.Controller.Steps.Shared/SkipCondition.cs b/Questionable/Questionable.Controller.Steps.Shared/SkipCondition.cs index 88099fe..8da309f 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/SkipCondition.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/SkipCondition.cs @@ -45,7 +45,7 @@ internal static class SkipCondition } } - internal sealed class CheckSkip(ILogger logger, Configuration configuration, AetheryteFunctions aetheryteFunctions, GameFunctions gameFunctions, QuestFunctions questFunctions, IClientState clientState, ICondition condition, ExtraConditionUtils extraConditionUtils, ClassJobUtils classJobUtils) : TaskExecutor() + internal sealed class CheckSkip(ILogger logger, Configuration configuration, AetheryteFunctions aetheryteFunctions, GameFunctions gameFunctions, QuestFunctions questFunctions, IClientState clientState, IObjectTable objectTable, ICondition condition, ExtraConditionUtils extraConditionUtils, ClassJobUtils classJobUtils) : TaskExecutor() { protected override bool Start() { @@ -200,9 +200,10 @@ internal static class SkipCondition if (skipConditions.NotTargetable && step != null && step.DataId.HasValue) { IGameObject gameObject = gameFunctions.FindObjectByDataId(step.DataId.Value); + IGameObject gameObject2 = objectTable[0]; if (gameObject == null) { - if ((step.Position.GetValueOrDefault() - clientState.LocalPlayer.Position).Length() < 100f) + if (gameObject2 != null && (step.Position.GetValueOrDefault() - gameObject2.Position).Length() < 100f) { logger.LogInformation("Skipping step, object is not nearby (but we are)"); return true; @@ -340,9 +341,10 @@ internal static class SkipCondition private bool CheckLevelCondition(SkipStepConditions skipConditions) { - if (skipConditions.MinimumLevel.HasValue && clientState.LocalPlayer != null && clientState.LocalPlayer.Level >= skipConditions.MinimumLevel.Value) + ICharacter character = objectTable[0] as ICharacter; + if (skipConditions.MinimumLevel.HasValue && character != null && character.Level >= skipConditions.MinimumLevel.Value) { - logger.LogInformation("Skipping step, as player level {CurrentLevel} >= minimum level {MinLevel}", clientState.LocalPlayer.Level, skipConditions.MinimumLevel.Value); + logger.LogInformation("Skipping step, as player level {CurrentLevel} >= minimum level {MinLevel}", character.Level, skipConditions.MinimumLevel.Value); return true; } return false; @@ -407,9 +409,9 @@ internal static class SkipCondition if (requiredCurrentJob != null && requiredCurrentJob.Count > 0) { List list = step.RequiredCurrentJob.SelectMany((EExtendedClassJob x) => classJobUtils.AsIndividualJobs(x, elementId)).ToList(); - EClassJob rowId = (EClassJob)clientState.LocalPlayer.ClassJob.RowId; - logger.LogInformation("Checking current job {CurrentJob} against {ExpectedJobs}", rowId, string.Join(",", list)); - if (!list.Contains(rowId)) + EClassJob valueOrDefault = ((EClassJob?)(objectTable[0] as ICharacter)?.ClassJob.RowId).GetValueOrDefault(); + logger.LogInformation("Checking current job {CurrentJob} against {ExpectedJobs}", valueOrDefault, string.Join(",", list)); + if (!list.Contains(valueOrDefault)) { logger.LogInformation("Skipping step, as step requires a different job"); return true; @@ -421,14 +423,15 @@ internal static class SkipCondition private bool CheckPositionCondition(SkipStepConditions skipConditions) { + IGameObject gameObject = objectTable[0]; NearPositionCondition nearPosition = skipConditions.NearPosition; - if (nearPosition != null && clientState.TerritoryType == nearPosition.TerritoryId && Vector3.Distance(nearPosition.Position, clientState.LocalPlayer.Position) <= nearPosition.MaximumDistance) + if (nearPosition != null && clientState.TerritoryType == nearPosition.TerritoryId && gameObject != null && Vector3.Distance(nearPosition.Position, gameObject.Position) <= nearPosition.MaximumDistance) { logger.LogInformation("Skipping step, as we're near the position"); return true; } NearPositionCondition notNearPosition = skipConditions.NotNearPosition; - if (notNearPosition != null && clientState.TerritoryType == notNearPosition.TerritoryId && notNearPosition.MaximumDistance <= Vector3.Distance(notNearPosition.Position, clientState.LocalPlayer.Position)) + if (notNearPosition != null && clientState.TerritoryType == notNearPosition.TerritoryId && gameObject != null && notNearPosition.MaximumDistance <= Vector3.Distance(notNearPosition.Position, gameObject.Position)) { logger.LogInformation("Skipping step, as we're not near the position"); return true; @@ -479,7 +482,7 @@ internal static class SkipCondition private unsafe bool IsBetterOrEqualItemEquipped(uint itemId) { - if (clientState.LocalPlayer == null) + if (objectTable[0] == null) { return false; } diff --git a/Questionable/Questionable.Controller.Steps.Shared/SwitchClassJob.cs b/Questionable/Questionable.Controller.Steps.Shared/SwitchClassJob.cs index 79756cd..7cc8302 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/SwitchClassJob.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/SwitchClassJob.cs @@ -1,4 +1,5 @@ using System.Linq; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Client.UI.Misc; using LLib.GameData; @@ -31,11 +32,11 @@ internal static class SwitchClassJob } } - internal sealed class SwitchClassJobExecutor(IClientState clientState) : AbstractDelayedTaskExecutor() + internal sealed class SwitchClassJobExecutor(IObjectTable objectTable) : AbstractDelayedTaskExecutor() { protected unsafe override bool StartInternal() { - if (clientState.LocalPlayer.ClassJob.RowId == (uint)base.Task.ClassJob) + if ((objectTable[0] as ICharacter)?.ClassJob.RowId == (uint?)base.Task.ClassJob) { return false; } diff --git a/Questionable/Questionable.Controller.Steps.Shared/WaitAtEnd.cs b/Questionable/Questionable.Controller.Steps.Shared/WaitAtEnd.cs index 6c2f566..3266500 100644 --- a/Questionable/Questionable.Controller.Steps.Shared/WaitAtEnd.cs +++ b/Questionable/Questionable.Controller.Steps.Shared/WaitAtEnd.cs @@ -17,7 +17,7 @@ namespace Questionable.Controller.Steps.Shared; internal static class WaitAtEnd { - internal sealed class Factory(IClientState clientState, ICondition condition, TerritoryData territoryData, AutoDutyIpc autoDutyIpc, BossModIpc bossModIpc) : ITaskFactory + internal sealed class Factory(IClientState clientState, IObjectTable objectTable, ICondition condition, TerritoryData territoryData, AutoDutyIpc autoDutyIpc, BossModIpc bossModIpc) : ITaskFactory { public IEnumerable CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step) { @@ -129,10 +129,10 @@ internal static class WaitAtEnd } else { - Vector3 lastPosition = step.Position ?? clientState.LocalPlayer?.Position ?? Vector3.Zero; + Vector3 lastPosition = step.Position ?? objectTable[0]?.Position ?? Vector3.Zero; task = new WaitCondition.Task(delegate { - Vector3? vector = clientState.LocalPlayer?.Position; + Vector3? vector = objectTable[0]?.Position; return vector.HasValue && (lastPosition - vector.Value).Length() > 2f; }, "Wait(tp away from " + lastPosition.ToString("G", CultureInfo.InvariantCulture) + ")"); } diff --git a/Questionable/Questionable.Controller/CombatController.cs b/Questionable/Questionable.Controller/CombatController.cs index 76e7f35..bffe604 100644 --- a/Questionable/Questionable.Controller/CombatController.cs +++ b/Questionable/Questionable.Controller/CombatController.cs @@ -6,7 +6,6 @@ using System.Runtime.InteropServices; using Dalamud.Game.ClientState.Conditions; using Dalamud.Game.ClientState.Objects; using Dalamud.Game.ClientState.Objects.Enums; -using Dalamud.Game.ClientState.Objects.SubKinds; using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Client.Game; @@ -323,12 +322,13 @@ internal sealed class CombatController : IDisposable } } } + IGameObject localPlayer = _objectTable[0]; IGameObject gameObject = (from x in _objectTable select new { GameObject = x, Priority = GetKillPriority(x).Priority, - Distance = Vector3.Distance(x.Position, _clientState.LocalPlayer.Position) + Distance = Vector3.Distance(x.Position, localPlayer?.Position ?? Vector3.Zero) } into x where x.Priority > 0 orderby x.Priority descending, x.Distance @@ -355,7 +355,8 @@ internal sealed class CombatController : IDisposable } if (gameObject is IBattleNpc battleNpc && battleNpc.StatusFlags.HasFlag(StatusFlags.InCombat)) { - if (gameObject.TargetObjectId == _clientState.LocalPlayer?.GameObjectId) + IGameObject? gameObject2 = _objectTable[0]; + if (gameObject.TargetObjectId == gameObject2?.GameObjectId) { return (Priority: num.Value + 150, Reason: text + "/Targeted"); } @@ -393,11 +394,12 @@ internal sealed class CombatController : IDisposable } List complexCombatDatas = _currentFight.Data.ComplexCombatDatas; GameObject* address = (GameObject*)gameObject.Address; - if (address->FateId != 0 && _currentFight.Data.SpawnType != EEnemySpawnType.FateEnemies && gameObject.TargetObjectId != _clientState.LocalPlayer?.GameObjectId) + IGameObject gameObject2 = _objectTable[0]; + if (address->FateId != 0 && _currentFight.Data.SpawnType != EEnemySpawnType.FateEnemies && gameObject.TargetObjectId != gameObject2?.GameObjectId) { return (Priority: null, Reason: "FATE mob"); } - Vector3 value = _clientState.LocalPlayer?.Position ?? Vector3.Zero; + Vector3 value = gameObject2?.Position ?? Vector3.Zero; bool flag = _currentFight.Data.SpawnType != EEnemySpawnType.FinishCombatIfAny && (_currentFight.Data.SpawnType != EEnemySpawnType.OverworldEnemies || !(Vector3.Distance(value, battleNpc.Position) >= 50f)) && _currentFight.Data.SpawnType != EEnemySpawnType.FateEnemies; if (complexCombatDatas.Count > 0) { @@ -430,6 +432,7 @@ internal sealed class CombatController : IDisposable private void SetTarget(IGameObject? target) { + IGameObject gameObject = _objectTable[0]; if (target == null) { if (_targetManager.Target != null) @@ -438,9 +441,9 @@ internal sealed class CombatController : IDisposable _targetManager.Target = null; } } - else if (Vector3.Distance(_clientState.LocalPlayer.Position, target.Position) > 55f) + else if (gameObject != null && Vector3.Distance(gameObject.Position, target.Position) > 55f) { - _logger.LogInformation("Moving to target, distance: {Distance:N2}", Vector3.Distance(_clientState.LocalPlayer.Position, target.Position)); + _logger.LogInformation("Moving to target, distance: {Distance:N2}", Vector3.Distance(gameObject.Position, target.Position)); MoveToTarget(target); } else @@ -468,39 +471,45 @@ internal sealed class CombatController : IDisposable private void MoveToTarget(IGameObject gameObject) { - IPlayerCharacter localPlayer = _clientState.LocalPlayer; - if (localPlayer == null) + IGameObject gameObject2 = _objectTable[0]; + if (gameObject2 == null) { return; } - float num = localPlayer.HitboxRadius + gameObject.HitboxRadius; - float num2 = Vector3.Distance(localPlayer.Position, gameObject.Position); - byte? b = localPlayer.ClassJob.ValueNullable?.Role; - bool flag; - if (b.HasValue) + float num = gameObject2.HitboxRadius + gameObject.HitboxRadius; + float num2 = Vector3.Distance(gameObject2.Position, gameObject.Position); + ICharacter character = gameObject2 as ICharacter; + bool flag = character != null; + bool flag2; + if (flag) { - byte valueOrDefault = b.GetValueOrDefault(); - if ((uint)(valueOrDefault - 3) <= 1u) + byte? b = character.ClassJob.ValueNullable?.Role; + if (b.HasValue) { - flag = true; - goto IL_008e; + byte valueOrDefault = b.GetValueOrDefault(); + if ((uint)(valueOrDefault - 3) <= 1u) + { + flag2 = true; + goto IL_00a3; + } } + flag2 = false; + goto IL_00a3; } - flag = false; - goto IL_008e; - IL_008e: + goto IL_00a7; + IL_00a7: float num3 = (flag ? 20f : 2.9f); - bool flag2 = num2 - num >= num3; - bool flag3 = IsInLineOfSight(gameObject); - if (flag2 || !flag3) + bool flag3 = num2 - num >= num3; + bool flag4 = IsInLineOfSight(gameObject); + if (flag3 || !flag4) { - bool flag4 = num2 - num > 5f; - if (!flag2 && !flag3) + bool flag5 = num2 - num > 5f; + if (!flag3 && !flag4) { num3 = Math.Min(num3, num2) / 2f; - flag4 = true; + flag5 = true; } - if (!flag4) + if (!flag5) { _logger.LogInformation("Moving to {TargetName} ({BaseId}) to attack", gameObject.Name, gameObject.BaseId); MovementController movementController = _movementController; @@ -518,11 +527,20 @@ internal sealed class CombatController : IDisposable _movementController.NavigateTo(EMovementType.Combat, null, gameObject.Position, fly: false, sprint: false, num3 + num - 0.25f, float.MaxValue); } } + return; + IL_00a3: + flag = flag2; + goto IL_00a7; } internal unsafe bool IsInLineOfSight(IGameObject target) { - Vector3 position = _clientState.LocalPlayer.Position; + IGameObject gameObject = _objectTable[0]; + if (gameObject == null) + { + return false; + } + Vector3 position = gameObject.Position; position.Y += 2f; Vector3 position2 = target.Position; position2.Y += 2f; diff --git a/Questionable/Questionable.Controller/CommandHandler.cs b/Questionable/Questionable.Controller/CommandHandler.cs index e41850d..60dde5f 100644 --- a/Questionable/Questionable.Controller/CommandHandler.cs +++ b/Questionable/Questionable.Controller/CommandHandler.cs @@ -1,20 +1,8 @@ using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; using Dalamud.Game.ClientState.Objects; using Dalamud.Game.Command; using Dalamud.Plugin.Services; -using FFXIVClientStructs.FFXIV.Client.Game; -using FFXIVClientStructs.FFXIV.Client.Game.UI; -using Lumina.Excel; -using Lumina.Excel.Sheets; -using Questionable.Data; using Questionable.Functions; -using Questionable.Model; -using Questionable.Model.Common; -using Questionable.Model.Questing; -using Questionable.Model.Questing.Converter; using Questionable.Windows; namespace Questionable.Controller; @@ -33,12 +21,8 @@ internal sealed class CommandHandler : IDisposable private readonly MovementController _movementController; - private readonly QuestRegistry _questRegistry; - private readonly ConfigWindow _configWindow; - private readonly DebugOverlay _debugOverlay; - private readonly OneTimeSetupWindow _oneTimeSetupWindow; private readonly QuestWindow _questWindow; @@ -53,33 +37,19 @@ internal sealed class CommandHandler : IDisposable private readonly ITargetManager _targetManager; - private readonly QuestFunctions _questFunctions; - - private readonly GameFunctions _gameFunctions; - - private readonly AetheryteFunctions _aetheryteFunctions; - - private readonly IDataManager _dataManager; - private readonly IClientState _clientState; - private readonly IObjectTable _objectTable; - private readonly Configuration _configuration; private readonly ChangelogWindow _changelogWindow; - private IReadOnlyList _previouslyUnlockedUnlockLinks = Array.Empty(); - public CommandHandler(ICommandManager commandManager, IChatGui chatGui, QuestController questController, MovementController movementController, QuestRegistry questRegistry, ConfigWindow configWindow, DebugOverlay debugOverlay, OneTimeSetupWindow oneTimeSetupWindow, QuestWindow questWindow, QuestSelectionWindow questSelectionWindow, QuestSequenceWindow questSequenceWindow, JournalProgressWindow journalProgressWindow, PriorityWindow priorityWindow, ITargetManager targetManager, QuestFunctions questFunctions, GameFunctions gameFunctions, AetheryteFunctions aetheryteFunctions, IDataManager dataManager, IClientState clientState, IObjectTable objectTable, Configuration configuration, ChangelogWindow changelogWindow) { _commandManager = commandManager; _chatGui = chatGui; _questController = questController; _movementController = movementController; - _questRegistry = questRegistry; _configWindow = configWindow; - _debugOverlay = debugOverlay; _oneTimeSetupWindow = oneTimeSetupWindow; _questWindow = questWindow; _questSelectionWindow = questSelectionWindow; @@ -87,12 +57,7 @@ internal sealed class CommandHandler : IDisposable _journalProgressWindow = journalProgressWindow; _priorityWindow = priorityWindow; _targetManager = targetManager; - _questFunctions = questFunctions; - _gameFunctions = gameFunctions; - _aetheryteFunctions = aetheryteFunctions; - _dataManager = dataManager; _clientState = clientState; - _objectTable = objectTable; _configuration = configuration; _changelogWindow = changelogWindow; _clientState.Logout += OnLogout; @@ -185,465 +150,8 @@ internal sealed class CommandHandler : IDisposable } } - private unsafe void ProcessDebugCommand(string command, string arguments) + private void ProcessDebugCommand(string command, string arguments) { - if (OpenSetupIfNeeded(arguments)) - { - return; - } - string[] array = arguments.Split(' '); - string text = array[0]; - if (text == null) - { - return; - } - switch (text.Length) - { - case 4: - switch (text[0]) - { - case 'n': - if (text == "next") - { - SetNextQuest(array.Skip(1).ToArray()); - } - break; - case 't': - { - if (!(text == "taxi")) - { - break; - } - List list5 = new List(); - ExcelSheet excelSheet = _dataManager.GetExcelSheet(); - UIState* ptr = UIState.Instance(); - if (ptr == null) - { - _chatGui.PrintError("UIState is null", "Questionable", 576); - break; - } - for (int num10 = 0; num10 < 192; num10++) - { - uint num11 = (uint)(num10 + 1179648); - try - { - if (excelSheet.HasRow(num11) && ptr->IsChocoboTaxiStandUnlocked(num11)) - { - string value14 = excelSheet.GetRow(num11).PlaceName.ToString(); - if (string.IsNullOrEmpty(value14)) - { - value14 = "Unknown"; - } - list5.Add($"{value14} (ID: {num10}, Row: 0x{num11:X})"); - } - } - catch - { - } - } - _chatGui.Print($"Unlocked taxi stands ({list5.Count}):", "Questionable", 576); - if (list5.Count == 0) - { - _chatGui.Print(" (No unlocked taxi stands found)", "Questionable", 576); - break; - } - { - foreach (string item5 in list5) - { - _chatGui.Print(" - " + item5, "Questionable", 576); - } - break; - } - } - } - break; - case 3: - switch (text[1]) - { - default: - return; - case 'i': - if (text == "sim") - { - SetSimulatedQuest(array.Skip(1).ToArray()); - } - return; - case 'e': - break; - } - if (!(text == "seq")) - { - break; - } - goto IL_0209; - case 12: - switch (text[0]) - { - case 'a': - if (text == "abandon-duty") - { - _gameFunctions.AbandonDuty(); - } - break; - case 'u': - { - if (!(text == "unlock-links")) - { - break; - } - IReadOnlyList unlockLinks = _gameFunctions.GetUnlockLinks(); - if (unlockLinks.Count >= 0) - { - _chatGui.Print($"Saved {unlockLinks.Count} unlock links to log.", "Questionable", 576); - List list6 = unlockLinks.Except(_previouslyUnlockedUnlockLinks).ToList(); - if (_previouslyUnlockedUnlockLinks.Count > 0 && list6.Count > 0) - { - _chatGui.Print("New unlock links: " + string.Join(", ", list6), "Questionable", 576); - } - } - else - { - _chatGui.PrintError("Could not query unlock links.", "Questionable", 576); - } - _previouslyUnlockedUnlockLinks = unlockLinks; - break; - } - } - break; - case 9: - switch (text[0]) - { - default: - return; - case 's': - break; - case 'f': - { - if (!(text == "festivals")) - { - return; - } - List list4 = new List(); - for (byte b8 = 0; b8 < 4; b8++) - { - GameMain.Festival festival = GameMain.Instance()->ActiveFestivals[b8]; - if (festival.Id == 0) - { - list4.Add($"Slot {b8}: None"); - } - else - { - list4.Add($"Slot {b8}: {festival.Id}({festival.Phase})"); - } - } - _chatGui.Print("Festival slots:", "Questionable", 576); - { - foreach (string item6 in list4) - { - _chatGui.Print(" " + item6, "Questionable", 576); - } - return; - } - } - case 'a': - { - if (!(text == "aethernet")) - { - return; - } - ushort territoryType = _clientState.TerritoryType; - Dictionary values = AethernetShardConverter.Values; - AetheryteData aetheryteData = new AetheryteData(_dataManager); - HashSet hashSet2 = new HashSet(); - Dictionary> dictionary = new Dictionary>(); - EAetheryteLocation key; - string value10; - foreach (KeyValuePair item7 in values) - { - item7.Deconstruct(out key, out value10); - EAetheryteLocation key2 = key; - string text2 = value10; - if (aetheryteData.TerritoryIds.TryGetValue(key2, out var value11) && value11 == territoryType) - { - int num8 = text2.IndexOf(']', StringComparison.Ordinal); - if (num8 > 0) - { - string item3 = text2.Substring(1, num8 - 1); - hashSet2.Add(item3); - } - } - } - if (hashSet2.Count == 0) - { - _chatGui.Print("No aethernet shards found in current zone.", "Questionable", 576); - return; - } - foreach (KeyValuePair item8 in values) - { - item8.Deconstruct(out key, out value10); - EAetheryteLocation eAetheryteLocation = key; - string text3 = value10; - int num9 = text3.IndexOf(']', StringComparison.Ordinal); - if (num9 <= 0) - { - continue; - } - string text4 = text3.Substring(1, num9 - 1); - if (hashSet2.Contains(text4)) - { - if (!dictionary.ContainsKey(text4)) - { - dictionary[text4] = new List<(EAetheryteLocation, string, bool)>(); - } - bool item4 = _aetheryteFunctions.IsAetheryteUnlocked(eAetheryteLocation); - dictionary[text4].Add((eAetheryteLocation, text3, item4)); - } - } - { - foreach (KeyValuePair> item9 in dictionary.OrderBy>, string>((KeyValuePair> x) => x.Key)) - { - item9.Deconstruct(out value10, out var value12); - string value13 = value10; - List<(EAetheryteLocation, string, bool)> list = value12; - List<(EAetheryteLocation, string, bool)> list2 = list.Where<(EAetheryteLocation, string, bool)>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => x.Unlocked).ToList(); - List<(EAetheryteLocation, string, bool)> list3 = list.Where<(EAetheryteLocation, string, bool)>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => !x.Unlocked).ToList(); - _chatGui.Print($"Aethernet Shards in {value13} ({list.Count} total):", "Questionable", 576); - _chatGui.Print($" Unlocked: {list2.Count}", "Questionable", 576); - _chatGui.Print($" Missing: {list3.Count}", "Questionable", 576); - _chatGui.Print("", "Questionable", 576); - if (list3.Count > 0) - { - _chatGui.Print("Missing/Unattuned Aethernet Shards:", "Questionable", 576); - foreach (var item10 in list3.OrderBy<(EAetheryteLocation, string, bool), string>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => x.Name)) - { - _chatGui.Print(" " + item10.Item2, "Questionable", 576); - } - _chatGui.Print("", "Questionable", 576); - } - if (list2.Count > 0) - { - _chatGui.Print("Unlocked Aethernet Shards:", "Questionable", 576); - foreach (var item11 in list2.OrderBy<(EAetheryteLocation, string, bool), string>(((EAetheryteLocation Location, string Name, bool Unlocked) x) => x.Name)) - { - _chatGui.Print(" " + item11.Item2, "Questionable", 576); - } - } - if (dictionary.Count > 1) - { - _chatGui.Print("", "Questionable", 576); - } - } - return; - } - } - } - if (!(text == "sequences")) - { - break; - } - goto IL_0209; - case 5: - if (text == "setup") - { - _oneTimeSetupWindow.IsOpenAndUncollapsed = true; - } - break; - case 2: - if (text == "do") - { - ConfigureDebugOverlay(array.Skip(1).ToArray()); - } - break; - case 7: - if (text == "mountid") - { - PrintMountId(); - } - break; - case 11: - { - if (!(text == "quest-kills")) - { - break; - } - (QuestController.QuestProgress, QuestController.ECurrentQuestType)? currentQuestDetails = _questController.CurrentQuestDetails; - if (!currentQuestDetails.HasValue) - { - _chatGui.PrintError("No active quest.", "Questionable", 576); - break; - } - QuestController.QuestProgress item = currentQuestDetails.Value.Item1; - Questionable.Model.Quest quest = item.Quest; - QuestProgressInfo questProgressInfo = null; - if (quest.Id is QuestId elementId) - { - questProgressInfo = _questFunctions.GetQuestProgressInfo(elementId); - } - if (questProgressInfo == null) - { - _chatGui.PrintError("Unable to retrieve quest progress information.", "Questionable", 576); - break; - } - QuestSequence questSequence = quest.FindSequence(item.Sequence); - if (questSequence == null) - { - _chatGui.PrintError($"Sequence {item.Sequence} not found for quest {quest.Id}.", "Questionable", 576); - break; - } - QuestStep questStep = ((item.Step < questSequence.Steps.Count) ? questSequence.Steps[item.Step] : null); - if (questStep == null) - { - _chatGui.PrintError($"Step {item.Step} not found in sequence {item.Sequence}.", "Questionable", 576); - break; - } - _chatGui.Print($"Quest: {quest.Info.Name} ({quest.Id})", "Questionable", 576); - _chatGui.Print($"Sequence: {item.Sequence}, Step: {item.Step}", "Questionable", 576); - _chatGui.Print("", "Questionable", 576); - _chatGui.Print("Quest Variables: " + string.Join(", ", questProgressInfo.Variables.Select((byte v, int i) => $"[{i}]={v}")), "Questionable", 576); - _chatGui.Print("", "Questionable", 576); - ExcelSheet bnpcNameSheet = _dataManager.GetExcelSheet(); - HashSet hashSet = new HashSet(questStep.KillEnemyDataIds); - foreach (ComplexCombatData complexCombatDatum in questStep.ComplexCombatData) - { - hashSet.Add(complexCombatDatum.DataId); - } - if (hashSet.Count > 0) - { - _chatGui.Print($"All Enemy DataIds Found: {hashSet.Count}", "Questionable", 576); - foreach (uint item12 in hashSet.OrderBy((uint x) => x)) - { - (string Name, bool Found) tuple = GetEnemyName(item12); - var (value, _) = tuple; - if (tuple.Found) - { - _chatGui.Print($" - {value} (DataId: {item12})", "Questionable", 576); - } - else - { - _chatGui.Print($" - DataId: {item12}", "Questionable", 576); - } - } - _chatGui.Print("", "Questionable", 576); - } - if (questStep.ComplexCombatData.Count > 0) - { - _chatGui.Print($"Complex Combat Data Entries: {questStep.ComplexCombatData.Count}", "Questionable", 576); - _chatGui.Print("Kill Progress:", "Questionable", 576); - if (questStep.ComplexCombatData.Count == 1 && hashSet.Count > 1) - { - ComplexCombatData complexCombatData = questStep.ComplexCombatData[0]; - int num = -1; - byte? b = null; - for (int num2 = 0; num2 < complexCombatData.CompletionQuestVariablesFlags.Count; num2++) - { - QuestWorkValue questWorkValue = complexCombatData.CompletionQuestVariablesFlags[num2]; - if (questWorkValue != null && questWorkValue.Low.HasValue) - { - num = num2; - b = questWorkValue.Low; - break; - } - } - byte b2 = (byte)(((num >= 0 && num < questProgressInfo.Variables.Count) ? questProgressInfo.Variables[num] : 0) & 0xF); - string value2 = (b.HasValue ? $" {b2}/{b}" : ""); - string value3 = ((b.HasValue && b2 >= b) ? "✓" : "○"); - foreach (uint item13 in hashSet.OrderBy((uint x) => x)) - { - (string Name, bool Found) tuple3 = GetEnemyName(item13); - var (value4, _) = tuple3; - if (tuple3.Found) - { - _chatGui.Print($" {value3} Slay {value4}.{value2} (DataId: {item13})", "Questionable", 576); - } - else - { - _chatGui.Print($" {value3} Slay enemy.{value2} (DataId: {item13})", "Questionable", 576); - } - } - } - else - { - for (int num3 = 0; num3 < questStep.ComplexCombatData.Count; num3++) - { - ComplexCombatData complexCombatData2 = questStep.ComplexCombatData[num3]; - int num4 = -1; - byte? b3 = null; - bool flag = false; - for (int num5 = 0; num5 < complexCombatData2.CompletionQuestVariablesFlags.Count; num5++) - { - QuestWorkValue questWorkValue2 = complexCombatData2.CompletionQuestVariablesFlags[num5]; - if (questWorkValue2 != null) - { - if (questWorkValue2.Low.HasValue) - { - num4 = num5; - b3 = questWorkValue2.Low; - flag = false; - break; - } - if (questWorkValue2.High.HasValue) - { - num4 = num5; - b3 = questWorkValue2.High; - flag = true; - break; - } - } - } - byte b4 = (byte)((num4 >= 0 && num4 < questProgressInfo.Variables.Count) ? questProgressInfo.Variables[num4] : 0); - byte b5 = (flag ? ((byte)(b4 >> 4)) : ((byte)(b4 & 0xF))); - string value5; - if (complexCombatData2.NameId.HasValue) - { - BNpcName? bNpcName = bnpcNameSheet?.GetRowOrDefault(complexCombatData2.NameId.Value); - value5 = ((!bNpcName.HasValue || string.IsNullOrEmpty(bNpcName.Value.Singular.ToString())) ? "enemy" : bNpcName.Value.Singular.ToString()); - } - else - { - (string Name, bool Found) tuple5 = GetEnemyName(complexCombatData2.DataId); - string item2 = tuple5.Name; - value5 = (tuple5.Found ? item2 : "enemy"); - } - string value6 = (b3.HasValue ? $" {b5}/{b3}" : ""); - string value7 = ((b3.HasValue && b5 >= b3) ? "✓" : "○"); - string value8 = (complexCombatData2.NameId.HasValue ? $" (DataId: {complexCombatData2.DataId}, NameId: {complexCombatData2.NameId})" : $" (DataId: {complexCombatData2.DataId})"); - _chatGui.Print($" {value7} Slay {value5}.{value6}{value8}", "Questionable", 576); - } - } - _chatGui.Print("", "Questionable", 576); - } - else if (questStep.KillEnemyDataIds.Count == 0) - { - _chatGui.Print("No kill enemy data for this step.", "Questionable", 576); - _chatGui.Print("", "Questionable", 576); - } - if (questStep.CompletionQuestVariablesFlags.Count <= 0 || !questStep.CompletionQuestVariablesFlags.Any((QuestWorkValue x) => x != null)) - { - break; - } - _chatGui.Print("Completion Flags (Debug):", "Questionable", 576); - for (int num6 = 0; num6 < questStep.CompletionQuestVariablesFlags.Count; num6++) - { - QuestWorkValue questWorkValue3 = questStep.CompletionQuestVariablesFlags[num6]; - if (questWorkValue3 != null) - { - int num7 = ((num6 < questProgressInfo.Variables.Count) ? questProgressInfo.Variables[num6] : 0); - byte b6 = (byte)(num7 >> 4); - byte b7 = (byte)(num7 & 0xF); - string value9 = (((!questWorkValue3.High.HasValue || questWorkValue3.High == b6) && (!questWorkValue3.Low.HasValue || questWorkValue3.Low == b7)) ? " ✓" : " ✗"); - _chatGui.Print($" [{num6}] Expected: H={questWorkValue3.High?.ToString(CultureInfo.InvariantCulture) ?? "any"} L={questWorkValue3.Low?.ToString(CultureInfo.InvariantCulture) ?? "any"} | Actual: H={b6.ToString(CultureInfo.InvariantCulture)} L={b7.ToString(CultureInfo.InvariantCulture)}{value9}", "Questionable", 576); - } - } - break; - } - case 6: - case 8: - case 10: - break; - IL_0209: - _questSequenceWindow.ToggleOrUncollapse(); - break; - } } private bool OpenSetupIfNeeded(string arguments) @@ -663,110 +171,8 @@ internal sealed class CommandHandler : IDisposable return false; } - private void ConfigureDebugOverlay(string[] arguments) - { - ElementId elementId; - if (!_debugOverlay.DrawConditions()) - { - _chatGui.PrintError("You don't have the debug overlay enabled.", "Questionable", 576); - } - else if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out elementId) && elementId != null) - { - if (_questRegistry.TryGetQuest(elementId, out Questionable.Model.Quest quest)) - { - _debugOverlay.HighlightedQuest = quest.Id; - _chatGui.Print($"Set highlighted quest to {elementId} ({quest.Info.Name}).", "Questionable", 576); - } - else - { - _chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576); - } - } - else - { - _debugOverlay.HighlightedQuest = null; - _chatGui.Print("Cleared highlighted quest.", "Questionable", 576); - } - } - - private void SetNextQuest(string[] arguments) - { - if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out ElementId elementId) && elementId != null) - { - Questionable.Model.Quest quest; - if (_questFunctions.IsQuestLocked(elementId)) - { - _chatGui.PrintError($"Quest {elementId} is locked.", "Questionable", 576); - } - else if (_questRegistry.TryGetQuest(elementId, out quest)) - { - _questController.SetNextQuest(quest); - _chatGui.Print($"Set next quest to {elementId} ({quest.Info.Name}).", "Questionable", 576); - } - else - { - _chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576); - } - } - else - { - _questController.SetNextQuest(null); - _chatGui.Print("Cleared next quest.", "Questionable", 576); - } - } - - private void SetSimulatedQuest(string[] arguments) - { - if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out ElementId elementId) && elementId != null) - { - if (_questRegistry.TryGetQuest(elementId, out Questionable.Model.Quest quest)) - { - byte sequence = 0; - int step = 0; - if (arguments.Length >= 2 && byte.TryParse(arguments[1], out var result)) - { - QuestSequence questSequence = quest.FindSequence(result); - if (questSequence != null) - { - sequence = questSequence.Sequence; - if (arguments.Length >= 3 && int.TryParse(arguments[2], out var result2) && questSequence.FindStep(result2) != null) - { - step = result2; - } - } - } - _questController.SimulateQuest(quest, sequence, step); - _chatGui.Print($"Simulating quest {elementId} ({quest.Info.Name}).", "Questionable", 576); - } - else - { - _chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576); - } - } - else - { - _questController.SimulateQuest(null, 0, 0); - _chatGui.Print("Cleared simulated quest.", "Questionable", 576); - } - } - - private void PrintMountId() - { - ushort? mountId = _gameFunctions.GetMountId(); - if (mountId.HasValue) - { - Mount? rowOrDefault = _dataManager.GetExcelSheet().GetRowOrDefault(mountId.Value); - _chatGui.Print($"Mount ID: {mountId}, Name: {rowOrDefault?.Singular}, Obtainable: {((rowOrDefault?.Order == -1) ? "No" : "Yes")}", "Questionable", 576); - } - else - { - _chatGui.Print("You are not mounted.", "Questionable", 576); - } - } - private void OnLogout(int type, int code) { - _previouslyUnlockedUnlockLinks = Array.Empty(); } public void Dispose() diff --git a/Questionable/Questionable.Controller/ContextMenuController.cs b/Questionable/Questionable.Controller/ContextMenuController.cs index f772ae8..b29c8be 100644 --- a/Questionable/Questionable.Controller/ContextMenuController.cs +++ b/Questionable/Questionable.Controller/ContextMenuController.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Game.Gui.ContextMenu; using Dalamud.Game.Text; using Dalamud.Plugin.Services; @@ -43,9 +44,11 @@ internal sealed class ContextMenuController : IDisposable private readonly IClientState _clientState; + private readonly IObjectTable _objectTable; + private readonly ILogger _logger; - public ContextMenuController(IContextMenu contextMenu, QuestController questController, GatheringPointRegistry gatheringPointRegistry, GatheringData gatheringData, QuestRegistry questRegistry, QuestData questData, GameFunctions gameFunctions, QuestFunctions questFunctions, IGameGui gameGui, IChatGui chatGui, IClientState clientState, ILogger logger) + public ContextMenuController(IContextMenu contextMenu, QuestController questController, GatheringPointRegistry gatheringPointRegistry, GatheringData gatheringData, QuestRegistry questRegistry, QuestData questData, GameFunctions gameFunctions, QuestFunctions questFunctions, IGameGui gameGui, IChatGui chatGui, IClientState clientState, IObjectTable objectTable, ILogger logger) { _contextMenu = contextMenu; _questController = questController; @@ -58,6 +61,7 @@ internal sealed class ContextMenuController : IDisposable _gameGui = gameGui; _chatGui = chatGui; _clientState = clientState; + _objectTable = objectTable; _logger = logger; _contextMenu.OnMenuOpened += MenuOpened; } @@ -113,7 +117,11 @@ internal sealed class ContextMenuController : IDisposable private unsafe void AddContextMenuEntry(IMenuOpenedArgs args, uint itemId, uint npcId, EClassJob classJob, string verb) { - EClassJob rowId = (EClassJob)_clientState.LocalPlayer.ClassJob.RowId; + if (!(_objectTable[0] is ICharacter { ClassJob: var classJob2 })) + { + return; + } + EClassJob rowId = (EClassJob)classJob2.RowId; bool flag = classJob != rowId; if (flag) { diff --git a/Questionable/Questionable.Controller/InterruptHandler.cs b/Questionable/Questionable.Controller/InterruptHandler.cs index 304d4a6..800c811 100644 --- a/Questionable/Questionable.Controller/InterruptHandler.cs +++ b/Questionable/Questionable.Controller/InterruptHandler.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Hooking; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Client.Game; @@ -135,15 +136,18 @@ internal sealed class InterruptHandler : IDisposable private readonly IClientState _clientState; + private readonly IObjectTable _objectTable; + private readonly TerritoryData _territoryData; private readonly ILogger _logger; public event EventHandler? Interrupted; - public unsafe InterruptHandler(IGameInteropProvider gameInteropProvider, IClientState clientState, TerritoryData territoryData, ILogger logger) + public unsafe InterruptHandler(IGameInteropProvider gameInteropProvider, IClientState clientState, IObjectTable objectTable, TerritoryData territoryData, ILogger logger) { _clientState = clientState; + _objectTable = objectTable; _territoryData = territoryData; _logger = logger; _processActionEffectHook = gameInteropProvider.HookFromSignature("40 ?? 56 57 41 ?? 41 ?? 41 ?? 48 ?? ?? ?? ?? ?? ?? ?? 48", HandleProcessActionEffect); @@ -158,11 +162,12 @@ internal sealed class InterruptHandler : IDisposable { return; } + IGameObject gameObject = _objectTable[0]; for (int i = 0; i < effectHeader->TargetCount; i++) { int num = (int)(effectTail[i] & 0xFFFFFFFFu); EffectEntry* ptr = effectArray + 8 * i; - bool flag = (uint)num == _clientState.LocalPlayer?.GameObjectId; + bool flag = (uint)num == gameObject?.GameObjectId; if (flag) { EActionEffectType type = ptr->Type; diff --git a/Questionable/Questionable.Controller/MovementController.cs b/Questionable/Questionable.Controller/MovementController.cs index 7cb1cc6..4371bec 100644 --- a/Questionable/Questionable.Controller/MovementController.cs +++ b/Questionable/Questionable.Controller/MovementController.cs @@ -73,6 +73,8 @@ internal sealed class MovementController : IDisposable private readonly IClientState _clientState; + private readonly IObjectTable _objectTable; + private readonly GameFunctions _gameFunctions; private readonly ChatFunctions _chatFunctions; @@ -89,6 +91,8 @@ internal sealed class MovementController : IDisposable private Task>? _pathfindTask; + private long _pathfindStartTime; + public bool IsNavmeshReady { get @@ -138,10 +142,15 @@ internal sealed class MovementController : IDisposable public int BuiltNavmeshPercent => _navmeshIpc.GetBuildProgress(); - public MovementController(NavmeshIpc navmeshIpc, IClientState clientState, GameFunctions gameFunctions, ChatFunctions chatFunctions, ICondition condition, MovementOverrideController movementOverrideController, AetheryteData aetheryteData, ILogger logger) + public bool IsNavmeshPathfindInProgress => _navmeshIpc.IsPathfindInProgress; + + public int NumQueuedPathfindRequests => _navmeshIpc.NumQueuedPathfindRequests; + + public MovementController(NavmeshIpc navmeshIpc, IClientState clientState, IObjectTable objectTable, GameFunctions gameFunctions, ChatFunctions chatFunctions, ICondition condition, MovementOverrideController movementOverrideController, AetheryteData aetheryteData, ILogger logger) { _navmeshIpc = navmeshIpc; _clientState = clientState; + _objectTable = objectTable; _gameFunctions = gameFunctions; _chatFunctions = chatFunctions; _condition = condition; @@ -154,16 +163,51 @@ internal sealed class MovementController : IDisposable { if (_pathfindTask != null && Destination != null) { + if (!_pathfindTask.IsCompleted && Environment.TickCount64 - _pathfindStartTime > 30000 && _navmeshIpc.NumQueuedPathfindRequests > 5) + { + _logger.LogWarning("Pathfinding appears stuck: {QueuedRequests} queued requests, task running for {Duration}ms", _navmeshIpc.NumQueuedPathfindRequests, Environment.TickCount64 - _pathfindStartTime); + } if (_pathfindTask.IsCompletedSuccessfully) { _logger.LogInformation("Pathfinding complete, got {Count} points", _pathfindTask.Result.Count); if (_pathfindTask.Result.Count == 0) { + if (Destination.NavmeshCalculations == 1) + { + _logger.LogWarning("Initial pathfinding returned 0 points, attempting to find accessible destination"); + Vector3? vector = TryFindAccessibleDestination(Destination.Position, Destination.IsFlying, Destination.Land); + if (vector.HasValue && Vector3.Distance(Destination.Position, vector.Value) < 30f) + { + _logger.LogInformation("Retrying pathfinding with adjusted destination: {AdjustedDestination}", vector.Value.ToString("G", CultureInfo.InvariantCulture)); + Restart(Destination with + { + Position = vector.Value + }); + return; + } + if (Destination.IsFlying && Destination.Land) + { + _logger.LogWarning("Adjusted destination failed, trying tolerance-based pathfinding"); + _cancellationTokenSource = new CancellationTokenSource(); + _cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(30L)); + Vector3 vector2 = _objectTable[0]?.Position ?? Vector3.Zero; + if (Destination.IsFlying) + { + Vector3 vector3 = vector2; + vector3.Y = vector2.Y + 0.2f; + vector2 = vector3; + } + _pathfindStartTime = Environment.TickCount64; + _pathfindTask = _navmeshIpc.PathfindWithTolerance(vector2, Destination.Position, Destination.IsFlying, 10f, _cancellationTokenSource.Token); + Destination.NavmeshCalculations++; + return; + } + } ResetPathfinding(); throw new PathfindingFailedException(); } List list = _pathfindTask.Result.Skip(1).ToList(); - Vector3 p = _clientState.LocalPlayer?.Position ?? list[0]; + Vector3 p = _objectTable[0]?.Position ?? list[0]; if (Destination.IsFlying && !_condition[ConditionFlag.InFlight] && _condition[ConditionFlag.Mounted] && (IsOnFlightPath(p) || list.Any(IsOnFlightPath))) { ActionManager.Instance()->UseAction(ActionType.GeneralAction, 2u, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null); @@ -179,6 +223,7 @@ internal sealed class MovementController : IDisposable _logger.LogInformation("Running navmesh recalculation with fudged point ({From} to {To})", list.Last(), Destination.Position); _cancellationTokenSource = new CancellationTokenSource(); _cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(30L)); + _pathfindStartTime = Environment.TickCount64; _pathfindTask = _navmeshIpc.Pathfind(list.Last(), Destination.Position, Destination.IsFlying, _cancellationTokenSource.Token); return; } @@ -220,7 +265,7 @@ internal sealed class MovementController : IDisposable Restart(Destination); return; } - Vector3 vector = _clientState.LocalPlayer?.Position ?? Vector3.Zero; + Vector3 vector4 = _objectTable[0]?.Position ?? Vector3.Zero; if (Destination.MovementType == EMovementType.Landing) { if (!_condition[ConditionFlag.InFlight]) @@ -228,9 +273,9 @@ internal sealed class MovementController : IDisposable Stop(); } } - else if ((vector - Destination.Position).Length() < Destination.StopDistance) + else if ((vector4 - Destination.Position).Length() < Destination.StopDistance) { - if (vector.Y - Destination.Position.Y <= Destination.VerticalStopDistance) + if (vector4.Y - Destination.Position.Y <= Destination.VerticalStopDistance) { Stop(); } @@ -239,7 +284,7 @@ internal sealed class MovementController : IDisposable IGameObject gameObject = _gameFunctions.FindObjectByDataId(Destination.DataId.Value); if ((gameObject is ICharacter || gameObject is IEventObj) ? true : false) { - if (Math.Abs(vector.Y - gameObject.Position.Y) < 1.95f) + if (Math.Abs(vector4.Y - gameObject.Position.Y) < 1.95f) { Stop(); } @@ -250,7 +295,7 @@ internal sealed class MovementController : IDisposable { Stop(); } - else if (Math.Abs(vector.Y - gameObject.Position.Y) < 1.95f) + else if (Math.Abs(vector4.Y - gameObject.Position.Y) < 1.95f) { Stop(); } @@ -268,10 +313,10 @@ internal sealed class MovementController : IDisposable else { List waypoints = _navmeshIpc.GetWaypoints(); - Vector3? vector2 = _clientState.LocalPlayer?.Position; - if (vector2.HasValue && (!Destination.ShouldRecalculateNavmesh() || !RecalculateNavmesh(waypoints, vector2.Value)) && !Destination.IsFlying && !_condition[ConditionFlag.Mounted] && !_gameFunctions.HasStatusPreventingSprint() && Destination.CanSprint) + Vector3? vector5 = _objectTable[0]?.Position; + if (vector5.HasValue && (!Destination.ShouldRecalculateNavmesh() || !RecalculateNavmesh(waypoints, vector5.Value)) && !Destination.IsFlying && !_condition[ConditionFlag.Mounted] && !_gameFunctions.HasStatusPreventingSprint() && Destination.CanSprint) { - TriggerSprintIfNeeded(waypoints, vector2.Value); + TriggerSprintIfNeeded(waypoints, vector5.Value); } } } @@ -331,7 +376,7 @@ internal sealed class MovementController : IDisposable Destination.NavmeshCalculations++; _cancellationTokenSource = new CancellationTokenSource(); _cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(30L)); - Vector3 vector2 = _clientState.LocalPlayer.Position; + Vector3 vector2 = _objectTable[0]?.Position ?? Vector3.Zero; if (fly && _aetheryteData.CalculateDistance(vector2, _clientState.TerritoryType, EAetheryteLocation.CoerthasCentralHighlandsCampDragonhead) < 11f) { Vector3 vector = vector2; @@ -345,7 +390,16 @@ internal sealed class MovementController : IDisposable vector.Y = vector2.Y + 0.2f; vector2 = vector; } - _pathfindTask = _navmeshIpc.Pathfind(vector2, to, fly, _cancellationTokenSource.Token); + _pathfindStartTime = Environment.TickCount64; + if (fly && land) + { + _logger.LogInformation("Using tolerance-based pathfinding for landing (tolerance: 5.0)"); + _pathfindTask = _navmeshIpc.PathfindWithTolerance(vector2, to, fly, 5f, _cancellationTokenSource.Token); + } + else + { + _pathfindTask = _navmeshIpc.Pathfind(vector2, to, fly, _cancellationTokenSource.Token); + } } public void NavigateTo(EMovementType type, uint? dataId, List to, bool fly, bool sprint, float? stopDistance, float? verticalStopDistance = null, bool land = false) @@ -380,6 +434,46 @@ internal sealed class MovementController : IDisposable _pathfindTask = null; } + private Vector3? TryFindAccessibleDestination(Vector3 target, bool flying, bool landing) + { + float[] array = ((!(flying && landing)) ? ((!flying) ? new float[3] { 1f, 3f, 5f } : new float[3] { 2f, 5f, 10f }) : new float[3] { 5f, 10f, 15f }); + float[] array2 = ((!flying) ? new float[3] { 1f, 2f, 3f } : new float[3] { 3f, 5f, 10f }); + for (int i = 0; i < array.Length; i++) + { + float num = array[i]; + float num2 = array2[Math.Min(i, array2.Length - 1)]; + Vector3? vector = _navmeshIpc.FindNearestMeshPoint(target, num, num2); + if (vector.HasValue) + { + float num3 = Vector3.Distance(target, vector.Value); + if (num3 <= num * 1.5f) + { + if (i > 0) + { + _logger.LogInformation("Adjusted destination from {Original} to {Adjusted} (distance: {Distance:F2}, extent: {ExtentXZ}/{ExtentY})", target.ToString("G", CultureInfo.InvariantCulture), vector.Value.ToString("G", CultureInfo.InvariantCulture), num3, num, num2); + } + return vector.Value; + } + } + Vector3? pointOnFloor = _navmeshIpc.GetPointOnFloor(target, flying, num); + if (!pointOnFloor.HasValue) + { + continue; + } + float num4 = Vector3.Distance(target, pointOnFloor.Value); + if (num4 <= num * 1.5f) + { + if (i > 0) + { + _logger.LogInformation("Adjusted destination via floor point from {Original} to {Adjusted} (distance: {Distance:F2}, extent: {ExtentXZ})", target.ToString("G", CultureInfo.InvariantCulture), pointOnFloor.Value.ToString("G", CultureInfo.InvariantCulture), num4, num); + } + return pointOnFloor.Value; + } + } + _logger.LogWarning("Could not find accessible mesh point near {Target} within max extent {MaxExtent}", target.ToString("G", CultureInfo.InvariantCulture), array[^1]); + return null; + } + private unsafe bool RecalculateNavmesh(List navPoints, Vector3 start) { if (Destination == null) diff --git a/Questionable/Questionable.Controller/QuestController.cs b/Questionable/Questionable.Controller/QuestController.cs index 265fa27..19def79 100644 --- a/Questionable/Questionable.Controller/QuestController.cs +++ b/Questionable/Questionable.Controller/QuestController.cs @@ -6,6 +6,7 @@ using System.Numerics; using Dalamud.Game.ClientState.Conditions; using Dalamud.Game.ClientState.Keys; using Dalamud.Game.ClientState.Objects.SubKinds; +using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Game.Gui.Toast; using Dalamud.Game.Text.SeStringHandling; using Dalamud.Plugin.Services; @@ -84,6 +85,8 @@ internal sealed class QuestController : MiniTaskController private readonly IClientState _clientState; + private readonly IObjectTable _objectTable; + private readonly GameFunctions _gameFunctions; private readonly QuestFunctions _questFunctions; @@ -231,10 +234,11 @@ internal sealed class QuestController : MiniTaskController public event AutomationTypeChangedEventHandler? AutomationTypeChanged; - public QuestController(IClientState clientState, GameFunctions gameFunctions, QuestFunctions questFunctions, MovementController movementController, CombatController combatController, GatheringController gatheringController, ILogger logger, QuestRegistry questRegistry, IKeyState keyState, IChatGui chatGui, ICondition condition, IToastGui toastGui, Configuration configuration, TaskCreator taskCreator, IServiceProvider serviceProvider, InterruptHandler interruptHandler, IDataManager dataManager, SinglePlayerDutyConfigComponent singlePlayerDutyConfigComponent) + public QuestController(IClientState clientState, IObjectTable objectTable, GameFunctions gameFunctions, QuestFunctions questFunctions, MovementController movementController, CombatController combatController, GatheringController gatheringController, ILogger logger, QuestRegistry questRegistry, IKeyState keyState, IChatGui chatGui, ICondition condition, IToastGui toastGui, Configuration configuration, TaskCreator taskCreator, IServiceProvider serviceProvider, InterruptHandler interruptHandler, IDataManager dataManager, SinglePlayerDutyConfigComponent singlePlayerDutyConfigComponent) : base(chatGui, condition, serviceProvider, interruptHandler, dataManager, logger) { _clientState = clientState; + _objectTable = objectTable; _gameFunctions = gameFunctions; _questFunctions = questFunctions; _movementController = movementController; @@ -425,12 +429,12 @@ internal sealed class QuestController : MiniTaskController _lastProgressUpdate = DateTime.Now; return; } - IPlayerCharacter localPlayer = _clientState.LocalPlayer; - if (localPlayer == null) + IGameObject gameObject = _objectTable[0]; + if (gameObject == null) { return; } - Vector3 position = localPlayer.Position; + Vector3 position = gameObject.Position; if (CurrentQuest == null) { return; @@ -463,7 +467,7 @@ internal sealed class QuestController : MiniTaskController { if (_configuration.General.AutoStepRefreshEnabled && AutomationType == EAutomationType.Automatic && IsRunning && CurrentQuest != null && _clientState.IsLoggedIn) { - return _clientState.LocalPlayer != null; + return _objectTable[0] != null; } return false; } @@ -651,9 +655,9 @@ internal sealed class QuestController : MiniTaskController { _logger.LogInformation("New quest: {QuestName}", quest.Info.Name); _startedQuest = new QuestProgress(quest, b); - if (_clientState.LocalPlayer != null && _clientState.LocalPlayer.Level < quest.Info.Level) + if (_objectTable[0] is IPlayerCharacter playerCharacter && playerCharacter.Level < quest.Info.Level) { - _logger.LogInformation("Stopping automation, player level ({PlayerLevel}) < quest level ({QuestLevel}", _clientState.LocalPlayer.Level, quest.Info.Level); + _logger.LogInformation("Stopping automation, player level ({PlayerLevel}) < quest level ({QuestLevel}", playerCharacter.Level, quest.Info.Level); Stop("Quest level too high"); return; } diff --git a/Questionable/Questionable.Data/ChangelogData.cs b/Questionable/Questionable.Data/ChangelogData.cs index 52d9248..7ff0c7f 100644 --- a/Questionable/Questionable.Data/ChangelogData.cs +++ b/Questionable/Questionable.Data/ChangelogData.cs @@ -11,42 +11,48 @@ internal static class ChangelogData static ChangelogData() { - int num = 42; + int num = 43; List list = new List(num); CollectionsMarshal.SetCount(list, num); Span span = CollectionsMarshal.AsSpan(list); int num2 = 0; ref ChangelogEntry reference = ref span[num2]; - DateOnly releaseDate = new DateOnly(2025, 11, 25); + DateOnly releaseDate = new DateOnly(2025, 11, 29); int num3 = 2; List list2 = new List(num3); CollectionsMarshal.SetCount(list2, num3); Span span2 = CollectionsMarshal.AsSpan(list2); int num4 = 0; ref ChangeEntry reference2 = ref span2[num4]; - int num5 = 2; + int num5 = 3; List list3 = new List(num5); CollectionsMarshal.SetCount(list3, num5); Span span3 = CollectionsMarshal.AsSpan(list3); int num6 = 0; - span3[num6] = "Added individual sequence stop condition for each quest"; + span3[num6] = "Movement update with automatic retrying if character can't reach target position"; num6++; - span3[num6] = "Added Trials to Duties tab in config"; - reference2 = new ChangeEntry(EChangeCategory.Added, "Major features", list3); + span3[num6] = "Added Hunt mob data"; + num6++; + span3[num6] = "Refactored commands"; + reference2 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list3); num4++; ref ChangeEntry reference3 = ref span2[num4]; - num6 = 1; + num6 = 3; List list4 = new List(num6); CollectionsMarshal.SetCount(list4, num6); span3 = CollectionsMarshal.AsSpan(list4); num5 = 0; - span3[num5] = "Added IPC for stop conditions: GetQuestSequenceStopCondition, SetQuestSequenceStopCondition, RemoveQuestSequenceStopCondition, GetAllQuestSequenceStopConditions"; - reference3 = new ChangeEntry(EChangeCategory.Added, "IPC changes", list4); - reference = new ChangelogEntry("7.38.7", releaseDate, list2); + span3[num5] = "Fixed quest (Way of the Archer)"; + num5++; + span3[num5] = "Fixed quest (Spirithold Broken)"; + num5++; + span3[num5] = "Fixed quest (It's Probably Not Pirates)"; + reference3 = new ChangeEntry(EChangeCategory.Fixed, "Bug fixes", list4); + reference = new ChangelogEntry("7.38.8", releaseDate, list2); num2++; ref ChangelogEntry reference4 = ref span[num2]; DateOnly releaseDate2 = new DateOnly(2025, 11, 25); - num4 = 3; + num4 = 2; List list5 = new List(num4); CollectionsMarshal.SetCount(list5, num4); span2 = CollectionsMarshal.AsSpan(list5); @@ -57,10 +63,10 @@ internal static class ChangelogData CollectionsMarshal.SetCount(list6, num5); span3 = CollectionsMarshal.AsSpan(list6); num6 = 0; - span3[num6] = "Updated Allied Society journal text"; + span3[num6] = "Added individual sequence stop condition for each quest"; num6++; - span3[num6] = "Improved Allied Society rank handling"; - reference5 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list6); + span3[num6] = "Added Trials to Duties tab in config"; + reference5 = new ChangeEntry(EChangeCategory.Added, "Major features", list6); num3++; ref ChangeEntry reference6 = ref span2[num3]; num6 = 1; @@ -68,34 +74,36 @@ internal static class ChangelogData CollectionsMarshal.SetCount(list7, num6); span3 = CollectionsMarshal.AsSpan(list7); num5 = 0; - span3[num5] = "Added IPC for Allied Society: AddAlliedSocietyOptimalQuests, GetAlliedSocietyOptimalQuests"; + span3[num5] = "Added IPC for stop conditions: GetQuestSequenceStopCondition, SetQuestSequenceStopCondition, RemoveQuestSequenceStopCondition, GetAllQuestSequenceStopConditions"; reference6 = new ChangeEntry(EChangeCategory.Added, "IPC changes", list7); - num3++; - ref ChangeEntry reference7 = ref span2[num3]; - num5 = 1; - List list8 = new List(num5); - CollectionsMarshal.SetCount(list8, num5); - span3 = CollectionsMarshal.AsSpan(list8); - num6 = 0; - span3[num6] = "Fixed quest (We Come in Peace)"; - reference7 = new ChangeEntry(EChangeCategory.Fixed, "Bug fixes", list8); - reference4 = new ChangelogEntry("7.38.6", releaseDate2, list5); + reference4 = new ChangelogEntry("7.38.7", releaseDate2, list5); num2++; - ref ChangelogEntry reference8 = ref span[num2]; - DateOnly releaseDate3 = new DateOnly(2025, 11, 24); - num3 = 2; - List list9 = new List(num3); - CollectionsMarshal.SetCount(list9, num3); - span2 = CollectionsMarshal.AsSpan(list9); + ref ChangelogEntry reference7 = ref span[num2]; + DateOnly releaseDate3 = new DateOnly(2025, 11, 25); + num3 = 3; + List list8 = new List(num3); + CollectionsMarshal.SetCount(list8, num3); + span2 = CollectionsMarshal.AsSpan(list8); num4 = 0; + ref ChangeEntry reference8 = ref span2[num4]; + num5 = 2; + List list9 = new List(num5); + CollectionsMarshal.SetCount(list9, num5); + span3 = CollectionsMarshal.AsSpan(list9); + num6 = 0; + span3[num6] = "Updated Allied Society journal text"; + num6++; + span3[num6] = "Improved Allied Society rank handling"; + reference8 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list9); + num4++; ref ChangeEntry reference9 = ref span2[num4]; num6 = 1; List list10 = new List(num6); CollectionsMarshal.SetCount(list10, num6); span3 = CollectionsMarshal.AsSpan(list10); num5 = 0; - span3[num5] = "Added Allied Society daily allowance tracker with bulk quest adding buttons"; - reference9 = new ChangeEntry(EChangeCategory.Added, "Major features", list10); + span3[num5] = "Added IPC for Allied Society: AddAlliedSocietyOptimalQuests, GetAlliedSocietyOptimalQuests"; + reference9 = new ChangeEntry(EChangeCategory.Added, "IPC changes", list10); num4++; ref ChangeEntry reference10 = ref span2[num4]; num5 = 1; @@ -103,12 +111,12 @@ internal static class ChangelogData CollectionsMarshal.SetCount(list11, num5); span3 = CollectionsMarshal.AsSpan(list11); num6 = 0; - span3[num6] = "Added IPC for Allied Society: GetRemainingAllowances, GetTimeUntilReset, GetAvailableQuestIds, GetAllAvailableQuestCounts, IsMaxRank, GetCurrentRank, GetSocietiesWithAvailableQuests"; - reference10 = new ChangeEntry(EChangeCategory.Added, "IPC changes", list11); - reference8 = new ChangelogEntry("7.38.5", releaseDate3, list9); + span3[num6] = "Fixed quest (We Come in Peace)"; + reference10 = new ChangeEntry(EChangeCategory.Fixed, "Bug fixes", list11); + reference7 = new ChangelogEntry("7.38.6", releaseDate3, list8); num2++; ref ChangelogEntry reference11 = ref span[num2]; - DateOnly releaseDate4 = new DateOnly(2025, 11, 23); + DateOnly releaseDate4 = new DateOnly(2025, 11, 24); num4 = 2; List list12 = new List(num4); CollectionsMarshal.SetCount(list12, num4); @@ -120,15 +128,41 @@ internal static class ChangelogData CollectionsMarshal.SetCount(list13, num6); span3 = CollectionsMarshal.AsSpan(list13); num5 = 0; - span3[num5] = "Explicitly declare support for BMR singleplayer duty (The Rematch)"; - reference12 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list13); + span3[num5] = "Added Allied Society daily allowance tracker with bulk quest adding buttons"; + reference12 = new ChangeEntry(EChangeCategory.Added, "Major features", list13); num3++; ref ChangeEntry reference13 = ref span2[num3]; - num5 = 8; + num5 = 1; List list14 = new List(num5); CollectionsMarshal.SetCount(list14, num5); span3 = CollectionsMarshal.AsSpan(list14); num6 = 0; + span3[num6] = "Added IPC for Allied Society: GetRemainingAllowances, GetTimeUntilReset, GetAvailableQuestIds, GetAllAvailableQuestCounts, IsMaxRank, GetCurrentRank, GetSocietiesWithAvailableQuests"; + reference13 = new ChangeEntry(EChangeCategory.Added, "IPC changes", list14); + reference11 = new ChangelogEntry("7.38.5", releaseDate4, list12); + num2++; + ref ChangelogEntry reference14 = ref span[num2]; + DateOnly releaseDate5 = new DateOnly(2025, 11, 23); + num3 = 2; + List list15 = new List(num3); + CollectionsMarshal.SetCount(list15, num3); + span2 = CollectionsMarshal.AsSpan(list15); + num4 = 0; + ref ChangeEntry reference15 = ref span2[num4]; + num6 = 1; + List list16 = new List(num6); + CollectionsMarshal.SetCount(list16, num6); + span3 = CollectionsMarshal.AsSpan(list16); + num5 = 0; + span3[num5] = "Explicitly declare support for BMR singleplayer duty (The Rematch)"; + reference15 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list16); + num4++; + ref ChangeEntry reference16 = ref span2[num4]; + num5 = 8; + List list17 = new List(num5); + CollectionsMarshal.SetCount(list17, num5); + span3 = CollectionsMarshal.AsSpan(list17); + num6 = 0; span3[num6] = "Fixed quest (Microbrewing) to not get stuck near ramp"; num6++; span3[num6] = "Fixed quest (The Illuminated Land) where pathing would kill the player due to fall damage"; @@ -144,69 +178,37 @@ internal static class ChangelogData span3[num6] = "Fixed quest (Poisoned Hearts) where incorrect pathing caused the player to die"; num6++; span3[num6] = "Fixed quests (Savage Snares) and (An Apple a Day) not detecting kills"; - reference13 = new ChangeEntry(EChangeCategory.Fixed, "Bug fixes", list14); - reference11 = new ChangelogEntry("7.38.4", releaseDate4, list12); + reference16 = new ChangeEntry(EChangeCategory.Fixed, "Bug fixes", list17); + reference14 = new ChangelogEntry("7.38.4", releaseDate5, list15); num2++; - ref ChangelogEntry reference14 = ref span[num2]; - DateOnly releaseDate5 = new DateOnly(2025, 11, 23); - num3 = 3; - List list15 = new List(num3); - CollectionsMarshal.SetCount(list15, num3); - span2 = CollectionsMarshal.AsSpan(list15); - num4 = 0; - ref ChangeEntry reference15 = ref span2[num4]; + ref ChangelogEntry reference17 = ref span[num2]; + DateOnly releaseDate6 = new DateOnly(2025, 11, 23); + num4 = 3; + List list18 = new List(num4); + CollectionsMarshal.SetCount(list18, num4); + span2 = CollectionsMarshal.AsSpan(list18); + num3 = 0; + ref ChangeEntry reference18 = ref span2[num3]; num6 = 2; - List list16 = new List(num6); - CollectionsMarshal.SetCount(list16, num6); - span3 = CollectionsMarshal.AsSpan(list16); + List list19 = new List(num6); + CollectionsMarshal.SetCount(list19, num6); + span3 = CollectionsMarshal.AsSpan(list19); num5 = 0; span3[num5] = "Added RequireHq to crafting InteractionType"; num5++; span3[num5] = "Mark GC quests as Locked if rank not achieved"; - reference15 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list16); - num4++; - ref ChangeEntry reference16 = ref span2[num4]; - num5 = 2; - List list17 = new List(num5); - CollectionsMarshal.SetCount(list17, num5); - span3 = CollectionsMarshal.AsSpan(list17); - num6 = 0; - span3[num6] = "Added IPC for stop conditions: GetStopConditionsEnabled, SetStopConditionsEnabled, GetStopQuestList, AddStopQuest, RemoveStopQuest, ClearStopQuests, GetLevelStopCondition, SetLevelStopCondition, GetSequenceStopCondition, SetSequenceStopCondition"; - num6++; - span3[num6] = "Added IPC for priority quests: GetPriorityQuests, RemovePriorityQuest, ReorderPriorityQuest, GetAvailablePresets, GetPresetQuests, AddPresetToPriority, IsPresetAvailable, IsQuestInPriority, GetQuestPriorityIndex, HasAvailablePriorityQuests"; - reference16 = new ChangeEntry(EChangeCategory.Added, "IPC changes", list17); - num4++; - ref ChangeEntry reference17 = ref span2[num4]; - num6 = 3; - List list18 = new List(num6); - CollectionsMarshal.SetCount(list18, num6); - span3 = CollectionsMarshal.AsSpan(list18); - num5 = 0; - span3[num5] = "Fixed line breaks not working in dialog strings"; - num5++; - span3[num5] = "Fixed quest (Labor of Love)"; - num5++; - span3[num5] = "Fixed quest (Sea of Sorrow)"; - reference17 = new ChangeEntry(EChangeCategory.Fixed, "Bug fixes", list18); - reference14 = new ChangelogEntry("7.38.3", releaseDate5, list15); - num2++; - ref ChangelogEntry reference18 = ref span[num2]; - DateOnly releaseDate6 = new DateOnly(2025, 11, 18); - num4 = 3; - List list19 = new List(num4); - CollectionsMarshal.SetCount(list19, num4); - span2 = CollectionsMarshal.AsSpan(list19); - num3 = 0; + reference18 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list19); + num3++; ref ChangeEntry reference19 = ref span2[num3]; num5 = 2; List list20 = new List(num5); CollectionsMarshal.SetCount(list20, num5); span3 = CollectionsMarshal.AsSpan(list20); num6 = 0; - span3[num6] = "Auto Duty unsync options for each duty (Duty Support, Unsync Solo, Unsync Party)"; + span3[num6] = "Added IPC for stop conditions: GetStopConditionsEnabled, SetStopConditionsEnabled, GetStopQuestList, AddStopQuest, RemoveStopQuest, ClearStopQuests, GetLevelStopCondition, SetLevelStopCondition, GetSequenceStopCondition, SetSequenceStopCondition"; num6++; - span3[num6] = "Added Auto Duty unsync options to quest schema and updated quests using old unsync method"; - reference19 = new ChangeEntry(EChangeCategory.Added, "Major features", list20); + span3[num6] = "Added IPC for priority quests: GetPriorityQuests, RemovePriorityQuest, ReorderPriorityQuest, GetAvailablePresets, GetPresetQuests, AddPresetToPriority, IsPresetAvailable, IsQuestInPriority, GetQuestPriorityIndex, HasAvailablePriorityQuests"; + reference19 = new ChangeEntry(EChangeCategory.Added, "IPC changes", list20); num3++; ref ChangeEntry reference20 = ref span2[num3]; num6 = 3; @@ -214,15 +216,13 @@ internal static class ChangelogData CollectionsMarshal.SetCount(list21, num6); span3 = CollectionsMarshal.AsSpan(list21); num5 = 0; - span3[num5] = "Added IPC for duty sync handling: GetDefaultDutyMode, SetDefaultDutyMode"; + span3[num5] = "Fixed line breaks not working in dialog strings"; num5++; - span3[num5] = "Added IPC for duty mode overrides: GetDutyModeOverride, SetDutyModeOverride"; + span3[num5] = "Fixed quest (Labor of Love)"; num5++; - span3[num5] = "Added IPC for clearing overrides: ClearDutyModeOverride, ClearAllDutyModeOverrides"; - reference20 = new ChangeEntry(EChangeCategory.Added, "IPC changes", list21); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed quest (Constant Cravings)"); - reference18 = new ChangelogEntry("7.38.2", releaseDate6, list19); + span3[num5] = "Fixed quest (Sea of Sorrow)"; + reference20 = new ChangeEntry(EChangeCategory.Fixed, "Bug fixes", list21); + reference17 = new ChangelogEntry("7.38.3", releaseDate6, list18); num2++; ref ChangelogEntry reference21 = ref span[num2]; DateOnly releaseDate7 = new DateOnly(2025, 11, 18); @@ -232,13 +232,15 @@ internal static class ChangelogData span2 = CollectionsMarshal.AsSpan(list22); num4 = 0; ref ChangeEntry reference22 = ref span2[num4]; - num5 = 1; + num5 = 2; List list23 = new List(num5); CollectionsMarshal.SetCount(list23, num5); span3 = CollectionsMarshal.AsSpan(list23); num6 = 0; - span3[num6] = "Added new fields to quest schema"; - reference22 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list23); + span3[num6] = "Auto Duty unsync options for each duty (Duty Support, Unsync Solo, Unsync Party)"; + num6++; + span3[num6] = "Added Auto Duty unsync options to quest schema and updated quests using old unsync method"; + reference22 = new ChangeEntry(EChangeCategory.Added, "Major features", list23); num4++; ref ChangeEntry reference23 = ref span2[num4]; num6 = 3; @@ -246,390 +248,422 @@ internal static class ChangelogData CollectionsMarshal.SetCount(list24, num6); span3 = CollectionsMarshal.AsSpan(list24); num5 = 0; + span3[num5] = "Added IPC for duty sync handling: GetDefaultDutyMode, SetDefaultDutyMode"; + num5++; + span3[num5] = "Added IPC for duty mode overrides: GetDutyModeOverride, SetDutyModeOverride"; + num5++; + span3[num5] = "Added IPC for clearing overrides: ClearDutyModeOverride, ClearAllDutyModeOverrides"; + reference23 = new ChangeEntry(EChangeCategory.Added, "IPC changes", list24); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed quest (Constant Cravings)"); + reference21 = new ChangelogEntry("7.38.2", releaseDate7, list22); + num2++; + ref ChangelogEntry reference24 = ref span[num2]; + DateOnly releaseDate8 = new DateOnly(2025, 11, 18); + num4 = 3; + List list25 = new List(num4); + CollectionsMarshal.SetCount(list25, num4); + span2 = CollectionsMarshal.AsSpan(list25); + num3 = 0; + ref ChangeEntry reference25 = ref span2[num3]; + num5 = 1; + List list26 = new List(num5); + CollectionsMarshal.SetCount(list26, num5); + span3 = CollectionsMarshal.AsSpan(list26); + num6 = 0; + span3[num6] = "Added new fields to quest schema"; + reference25 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list26); + num3++; + ref ChangeEntry reference26 = ref span2[num3]; + num6 = 3; + List list27 = new List(num6); + CollectionsMarshal.SetCount(list27, num6); + span3 = CollectionsMarshal.AsSpan(list27); + num5 = 0; span3[num5] = "A Faerie Tale Come True"; num5++; span3[num5] = "Constant Cravings"; num5++; span3[num5] = "A Bridge Too Full"; - reference23 = new ChangeEntry(EChangeCategory.QuestUpdates, "Added new quest paths", list24); - num4++; - ref ChangeEntry reference24 = ref span2[num4]; + reference26 = new ChangeEntry(EChangeCategory.QuestUpdates, "Added new quest paths", list27); + num3++; + ref ChangeEntry reference27 = ref span2[num3]; num5 = 3; - List list25 = new List(num5); - CollectionsMarshal.SetCount(list25, num5); - span3 = CollectionsMarshal.AsSpan(list25); + List list28 = new List(num5); + CollectionsMarshal.SetCount(list28, num5); + span3 = CollectionsMarshal.AsSpan(list28); num6 = 0; span3[num6] = "Fixed various quest schemas"; num6++; span3[num6] = "Fixed changelog bullet point encoding"; num6++; span3[num6] = "Fixed item use to wait until item is used before next action"; - reference24 = new ChangeEntry(EChangeCategory.Fixed, "Bug fixes", list25); - reference21 = new ChangelogEntry("7.38.1", releaseDate7, list22); + reference27 = new ChangeEntry(EChangeCategory.Fixed, "Bug fixes", list28); + reference24 = new ChangelogEntry("7.38.1", releaseDate8, list25); num2++; - ref ChangelogEntry reference25 = ref span[num2]; - DateOnly releaseDate8 = new DateOnly(2025, 11, 17); - num4 = 5; - List list26 = new List(num4); - CollectionsMarshal.SetCount(list26, num4); - span2 = CollectionsMarshal.AsSpan(list26); - num3 = 0; - ref ChangeEntry reference26 = ref span2[num3]; + ref ChangelogEntry reference28 = ref span[num2]; + DateOnly releaseDate9 = new DateOnly(2025, 11, 17); + num3 = 5; + List list29 = new List(num3); + CollectionsMarshal.SetCount(list29, num3); + span2 = CollectionsMarshal.AsSpan(list29); + num4 = 0; + ref ChangeEntry reference29 = ref span2[num4]; num6 = 2; - List list27 = new List(num6); - CollectionsMarshal.SetCount(list27, num6); - span3 = CollectionsMarshal.AsSpan(list27); + List list30 = new List(num6); + CollectionsMarshal.SetCount(list30, num6); + span3 = CollectionsMarshal.AsSpan(list30); num5 = 0; span3[num5] = "Quest sequence window to show expected sequences in each quest (with quest searching)"; num5++; span3[num5] = "Changelog"; - reference26 = new ChangeEntry(EChangeCategory.Added, "Major features", list27); - num3++; - ref ChangeEntry reference27 = ref span2[num3]; + reference29 = new ChangeEntry(EChangeCategory.Added, "Major features", list30); + num4++; + ref ChangeEntry reference30 = ref span2[num4]; num5 = 2; - List list28 = new List(num5); - CollectionsMarshal.SetCount(list28, num5); - span3 = CollectionsMarshal.AsSpan(list28); + List list31 = new List(num5); + CollectionsMarshal.SetCount(list31, num5); + span3 = CollectionsMarshal.AsSpan(list31); num6 = 0; span3[num6] = "Updated quest schemas"; num6++; span3[num6] = "Added search bar to preferred mounts and capitalization to mirror game mount names"; - reference27 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list28); - num3++; - ref ChangeEntry reference28 = ref span2[num3]; + reference30 = new ChangeEntry(EChangeCategory.Changed, "Improvements", list31); + num4++; + ref ChangeEntry reference31 = ref span2[num4]; num6 = 3; - List list29 = new List(num6); - CollectionsMarshal.SetCount(list29, num6); - span3 = CollectionsMarshal.AsSpan(list29); + List list32 = new List(num6); + CollectionsMarshal.SetCount(list32, num6); + span3 = CollectionsMarshal.AsSpan(list32); num5 = 0; span3[num5] = "Renamed IsQuestCompleted → IsQuestComplete"; num5++; span3[num5] = "Renamed IsQuestAvailable → IsReadyToAcceptQuest"; num5++; span3[num5] = "Added GetCurrentTask IPC"; - reference28 = new ChangeEntry(EChangeCategory.Changed, "IPC changes", list29); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added all Hildibrand quests"); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed credits/cutscenes playback"); - reference25 = new ChangelogEntry("7.38.0", releaseDate8, list26); - num2++; - ref ChangelogEntry reference29 = ref span[num2]; - DateOnly releaseDate9 = new DateOnly(2025, 11, 8); - num3 = 1; - List list30 = new List(num3); - CollectionsMarshal.SetCount(list30, num3); - span2 = CollectionsMarshal.AsSpan(list30); - num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added Fall Guys quest (Just Crowning Around)"); - reference29 = new ChangelogEntry("6.38", releaseDate9, list30); - num2++; - ref ChangelogEntry reference30 = ref span[num2]; - DateOnly releaseDate10 = new DateOnly(2025, 11, 8); - num4 = 1; - List list31 = new List(num4); - CollectionsMarshal.SetCount(list31, num4); - span2 = CollectionsMarshal.AsSpan(list31); - num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added Cosmic Exploration and various unlock quests"); - reference30 = new ChangelogEntry("6.37", releaseDate10, list31); - num2++; - ref ChangelogEntry reference31 = ref span[num2]; - DateOnly releaseDate11 = new DateOnly(2025, 11, 2); - num3 = 1; - List list32 = new List(num3); - CollectionsMarshal.SetCount(list32, num3); - span2 = CollectionsMarshal.AsSpan(list32); - num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy Rank 6 quest (With High Spirits)"); - reference31 = new ChangelogEntry("6.36", releaseDate11, list32); + reference31 = new ChangeEntry(EChangeCategory.Changed, "IPC changes", list32); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added all Hildibrand quests"); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed credits/cutscenes playback"); + reference28 = new ChangelogEntry("7.38.0", releaseDate9, list29); num2++; ref ChangelogEntry reference32 = ref span[num2]; - DateOnly releaseDate12 = new DateOnly(2025, 10, 28); + DateOnly releaseDate10 = new DateOnly(2025, 11, 8); num4 = 1; List list33 = new List(num4); CollectionsMarshal.SetCount(list33, num4); span2 = CollectionsMarshal.AsSpan(list33); num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed level 3 MSQ handling if character started on non-XP buff world"); - reference32 = new ChangelogEntry("6.35", releaseDate12, list33); + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added Fall Guys quest (Just Crowning Around)"); + reference32 = new ChangelogEntry("6.38", releaseDate10, list33); num2++; ref ChangelogEntry reference33 = ref span[num2]; - DateOnly releaseDate13 = new DateOnly(2025, 10, 23); - num3 = 2; + DateOnly releaseDate11 = new DateOnly(2025, 11, 8); + num3 = 1; List list34 = new List(num3); CollectionsMarshal.SetCount(list34, num3); span2 = CollectionsMarshal.AsSpan(list34); num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.Added, "Added clear priority quests on logout and on completion config settings"); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed priority quest importing to respect import order"); - reference33 = new ChangelogEntry("6.34", releaseDate13, list34); + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added Cosmic Exploration and various unlock quests"); + reference33 = new ChangelogEntry("6.37", releaseDate11, list34); num2++; ref ChangelogEntry reference34 = ref span[num2]; - DateOnly releaseDate14 = new DateOnly(2025, 10, 23); + DateOnly releaseDate12 = new DateOnly(2025, 11, 2); num4 = 1; List list35 = new List(num4); CollectionsMarshal.SetCount(list35, num4); span2 = CollectionsMarshal.AsSpan(list35); num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed RSR combat module"); - reference34 = new ChangelogEntry("6.33", releaseDate14, list35); + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy Rank 6 quest (With High Spirits)"); + reference34 = new ChangelogEntry("6.36", releaseDate12, list35); num2++; ref ChangelogEntry reference35 = ref span[num2]; - DateOnly releaseDate15 = new DateOnly(2025, 10, 23); + DateOnly releaseDate13 = new DateOnly(2025, 10, 28); num3 = 1; List list36 = new List(num3); CollectionsMarshal.SetCount(list36, num3); span2 = CollectionsMarshal.AsSpan(list36); num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy Rank 5 quest (Forged in Corn)"); - reference35 = new ChangelogEntry("6.32", releaseDate15, list36); + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed level 3 MSQ handling if character started on non-XP buff world"); + reference35 = new ChangelogEntry("6.35", releaseDate13, list36); num2++; ref ChangelogEntry reference36 = ref span[num2]; - DateOnly releaseDate16 = new DateOnly(2025, 10, 21); - num4 = 1; + DateOnly releaseDate14 = new DateOnly(2025, 10, 23); + num4 = 2; List list37 = new List(num4); CollectionsMarshal.SetCount(list37, num4); span2 = CollectionsMarshal.AsSpan(list37); num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Added checks for moogle and allied society quests when using add all available quests"); - reference36 = new ChangelogEntry("6.31", releaseDate16, list37); + span2[num3] = new ChangeEntry(EChangeCategory.Added, "Added clear priority quests on logout and on completion config settings"); + num3++; + span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed priority quest importing to respect import order"); + reference36 = new ChangelogEntry("6.34", releaseDate14, list37); num2++; ref ChangelogEntry reference37 = ref span[num2]; - DateOnly releaseDate17 = new DateOnly(2025, 10, 21); + DateOnly releaseDate15 = new DateOnly(2025, 10, 23); num3 = 1; List list38 = new List(num3); CollectionsMarshal.SetCount(list38, num3); span2 = CollectionsMarshal.AsSpan(list38); num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.Added, "Added button to journal that allows adding all available quests to priority"); - reference37 = new ChangelogEntry("6.30", releaseDate17, list38); + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed RSR combat module"); + reference37 = new ChangelogEntry("6.33", releaseDate15, list38); num2++; ref ChangelogEntry reference38 = ref span[num2]; - DateOnly releaseDate18 = new DateOnly(2025, 10, 20); - num4 = 2; + DateOnly releaseDate16 = new DateOnly(2025, 10, 23); + num4 = 1; List list39 = new List(num4); CollectionsMarshal.SetCount(list39, num4); span2 = CollectionsMarshal.AsSpan(list39); num3 = 0; - ref ChangeEntry reference39 = ref span2[num3]; + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy Rank 5 quest (Forged in Corn)"); + reference38 = new ChangelogEntry("6.32", releaseDate16, list39); + num2++; + ref ChangelogEntry reference39 = ref span[num2]; + DateOnly releaseDate17 = new DateOnly(2025, 10, 21); + num3 = 1; + List list40 = new List(num3); + CollectionsMarshal.SetCount(list40, num3); + span2 = CollectionsMarshal.AsSpan(list40); + num4 = 0; + span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Added checks for moogle and allied society quests when using add all available quests"); + reference39 = new ChangelogEntry("6.31", releaseDate17, list40); + num2++; + ref ChangelogEntry reference40 = ref span[num2]; + DateOnly releaseDate18 = new DateOnly(2025, 10, 21); + num4 = 1; + List list41 = new List(num4); + CollectionsMarshal.SetCount(list41, num4); + span2 = CollectionsMarshal.AsSpan(list41); + num3 = 0; + span2[num3] = new ChangeEntry(EChangeCategory.Added, "Added button to journal that allows adding all available quests to priority"); + reference40 = new ChangelogEntry("6.30", releaseDate18, list41); + num2++; + ref ChangelogEntry reference41 = ref span[num2]; + DateOnly releaseDate19 = new DateOnly(2025, 10, 20); + num3 = 2; + List list42 = new List(num3); + CollectionsMarshal.SetCount(list42, num3); + span2 = CollectionsMarshal.AsSpan(list42); + num4 = 0; + ref ChangeEntry reference42 = ref span2[num4]; num5 = 2; - List list40 = new List(num5); - CollectionsMarshal.SetCount(list40, num5); - span3 = CollectionsMarshal.AsSpan(list40); + List list43 = new List(num5); + CollectionsMarshal.SetCount(list43, num5); + span3 = CollectionsMarshal.AsSpan(list43); num6 = 0; span3[num6] = "Added item count to combat handling rework"; num6++; span3[num6] = "Updated Pandora conflicting features"; - reference39 = new ChangeEntry(EChangeCategory.Changed, "Combat handling improvements", list40); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed quest to purchase Gysahl Greens if not in inventory"); - reference38 = new ChangelogEntry("6.29", releaseDate18, list39); - num2++; - ref ChangelogEntry reference40 = ref span[num2]; - DateOnly releaseDate19 = new DateOnly(2025, 10, 19); - num3 = 1; - List list41 = new List(num3); - CollectionsMarshal.SetCount(list41, num3); - span2 = CollectionsMarshal.AsSpan(list41); - num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Reworked kill count combat handling - combat and enemy kills are now processed instantly"); - reference40 = new ChangelogEntry("6.28", releaseDate19, list41); - num2++; - ref ChangelogEntry reference41 = ref span[num2]; - DateOnly releaseDate20 = new DateOnly(2025, 10, 18); - num4 = 2; - List list42 = new List(num4); - CollectionsMarshal.SetCount(list42, num4); - span2 = CollectionsMarshal.AsSpan(list42); - num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Improved Aether Current checking logic"); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed Chocobo Taxi Stand CheckSkip error and Patch 7.3 Fantasia unlock quest date/time"); - reference41 = new ChangelogEntry("6.27", releaseDate20, list42); - num2++; - ref ChangelogEntry reference42 = ref span[num2]; - DateOnly releaseDate21 = new DateOnly(2025, 10, 18); - num3 = 1; - List list43 = new List(num3); - CollectionsMarshal.SetCount(list43, num3); - span2 = CollectionsMarshal.AsSpan(list43); - num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 4 quests"); - reference42 = new ChangelogEntry("6.26", releaseDate21, list43); + reference42 = new ChangeEntry(EChangeCategory.Changed, "Combat handling improvements", list43); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed quest to purchase Gysahl Greens if not in inventory"); + reference41 = new ChangelogEntry("6.29", releaseDate19, list42); num2++; ref ChangelogEntry reference43 = ref span[num2]; - DateOnly releaseDate22 = new DateOnly(2025, 10, 17); + DateOnly releaseDate20 = new DateOnly(2025, 10, 19); num4 = 1; List list44 = new List(num4); CollectionsMarshal.SetCount(list44, num4); span2 = CollectionsMarshal.AsSpan(list44); num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added All Saints' Wake 2025 quests and 7.35 Yok Huy rank 4 quests"); - reference43 = new ChangelogEntry("6.25", releaseDate22, list44); + span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Reworked kill count combat handling - combat and enemy kills are now processed instantly"); + reference43 = new ChangelogEntry("6.28", releaseDate20, list44); num2++; ref ChangelogEntry reference44 = ref span[num2]; - DateOnly releaseDate23 = new DateOnly(2025, 10, 16); - num3 = 1; + DateOnly releaseDate21 = new DateOnly(2025, 10, 18); + num3 = 2; List list45 = new List(num3); CollectionsMarshal.SetCount(list45, num3); span2 = CollectionsMarshal.AsSpan(list45); num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 4 quests and Deep Dungeon quest"); - reference44 = new ChangelogEntry("6.24", releaseDate23, list45); + span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Improved Aether Current checking logic"); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed Chocobo Taxi Stand CheckSkip error and Patch 7.3 Fantasia unlock quest date/time"); + reference44 = new ChangelogEntry("6.27", releaseDate21, list45); num2++; ref ChangelogEntry reference45 = ref span[num2]; - DateOnly releaseDate24 = new DateOnly(2025, 10, 13); + DateOnly releaseDate22 = new DateOnly(2025, 10, 18); num4 = 1; List list46 = new List(num4); CollectionsMarshal.SetCount(list46, num4); span2 = CollectionsMarshal.AsSpan(list46); num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 3 quest (Larder Logistics)"); - reference45 = new ChangelogEntry("6.23", releaseDate24, list46); + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 4 quests"); + reference45 = new ChangelogEntry("6.26", releaseDate22, list46); num2++; ref ChangelogEntry reference46 = ref span[num2]; - DateOnly releaseDate25 = new DateOnly(2025, 10, 12); - num3 = 3; + DateOnly releaseDate23 = new DateOnly(2025, 10, 17); + num3 = 1; List list47 = new List(num3); CollectionsMarshal.SetCount(list47, num3); span2 = CollectionsMarshal.AsSpan(list47); num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Prevent disabled or Locked quests from being started as 'Start as next quest'"); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 3 quests"); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed Yok Huy quest and journal quest chain priority issues"); - reference46 = new ChangelogEntry("6.22", releaseDate25, list47); + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added All Saints' Wake 2025 quests and 7.35 Yok Huy rank 4 quests"); + reference46 = new ChangelogEntry("6.25", releaseDate23, list47); num2++; ref ChangelogEntry reference47 = ref span[num2]; - DateOnly releaseDate26 = new DateOnly(2025, 10, 12); - num4 = 2; + DateOnly releaseDate24 = new DateOnly(2025, 10, 16); + num4 = 1; List list48 = new List(num4); CollectionsMarshal.SetCount(list48, num4); span2 = CollectionsMarshal.AsSpan(list48); num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.Added, "Added expansion abbreviation to journal window"); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 3 quests"); - reference47 = new ChangelogEntry("6.21", releaseDate26, list48); + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 4 quests and Deep Dungeon quest"); + reference47 = new ChangelogEntry("6.24", releaseDate24, list48); num2++; ref ChangelogEntry reference48 = ref span[num2]; - DateOnly releaseDate27 = new DateOnly(2025, 10, 10); - num3 = 2; + DateOnly releaseDate25 = new DateOnly(2025, 10, 13); + num3 = 1; List list49 = new List(num3); CollectionsMarshal.SetCount(list49, num3); span2 = CollectionsMarshal.AsSpan(list49); num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Allow completed repeatable quests to be used with 'Add quest and requirements to priority' feature"); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 1 quest (A Work of Cart)"); - reference48 = new ChangelogEntry("6.20", releaseDate27, list49); + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 3 quest (Larder Logistics)"); + reference48 = new ChangelogEntry("6.23", releaseDate25, list49); num2++; ref ChangelogEntry reference49 = ref span[num2]; - DateOnly releaseDate28 = new DateOnly(2025, 10, 9); + DateOnly releaseDate26 = new DateOnly(2025, 10, 12); num4 = 3; List list50 = new List(num4); CollectionsMarshal.SetCount(list50, num4); span2 = CollectionsMarshal.AsSpan(list50); num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.Added, "Added config to batch Allied Society quest turn-ins"); + span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Prevent disabled or Locked quests from being started as 'Start as next quest'"); num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Repeatable quests now show correct availability state in journal"); + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 3 quests"); num3++; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 2 quests"); - reference49 = new ChangelogEntry("6.19", releaseDate28, list50); + span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed Yok Huy quest and journal quest chain priority issues"); + reference49 = new ChangelogEntry("6.22", releaseDate26, list50); num2++; ref ChangelogEntry reference50 = ref span[num2]; - DateOnly releaseDate29 = new DateOnly(2025, 10, 9); + DateOnly releaseDate27 = new DateOnly(2025, 10, 12); num3 = 2; List list51 = new List(num3); CollectionsMarshal.SetCount(list51, num3); span2 = CollectionsMarshal.AsSpan(list51); num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Show once completed quests with improved state display"); + span2[num4] = new ChangeEntry(EChangeCategory.Added, "Added expansion abbreviation to journal window"); num4++; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy daily quest and improvements to various Yok Huy quests"); - reference50 = new ChangelogEntry("6.18", releaseDate29, list51); + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 3 quests"); + reference50 = new ChangelogEntry("6.21", releaseDate27, list51); num2++; ref ChangelogEntry reference51 = ref span[num2]; - DateOnly releaseDate30 = new DateOnly(2025, 10, 8); - num4 = 1; + DateOnly releaseDate28 = new DateOnly(2025, 10, 10); + num4 = 2; List list52 = new List(num4); CollectionsMarshal.SetCount(list52, num4); span2 = CollectionsMarshal.AsSpan(list52); num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 1 and rank 2 quests"); - reference51 = new ChangelogEntry("6.17", releaseDate30, list52); + span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Allow completed repeatable quests to be used with 'Add quest and requirements to priority' feature"); + num3++; + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 1 quest (A Work of Cart)"); + reference51 = new ChangelogEntry("6.20", releaseDate28, list52); num2++; ref ChangelogEntry reference52 = ref span[num2]; - DateOnly releaseDate31 = new DateOnly(2025, 10, 8); - num3 = 1; + DateOnly releaseDate29 = new DateOnly(2025, 10, 9); + num3 = 3; List list53 = new List(num3); CollectionsMarshal.SetCount(list53, num3); span2 = CollectionsMarshal.AsSpan(list53); num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Deep Dungeon quest (Faerie Tale)"); - reference52 = new ChangelogEntry("6.16", releaseDate31, list53); + span2[num4] = new ChangeEntry(EChangeCategory.Added, "Added config to batch Allied Society quest turn-ins"); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Repeatable quests now show correct availability state in journal"); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 2 quests"); + reference52 = new ChangelogEntry("6.19", releaseDate29, list53); num2++; ref ChangelogEntry reference53 = ref span[num2]; - DateOnly releaseDate32 = new DateOnly(2025, 10, 8); + DateOnly releaseDate30 = new DateOnly(2025, 10, 9); num4 = 2; List list54 = new List(num4); CollectionsMarshal.SetCount(list54, num4); span2 = CollectionsMarshal.AsSpan(list54); num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Dalamud cleanup"); + span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Show once completed quests with improved state display"); num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed quest level requirement check log spam"); - reference53 = new ChangelogEntry("6.15", releaseDate32, list54); + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy daily quest and improvements to various Yok Huy quests"); + reference53 = new ChangelogEntry("6.18", releaseDate30, list54); num2++; ref ChangelogEntry reference54 = ref span[num2]; - DateOnly releaseDate33 = new DateOnly(2025, 10, 8); + DateOnly releaseDate31 = new DateOnly(2025, 10, 8); num3 = 1; List list55 = new List(num3); CollectionsMarshal.SetCount(list55, num3); span2 = CollectionsMarshal.AsSpan(list55); num4 = 0; - span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed abandoned quest check logic if quest were MSQ"); - reference54 = new ChangelogEntry("6.14", releaseDate33, list55); + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Yok Huy rank 1 and rank 2 quests"); + reference54 = new ChangelogEntry("6.17", releaseDate31, list55); num2++; ref ChangelogEntry reference55 = ref span[num2]; - DateOnly releaseDate34 = new DateOnly(2025, 10, 8); - num4 = 2; + DateOnly releaseDate32 = new DateOnly(2025, 10, 8); + num4 = 1; List list56 = new List(num4); CollectionsMarshal.SetCount(list56, num4); span2 = CollectionsMarshal.AsSpan(list56); num3 = 0; - ref ChangeEntry reference56 = ref span2[num3]; + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Deep Dungeon quest (Faerie Tale)"); + reference55 = new ChangelogEntry("6.16", releaseDate32, list56); + num2++; + ref ChangelogEntry reference56 = ref span[num2]; + DateOnly releaseDate33 = new DateOnly(2025, 10, 8); + num3 = 2; + List list57 = new List(num3); + CollectionsMarshal.SetCount(list57, num3); + span2 = CollectionsMarshal.AsSpan(list57); + num4 = 0; + span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Dalamud cleanup"); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed quest level requirement check log spam"); + reference56 = new ChangelogEntry("6.15", releaseDate33, list57); + num2++; + ref ChangelogEntry reference57 = ref span[num2]; + DateOnly releaseDate34 = new DateOnly(2025, 10, 8); + num4 = 1; + List list58 = new List(num4); + CollectionsMarshal.SetCount(list58, num4); + span2 = CollectionsMarshal.AsSpan(list58); + num3 = 0; + span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed abandoned quest check logic if quest were MSQ"); + reference57 = new ChangelogEntry("6.14", releaseDate34, list58); + num2++; + ref ChangelogEntry reference58 = ref span[num2]; + DateOnly releaseDate35 = new DateOnly(2025, 10, 8); + num3 = 2; + List list59 = new List(num3); + CollectionsMarshal.SetCount(list59, num3); + span2 = CollectionsMarshal.AsSpan(list59); + num4 = 0; + ref ChangeEntry reference59 = ref span2[num4]; num6 = 3; - List list57 = new List(num6); - CollectionsMarshal.SetCount(list57, num6); - span3 = CollectionsMarshal.AsSpan(list57); + List list60 = new List(num6); + CollectionsMarshal.SetCount(list60, num6); + span3 = CollectionsMarshal.AsSpan(list60); num5 = 0; span3[num5] = "Context menu option to add required quests and their chain to priority list"; num5++; span3[num5] = "AetheryteShortcut to multiple quests"; num5++; span3[num5] = "Artisan as a recommended plugin/dependency"; - reference56 = new ChangeEntry(EChangeCategory.Added, "Quest improvements", list57); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed abandoned quest check and priority list issues"); - reference55 = new ChangelogEntry("6.13", releaseDate34, list56); + reference59 = new ChangeEntry(EChangeCategory.Added, "Quest improvements", list60); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed abandoned quest check and priority list issues"); + reference58 = new ChangelogEntry("6.13", releaseDate35, list59); num2++; - ref ChangelogEntry reference57 = ref span[num2]; - DateOnly releaseDate35 = new DateOnly(2025, 10, 7); - num3 = 4; - List list58 = new List(num3); - CollectionsMarshal.SetCount(list58, num3); - span2 = CollectionsMarshal.AsSpan(list58); - num4 = 0; - ref ChangeEntry reference58 = ref span2[num4]; + ref ChangelogEntry reference60 = ref span[num2]; + DateOnly releaseDate36 = new DateOnly(2025, 10, 7); + num4 = 4; + List list61 = new List(num4); + CollectionsMarshal.SetCount(list61, num4); + span2 = CollectionsMarshal.AsSpan(list61); + num3 = 0; + ref ChangeEntry reference61 = ref span2[num3]; num5 = 4; - List list59 = new List(num5); - CollectionsMarshal.SetCount(list59, num5); - span3 = CollectionsMarshal.AsSpan(list59); + List list62 = new List(num5); + CollectionsMarshal.SetCount(list62, num5); + span3 = CollectionsMarshal.AsSpan(list62); num6 = 0; span3[num6] = "FATE combat handling with auto level syncing"; num6++; @@ -638,67 +672,67 @@ internal static class ChangelogData span3[num6] = "Update quest tracking when quests are hidden or prioritised in game"; num6++; span3[num6] = "QuestMap as a recommended plugin/dependency"; - reference58 = new ChangeEntry(EChangeCategory.Added, "FATE and quest tracking", list59); - num4++; - ref ChangeEntry reference59 = ref span2[num4]; + reference61 = new ChangeEntry(EChangeCategory.Added, "FATE and quest tracking", list62); + num3++; + ref ChangeEntry reference62 = ref span2[num3]; num6 = 3; - List list60 = new List(num6); - CollectionsMarshal.SetCount(list60, num6); - span3 = CollectionsMarshal.AsSpan(list60); + List list63 = new List(num6); + CollectionsMarshal.SetCount(list63, num6); + span3 = CollectionsMarshal.AsSpan(list63); num5 = 0; span3[num5] = "Always prioritise next quest during teleportation/zone transitions"; num5++; span3[num5] = "Improved accepted quest logic with abandoned quest detection"; num5++; span3[num5] = "Show quests without quest paths as Locked"; - reference59 = new ChangeEntry(EChangeCategory.Changed, "Quest prioritisation improvements", list60); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Deep Dungeon, Hildibrand, Yok Huy, Monster Hunter Wilds Collab, and Doman Enclave quests"); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed accepted/active quest display and Hildibrand quest issues"); - reference57 = new ChangelogEntry("6.12", releaseDate35, list58); + reference62 = new ChangeEntry(EChangeCategory.Changed, "Quest prioritisation improvements", list63); + num3++; + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.35 Deep Dungeon, Hildibrand, Yok Huy, Monster Hunter Wilds Collab, and Doman Enclave quests"); + num3++; + span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed accepted/active quest display and Hildibrand quest issues"); + reference60 = new ChangelogEntry("6.12", releaseDate36, list61); num2++; - ref ChangelogEntry reference60 = ref span[num2]; - DateOnly releaseDate36 = new DateOnly(2025, 10, 3); - num4 = 1; - List list61 = new List(num4); - CollectionsMarshal.SetCount(list61, num4); - span2 = CollectionsMarshal.AsSpan(list61); - num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Added remaining checks for quest priority to prevent infinite teleport looping"); - reference60 = new ChangelogEntry("6.11", releaseDate36, list61); - num2++; - ref ChangelogEntry reference61 = ref span[num2]; - DateOnly releaseDate37 = new DateOnly(2025, 10, 2); + ref ChangelogEntry reference63 = ref span[num2]; + DateOnly releaseDate37 = new DateOnly(2025, 10, 3); num3 = 1; - List list62 = new List(num3); - CollectionsMarshal.SetCount(list62, num3); - span2 = CollectionsMarshal.AsSpan(list62); + List list64 = new List(num3); + CollectionsMarshal.SetCount(list64, num3); + span2 = CollectionsMarshal.AsSpan(list64); num4 = 0; - ref ChangeEntry reference62 = ref span2[num4]; + span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Added remaining checks for quest priority to prevent infinite teleport looping"); + reference63 = new ChangelogEntry("6.11", releaseDate37, list64); + num2++; + ref ChangelogEntry reference64 = ref span[num2]; + DateOnly releaseDate38 = new DateOnly(2025, 10, 2); + num4 = 1; + List list65 = new List(num4); + CollectionsMarshal.SetCount(list65, num4); + span2 = CollectionsMarshal.AsSpan(list65); + num3 = 0; + ref ChangeEntry reference65 = ref span2[num3]; num5 = 2; - List list63 = new List(num5); - CollectionsMarshal.SetCount(list63, num5); - span3 = CollectionsMarshal.AsSpan(list63); + List list66 = new List(num5); + CollectionsMarshal.SetCount(list66, num5); + span3 = CollectionsMarshal.AsSpan(list66); num6 = 0; span3[num6] = "Don't show quests as available if player doesn't meet level requirements"; num6++; span3[num6] = "Updated 'required for MSQ' text in Crystal Tower quest preset window"; - reference62 = new ChangeEntry(EChangeCategory.Changed, "Quest window improvements", list63); - reference61 = new ChangelogEntry("6.10", releaseDate37, list62); + reference65 = new ChangeEntry(EChangeCategory.Changed, "Quest window improvements", list66); + reference64 = new ChangelogEntry("6.10", releaseDate38, list65); num2++; - ref ChangelogEntry reference63 = ref span[num2]; - DateOnly releaseDate38 = new DateOnly(2025, 9, 21); - num4 = 5; - List list64 = new List(num4); - CollectionsMarshal.SetCount(list64, num4); - span2 = CollectionsMarshal.AsSpan(list64); - num3 = 0; - ref ChangeEntry reference64 = ref span2[num3]; + ref ChangelogEntry reference66 = ref span[num2]; + DateOnly releaseDate39 = new DateOnly(2025, 9, 21); + num3 = 5; + List list67 = new List(num3); + CollectionsMarshal.SetCount(list67, num3); + span2 = CollectionsMarshal.AsSpan(list67); + num4 = 0; + ref ChangeEntry reference67 = ref span2[num4]; num6 = 4; - List list65 = new List(num6); - CollectionsMarshal.SetCount(list65, num6); - span3 = CollectionsMarshal.AsSpan(list65); + List list68 = new List(num6); + CollectionsMarshal.SetCount(list68, num6); + span3 = CollectionsMarshal.AsSpan(list68); num5 = 0; span3[num5] = "Reworked event quest handling - automatically displays when events are active"; num5++; @@ -707,13 +741,13 @@ internal static class ChangelogData span3[num5] = "Reworked Priority Quests tab (Manual Priority and Quest Presets)"; num5++; span3[num5] = "Quest path viewer site (https://wigglymuffin.github.io/FFXIV-Tools/)"; - reference64 = new ChangeEntry(EChangeCategory.Added, "Major system reworks", list65); - num3++; - ref ChangeEntry reference65 = ref span2[num3]; + reference67 = new ChangeEntry(EChangeCategory.Added, "Major system reworks", list68); + num4++; + ref ChangeEntry reference68 = ref span2[num4]; num5 = 4; - List list66 = new List(num5); - CollectionsMarshal.SetCount(list66, num5); - span3 = CollectionsMarshal.AsSpan(list66); + List list69 = new List(num5); + CollectionsMarshal.SetCount(list69, num5); + span3 = CollectionsMarshal.AsSpan(list69); num6 = 0; span3[num6] = "Questionable.IsQuestCompleted"; num6++; @@ -722,13 +756,13 @@ internal static class ChangelogData span3[num6] = "Questionable.IsQuestAccepted"; num6++; span3[num6] = "Questionable.IsQuestUnobtainable"; - reference65 = new ChangeEntry(EChangeCategory.Added, "New IPC commands", list66); - num3++; - ref ChangeEntry reference66 = ref span2[num3]; + reference68 = new ChangeEntry(EChangeCategory.Added, "New IPC commands", list69); + num4++; + ref ChangeEntry reference69 = ref span2[num4]; num6 = 5; - List list67 = new List(num6); - CollectionsMarshal.SetCount(list67, num6); - span3 = CollectionsMarshal.AsSpan(list67); + List list70 = new List(num6); + CollectionsMarshal.SetCount(list70, num6); + span3 = CollectionsMarshal.AsSpan(list70); num5 = 0; span3[num5] = "Improved JSON quest validation with specific error reasons"; num5++; @@ -739,25 +773,25 @@ internal static class ChangelogData span3[num5] = "Improved DialogueChoices regex matching"; num5++; span3[num5] = "Improved refresh checker for all quest states"; - reference66 = new ChangeEntry(EChangeCategory.Changed, "Various improvements", list67); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.31 Occult Crescent quests"); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed cutscene crashes, Single Player Duty triggers, and various quest issues"); - reference63 = new ChangelogEntry("6.9", releaseDate38, list64); + reference69 = new ChangeEntry(EChangeCategory.Changed, "Various improvements", list70); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added 7.31 Occult Crescent quests"); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed cutscene crashes, Single Player Duty triggers, and various quest issues"); + reference66 = new ChangelogEntry("6.9", releaseDate39, list67); num2++; - ref ChangelogEntry reference67 = ref span[num2]; - DateOnly releaseDate39 = new DateOnly(2025, 9, 2); - num3 = 4; - List list68 = new List(num3); - CollectionsMarshal.SetCount(list68, num3); - span2 = CollectionsMarshal.AsSpan(list68); - num4 = 0; - ref ChangeEntry reference68 = ref span2[num4]; + ref ChangelogEntry reference70 = ref span[num2]; + DateOnly releaseDate40 = new DateOnly(2025, 9, 2); + num4 = 4; + List list71 = new List(num4); + CollectionsMarshal.SetCount(list71, num4); + span2 = CollectionsMarshal.AsSpan(list71); + num3 = 0; + ref ChangeEntry reference71 = ref span2[num3]; num5 = 4; - List list69 = new List(num5); - CollectionsMarshal.SetCount(list69, num5); - span3 = CollectionsMarshal.AsSpan(list69); + List list72 = new List(num5); + CollectionsMarshal.SetCount(list72, num5); + span3 = CollectionsMarshal.AsSpan(list72); num6 = 0; span3[num6] = "Help commands and priority quest command"; num6++; @@ -766,72 +800,72 @@ internal static class ChangelogData span3[num6] = "Duty counts and controls in 'Quest Battles' tab"; num6++; span3[num6] = "'Refresh quest timer' setting (WIP)"; - reference68 = new ChangeEntry(EChangeCategory.Added, "Command and UI improvements", list69); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Improved 'Clear All' buttons to require CTRL being held"); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added Zodiac quests and 7.31 Cosmic/Occult Crescent quests"); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed Fishing for Friendship and Cosmic Exploration quests"); - reference67 = new ChangelogEntry("6.8", releaseDate39, list68); + reference71 = new ChangeEntry(EChangeCategory.Added, "Command and UI improvements", list72); + num3++; + span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Improved 'Clear All' buttons to require CTRL being held"); + num3++; + span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added Zodiac quests and 7.31 Cosmic/Occult Crescent quests"); + num3++; + span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed Fishing for Friendship and Cosmic Exploration quests"); + reference70 = new ChangelogEntry("6.8", releaseDate40, list71); num2++; - ref ChangelogEntry reference69 = ref span[num2]; - DateOnly releaseDate40 = new DateOnly(2025, 8, 27); - num4 = 4; - List list70 = new List(num4); - CollectionsMarshal.SetCount(list70, num4); - span2 = CollectionsMarshal.AsSpan(list70); - num3 = 0; - ref ChangeEntry reference70 = ref span2[num3]; + ref ChangelogEntry reference72 = ref span[num2]; + DateOnly releaseDate41 = new DateOnly(2025, 8, 27); + num3 = 4; + List list73 = new List(num3); + CollectionsMarshal.SetCount(list73, num3); + span2 = CollectionsMarshal.AsSpan(list73); + num4 = 0; + ref ChangeEntry reference73 = ref span2[num4]; num6 = 2; - List list71 = new List(num6); - CollectionsMarshal.SetCount(list71, num6); - span3 = CollectionsMarshal.AsSpan(list71); + List list74 = new List(num6); + CollectionsMarshal.SetCount(list74, num6); + span3 = CollectionsMarshal.AsSpan(list74); num5 = 0; span3[num5] = "Icon to 'Clear All' button in stop conditions"; num5++; span3[num5] = "Duty counts and 'Enable All' button in 'Duties' tab"; - reference70 = new ChangeEntry(EChangeCategory.Added, "UI improvements", list71); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Renamed 'Clear' button to 'Clear All' in priority window"); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added Rising 2025 Event Quests"); - num3++; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Fixed clipboard assigning blacklist to whitelist in 'Duties' tab"); - reference69 = new ChangelogEntry("6.7", releaseDate40, list70); + reference73 = new ChangeEntry(EChangeCategory.Added, "UI improvements", list74); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Renamed 'Clear' button to 'Clear All' in priority window"); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added Rising 2025 Event Quests"); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Fixed clipboard assigning blacklist to whitelist in 'Duties' tab"); + reference72 = new ChangelogEntry("6.7", releaseDate41, list73); num2++; - ref ChangelogEntry reference71 = ref span[num2]; - DateOnly releaseDate41 = new DateOnly(2025, 8, 25); - num3 = 2; - List list72 = new List(num3); - CollectionsMarshal.SetCount(list72, num3); - span2 = CollectionsMarshal.AsSpan(list72); - num4 = 0; - ref ChangeEntry reference72 = ref span2[num4]; + ref ChangelogEntry reference74 = ref span[num2]; + DateOnly releaseDate42 = new DateOnly(2025, 8, 25); + num4 = 2; + List list75 = new List(num4); + CollectionsMarshal.SetCount(list75, num4); + span2 = CollectionsMarshal.AsSpan(list75); + num3 = 0; + ref ChangeEntry reference75 = ref span2[num3]; num5 = 2; - List list73 = new List(num5); - CollectionsMarshal.SetCount(list73, num5); - span3 = CollectionsMarshal.AsSpan(list73); + List list76 = new List(num5); + CollectionsMarshal.SetCount(list76, num5); + span3 = CollectionsMarshal.AsSpan(list76); num6 = 0; span3[num6] = "Missing emotes to schema and emote handler"; num6++; span3[num6] = "Improved stop conditions with 'Clear All' button"; - reference72 = new ChangeEntry(EChangeCategory.Added, "Emote support and stop conditions", list73); - num4++; - span2[num4] = new ChangeEntry(EChangeCategory.Changed, "Stop at level functionality"); - reference71 = new ChangelogEntry("6.6", releaseDate41, list72); - num2++; - ref ChangelogEntry reference73 = ref span[num2]; - DateOnly releaseDate42 = new DateOnly(2025, 8, 25); - num4 = 2; - List list74 = new List(num4); - CollectionsMarshal.SetCount(list74, num4); - span2 = CollectionsMarshal.AsSpan(list74); - num3 = 0; - span2[num3] = new ChangeEntry(EChangeCategory.Fixed, "Potential fix to single/solo duties softlocking"); + reference75 = new ChangeEntry(EChangeCategory.Added, "Emote support and stop conditions", list76); num3++; - span2[num3] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added San d'Oria: The Second Walk and various side quests"); - reference73 = new ChangelogEntry("6.5", releaseDate42, list74); + span2[num3] = new ChangeEntry(EChangeCategory.Changed, "Stop at level functionality"); + reference74 = new ChangelogEntry("6.6", releaseDate42, list75); + num2++; + ref ChangelogEntry reference76 = ref span[num2]; + DateOnly releaseDate43 = new DateOnly(2025, 8, 25); + num3 = 2; + List list77 = new List(num3); + CollectionsMarshal.SetCount(list77, num3); + span2 = CollectionsMarshal.AsSpan(list77); + num4 = 0; + span2[num4] = new ChangeEntry(EChangeCategory.Fixed, "Potential fix to single/solo duties softlocking"); + num4++; + span2[num4] = new ChangeEntry(EChangeCategory.QuestUpdates, "Added San d'Oria: The Second Walk and various side quests"); + reference76 = new ChangelogEntry("6.5", releaseDate43, list77); Changelogs = list; } } diff --git a/Questionable/Questionable.Data/HuntMobData.cs b/Questionable/Questionable.Data/HuntMobData.cs new file mode 100644 index 0000000..ed478ca --- /dev/null +++ b/Questionable/Questionable.Data/HuntMobData.cs @@ -0,0 +1,68 @@ +using System.Collections.Generic; +using Dalamud.Plugin.Services; +using Lumina.Excel; +using Lumina.Excel.Sheets; + +namespace Questionable.Data; + +internal sealed class HuntMobData +{ + private readonly HashSet _aRankDataIds = new HashSet(); + + private readonly HashSet _sRankDataIds = new HashSet(); + + private readonly HashSet _allHuntMobDataIds = new HashSet(); + + public const float SafeDistance = 15f; + + public IReadOnlySet ARankDataIds => _aRankDataIds; + + public IReadOnlySet SRankDataIds => _sRankDataIds; + + public IReadOnlySet AllHuntMobDataIds => _allHuntMobDataIds; + + public HuntMobData(IDataManager dataManager) + { + ExcelSheet excelSheet = dataManager.GetExcelSheet(); + if (excelSheet == null) + { + return; + } + foreach (NotoriousMonster item in excelSheet) + { + byte rank = item.Rank; + if ((uint)(rank - 2) > 1u) + { + continue; + } + uint rowId = item.BNpcBase.RowId; + if (rowId != 0) + { + _allHuntMobDataIds.Add(rowId); + if (item.Rank == 2) + { + _aRankDataIds.Add(rowId); + } + else if (item.Rank == 3) + { + _sRankDataIds.Add(rowId); + } + } + } + } + + public bool IsHuntMob(uint dataId) + { + return _allHuntMobDataIds.Contains(dataId); + } + + public bool IsARank(uint dataId) + { + return _aRankDataIds.Contains(dataId); + } + + public bool IsSRank(uint dataId) + { + return _sRankDataIds.Contains(dataId); + } +} diff --git a/Questionable/Questionable.External/NavmeshIpc.cs b/Questionable/Questionable.External/NavmeshIpc.cs index 949d9d7..0ed9d8a 100644 --- a/Questionable/Questionable.External/NavmeshIpc.cs +++ b/Questionable/Questionable.External/NavmeshIpc.cs @@ -11,12 +11,18 @@ namespace Questionable.External; internal sealed class NavmeshIpc { + private readonly IDalamudPluginInterface _pluginInterface; + private readonly ILogger _logger; private readonly ICallGateSubscriber _isNavReady; private readonly ICallGateSubscriber>> _navPathfind; + private readonly ICallGateSubscriber _navPathfindInProgress; + + private readonly ICallGateSubscriber _navNumQueuedRequests; + private readonly ICallGateSubscriber, bool, object> _pathMoveTo; private readonly ICallGateSubscriber _pathStop; @@ -29,6 +35,8 @@ internal sealed class NavmeshIpc private readonly ICallGateSubscriber _queryPointOnFloor; + private readonly ICallGateSubscriber _queryNearestPoint; + private readonly ICallGateSubscriber _buildProgress; public bool IsReady @@ -61,17 +69,51 @@ internal sealed class NavmeshIpc } } + public bool IsPathfindInProgress + { + get + { + try + { + return _navPathfindInProgress.InvokeFunc(); + } + catch (IpcError) + { + return false; + } + } + } + + public int NumQueuedPathfindRequests + { + get + { + try + { + return _navNumQueuedRequests.InvokeFunc(); + } + catch (IpcError) + { + return 0; + } + } + } + public NavmeshIpc(IDalamudPluginInterface pluginInterface, ILogger logger) { + _pluginInterface = pluginInterface; _logger = logger; _isNavReady = pluginInterface.GetIpcSubscriber("vnavmesh.Nav.IsReady"); _navPathfind = pluginInterface.GetIpcSubscriber>>("vnavmesh.Nav.PathfindCancelable"); + _navPathfindInProgress = pluginInterface.GetIpcSubscriber("vnavmesh.Nav.PathfindInProgress"); + _navNumQueuedRequests = pluginInterface.GetIpcSubscriber("vnavmesh.Nav.PathfindNumQueued"); _pathMoveTo = pluginInterface.GetIpcSubscriber, bool, object>("vnavmesh.Path.MoveTo"); _pathStop = pluginInterface.GetIpcSubscriber("vnavmesh.Path.Stop"); _pathIsRunning = pluginInterface.GetIpcSubscriber("vnavmesh.Path.IsRunning"); _pathListWaypoints = pluginInterface.GetIpcSubscriber>("vnavmesh.Path.ListWaypoints"); _pathSetTolerance = pluginInterface.GetIpcSubscriber("vnavmesh.Path.SetTolerance"); _queryPointOnFloor = pluginInterface.GetIpcSubscriber("vnavmesh.Query.Mesh.PointOnFloor"); + _queryNearestPoint = pluginInterface.GetIpcSubscriber("vnavmesh.Query.Mesh.NearestPoint"); _buildProgress = pluginInterface.GetIpcSubscriber("vnavmesh.Nav.BuildProgress"); } @@ -101,6 +143,20 @@ internal sealed class NavmeshIpc } } + public Task> PathfindWithTolerance(Vector3 localPlayerPosition, Vector3 targetPosition, bool fly, float tolerance, CancellationToken cancellationToken) + { + try + { + _pathSetTolerance.InvokeAction(0.25f); + return _pluginInterface.GetIpcSubscriber>>("vnavmesh.Nav.PathfindWithTolerance").InvokeFunc(localPlayerPosition, targetPosition, fly, tolerance, cancellationToken); + } + catch (IpcError exception) + { + _logger.LogWarning(exception, "Could not pathfind with tolerance via navmesh"); + return Task.FromException>(exception); + } + } + public void MoveTo(List position, bool fly) { Stop(); @@ -126,6 +182,30 @@ internal sealed class NavmeshIpc } } + public Vector3? GetPointOnFloor(Vector3 position, bool unlandable, float halfExtentXZ) + { + try + { + return _queryPointOnFloor.InvokeFunc(position, unlandable, halfExtentXZ); + } + catch (IpcError) + { + return null; + } + } + + public Vector3? FindNearestMeshPoint(Vector3 position, float halfExtentXZ, float halfExtentY) + { + try + { + return _queryNearestPoint.InvokeFunc(position, halfExtentXZ, halfExtentY); + } + catch (IpcError) + { + return null; + } + } + public List GetWaypoints() { if (IsPathRunning) diff --git a/Questionable/Questionable.Functions/AetheryteFunctions.cs b/Questionable/Questionable.Functions/AetheryteFunctions.cs index f3e40d3..9df51af 100644 --- a/Questionable/Questionable.Functions/AetheryteFunctions.cs +++ b/Questionable/Questionable.Functions/AetheryteFunctions.cs @@ -22,16 +22,16 @@ internal sealed class AetheryteFunctions private readonly IDataManager _dataManager; - private readonly IClientState _clientState; + private readonly IObjectTable _objectTable; public DateTime ReturnRequestedAt { get; set; } = DateTime.MinValue; - public AetheryteFunctions(IServiceProvider serviceProvider, ILogger logger, IDataManager dataManager, IClientState clientState) + public AetheryteFunctions(IServiceProvider serviceProvider, ILogger logger, IDataManager dataManager, IObjectTable objectTable) { _serviceProvider = serviceProvider; _logger = logger; _dataManager = dataManager; - _clientState = clientState; + _objectTable = objectTable; } public unsafe bool IsAetheryteUnlocked(uint aetheryteId, out byte subIndex) @@ -114,7 +114,7 @@ internal sealed class AetheryteFunctions public unsafe AetheryteRegistrationResult CanRegisterFreeOrFavoriteAetheryte(EAetheryteLocation aetheryteLocation) { - if (_clientState.LocalPlayer == null) + if (_objectTable[0] == null) { return AetheryteRegistrationResult.NotPossible; } diff --git a/Questionable/Questionable.Functions/GameFunctions.cs b/Questionable/Questionable.Functions/GameFunctions.cs index 100e49a..9258154 100644 --- a/Questionable/Questionable.Functions/GameFunctions.cs +++ b/Questionable/Questionable.Functions/GameFunctions.cs @@ -104,7 +104,7 @@ internal sealed class GameFunctions public unsafe ushort? GetMountId() { - BattleChara* ptr = (BattleChara*)(_clientState.LocalPlayer?.Address ?? 0); + BattleChara* ptr = (BattleChara*)(_objectTable.LocalPlayer?.Address ?? 0); if (ptr != null && ptr->Mount.MountId != 0) { return ptr->Mount.MountId; @@ -203,14 +203,14 @@ internal sealed class GameFunctions if (gameObject != null) { Vector3 position = gameObject.Position; - return ActionManager.Instance()->UseActionLocation(ActionType.KeyItem, itemId, 3758096384uL, &position, 0u, 0); + return ActionManager.Instance()->UseActionLocation(ActionType.EventItem, itemId, 3758096384uL, &position, 0u, 0); } return false; } public unsafe bool UseItemOnPosition(Vector3 position, uint itemId) { - return ActionManager.Instance()->UseActionLocation(ActionType.KeyItem, itemId, 3758096384uL, &position, 0u, 0); + return ActionManager.Instance()->UseActionLocation(ActionType.EventItem, itemId, 3758096384uL, &position, 0u, 0); } public unsafe bool UseAction(EAction action) @@ -287,7 +287,7 @@ internal sealed class GameFunctions { return true; } - IPlayerCharacter localPlayer = _clientState.LocalPlayer; + IPlayerCharacter localPlayer = _objectTable.LocalPlayer; if (localPlayer == null) { return false; @@ -308,7 +308,7 @@ internal sealed class GameFunctions private unsafe bool HasCharacterStatusPreventingMountOrSprint() { - IPlayerCharacter localPlayer = _clientState.LocalPlayer; + IPlayerCharacter localPlayer = _objectTable.LocalPlayer; if (localPlayer == null) { return false; @@ -324,7 +324,7 @@ internal sealed class GameFunctions public unsafe bool HasStatus(EStatus statusId) { - IPlayerCharacter localPlayer = _clientState.LocalPlayer; + IPlayerCharacter localPlayer = _objectTable.LocalPlayer; if (localPlayer == null) { return false; @@ -423,7 +423,7 @@ internal sealed class GameFunctions public unsafe bool IsOccupied() { - if (!_clientState.IsLoggedIn || _clientState.LocalPlayer == null) + if (!_clientState.IsLoggedIn || _objectTable.LocalPlayer == null) { return true; } @@ -547,7 +547,7 @@ internal sealed class GameFunctions public unsafe bool SyncToFate(uint fateId) { - IPlayerCharacter localPlayer = _clientState.LocalPlayer; + IPlayerCharacter localPlayer = _objectTable.LocalPlayer; if (localPlayer == null) { _logger.LogWarning("Cannot sync to FATE: LocalPlayer is null"); diff --git a/Questionable/Questionable.Functions/QuestFunctions.cs b/Questionable/Questionable.Functions/QuestFunctions.cs index b240264..c39da6e 100644 --- a/Questionable/Questionable.Functions/QuestFunctions.cs +++ b/Questionable/Questionable.Functions/QuestFunctions.cs @@ -44,6 +44,8 @@ internal sealed class QuestFunctions private readonly IDataManager _dataManager; + private readonly IObjectTable _objectTable; + private readonly IClientState _clientState; private readonly IGameGui _gameGui; @@ -68,7 +70,7 @@ internal sealed class QuestFunctions private ElementId? _lastLoggedAcceptedHiddenMsq; - public QuestFunctions(QuestRegistry questRegistry, QuestData questData, AetheryteFunctions aetheryteFunctions, AlliedSocietyQuestFunctions alliedSocietyQuestFunctions, AlliedSocietyData alliedSocietyData, AetheryteData aetheryteData, Configuration configuration, IDataManager dataManager, IClientState clientState, IGameGui gameGui, IAetheryteList aetheryteList, ILogger logger) + public QuestFunctions(QuestRegistry questRegistry, QuestData questData, AetheryteFunctions aetheryteFunctions, AlliedSocietyQuestFunctions alliedSocietyQuestFunctions, AlliedSocietyData alliedSocietyData, AetheryteData aetheryteData, Configuration configuration, IDataManager dataManager, IObjectTable objectTable, IClientState clientState, IGameGui gameGui, IAetheryteList aetheryteList, ILogger logger) { _questRegistry = questRegistry; _questData = questData; @@ -78,6 +80,7 @@ internal sealed class QuestFunctions _aetheryteData = aetheryteData; _configuration = configuration; _dataManager = dataManager; + _objectTable = objectTable; _clientState = clientState; _gameGui = gameGui; _aetheryteList = aetheryteList; @@ -163,14 +166,14 @@ internal sealed class QuestFunctions } questReference = QuestReference.NoQuest(questReference.State); } - byte currentLevel = _clientState.LocalPlayer?.Level ?? 0; + byte currentLevel = _objectTable.LocalPlayer?.Level ?? 0; if (questReference.CurrentQuest != null) { Questionable.Model.Quest quest; bool flag = _questRegistry.TryGetQuest(questReference.CurrentQuest, out quest); bool flag2 = IsQuestAccepted(questReference.CurrentQuest); _logger.LogTrace("MSQ check: QuestId={QuestId}, InRegistry={InRegistry}, Level={QuestLevel}, CurrentLevel={CurrentLevel}, IsAccepted={IsAccepted}", questReference.CurrentQuest, flag, ((int?)quest?.Info.Level) ?? (-1), currentLevel, flag2); - EClassJob valueOrDefault = ((EClassJob?)_clientState.LocalPlayer?.ClassJob.RowId).GetValueOrDefault(); + EClassJob valueOrDefault = ((EClassJob?)_objectTable.LocalPlayer?.ClassJob.RowId).GetValueOrDefault(); if (valueOrDefault != EClassJob.Adventurer) { QuestInfo questInfo = (from x in _questData.GetClassJobQuests(valueOrDefault) @@ -467,7 +470,7 @@ internal sealed class QuestFunctions return (QuestReference.NoQuest(MainScenarioQuestState.Unavailable), $"Not readdy to accept quest {questId.Value}"); } _lastLoggedNotReadyQuest = null; - if (!(_clientState.LocalPlayer?.Level).HasValue) + if (!(_objectTable.LocalPlayer?.Level).HasValue) { _logger.LogTrace("GetMainScenarioQuest: In loading screen"); return (QuestReference.NoQuest(MainScenarioQuestState.LoadingScreen), "In loading screen"); @@ -492,7 +495,7 @@ internal sealed class QuestFunctions private unsafe bool IsOnAlliedSocietyMount() { - BattleChara* ptr = (BattleChara*)(_clientState.LocalPlayer?.Address ?? 0); + BattleChara* ptr = (BattleChara*)(_objectTable.LocalPlayer?.Address ?? 0); if (ptr != null && ptr->Mount.MountId != 0) { return _alliedSocietyData.Mounts.ContainsKey(ptr->Mount.MountId); @@ -639,7 +642,7 @@ internal sealed class QuestFunctions } if (!_configuration.Advanced.SkipClassJobQuests) { - EClassJob valueOrDefault = ((EClassJob?)_clientState.LocalPlayer?.ClassJob.RowId).GetValueOrDefault(); + EClassJob valueOrDefault = ((EClassJob?)_objectTable.LocalPlayer?.ClassJob.RowId).GetValueOrDefault(); uint[] shadowbringersRoleQuestChapters = QuestData.AllRoleQuestChapters.Select((IReadOnlyList x) => x[0]).ToArray(); if (valueOrDefault != EClassJob.Adventurer) { @@ -712,7 +715,7 @@ internal sealed class QuestFunctions } if (!ignoreLevel) { - byte b = _clientState.LocalPlayer?.Level ?? 0; + byte b = _objectTable.LocalPlayer?.Level ?? 0; if (b == 0) { return false; diff --git a/Questionable/Questionable.Windows.ConfigComponents/StopConditionComponent.cs b/Questionable/Questionable.Windows.ConfigComponents/StopConditionComponent.cs index 568d931..fed1a79 100644 --- a/Questionable/Questionable.Windows.ConfigComponents/StopConditionComponent.cs +++ b/Questionable/Questionable.Windows.ConfigComponents/StopConditionComponent.cs @@ -31,11 +31,13 @@ internal sealed class StopConditionComponent : ConfigComponent private readonly UiUtils _uiUtils; + private readonly IObjectTable _objectTable; + private readonly IClientState _clientState; private readonly QuestController _questController; - public StopConditionComponent(IDalamudPluginInterface pluginInterface, QuestSelector questSelector, QuestFunctions questFunctions, QuestRegistry questRegistry, QuestTooltipComponent questTooltipComponent, UiUtils uiUtils, IClientState clientState, QuestController questController, Configuration configuration) + public StopConditionComponent(IDalamudPluginInterface pluginInterface, QuestSelector questSelector, QuestFunctions questFunctions, QuestRegistry questRegistry, QuestTooltipComponent questTooltipComponent, UiUtils uiUtils, IObjectTable objectTable, IClientState clientState, QuestController questController, Configuration configuration) : base(pluginInterface, configuration) { StopConditionComponent stopConditionComponent = this; @@ -45,6 +47,7 @@ internal sealed class StopConditionComponent : ConfigComponent _questFunctions = questFunctions; _questTooltipComponent = questTooltipComponent; _uiUtils = uiUtils; + _objectTable = objectTable; _clientState = clientState; _questController = questController; _questSelector.SuggestionPredicate = (Quest quest) => configuration.Stop.QuestsToStopAfter.All((ElementId x) => x != quest.Id); @@ -88,7 +91,7 @@ internal sealed class StopConditionComponent : ConfigComponent base.Configuration.Stop.TargetLevel = Math.Max(1, Math.Min(100, data)); Save(); } - int num = _clientState.LocalPlayer?.Level ?? 0; + int num = _objectTable.LocalPlayer?.Level ?? 0; if (num > 0) { ImGui.SameLine(); diff --git a/Questionable/Questionable.Windows.QuestComponents/ActiveQuestComponent.cs b/Questionable/Questionable.Windows.QuestComponents/ActiveQuestComponent.cs index 931000b..e05fcda 100644 --- a/Questionable/Questionable.Windows.QuestComponents/ActiveQuestComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/ActiveQuestComponent.cs @@ -43,6 +43,8 @@ internal sealed class ActiveQuestComponent private readonly UiUtils _uiUtils; + private readonly IObjectTable _objectTable; + private readonly IClientState _clientState; private readonly IChatGui _chatGui; @@ -58,7 +60,7 @@ internal sealed class ActiveQuestComponent return _003CRegexGenerator_g_003EFBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0.Instance; } - public ActiveQuestComponent(QuestController questController, MovementController movementController, CombatController combatController, GatheringController gatheringController, QuestFunctions questFunctions, ICommandManager commandManager, Configuration configuration, QuestRegistry questRegistry, PriorityWindow priorityWindow, UiUtils uiUtils, IClientState clientState, IChatGui chatGui, ILogger logger) + public ActiveQuestComponent(QuestController questController, MovementController movementController, CombatController combatController, GatheringController gatheringController, QuestFunctions questFunctions, ICommandManager commandManager, Configuration configuration, QuestRegistry questRegistry, PriorityWindow priorityWindow, UiUtils uiUtils, IObjectTable objectTable, IClientState clientState, IChatGui chatGui, ILogger logger) { _questController = questController; _movementController = movementController; @@ -70,6 +72,7 @@ internal sealed class ActiveQuestComponent _questRegistry = questRegistry; _priorityWindow = priorityWindow; _uiUtils = uiUtils; + _objectTable = objectTable; _clientState = clientState; _chatGui = chatGui; _logger = logger; @@ -243,7 +246,7 @@ internal sealed class ActiveQuestComponent Vector4 col = ImGuiColors.ParsedPurple; if (flag) { - int num = _clientState.LocalPlayer?.Level ?? 0; + int num = _objectTable.LocalPlayer?.Level ?? 0; if (num > 0 && num >= _configuration.Stop.TargetLevel) { col = ImGuiColors.ParsedGreen; @@ -267,7 +270,7 @@ internal sealed class ActiveQuestComponent ImGui.Separator(); if (flag) { - int num2 = _clientState.LocalPlayer?.Level ?? 0; + int num2 = _objectTable.LocalPlayer?.Level ?? 0; text = new ImU8String(14, 1); text.AppendLiteral("Stop at level "); text.AppendFormatted(_configuration.Stop.TargetLevel); diff --git a/Questionable/Questionable.Windows.QuestComponents/CreationUtilsComponent.cs b/Questionable/Questionable.Windows.QuestComponents/CreationUtilsComponent.cs index d82c9f8..b132079 100644 --- a/Questionable/Questionable.Windows.QuestComponents/CreationUtilsComponent.cs +++ b/Questionable/Questionable.Windows.QuestComponents/CreationUtilsComponent.cs @@ -37,6 +37,8 @@ internal sealed class CreationUtilsComponent private readonly QuestSelectionWindow _questSelectionWindow; + private readonly IObjectTable _objectTable; + private readonly IClientState _clientState; private readonly ITargetManager _targetManager; @@ -49,7 +51,7 @@ internal sealed class CreationUtilsComponent private readonly ILogger _logger; - public CreationUtilsComponent(MovementController movementController, GameFunctions gameFunctions, QuestFunctions questFunctions, TerritoryData territoryData, QuestData questData, QuestSelectionWindow questSelectionWindow, IClientState clientState, ITargetManager targetManager, ICondition condition, IGameGui gameGui, Configuration configuration, ILogger logger) + public CreationUtilsComponent(MovementController movementController, GameFunctions gameFunctions, QuestFunctions questFunctions, TerritoryData territoryData, QuestData questData, QuestSelectionWindow questSelectionWindow, IObjectTable objectTable, IClientState clientState, ITargetManager targetManager, ICondition condition, IGameGui gameGui, Configuration configuration, ILogger logger) { _movementController = movementController; _gameFunctions = gameFunctions; @@ -57,6 +59,7 @@ internal sealed class CreationUtilsComponent _territoryData = territoryData; _questData = questData; _questSelectionWindow = questSelectionWindow; + _objectTable = objectTable; _clientState = clientState; _targetManager = targetManager; _condition = condition; @@ -129,16 +132,16 @@ internal sealed class CreationUtilsComponent handler.AppendFormatted(value); handler.AppendLiteral(")"); ImGui.Text(string.Create(provider, ref handler)); - if (_clientState.LocalPlayer != null) + if (_objectTable.LocalPlayer != null) { invariantCulture = CultureInfo.InvariantCulture; IFormatProvider provider2 = invariantCulture; handler = new DefaultInterpolatedStringHandler(10, 1, invariantCulture); handler.AppendLiteral("Distance: "); - handler.AppendFormatted((target.Position - _clientState.LocalPlayer.Position).Length(), "F2"); + handler.AppendFormatted((target.Position - _objectTable.LocalPlayer.Position).Length(), "F2"); ImGui.Text(string.Create(provider2, ref handler)); ImGui.SameLine(); - float value2 = target.Position.Y - _clientState.LocalPlayer.Position.Y; + float value2 = target.Position.Y - _objectTable.LocalPlayer.Position.Y; invariantCulture = CultureInfo.InvariantCulture; IFormatProvider provider3 = invariantCulture; handler = new DefaultInterpolatedStringHandler(3, 1, invariantCulture); @@ -317,7 +320,7 @@ internal sealed class CreationUtilsComponent private void DrawCopyButton() { - if (_clientState.LocalPlayer != null) + if (_objectTable.LocalPlayer != null) { bool num = ImGuiComponents.IconButton(FontAwesomeIcon.Copy); if (ImGui.IsItemHovered()) @@ -328,11 +331,11 @@ internal sealed class CreationUtilsComponent { ImU8String clipboardText = new ImU8String(87, 4); clipboardText.AppendLiteral("\"Position\": {\n \"X\": "); - clipboardText.AppendFormatted(_clientState.LocalPlayer.Position.X.ToString(CultureInfo.InvariantCulture)); + clipboardText.AppendFormatted(_objectTable.LocalPlayer.Position.X.ToString(CultureInfo.InvariantCulture)); clipboardText.AppendLiteral(",\n \"Y\": "); - clipboardText.AppendFormatted(_clientState.LocalPlayer.Position.Y.ToString(CultureInfo.InvariantCulture)); + clipboardText.AppendFormatted(_objectTable.LocalPlayer.Position.Y.ToString(CultureInfo.InvariantCulture)); clipboardText.AppendLiteral(",\n \"Z\": "); - clipboardText.AppendFormatted(_clientState.LocalPlayer.Position.Z.ToString(CultureInfo.InvariantCulture)); + clipboardText.AppendFormatted(_objectTable.LocalPlayer.Position.Z.ToString(CultureInfo.InvariantCulture)); clipboardText.AppendLiteral("\n},\n\"TerritoryId\": "); clipboardText.AppendFormatted(_clientState.TerritoryType); clipboardText.AppendLiteral(",\n\"InteractionType\": \"\""); @@ -340,7 +343,7 @@ internal sealed class CreationUtilsComponent } else if (ImGui.IsItemClicked(ImGuiMouseButton.Right)) { - Vector3 position = _clientState.LocalPlayer.Position; + Vector3 position = _objectTable.LocalPlayer.Position; IFormatProvider invariantCulture = CultureInfo.InvariantCulture; DefaultInterpolatedStringHandler handler = new DefaultInterpolatedStringHandler(12, 3, invariantCulture); handler.AppendLiteral("new("); diff --git a/Questionable/Questionable.Windows/DebugOverlay.cs b/Questionable/Questionable.Windows/DebugOverlay.cs index 5344a41..e41fa59 100644 --- a/Questionable/Questionable.Windows/DebugOverlay.cs +++ b/Questionable/Questionable.Windows/DebugOverlay.cs @@ -75,7 +75,7 @@ internal sealed class DebugOverlay : Window return; } IClientState clientState = _clientState; - if (clientState != null && clientState.IsLoggedIn && clientState.LocalPlayer != null && !clientState.IsPvPExcludingDen && _questController.IsQuestWindowOpen) + if (clientState != null && clientState.IsLoggedIn && !clientState.IsPvPExcludingDen && _objectTable.LocalPlayer != null && _questController.IsQuestWindowOpen) { DrawCurrentQuest(); DrawHighlightedQuest(); @@ -103,7 +103,7 @@ internal sealed class DebugOverlay : Window QuestStep questStep = questSequence.FindStep(i); if (questStep != null && TryGetPosition(questStep, out var position)) { - DrawStep(i.ToString(CultureInfo.InvariantCulture), questStep, position.Value, (Vector3.Distance(_clientState.LocalPlayer.Position, position.Value) < questStep.CalculateActualStopDistance()) ? 4278255360u : 4278190335u); + DrawStep(i.ToString(CultureInfo.InvariantCulture), questStep, position.Value, (Vector3.Distance(_objectTable.LocalPlayer.Position, position.Value) < questStep.CalculateActualStopDistance()) ? 4278255360u : 4278190335u); } } } @@ -141,7 +141,7 @@ internal sealed class DebugOverlay : Window text.AppendLiteral("\n"); text.AppendFormatted(position.ToString("G", CultureInfo.InvariantCulture)); text.AppendLiteral(" ["); - text.AppendFormatted((position - _clientState.LocalPlayer.Position).Length(), "N2"); + text.AppendFormatted((position - _objectTable.LocalPlayer.Position).Length(), "N2"); text.AppendLiteral("]\n"); text.AppendFormatted(step.Comment); windowDrawList.AddText(pos, color, text); @@ -175,7 +175,7 @@ internal sealed class DebugOverlay : Window text.AppendLiteral(" - "); text.AppendFormatted(item2); text.AppendLiteral(", "); - text.AppendFormatted(Vector3.Distance(item3.Position, _clientState.LocalPlayer.Position), "N2"); + text.AppendFormatted(Vector3.Distance(item3.Position, _objectTable.LocalPlayer.Position), "N2"); text.AppendLiteral(", "); text.AppendFormatted(item3.IsTargetable); windowDrawList.AddText(pos, (uint)col, text); diff --git a/Questionable/Questionable.Windows/QuestWindow.cs b/Questionable/Questionable.Windows/QuestWindow.cs index 041c4a8..0e8792d 100644 --- a/Questionable/Questionable.Windows/QuestWindow.cs +++ b/Questionable/Questionable.Windows/QuestWindow.cs @@ -22,6 +22,8 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig private readonly QuestController _questController; + private readonly IObjectTable _objectTable; + private readonly IClientState _clientState; private readonly Configuration _configuration; @@ -50,12 +52,13 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig public bool IsMinimized { get; set; } - public QuestWindow(IDalamudPluginInterface pluginInterface, QuestController questController, IClientState clientState, Configuration configuration, TerritoryData territoryData, ActiveQuestComponent activeQuestComponent, ARealmRebornComponent aRealmRebornComponent, EventInfoComponent eventInfoComponent, CreationUtilsComponent creationUtilsComponent, QuickAccessButtonsComponent quickAccessButtonsComponent, RemainingTasksComponent remainingTasksComponent, IFramework framework, InteractionUiController interactionUiController, ConfigWindow configWindow) + public QuestWindow(IDalamudPluginInterface pluginInterface, QuestController questController, IObjectTable objectTable, IClientState clientState, Configuration configuration, TerritoryData territoryData, ActiveQuestComponent activeQuestComponent, ARealmRebornComponent aRealmRebornComponent, EventInfoComponent eventInfoComponent, CreationUtilsComponent creationUtilsComponent, QuickAccessButtonsComponent quickAccessButtonsComponent, RemainingTasksComponent remainingTasksComponent, IFramework framework, InteractionUiController interactionUiController, ConfigWindow configWindow) : base("Questionable v" + PluginVersion.ToString(3) + "###Questionable", ImGuiWindowFlags.AlwaysAutoResize) { QuestWindow questWindow = this; _pluginInterface = pluginInterface; _questController = questController; + _objectTable = objectTable; _clientState = clientState; _configuration = configuration; _territoryData = territoryData; @@ -134,7 +137,7 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig { return false; } - if (!_clientState.IsLoggedIn || _clientState.LocalPlayer == null || _clientState.IsPvPExcludingDen) + if (!_clientState.IsLoggedIn || _objectTable.LocalPlayer == null || _clientState.IsPvPExcludingDen) { return false; }