forked from aly/qstbak
muffin v7.5.12
This commit is contained in:
parent
3102923ce2
commit
911ed68baa
65 changed files with 2356 additions and 1539 deletions
|
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||
using System.Numerics;
|
||||
using Dalamud.Game.ClientState.Conditions;
|
||||
using Dalamud.Plugin.Services;
|
||||
using LLib.GameData;
|
||||
using Questionable.Controller.Steps.Common;
|
||||
using Questionable.Controller.Utils;
|
||||
using Questionable.Data;
|
||||
|
|
@ -61,19 +62,19 @@ internal static class WaitAtEnd
|
|||
{
|
||||
break;
|
||||
}
|
||||
goto IL_01bf;
|
||||
goto IL_01ad;
|
||||
case EInteractionType.SinglePlayerDuty:
|
||||
if (bossModIpc.IsConfiguredToRunSoloInstance(quest.Id, step.SinglePlayerDutyOptions))
|
||||
{
|
||||
break;
|
||||
}
|
||||
goto IL_01bf;
|
||||
goto IL_01ad;
|
||||
case EInteractionType.Fish:
|
||||
if (autoHookIpc.IsAvailable())
|
||||
if (!autoHookIpc.IsAvailable())
|
||||
{
|
||||
break;
|
||||
return new global::_003C_003Ez__ReadOnlySingleElementList<ITask>(new EndAutomation());
|
||||
}
|
||||
goto IL_01bf;
|
||||
break;
|
||||
case EInteractionType.WalkTo:
|
||||
case EInteractionType.Jump:
|
||||
return new global::_003C_003Ez__ReadOnlySingleElementList<ITask>(Next(quest, sequence));
|
||||
|
|
@ -91,13 +92,13 @@ internal static class WaitAtEnd
|
|||
{
|
||||
break;
|
||||
}
|
||||
goto IL_02a6;
|
||||
goto IL_02ca;
|
||||
case EInteractionType.UseItem:
|
||||
if (!step.TargetTerritoryId.HasValue)
|
||||
{
|
||||
break;
|
||||
}
|
||||
goto IL_02a6;
|
||||
goto IL_02ca;
|
||||
case EInteractionType.AcceptQuest:
|
||||
{
|
||||
WaitQuestAccepted waitQuestAccepted = new WaitQuestAccepted(step.PickUpQuestId ?? quest.Id);
|
||||
|
|
@ -128,9 +129,14 @@ internal static class WaitAtEnd
|
|||
}
|
||||
return new global::_003C_003Ez__ReadOnlyArray<ITask>(new ITask[2] { waitQuestCompleted, waitDelay2 });
|
||||
}
|
||||
IL_01bf:
|
||||
return new global::_003C_003Ez__ReadOnlySingleElementList<ITask>(new EndAutomation());
|
||||
IL_02a6:
|
||||
IL_01ad:
|
||||
return new global::_003C_003Ez__ReadOnlyArray<ITask>(new ITask[3]
|
||||
{
|
||||
new WaitManualDuty(),
|
||||
new WaitDelay(),
|
||||
Next(quest, sequence)
|
||||
});
|
||||
IL_02ca:
|
||||
if (step.TerritoryId != step.TargetTerritoryId)
|
||||
{
|
||||
task2 = new WaitCondition.Task(() => clientState.TerritoryType == step.TargetTerritoryId, "Wait(tp to territory: " + territoryData.GetNameAndId(step.TargetTerritoryId.Value) + ")");
|
||||
|
|
@ -369,6 +375,58 @@ internal static class WaitAtEnd
|
|||
}
|
||||
}
|
||||
|
||||
internal sealed record WaitManualDuty : IDutyTask, ITask
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return "Wait(manual duty)";
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class WaitManualDutyExecutor(IClientState clientState, ICondition condition, TerritoryData territoryData) : TaskExecutor<WaitManualDuty>(), IDebugStateProvider, ITaskExecutor
|
||||
{
|
||||
private bool _enteredDuty;
|
||||
|
||||
protected override bool Start()
|
||||
{
|
||||
_enteredDuty = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override ETaskResult Update()
|
||||
{
|
||||
uint territoryType = clientState.TerritoryType;
|
||||
bool flag = territoryData.IsDutyInstance(territoryType) && !territoryData.IsFieldOperation(territoryType);
|
||||
if (!_enteredDuty)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
_enteredDuty = true;
|
||||
}
|
||||
return ETaskResult.StillRunning;
|
||||
}
|
||||
if (flag || ConditionHelper.IsBetweenAreas(condition))
|
||||
{
|
||||
return ETaskResult.StillRunning;
|
||||
}
|
||||
return ETaskResult.TaskComplete;
|
||||
}
|
||||
|
||||
public override bool ShouldInterruptOnDamage()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public string? GetDebugState()
|
||||
{
|
||||
if (!_enteredDuty)
|
||||
{
|
||||
return "Waiting for you to enter the duty";
|
||||
}
|
||||
return "Waiting for the duty to finish";
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed record NextStep(ElementId ElementId, int Sequence) : ILastTask, ITask
|
||||
{
|
||||
public override string ToString()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue