muffin v7.5.11
This commit is contained in:
parent
addf2d530f
commit
3102923ce2
522 changed files with 41082 additions and 211592 deletions
|
|
@ -1,8 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Questionable.Controller.CustomDelivery;
|
||||
using Questionable.Controller.Steps.Common;
|
||||
|
|
@ -16,354 +12,25 @@ internal static class AutoVendorPurchase
|
|||
{
|
||||
internal sealed class Factory(VendorResolverService vendorResolver, SmartNavRouteEnqueuer routeEnqueuer, ILogger<Factory> logger) : ITaskFactory
|
||||
{
|
||||
[CompilerGenerated]
|
||||
private sealed class _003CCreateAllTasks_003Ed__4 : IEnumerable<ITask>, IEnumerable, IEnumerator<ITask>, IEnumerator, IDisposable
|
||||
{
|
||||
private int _003C_003E1__state;
|
||||
|
||||
private ITask _003C_003E2__current;
|
||||
|
||||
private int _003C_003El__initialThreadId;
|
||||
|
||||
private QuestStep step;
|
||||
|
||||
public QuestStep _003C_003E3__step;
|
||||
|
||||
public Factory _003C_003E4__this;
|
||||
|
||||
private VendorResolverService.VendorInfo? _003Cvendor_003E5__2;
|
||||
|
||||
private int _003Cquantity_003E5__3;
|
||||
|
||||
private IEnumerator<ITask> _003C_003E7__wrap3;
|
||||
|
||||
ITask IEnumerator<ITask>.Current
|
||||
{
|
||||
[DebuggerHidden]
|
||||
get
|
||||
{
|
||||
return _003C_003E2__current;
|
||||
}
|
||||
}
|
||||
|
||||
object IEnumerator.Current
|
||||
{
|
||||
[DebuggerHidden]
|
||||
get
|
||||
{
|
||||
return _003C_003E2__current;
|
||||
}
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
public _003CCreateAllTasks_003Ed__4(int _003C_003E1__state)
|
||||
{
|
||||
this._003C_003E1__state = _003C_003E1__state;
|
||||
_003C_003El__initialThreadId = _202E_200D_206C_200F_206B_202D_200B_206D_202A_206E_200F_202E_206D_202E_206A_206E_200B_206B_206D_206A_202E_202D_202D_200C_206D_206F_206C_206A_202B_206E_202E_200C_200F_206C_200B_200B_200E_202E_206F_200C_202E();
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
int num = _003C_003E1__state;
|
||||
int num2 = ((num == -3) ? 1416042762 : 1416042763);
|
||||
while (true)
|
||||
{
|
||||
int num3 = num2;
|
||||
int num4 = 1416042762;
|
||||
int num5 = num3;
|
||||
switch ((num5 | num4) - (num5 & num4))
|
||||
{
|
||||
default:
|
||||
continue;
|
||||
case 2:
|
||||
num2 = 1416042763;
|
||||
continue;
|
||||
case 1:
|
||||
if (num == 1)
|
||||
{
|
||||
num2 = 1416042762;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
try
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
_003C_003Em__Finally1();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
_003C_003E7__wrap3 = null;
|
||||
_003C_003E1__state = -2;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
private bool MoveNext()
|
||||
{
|
||||
try
|
||||
{
|
||||
int num = _003C_003E1__state;
|
||||
Factory factory = _003C_003E4__this;
|
||||
int num2;
|
||||
switch (num)
|
||||
{
|
||||
default:
|
||||
num2 = 94833750;
|
||||
goto IL_0030;
|
||||
case 2:
|
||||
_003C_003E1__state = -1;
|
||||
_003C_003E2__current = new VendorPurchaseTask(_003Cvendor_003E5__2.Value.VendorNpcId, new global::_003C_003Ez__ReadOnlySingleElementList<VendorPurchaseTask.PurchaseItem>(new VendorPurchaseTask.PurchaseItem(_206B_200E_206E_202C_206E_206C_200D_206D_200C_206B_202A_200D_202C_206C_202E_206B_202E_206D_200F_202D_200B_200E_206E_206A_202A_202A_200C_202D_200D_202A_206A_206D_206A_206C_200F_206F_200C_206D_206A_202C_202E(step).Value, _003Cquantity_003E5__3)), _003Cvendor_003E5__2.Value.DialogOptionIndex);
|
||||
_003C_003E1__state = 3;
|
||||
return true;
|
||||
case 0:
|
||||
goto IL_025b;
|
||||
case 1:
|
||||
goto IL_02d8;
|
||||
case 3:
|
||||
break;
|
||||
IL_0030:
|
||||
while (true)
|
||||
{
|
||||
int num3 = num2;
|
||||
int num4 = 94833758;
|
||||
int num5 = num3;
|
||||
int num6 = num5 + num4;
|
||||
int num7 = num5 & num4;
|
||||
switch (num6 - (num7 + num7))
|
||||
{
|
||||
case 7:
|
||||
_003C_003Em__Finally1();
|
||||
_003C_003E7__wrap3 = null;
|
||||
_003C_003E2__current = new Mount.UnmountTask();
|
||||
_003C_003E1__state = 2;
|
||||
return true;
|
||||
case 0:
|
||||
goto IL_00c0;
|
||||
case 12:
|
||||
_206A_202E_202C_206A_206F_206B_206F_206E_200B_200B_200B_200B_200E_206B_202A_202A_206E_206C_200B_206B_200F_206E_206D_202B_200E_200E_202B_202C_202B_206A_206A_206C_200B_206E_206E_200D_206D_200E_206B_206A_202E((ILogger)factory.logger, global::_003CModule_003E._202E_206C_200F_206B_206A_202A_202C_206F_200C_206C_202B_206B_206D_206D_206D_202D_206E_202E_206C_206E_206D_202C_206F_200D_202D_202E_206A_206D_202A_206A_202B_200D_200C_206D_202B_200B_200D_200C_206E_206B_202E<string>(237865038), new object[1] { _206B_200E_206E_202C_206E_206C_200D_206D_200C_206B_202A_200D_202C_206C_202E_206B_202E_206D_200F_202D_200B_200E_206E_206A_202A_202A_200C_202D_200D_202A_206A_206D_206A_206C_200F_206F_200C_206D_206A_202C_202E(step) });
|
||||
return false;
|
||||
case 8:
|
||||
return false;
|
||||
case 11:
|
||||
{
|
||||
ITask current = _003C_003E7__wrap3.Current;
|
||||
_003C_003E2__current = current;
|
||||
_003C_003E1__state = 1;
|
||||
return true;
|
||||
}
|
||||
case 14:
|
||||
_003Cquantity_003E5__3 = _206E_206C_206F_202E_200B_202B_200B_202C_200E_206A_202B_200D_202D_202D_206C_206E_206A_206E_202D_206A_202D_200D_200F_200C_202A_206F_206A_200F_202E_200C_202A_206E_202D_206F_200C_200C_206D_206D_200C_202A_202E(step) ?? 1;
|
||||
_003C_003E7__wrap3 = factory.routeEnqueuer.BuildRoutedTasks(_003Cvendor_003E5__2.Value.TerritoryId, _003Cvendor_003E5__2.Value.Position).GetEnumerator();
|
||||
_003C_003E1__state = -3;
|
||||
num2 = 94833758;
|
||||
break;
|
||||
case 2:
|
||||
num2 = 94833750;
|
||||
break;
|
||||
case 6:
|
||||
goto end_IL_0030;
|
||||
case 10:
|
||||
goto IL_025b;
|
||||
case 1:
|
||||
goto IL_028c;
|
||||
case 5:
|
||||
goto IL_02d8;
|
||||
case 9:
|
||||
goto IL_02ec;
|
||||
case 3:
|
||||
return false;
|
||||
case 4:
|
||||
goto IL_032f;
|
||||
case 13:
|
||||
goto end_IL_000f;
|
||||
}
|
||||
continue;
|
||||
IL_032f:
|
||||
num2 = (_206B_200E_206E_202C_206E_206C_200D_206D_200C_206B_202A_200D_202C_206C_202E_206B_202E_206D_200F_202D_200B_200E_206E_206A_202A_202A_200C_202D_200D_202A_206A_206D_206A_206C_200F_206F_200C_206D_206A_202C_202E(step).HasValue ? 94833759 : 94833757);
|
||||
continue;
|
||||
IL_028c:
|
||||
_003Cvendor_003E5__2 = factory.vendorResolver.ResolveVendor(_206B_200E_206E_202C_206E_206C_200D_206D_200C_206B_202A_200D_202C_206C_202E_206B_202E_206D_200F_202D_200B_200E_206E_206A_202A_202A_200C_202D_200D_202A_206A_206D_206A_206C_200F_206F_200C_206D_206A_202C_202E(step).Value);
|
||||
num2 = (_003Cvendor_003E5__2.HasValue ? 94833744 : 94833746);
|
||||
continue;
|
||||
IL_00c0:
|
||||
num2 = (_202A_206B_200F_200F_200E_200D_206F_202A_206C_200C_206D_200E_206A_200E_202E_206D_206F_202B_202E_206C_202E_202D_202C_206E_202B_202D_206C_200B_200F_206F_206A_202B_206E_206C_206C_202E_206E_206B_206B_202A_202E((IEnumerator)_003C_003E7__wrap3) ? 94833749 : 94833753);
|
||||
continue;
|
||||
IL_02ec:
|
||||
num2 = (_200C_200F_200C_202A_202D_202D_202A_200C_200D_206C_206C_200C_206E_202E_206A_206A_200D_202C_200E_202C_206B_200F_206A_202A_202A_200C_206E_200D_202D_200C_200E_202B_206F_202C_202C_200C_206E_206A_200E_206D_202E(step).HasValue ? 94833757 : 94833754);
|
||||
continue;
|
||||
end_IL_0030:
|
||||
break;
|
||||
}
|
||||
goto case 2;
|
||||
IL_02d8:
|
||||
_003C_003E1__state = -3;
|
||||
num2 = 94833758;
|
||||
goto IL_0030;
|
||||
IL_025b:
|
||||
_003C_003E1__state = -1;
|
||||
num2 = ((_200B_206A_200B_206E_200B_206D_202C_202D_206F_202E_200D_202E_202A_206F_202C_206B_202B_206D_200D_202E_206A_206D_200C_202A_206F_206B_200C_202D_202B_202A_200E_206B_206C_200D_200E_200D_202D_202B_206D_200C_202E(step) != EInteractionType.PurchaseItem) ? 94833757 : 94833751);
|
||||
goto IL_0030;
|
||||
end_IL_000f:
|
||||
break;
|
||||
}
|
||||
_003C_003E1__state = -1;
|
||||
return false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
//try-fault
|
||||
((IDisposable)this).Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
bool IEnumerator.MoveNext()
|
||||
{
|
||||
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
|
||||
return this.MoveNext();
|
||||
}
|
||||
|
||||
private void _003C_003Em__Finally1()
|
||||
{
|
||||
_003C_003E1__state = -1;
|
||||
int num = ((_003C_003E7__wrap3 == null) ? 2030073587 : 2030073584);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 2030073586;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 1:
|
||||
return;
|
||||
case 2:
|
||||
_206D_202D_206A_200D_202C_206D_206A_206E_200E_206D_202E_206B_206D_206D_206D_200C_202C_200F_206F_200E_202B_202C_202B_202E_206E_200F_202C_202C_202E_200D_200F_202C_200F_202D_206F_200E_206D_202E_202E_202A_202E((IDisposable)_003C_003E7__wrap3);
|
||||
num = 2030073587;
|
||||
break;
|
||||
case 0:
|
||||
num = 2030073584;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
void IEnumerator.Reset()
|
||||
{
|
||||
throw _202E_200F_206F_202B_202B_202D_200C_206A_200B_206F_200D_202B_202C_202E_206F_202A_206E_200D_202A_200D_202D_206E_206F_206E_200E_206F_206E_200C_202A_206D_202E_200D_202C_202A_202D_206F_202E_206A_200E_206B_202E();
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
IEnumerator<ITask> IEnumerable<ITask>.GetEnumerator()
|
||||
{
|
||||
int num = ((_003C_003E1__state != -2) ? (-566231640) : (-566231639));
|
||||
_003CCreateAllTasks_003Ed__4 _003CCreateAllTasks_003Ed__ = default(_003CCreateAllTasks_003Ed__4);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -566231638;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 1:
|
||||
_003C_003E1__state = 0;
|
||||
_003CCreateAllTasks_003Ed__ = this;
|
||||
num = -566231638;
|
||||
break;
|
||||
case 3:
|
||||
num = ((_003C_003El__initialThreadId != _202E_200D_206C_200F_206B_202D_200B_206D_202A_206E_200F_202E_206D_202E_206A_206E_200B_206B_206D_206A_202E_202D_202D_200C_206D_206F_206C_206A_202B_206E_202E_200C_200F_206C_200B_200B_200E_202E_206F_200C_202E()) ? (-566231640) : (-566231637));
|
||||
break;
|
||||
case 2:
|
||||
_003CCreateAllTasks_003Ed__ = new _003CCreateAllTasks_003Ed__4(0)
|
||||
{
|
||||
_003C_003E4__this = _003C_003E4__this
|
||||
};
|
||||
num = -566231638;
|
||||
break;
|
||||
case 4:
|
||||
num = -566231639;
|
||||
break;
|
||||
case 0:
|
||||
_003CCreateAllTasks_003Ed__.step = _003C_003E3__step;
|
||||
return _003CCreateAllTasks_003Ed__;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[DebuggerHidden]
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return ((IEnumerable<ITask>)this).GetEnumerator();
|
||||
}
|
||||
|
||||
static int _202E_200D_206C_200F_206B_202D_200B_206D_202A_206E_200F_202E_206D_202E_206A_206E_200B_206B_206D_206A_202E_202D_202D_200C_206D_206F_206C_206A_202B_206E_202E_200C_200F_206C_200B_200B_200E_202E_206F_200C_202E()
|
||||
{
|
||||
return Environment.CurrentManagedThreadId;
|
||||
}
|
||||
|
||||
static EInteractionType _200B_206A_200B_206E_200B_206D_202C_202D_206F_202E_200D_202E_202A_206F_202C_206B_202B_206D_200D_202E_206A_206D_200C_202A_206F_206B_200C_202D_202B_202A_200E_206B_206C_200D_200E_200D_202D_202B_206D_200C_202E(QuestStep P_0)
|
||||
{
|
||||
return P_0.InteractionType;
|
||||
}
|
||||
|
||||
static uint? _200C_200F_200C_202A_202D_202D_202A_200C_200D_206C_206C_200C_206E_202E_206A_206A_200D_202C_200E_202C_206B_200F_206A_202A_202A_200C_206E_200D_202D_200C_200E_202B_206F_202C_202C_200C_206E_206A_200E_206D_202E(QuestStep P_0)
|
||||
{
|
||||
return P_0.DataId;
|
||||
}
|
||||
|
||||
static uint? _206B_200E_206E_202C_206E_206C_200D_206D_200C_206B_202A_200D_202C_206C_202E_206B_202E_206D_200F_202D_200B_200E_206E_206A_202A_202A_200C_202D_200D_202A_206A_206D_206A_206C_200F_206F_200C_206D_206A_202C_202E(QuestStep P_0)
|
||||
{
|
||||
return P_0.ItemId;
|
||||
}
|
||||
|
||||
static void _206A_202E_202C_206A_206F_206B_206F_206E_200B_200B_200B_200B_200E_206B_202A_202A_206E_206C_200B_206B_200F_206E_206D_202B_200E_200E_202B_202C_202B_206A_206A_206C_200B_206E_206E_200D_206D_200E_206B_206A_202E(ILogger P_0, string P_1, object[] P_2)
|
||||
{
|
||||
P_0.LogWarning(P_1, P_2);
|
||||
}
|
||||
|
||||
static int? _206E_206C_206F_202E_200B_202B_200B_202C_200E_206A_202B_200D_202D_202D_206C_206E_206A_206E_202D_206A_202D_200D_200F_200C_202A_206F_206A_200F_202E_200C_202A_206E_202D_206F_200C_200C_206D_206D_200C_202A_202E(QuestStep P_0)
|
||||
{
|
||||
return P_0.ItemCount;
|
||||
}
|
||||
|
||||
static bool _202A_206B_200F_200F_200E_200D_206F_202A_206C_200C_206D_200E_206A_200E_202E_206D_206F_202B_202E_206C_202E_202D_202C_206E_202B_202D_206C_200B_200F_206F_206A_202B_206E_206C_206C_202E_206E_206B_206B_202A_202E(IEnumerator P_0)
|
||||
{
|
||||
return P_0.MoveNext();
|
||||
}
|
||||
|
||||
static void _206D_202D_206A_200D_202C_206D_206A_206E_200E_206D_202E_206B_206D_206D_206D_200C_202C_200F_206F_200E_202B_202C_202B_202E_206E_200F_202C_202C_202E_200D_200F_202C_200F_202D_206F_200E_206D_202E_202E_202A_202E(IDisposable P_0)
|
||||
{
|
||||
P_0.Dispose();
|
||||
}
|
||||
|
||||
static NotSupportedException _202E_200F_206F_202B_202B_202D_200C_206A_200B_206F_200D_202B_202C_202E_206F_202A_206E_200D_202A_200D_202D_206E_206F_206E_200E_206F_206E_200C_202A_206D_202E_200D_202C_202A_202D_206F_202E_206A_200E_206B_202E()
|
||||
{
|
||||
return new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
[IteratorStateMachine(typeof(_003CCreateAllTasks_003Ed__4))]
|
||||
public IEnumerable<ITask> CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step)
|
||||
{
|
||||
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
|
||||
return new _003CCreateAllTasks_003Ed__4(-2)
|
||||
if (step.InteractionType != EInteractionType.PurchaseItem || step.DataId.HasValue || !step.ItemId.HasValue)
|
||||
{
|
||||
_003C_003E4__this = this,
|
||||
_003C_003E3__step = step
|
||||
};
|
||||
}
|
||||
|
||||
IEnumerable<ITask> ITaskFactory.CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step)
|
||||
{
|
||||
//ILSpy generated this explicit interface implementation from .override directive in CreateAllTasks
|
||||
return this.CreateAllTasks(quest, sequence, step);
|
||||
yield break;
|
||||
}
|
||||
VendorResolverService.VendorInfo? vendor = vendorResolver.ResolveVendor(step.ItemId.Value);
|
||||
if (!vendor.HasValue)
|
||||
{
|
||||
logger.LogWarning("No vendor with a known location sells item {ItemId}; cannot auto-purchase", step.ItemId);
|
||||
yield break;
|
||||
}
|
||||
int quantity = step.ItemCount ?? 1;
|
||||
foreach (ITask item in routeEnqueuer.BuildRoutedTasks(vendor.Value.TerritoryId, vendor.Value.Position))
|
||||
{
|
||||
yield return item;
|
||||
}
|
||||
yield return new Mount.UnmountTask();
|
||||
yield return new VendorPurchaseTask(vendor.Value.VendorNpcId, new global::_003C_003Ez__ReadOnlySingleElementList<VendorPurchaseTask.PurchaseItem>(new VendorPurchaseTask.PurchaseItem(step.ItemId.Value, quantity)), vendor.Value.DialogOptionIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue