forked from aly/qstbak
muffin v7.5.6
This commit is contained in:
parent
6266f9e6b7
commit
addf2d530f
619 changed files with 264792 additions and 446022 deletions
750
LLib/LLib.Shop/GcSupplyActions.cs
Normal file
750
LLib/LLib.Shop/GcSupplyActions.cs
Normal file
|
|
@ -0,0 +1,750 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
using LLib.GameData;
|
||||
using LLib.GameUI;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace LLib.Shop;
|
||||
|
||||
public static class GcSupplyActions
|
||||
{
|
||||
private const string SelectStringAddon = "SelectString";
|
||||
|
||||
private const string SupplyListAddon = "GrandCompanySupplyList";
|
||||
|
||||
private const string SupplyRewardAddon = "GrandCompanySupplyReward";
|
||||
|
||||
private const string SelectYesnoAddon = "SelectYesno";
|
||||
|
||||
private const int ListRowSealRewardBase = 265;
|
||||
|
||||
private const int ListRowItemIdBase = 425;
|
||||
|
||||
public const int MaxListRows = 40;
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsSelectStringReady(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(1633169237), out addonPtr) ? 1661521836 : 1661521839);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1661521838;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
goto IL_0054;
|
||||
case 1:
|
||||
return false;
|
||||
case 2:
|
||||
return LAddon.IsAddonReady(addonPtr);
|
||||
}
|
||||
continue;
|
||||
IL_0054:
|
||||
num = 1661521839;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TrySelectStringOption(IGameGui gameGui, int index)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(-223032717), out addonPtr) ? (-1381192086) : (-1381192087));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1381192088;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? (-1381192088) : (-1381192085));
|
||||
break;
|
||||
case 1:
|
||||
return false;
|
||||
case 0:
|
||||
AddonCallback.Fire(addonPtr, index);
|
||||
return true;
|
||||
case 3:
|
||||
return false;
|
||||
case 4:
|
||||
num = -1381192087;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryCloseSelectString(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(-223032717), out addonPtr) ? (-378189346) : (-378189345));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -378189346;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
AddonCallback.Fire(addonPtr, -1);
|
||||
return true;
|
||||
case 1:
|
||||
return false;
|
||||
case 2:
|
||||
goto IL_0068;
|
||||
}
|
||||
continue;
|
||||
IL_0068:
|
||||
num = -378189345;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsSupplyListReady(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(-1021783127), out addonPtr) ? 1360876237 : 1360876238);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1360876236;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 1:
|
||||
return LAddon.IsAddonReady(addonPtr);
|
||||
case 2:
|
||||
return false;
|
||||
case 0:
|
||||
goto IL_005b;
|
||||
}
|
||||
continue;
|
||||
IL_005b:
|
||||
num = 1360876238;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TrySwitchToExpertTab(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(-1021783127), out addonPtr) ? (-1935915101) : (-1935915100));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1935915097;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
AddonCallback.Fire(addonPtr, 0, 2, 0);
|
||||
return true;
|
||||
case 4:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? (-1935915097) : (-1935915098));
|
||||
break;
|
||||
case 3:
|
||||
return false;
|
||||
case 2:
|
||||
num = -1935915100;
|
||||
break;
|
||||
case 1:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private unsafe static bool IsListLoaded(AtkUnitBase* addon)
|
||||
{
|
||||
AtkValue atkValues = *addon->AtkValues;
|
||||
AtkValueType type = atkValues.Type;
|
||||
int num = ((type == AtkValueType.Int) ? 440834222 : 440834223);
|
||||
bool result = default(bool);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 440834218;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
num = 440834223;
|
||||
break;
|
||||
case 4:
|
||||
result = atkValues.Int == 2;
|
||||
num = 440834217;
|
||||
break;
|
||||
case 1:
|
||||
result = atkValues.UInt == 2;
|
||||
num = 440834217;
|
||||
break;
|
||||
case 2:
|
||||
result = false;
|
||||
num = 440834217;
|
||||
break;
|
||||
case 3:
|
||||
return result;
|
||||
case 5:
|
||||
num = ((type != AtkValueType.UInt) ? 440834216 : 440834219);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private unsafe static bool IsExpertTab(AtkUnitBase* addon)
|
||||
{
|
||||
AtkValue atkValue = addon->AtkValues[5];
|
||||
AtkValueType type = atkValue.Type;
|
||||
int num = ((type == AtkValueType.Int) ? (-1706563251) : (-1706563253));
|
||||
bool result = default(bool);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1706563256;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 4:
|
||||
result = atkValue.UInt == 2;
|
||||
num = -1706563255;
|
||||
break;
|
||||
case 1:
|
||||
return result;
|
||||
case 0:
|
||||
result = false;
|
||||
num = -1706563255;
|
||||
break;
|
||||
case 2:
|
||||
num = -1706563253;
|
||||
break;
|
||||
case 5:
|
||||
result = atkValue.Int == 2;
|
||||
num = -1706563255;
|
||||
break;
|
||||
case 3:
|
||||
num = ((type != AtkValueType.UInt) ? (-1706563256) : (-1706563252));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsExpertTabActive(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(-56578548), out addonPtr) ? (-429976172) : (-429976171));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -429976175;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 6:
|
||||
num = ((addonPtr->AtkValuesCount >= 7) ? (-429976174) : (-429976173));
|
||||
break;
|
||||
case 4:
|
||||
return false;
|
||||
case 5:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? (-429976176) : (-429976170));
|
||||
break;
|
||||
case 7:
|
||||
return false;
|
||||
case 3:
|
||||
return IsExpertTab(addonPtr);
|
||||
case 2:
|
||||
return false;
|
||||
case 0:
|
||||
num = -429976171;
|
||||
break;
|
||||
case 1:
|
||||
num = ((addonPtr->AtkValues == null) ? (-429976173) : (-429976169));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static int GetListItemCount(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-791024633), out addonPtr) ? (-2072162579) : (-2072162586));
|
||||
AtkValue atkValue = default(AtkValue);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -2072162587;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 8:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? (-2072162581) : (-2072162590));
|
||||
break;
|
||||
case 9:
|
||||
num = ((addonPtr->AtkValuesCount >= 7) ? (-2072162589) : (-2072162577));
|
||||
break;
|
||||
case 0:
|
||||
num = -2072162586;
|
||||
break;
|
||||
case 7:
|
||||
return -1;
|
||||
case 5:
|
||||
return atkValue.Int;
|
||||
case 10:
|
||||
return -1;
|
||||
case 11:
|
||||
num = ((atkValue.Type != AtkValueType.UInt) ? (-2072162583) : (-2072162591));
|
||||
break;
|
||||
case 12:
|
||||
return -1;
|
||||
case 4:
|
||||
return (int)atkValue.UInt;
|
||||
case 14:
|
||||
num = ((addonPtr->AtkValues == null) ? (-2072162577) : (-2072162580));
|
||||
break;
|
||||
case 3:
|
||||
return -1;
|
||||
case 13:
|
||||
num = (IsExpertTab(addonPtr) ? (-2072162588) : (-2072162585));
|
||||
break;
|
||||
case 2:
|
||||
return -1;
|
||||
case 6:
|
||||
num = ((!IsListLoaded(addonPtr)) ? (-2072162585) : (-2072162584));
|
||||
break;
|
||||
case 1:
|
||||
atkValue = addonPtr->AtkValues[6];
|
||||
num = ((atkValue.Type != AtkValueType.Int) ? (-2072162578) : (-2072162592));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static uint GetListItemId(IGameGui gameGui, int itemIndex)
|
||||
{
|
||||
int num = ((itemIndex < 0) ? 157882237 : 157882223);
|
||||
AtkValue atkValue = default(AtkValue);
|
||||
AtkUnitBase* addonPtr = default(AtkUnitBase*);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 157882237;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 12:
|
||||
num = ((atkValue.Int <= 0) ? 157882235 : 157882226);
|
||||
break;
|
||||
case 3:
|
||||
return atkValue.UInt;
|
||||
case 5:
|
||||
num = ((atkValue.Type != AtkValueType.Int) ? 157882235 : 157882225);
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
ushort atkValuesCount = addonPtr->AtkValuesCount;
|
||||
num3 = itemIndex;
|
||||
num4 = 425;
|
||||
int num5 = num4 ^ num3;
|
||||
int num6 = num4 & num3;
|
||||
num = ((atkValuesCount > num5 + (num6 + num6)) ? 157882233 : 157882228);
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
return 0u;
|
||||
case 15:
|
||||
return (uint)atkValue.Int;
|
||||
case 17:
|
||||
return 0u;
|
||||
case 18:
|
||||
num = ((itemIndex < 40) ? 157882221 : 157882237);
|
||||
break;
|
||||
case 8:
|
||||
num = 157882223;
|
||||
break;
|
||||
case 1:
|
||||
num = ((addonPtr->AtkValues == null) ? 157882228 : 157882227);
|
||||
break;
|
||||
case 9:
|
||||
return 0u;
|
||||
case 13:
|
||||
return 0u;
|
||||
case 16:
|
||||
num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(2078745431), out addonPtr) ? 157882239 : 157882231);
|
||||
break;
|
||||
case 2:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? 157882236 : 157882224);
|
||||
break;
|
||||
case 6:
|
||||
return 0u;
|
||||
case 7:
|
||||
num = (IsExpertTab(addonPtr) ? 157882230 : 157882220);
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
AtkValue* atkValues = addonPtr->AtkValues;
|
||||
num3 = itemIndex;
|
||||
num4 = 425;
|
||||
int num7 = num4 ^ num3;
|
||||
int num8 = num4 & num3;
|
||||
atkValue = atkValues[num7 + (num8 + num8)];
|
||||
num = ((atkValue.Type != AtkValueType.UInt) ? 157882232 : 157882238);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
return 0u;
|
||||
case 4:
|
||||
num = ((!IsListLoaded(addonPtr)) ? 157882220 : 157882234);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static int GetListItemSealReward(IGameGui gameGui, int itemIndex)
|
||||
{
|
||||
int num = ((itemIndex < 0) ? 942417142 : 942417140);
|
||||
AtkUnitBase* addonPtr = default(AtkUnitBase*);
|
||||
AtkValue atkValue = default(AtkValue);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 942417143;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 11:
|
||||
return -1;
|
||||
case 17:
|
||||
num = ((!IsListLoaded(addonPtr)) ? 942417138 : 942417143);
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
ushort atkValuesCount = addonPtr->AtkValuesCount;
|
||||
num3 = itemIndex;
|
||||
num4 = 265;
|
||||
num = ((atkValuesCount > (num4 | num3) + (num4 & num3)) ? 942417126 : 942417144);
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
return -1;
|
||||
case 12:
|
||||
num = 942417140;
|
||||
break;
|
||||
case 4:
|
||||
num = ((addonPtr->AtkValues == null) ? 942417144 : 942417150);
|
||||
break;
|
||||
case 2:
|
||||
return (int)atkValue.UInt;
|
||||
case 3:
|
||||
num = ((itemIndex < 40) ? 942417137 : 942417142);
|
||||
break;
|
||||
case 0:
|
||||
num = (IsExpertTab(addonPtr) ? 942417151 : 942417138);
|
||||
break;
|
||||
case 16:
|
||||
num = ((atkValue.Type != AtkValueType.UInt) ? 942417149 : 942417141);
|
||||
break;
|
||||
case 1:
|
||||
return -1;
|
||||
case 13:
|
||||
return atkValue.Int;
|
||||
case 7:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? 942417139 : 942417145);
|
||||
break;
|
||||
case 5:
|
||||
return -1;
|
||||
case 15:
|
||||
return -1;
|
||||
case 6:
|
||||
num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(2078745431), out addonPtr) ? 942417136 : 942417148);
|
||||
break;
|
||||
case 10:
|
||||
return -1;
|
||||
case 8:
|
||||
{
|
||||
AtkValue* atkValues = addonPtr->AtkValues;
|
||||
num3 = itemIndex;
|
||||
num4 = 265;
|
||||
atkValue = atkValues[(num4 | num3) + (num4 & num3)];
|
||||
num = ((atkValue.Type != AtkValueType.Int) ? 942417127 : 942417146);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TrySelectItem(IGameGui gameGui, int itemIndex)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(2047037119), out addonPtr) ? 83215981 : 83215979);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 83215977;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
num = 83215979;
|
||||
break;
|
||||
case 4:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? 83215976 : 83215978);
|
||||
break;
|
||||
case 3:
|
||||
return false;
|
||||
case 1:
|
||||
AddonCallback.Fire(addonPtr, 1, itemIndex, 0);
|
||||
return true;
|
||||
case 2:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryForceRefresh(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(2078745431), out addonPtr) ? 1468289263 : 1468289256);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1468289259;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
num = 1468289256;
|
||||
break;
|
||||
case 3:
|
||||
return false;
|
||||
case 4:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? 1468289258 : 1468289257);
|
||||
break;
|
||||
case 1:
|
||||
AddonCallback.Fire(addonPtr, 2);
|
||||
return true;
|
||||
case 2:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryCloseSupplyList(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(-56578548), out addonPtr) ? (-131329648) : (-131329645));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -131329647;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
goto IL_0052;
|
||||
case 2:
|
||||
return false;
|
||||
case 1:
|
||||
AddonCallback.Fire(addonPtr, -1);
|
||||
return true;
|
||||
}
|
||||
continue;
|
||||
IL_0052:
|
||||
num = -131329645;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsRewardDialogReady(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(-1608495528), out addonPtr) ? 578433628 : 578433629);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 578433628;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 2:
|
||||
goto IL_0052;
|
||||
case 0:
|
||||
return LAddon.IsAddonReady(addonPtr);
|
||||
case 1:
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
IL_0052:
|
||||
num = 578433629;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryConfirmTurnIn(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(275890163), out addonPtr) ? 799150129 : 799150135);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 799150131;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 3:
|
||||
num = 799150135;
|
||||
break;
|
||||
case 4:
|
||||
return false;
|
||||
case 1:
|
||||
AddonCallback.Fire(addonPtr, default(int));
|
||||
return true;
|
||||
case 2:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? 799150130 : 799150131);
|
||||
break;
|
||||
case 0:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsHqConfirmReady(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(1402346953), out addonPtr) ? 140237471 : 140237470);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 140237471;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
goto IL_0054;
|
||||
case 1:
|
||||
return false;
|
||||
case 0:
|
||||
return LAddon.IsAddonReady(addonPtr);
|
||||
}
|
||||
continue;
|
||||
IL_0054:
|
||||
num = 140237470;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryConfirmHqTrade(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-502173951), out addonPtr) ? 1659793375 : 1659793372);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1659793374;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 3:
|
||||
return false;
|
||||
case 0:
|
||||
AddonCallback.ClickYes(addonPtr);
|
||||
return true;
|
||||
case 4:
|
||||
num = 1659793372;
|
||||
break;
|
||||
case 1:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? 1659793374 : 1659793373);
|
||||
break;
|
||||
case 2:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetCurrentSeals()
|
||||
{
|
||||
return GrandCompanyShop.GetCompanySeals();
|
||||
}
|
||||
|
||||
public static int GetMaxSeals(IDataManager dataManager)
|
||||
{
|
||||
byte grandCompanyRank = GrandCompanyHelper.GetGrandCompanyRank();
|
||||
int num = ((grandCompanyRank != 0) ? 1262186934 : 1262186932);
|
||||
GrandCompanyRank row = default(GrandCompanyRank);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1262186933;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
num = 1262186932;
|
||||
break;
|
||||
case 1:
|
||||
return 0;
|
||||
case 4:
|
||||
return (int)row.MaxSeals;
|
||||
case 2:
|
||||
return 0;
|
||||
case 3:
|
||||
num = (dataManager.GetExcelSheet<GrandCompanyRank>().TryGetRow(grandCompanyRank, out row) ? 1262186929 : 1262186935);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsItemExpertDeliverable(IDataManager dataManager, uint itemId)
|
||||
{
|
||||
Item row;
|
||||
int num = (dataManager.GetExcelSheet<Item>().TryGetRow(itemId, out row) ? (-1763780714) : (-1763780716));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1763780715;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
num = -1763780716;
|
||||
break;
|
||||
case 0:
|
||||
return false;
|
||||
case 3:
|
||||
num = ((row.Rarity >= 2) ? (-1763780719) : (-1763780715));
|
||||
break;
|
||||
case 1:
|
||||
return false;
|
||||
case 4:
|
||||
return row.Desynth > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -11,8 +11,6 @@ public interface IShopWindow
|
|||
|
||||
Vector2? Position { get; set; }
|
||||
|
||||
int GetCurrencyCount();
|
||||
|
||||
unsafe void UpdateShopStock(AtkUnitBase* addon);
|
||||
|
||||
unsafe void TriggerPurchase(AtkUnitBase* addonShop, int buyNow);
|
||||
|
|
|
|||
1147
LLib/LLib.Shop/NpcPositionCache.cs
Normal file
1147
LLib/LLib.Shop/NpcPositionCache.cs
Normal file
File diff suppressed because it is too large
Load diff
152
LLib/LLib.Shop/NpcPositionCacheOptions.cs
Normal file
152
LLib/LLib.Shop/NpcPositionCacheOptions.cs
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace LLib.Shop;
|
||||
|
||||
public sealed record NpcPositionCacheOptions
|
||||
{
|
||||
[CompilerGenerated]
|
||||
private Type EqualityContract
|
||||
{
|
||||
[CompilerGenerated]
|
||||
get
|
||||
{
|
||||
return _200D_200B_200C_206D_206E_206F_200D_202D_206B_202E_202C_206F_206E_200C_202B_202D_206F_206C_206A_202C_202A_206C_200C_200D_206A_200D_200B_202D_202A_200E_202D_206C_200C_200F_202B_206F_202E_206E_206F_200E_202E(typeof(NpcPositionCacheOptions).TypeHandle);
|
||||
}
|
||||
}
|
||||
|
||||
public string? CacheDirectory { get; init; }
|
||||
|
||||
public string? GameVersion { get; init; }
|
||||
|
||||
public TimeSpan ScanThrottle { get; init; } = TimeSpan.Zero;
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
[CompilerGenerated]
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder stringBuilder = _202B_206D_202A_206F_202C_206F_202C_200C_200F_206C_202A_202E_200E_202D_200D_200D_200D_202E_206F_200B_202B_200E_200D_206C_200F_206C_206B_206C_206E_200C_200D_206F_206F_200E_206D_200F_200E_202C_206F_200C_202E();
|
||||
_206D_206E_200B_202D_202C_206E_202C_202B_206C_206D_202B_202A_206A_200E_206A_206B_200C_202D_206B_200B_200C_206B_202E_200C_200C_202E_206A_200B_202A_206D_206E_200F_206E_202C_206C_202D_202B_202E_200D_206E_202E(stringBuilder, global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(-186520668));
|
||||
_206D_206E_200B_202D_202C_206E_202C_202B_206C_206D_202B_202A_206A_200E_206A_206B_200C_202D_206B_200B_200C_206B_202E_200C_200C_202E_206A_200B_202A_206D_206E_200F_206E_202C_206C_202D_202B_202E_200D_206E_202E(stringBuilder, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(579144622));
|
||||
int num = ((!PrintMembers(stringBuilder)) ? (-658124115) : (-658124116));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -658124115;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 2:
|
||||
num = -658124116;
|
||||
break;
|
||||
case 1:
|
||||
_202E_200D_202E_200E_206C_200D_206A_206B_202B_200B_206B_206F_206F_206F_206D_206C_202D_202C_206F_202A_206B_206A_202D_202E_202A_206F_200B_206F_200E_206A_200D_202B_202B_200B_206A_202A_202E_200D_200C_202E_202E(stringBuilder, ' ');
|
||||
num = -658124115;
|
||||
break;
|
||||
case 0:
|
||||
_202E_200D_202E_200E_206C_200D_206A_206B_202B_200B_206B_206F_206F_206F_206D_206C_202D_202C_206F_202A_206B_206A_202D_202E_202A_206F_200B_206F_200E_206A_200D_202B_202B_200B_206A_202A_202E_200D_200C_202E_202E(stringBuilder, '}');
|
||||
return _200B_202C_202C_200F_200F_206F_200B_200D_202E_202B_206F_206F_200D_200D_206B_200E_200F_202A_202D_202C_200B_206C_200D_202B_206E_202C_206F_206A_206F_206B_202A_200D_206F_202D_200F_200E_206E_200C_206C_200C_202E((object?)stringBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
[CompilerGenerated]
|
||||
private bool PrintMembers(StringBuilder builder)
|
||||
{
|
||||
_206E_202A_202D_202A_202E_202A_200B_200B_202B_202B_202D_202E_206D_206D_206B_202B_202A_202D_206E_206E_200F_200B_206B_206E_200E_202C_206A_202E_206D_200D_202C_202A_202A_206F_200C_202D_202E_206E_200B_206C_202E();
|
||||
_206D_206E_200B_202D_202C_206E_202C_202B_206C_206D_202B_202A_206A_200E_206A_206B_200C_202D_206B_200B_200C_206B_202E_200C_200C_202E_206A_200B_202A_206D_206E_200F_206E_202C_206C_202D_202B_202E_200D_206E_202E(builder, global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(624739849));
|
||||
_206C_202D_206D_202A_202B_202D_206C_206F_202B_206D_206C_202C_206F_202E_200F_206C_202C_200E_200E_202C_206A_200F_202C_200B_202B_200D_202E_200C_206F_206A_206C_202C_202C_206E_200E_206D_202E_200F_206A_206F_202E(builder, (object?)CacheDirectory);
|
||||
_206D_206E_200B_202D_202C_206E_202C_202B_206C_206D_202B_202A_206A_200E_206A_206B_200C_202D_206B_200B_200C_206B_202E_200C_200C_202E_206A_200B_202A_206D_206E_200F_206E_202C_206C_202D_202B_202E_200D_206E_202E(builder, global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(1054887383));
|
||||
_206C_202D_206D_202A_202B_202D_206C_206F_202B_206D_206C_202C_206F_202E_200F_206C_202C_200E_200E_202C_206A_200F_202C_200B_202B_200D_202E_200C_206F_206A_206C_202C_202C_206E_200E_206D_202E_200F_206A_206F_202E(builder, (object?)GameVersion);
|
||||
_206D_206E_200B_202D_202C_206E_202C_202B_206C_206D_202B_202A_206A_200E_206A_206B_200C_202D_206B_200B_200C_206B_202E_200C_200C_202E_206A_200B_202A_206D_206E_200F_206E_202C_206C_202D_202B_202E_200D_206E_202E(builder, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(2000135391));
|
||||
_206D_206E_200B_202D_202C_206E_202C_202B_206C_206D_202B_202A_206A_200E_206A_206B_200C_202D_206B_200B_200C_206B_202E_200C_200C_202E_206A_200B_202A_206D_206E_200F_206E_202C_206C_202D_202B_202E_200D_206E_202E(builder, ScanThrottle.ToString());
|
||||
return true;
|
||||
}
|
||||
|
||||
[CompilerGenerated]
|
||||
public bool Equals(NpcPositionCacheOptions? other)
|
||||
{
|
||||
int num = (((object)this == other) ? (-1497695151) : (-1497695145));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1497695146;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 5:
|
||||
num = -1497695145;
|
||||
break;
|
||||
case 3:
|
||||
return false;
|
||||
case 1:
|
||||
num = (((object)other == null) ? (-1497695147) : (-1497695146));
|
||||
break;
|
||||
case 2:
|
||||
num = ((!EqualityComparer<string>.Default.Equals(GameVersion, other.GameVersion)) ? (-1497695147) : (-1497695152));
|
||||
break;
|
||||
case 6:
|
||||
return EqualityComparer<TimeSpan>.Default.Equals(ScanThrottle, other.ScanThrottle);
|
||||
case 7:
|
||||
return true;
|
||||
case 4:
|
||||
num = ((!EqualityComparer<string>.Default.Equals(CacheDirectory, other.CacheDirectory)) ? (-1497695147) : (-1497695148));
|
||||
break;
|
||||
case 0:
|
||||
num = ((!_200C_202B_206E_200C_206B_202A_202C_202D_200D_206D_200C_200F_200F_200D_206B_206F_206F_206C_202D_206D_202A_206D_200D_200C_202E_200B_200C_200B_200F_202D_206D_206E_200C_200C_202C_206F_200B_200F_202D_202C_202E(EqualityContract, other.EqualityContract)) ? (-1497695147) : (-1497695150));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool IEquatable<NpcPositionCacheOptions>.Equals(NpcPositionCacheOptions? other)
|
||||
{
|
||||
//ILSpy generated this explicit interface implementation from .override directive in Equals
|
||||
return this.Equals(other);
|
||||
}
|
||||
|
||||
static Type? _200D_200B_200C_206D_206E_206F_200D_202D_206B_202E_202C_206F_206E_200C_202B_202D_206F_206C_206A_202C_202A_206C_200C_200D_206A_200D_200B_202D_202A_200E_202D_206C_200C_200F_202B_206F_202E_206E_206F_200E_202E(RuntimeTypeHandle P_0)
|
||||
{
|
||||
return Type.GetTypeFromHandle(P_0);
|
||||
}
|
||||
|
||||
static StringBuilder? _202B_206D_202A_206F_202C_206F_202C_200C_200F_206C_202A_202E_200E_202D_200D_200D_200D_202E_206F_200B_202B_200E_200D_206C_200F_206C_206B_206C_206E_200C_200D_206F_206F_200E_206D_200F_200E_202C_206F_200C_202E()
|
||||
{
|
||||
return new StringBuilder();
|
||||
}
|
||||
|
||||
static StringBuilder? _206D_206E_200B_202D_202C_206E_202C_202B_206C_206D_202B_202A_206A_200E_206A_206B_200C_202D_206B_200B_200C_206B_202E_200C_200C_202E_206A_200B_202A_206D_206E_200F_206E_202C_206C_202D_202B_202E_200D_206E_202E(StringBuilder? P_0, string? P_1)
|
||||
{
|
||||
return P_0.Append(P_1);
|
||||
}
|
||||
|
||||
static StringBuilder? _202E_200D_202E_200E_206C_200D_206A_206B_202B_200B_206B_206F_206F_206F_206D_206C_202D_202C_206F_202A_206B_206A_202D_202E_202A_206F_200B_206F_200E_206A_200D_202B_202B_200B_206A_202A_202E_200D_200C_202E_202E(StringBuilder? P_0, char P_1)
|
||||
{
|
||||
return P_0.Append(P_1);
|
||||
}
|
||||
|
||||
static string? _200B_202C_202C_200F_200F_206F_200B_200D_202E_202B_206F_206F_200D_200D_206B_200E_200F_202A_202D_202C_200B_206C_200D_202B_206E_202C_206F_206A_206F_206B_202A_200D_206F_202D_200F_200E_206E_200C_206C_200C_202E(object? P_0)
|
||||
{
|
||||
return P_0.ToString();
|
||||
}
|
||||
|
||||
static void _206E_202A_202D_202A_202E_202A_200B_200B_202B_202B_202D_202E_206D_206D_206B_202B_202A_202D_206E_206E_200F_200B_206B_206E_200E_202C_206A_202E_206D_200D_202C_202A_202A_206F_200C_202D_202E_206E_200B_206C_202E()
|
||||
{
|
||||
RuntimeHelpers.EnsureSufficientExecutionStack();
|
||||
}
|
||||
|
||||
static StringBuilder? _206C_202D_206D_202A_202B_202D_206C_206F_202B_206D_206C_202C_206F_202E_200F_206C_202C_200E_200E_202C_206A_200F_202C_200B_202B_200D_202E_200C_206F_206A_206C_202C_202C_206E_200E_206D_202E_200F_206A_206F_202E(StringBuilder? P_0, object? P_1)
|
||||
{
|
||||
return P_0.Append(P_1);
|
||||
}
|
||||
|
||||
static bool _200C_202B_206E_200C_206B_202A_202C_202D_200D_206D_200C_200F_200F_200D_206B_206F_206F_206C_202D_206D_202A_206D_200D_200C_202E_200B_200C_200B_200F_202D_206D_206E_200C_200C_202C_206F_200B_200F_202D_202C_202E(Type? P_0, Type? P_1)
|
||||
{
|
||||
return P_0 == P_1;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,9 +8,12 @@ public sealed class PurchaseCompletedEventArgs : EventArgs
|
|||
|
||||
public bool Success { get; }
|
||||
|
||||
public PurchaseCompletedEventArgs(uint itemId, bool success)
|
||||
public int QuantityPurchased { get; }
|
||||
|
||||
public PurchaseCompletedEventArgs(uint itemId, bool success, int quantityPurchased = 0)
|
||||
{
|
||||
ItemId = itemId;
|
||||
Success = success;
|
||||
QuantityPurchased = quantityPurchased;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,21 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using Dalamud.Game.Addon.Lifecycle;
|
||||
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
|
||||
using Dalamud.Game.NativeWrapper;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
using LLib.GameUI;
|
||||
using LLib.Inventory;
|
||||
using LLib.Shop.Model;
|
||||
using Lumina.Excel;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace LLib.Shop;
|
||||
|
||||
public class RegularShopBase
|
||||
public class RegularShopBase : IDisposable
|
||||
{
|
||||
private readonly IShopWindow _parentWindow;
|
||||
|
||||
|
|
@ -22,6 +27,17 @@ public class RegularShopBase
|
|||
|
||||
private readonly IAddonLifecycle _addonLifecycle;
|
||||
|
||||
private readonly ExcelSheet<Item> _itemSheet;
|
||||
|
||||
private long _purchaseDeadlineMs;
|
||||
|
||||
[CompilerGenerated]
|
||||
private EventHandler<PurchaseCompletedEventArgs>? m_PurchaseCompleted;
|
||||
|
||||
private const int MaxPurchaseQuantity = 99;
|
||||
|
||||
private const int MaxWaitMs = 3000;
|
||||
|
||||
public ItemForSale? ItemForSale { get; set; }
|
||||
|
||||
public PurchaseState? PurchaseState { get; private set; }
|
||||
|
|
@ -36,240 +52,596 @@ public class RegularShopBase
|
|||
}
|
||||
set
|
||||
{
|
||||
PurchaseState.IsAwaitingYesNo = value;
|
||||
int num = ((PurchaseState == null) ? (-314894367) : (-314894366));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -314894368;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
num = -314894366;
|
||||
break;
|
||||
case 1:
|
||||
return;
|
||||
case 2:
|
||||
PurchaseState.IsAwaitingYesNo = value;
|
||||
num = -314894367;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RegularShopBase(IShopWindow parentWindow, string addonName, IPluginLog pluginLog, IGameGui gameGui, IAddonLifecycle addonLifecycle)
|
||||
public event EventHandler<PurchaseCompletedEventArgs>? PurchaseCompleted
|
||||
{
|
||||
[CompilerGenerated]
|
||||
add
|
||||
{
|
||||
EventHandler<PurchaseCompletedEventArgs> eventHandler = this.m_PurchaseCompleted;
|
||||
int num = 660558086;
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 660558087;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 2:
|
||||
return;
|
||||
case 1:
|
||||
{
|
||||
EventHandler<PurchaseCompletedEventArgs> eventHandler2 = eventHandler;
|
||||
EventHandler<PurchaseCompletedEventArgs> value2 = (EventHandler<PurchaseCompletedEventArgs>)_202E_202D_202E_200D_200B_206C_202C_200F_206C_200C_206B_202A_200B_202A_200D_206B_202B_206B_200F_200C_206C_206C_206B_202B_202C_200D_206B_202A_200E_206D_206B_200E_200E_206E_202D_206D_200F_206E_202C_206E_202E((Delegate)eventHandler2, (Delegate)value);
|
||||
eventHandler = Interlocked.CompareExchange(ref this.m_PurchaseCompleted, value2, eventHandler2);
|
||||
num = (((object)eventHandler != eventHandler2) ? 660558086 : 660558085);
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
num = 660558086;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
[CompilerGenerated]
|
||||
remove
|
||||
{
|
||||
EventHandler<PurchaseCompletedEventArgs> eventHandler = this.m_PurchaseCompleted;
|
||||
int num = 1746183052;
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1746183053;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
num = 1746183052;
|
||||
break;
|
||||
case 2:
|
||||
return;
|
||||
case 1:
|
||||
{
|
||||
EventHandler<PurchaseCompletedEventArgs> eventHandler2 = eventHandler;
|
||||
EventHandler<PurchaseCompletedEventArgs> value2 = (EventHandler<PurchaseCompletedEventArgs>)_200B_206D_202C_206D_206C_200D_202B_200D_202A_202E_200E_200C_200E_206D_202B_206E_200F_206E_200E_200B_202C_206E_202C_206A_206B_206F_206B_200B_206D_202D_202C_202C_206D_202B_202D_206B_200D_200C_200C_202C_202E((Delegate)eventHandler2, (Delegate)value);
|
||||
eventHandler = Interlocked.CompareExchange(ref this.m_PurchaseCompleted, value2, eventHandler2);
|
||||
num = (((object)eventHandler != eventHandler2) ? 1746183052 : 1746183055);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public RegularShopBase(IShopWindow parentWindow, string addonName, IPluginLog pluginLog, IGameGui gameGui, IAddonLifecycle addonLifecycle, IDataManager dataManager)
|
||||
{
|
||||
_206B_206A_202C_200C_206E_200C_202C_206A_200D_202A_202D_206D_200E_200B_206E_206F_200B_206A_206F_202D_200F_202A_202C_200E_202C_202B_206A_202C_200F_202D_206D_202D_202A_206C_202C_206C_206B_200B_200D_200F_202E((object)parentWindow, global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(1152352366));
|
||||
_200F_206D_202A_206D_200C_206A_202D_200D_206E_200F_206E_206D_206F_202B_202C_202A_200E_202D_206C_202B_200E_202D_206F_206C_202B_202B_206F_206F_206D_202C_202B_202E_200D_202A_206D_206A_206C_200C_206F_200F_202E(addonName, global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(876094366));
|
||||
_206B_206A_202C_200C_206E_200C_202C_206A_200D_202A_202D_206D_200E_200B_206E_206F_200B_206A_206F_202D_200F_202A_202C_200E_202C_202B_206A_202C_200F_202D_206D_202D_202A_206C_202C_206C_206B_200B_200D_200F_202E((object)pluginLog, global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(-2117874046));
|
||||
_206B_206A_202C_200C_206E_200C_202C_206A_200D_202A_202D_206D_200E_200B_206E_206F_200B_206A_206F_202D_200F_202A_202C_200E_202C_202B_206A_202C_200F_202D_206D_202D_202A_206C_202C_206C_206B_200B_200D_200F_202E((object)gameGui, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(608358874));
|
||||
_206B_206A_202C_200C_206E_200C_202C_206A_200D_202A_202D_206D_200E_200B_206E_206F_200B_206A_206F_202D_200F_202A_202C_200E_202C_202B_206A_202C_200F_202D_206D_202D_202A_206C_202C_206C_206B_200B_200D_200F_202E((object)addonLifecycle, global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(1756451262));
|
||||
_206B_206A_202C_200C_206E_200C_202C_206A_200D_202A_202D_206D_200E_200B_206E_206F_200B_206A_206F_202D_200F_202A_202C_200E_202C_202B_206A_202C_200F_202D_206D_202D_202A_206C_202C_206C_206B_200B_200D_200F_202E((object)dataManager, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(990210437));
|
||||
_parentWindow = parentWindow;
|
||||
_addonName = addonName;
|
||||
_pluginLog = pluginLog;
|
||||
_gameGui = gameGui;
|
||||
_addonLifecycle = addonLifecycle;
|
||||
_addonLifecycle.RegisterListener(AddonEvent.PostSetup, _addonName, ShopPostSetup);
|
||||
_addonLifecycle.RegisterListener(AddonEvent.PreFinalize, _addonName, ShopPreFinalize);
|
||||
_addonLifecycle.RegisterListener(AddonEvent.PostUpdate, _addonName, ShopPostUpdate);
|
||||
_itemSheet = dataManager.GetExcelSheet<Item>();
|
||||
_202B_200B_206D_200B_206F_200C_200C_206E_200B_206E_206D_206B_206E_202A_200B_206F_202B_206F_206F_206E_200D_200F_206D_200E_202C_200D_206E_200C_200D_202A_202C_200B_202A_202E_202D_202E_202A_206B_206F_200C_202E(_addonLifecycle, AddonEvent.PostSetup, _addonName, (IAddonLifecycle.AddonEventDelegate)ShopPostSetup);
|
||||
_202B_200B_206D_200B_206F_200C_200C_206E_200B_206E_206D_206B_206E_202A_200B_206F_202B_206F_206F_206E_200D_200F_206D_200E_202C_200D_206E_200C_200D_202A_202C_200B_202A_202E_202D_202E_202A_206B_206F_200C_202E(_addonLifecycle, AddonEvent.PreFinalize, _addonName, (IAddonLifecycle.AddonEventDelegate)ShopPreFinalize);
|
||||
_202B_200B_206D_200B_206F_200C_200C_206E_200B_206E_206D_206B_206E_202A_200B_206F_202B_206F_206F_206E_200D_200F_206D_200E_202C_200D_206E_200C_200D_202A_202C_200B_202A_202E_202D_202E_202A_206B_206F_200C_202E(_addonLifecycle, AddonEvent.PostUpdate, _addonName, (IAddonLifecycle.AddonEventDelegate)ShopPostUpdate);
|
||||
}
|
||||
|
||||
private unsafe void ShopPostSetup(AddonEvent type, AddonArgs args)
|
||||
{
|
||||
if (!_parentWindow.IsEnabled)
|
||||
int num = (_parentWindow.IsEnabled ? (-1920873629) : (-1920873630));
|
||||
while (true)
|
||||
{
|
||||
ItemForSale = null;
|
||||
_parentWindow.IsOpen = false;
|
||||
return;
|
||||
}
|
||||
_parentWindow.UpdateShopStock((AtkUnitBase*)args.Addon.Address);
|
||||
PostUpdateShopStock();
|
||||
if (ItemForSale != null)
|
||||
{
|
||||
_parentWindow.IsOpen = true;
|
||||
int num2 = num;
|
||||
int num3 = -1920873629;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 4:
|
||||
_parentWindow.IsOpen = true;
|
||||
num = -1920873632;
|
||||
break;
|
||||
case 0:
|
||||
_parentWindow.UpdateShopStock((AtkUnitBase*)_206F_200C_202D_200F_200F_206B_206F_200D_202B_206C_202E_206C_206F_200D_206F_206B_200C_200B_202E_200D_200B_200C_206B_200F_200B_202E_202C_202C_206A_200C_206D_200D_206D_200B_200E_202C_206D_200B_200C_202A_202E(args).Address);
|
||||
PostUpdateShopStock();
|
||||
num = ((ItemForSale == null) ? (-1920873632) : (-1920873625));
|
||||
break;
|
||||
case 3:
|
||||
return;
|
||||
case 2:
|
||||
num = -1920873630;
|
||||
break;
|
||||
case 1:
|
||||
ItemForSale = null;
|
||||
_parentWindow.IsOpen = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ShopPreFinalize(AddonEvent type, AddonArgs args)
|
||||
{
|
||||
PurchaseState = null;
|
||||
_parentWindow.RestoreExternalPluginState();
|
||||
_parentWindow.IsOpen = false;
|
||||
int num = ((PurchaseState == null) ? (-1080756393) : (-1080756395));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1080756396;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
_parentWindow.IsOpen = false;
|
||||
return;
|
||||
case 1:
|
||||
num = ((ItemForSale == null) ? (-1080756393) : (-1080756400));
|
||||
break;
|
||||
case 4:
|
||||
CompletePurchase(ItemForSale.ItemId, success: false);
|
||||
num = -1080756396;
|
||||
break;
|
||||
case 3:
|
||||
PurchaseState = null;
|
||||
_parentWindow.RestoreExternalPluginState();
|
||||
num = -1080756396;
|
||||
break;
|
||||
case 2:
|
||||
num = -1080756395;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private unsafe void ShopPostUpdate(AddonEvent type, AddonArgs args)
|
||||
{
|
||||
if (!_parentWindow.IsEnabled)
|
||||
int num = (_parentWindow.IsEnabled ? (-1011514953) : (-1011514956));
|
||||
Vector2 valueOrDefault = default(Vector2);
|
||||
Vector2? position = default(Vector2?);
|
||||
short num6 = default(short);
|
||||
short num5 = default(short);
|
||||
while (true)
|
||||
{
|
||||
ItemForSale = null;
|
||||
_parentWindow.IsOpen = false;
|
||||
return;
|
||||
}
|
||||
_parentWindow.UpdateShopStock((AtkUnitBase*)args.Addon.Address);
|
||||
PostUpdateShopStock();
|
||||
if (ItemForSale != null)
|
||||
{
|
||||
AtkUnitBase* address = (AtkUnitBase*)args.Addon.Address;
|
||||
short num = 0;
|
||||
short num2 = 0;
|
||||
address->GetPosition(&num, &num2);
|
||||
ushort num3 = 0;
|
||||
ushort num4 = 0;
|
||||
address->GetSize(&num3, &num4, scaled: true);
|
||||
num += (short)num3;
|
||||
Vector2? position = _parentWindow.Position;
|
||||
if (position.HasValue)
|
||||
int num2 = num;
|
||||
int num3 = -1011514953;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
Vector2 valueOrDefault = position.GetValueOrDefault();
|
||||
if ((short)valueOrDefault.X != num || (short)valueOrDefault.Y != num2)
|
||||
{
|
||||
_parentWindow.Position = new Vector2(num, num2);
|
||||
}
|
||||
case 0:
|
||||
_parentWindow.UpdateShopStock((AtkUnitBase*)_206F_200C_202D_200F_200F_206B_206F_200D_202B_206C_202E_206C_206F_200D_206F_206B_200C_200B_202E_200D_200B_200C_206B_200F_200B_202E_202C_202C_206A_200C_206D_200D_206D_200B_200E_202C_206D_200B_200C_202A_202E(args).Address);
|
||||
PostUpdateShopStock();
|
||||
num = ((ItemForSale == null) ? (-1011514945) : (-1011514954));
|
||||
break;
|
||||
case 8:
|
||||
_parentWindow.IsOpen = false;
|
||||
return;
|
||||
case 6:
|
||||
valueOrDefault = position.GetValueOrDefault();
|
||||
num = (((short)valueOrDefault.X != num6) ? (-1011514958) : (-1011514955));
|
||||
break;
|
||||
case 7:
|
||||
num = -1011514956;
|
||||
break;
|
||||
case 4:
|
||||
_parentWindow.IsOpen = true;
|
||||
return;
|
||||
case 5:
|
||||
_parentWindow.Position = new Vector2(num6, num5);
|
||||
num = -1011514957;
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
AtkUnitBase* address = (AtkUnitBase*)_206F_200C_202D_200F_200F_206B_206F_200D_202B_206C_202E_206C_206F_200D_206F_206B_200C_200B_202E_200D_200B_200C_206B_200F_200B_202E_202C_202C_206A_200C_206D_200D_206D_200B_200E_202C_206D_200B_200C_202A_202E(args).Address;
|
||||
num6 = 0;
|
||||
num5 = 0;
|
||||
address->GetPosition(&num6, &num5);
|
||||
ushort num7 = 0;
|
||||
ushort num8 = 0;
|
||||
address->GetSize(&num7, &num8, scaled: true);
|
||||
num6 += (short)num7;
|
||||
position = _parentWindow.Position;
|
||||
num = ((!position.HasValue) ? (-1011514957) : (-1011514959));
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
num = (((short)valueOrDefault.Y == num5) ? (-1011514957) : (-1011514958));
|
||||
break;
|
||||
case 3:
|
||||
ItemForSale = null;
|
||||
_parentWindow.IsOpen = false;
|
||||
return;
|
||||
}
|
||||
_parentWindow.IsOpen = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_parentWindow.IsOpen = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void PostUpdateShopStock()
|
||||
{
|
||||
if (ItemForSale != null && PurchaseState != null)
|
||||
int num = ((ItemForSale == null) ? 662202299 : 662202301);
|
||||
int ownedItems = default(int);
|
||||
while (true)
|
||||
{
|
||||
int ownedItems = (int)ItemForSale.OwnedItems;
|
||||
if (PurchaseState.OwnedItems != ownedItems)
|
||||
int num2 = num;
|
||||
int num3 = 662202297;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 3:
|
||||
ownedItems = (int)ItemForSale.OwnedItems;
|
||||
num = ((PurchaseState.OwnedItems == ownedItems) ? 662202299 : 662202296);
|
||||
break;
|
||||
case 2:
|
||||
return;
|
||||
case 0:
|
||||
num = 662202301;
|
||||
break;
|
||||
case 4:
|
||||
num = ((PurchaseState == null) ? 662202299 : 662202298);
|
||||
break;
|
||||
case 1:
|
||||
PurchaseState.OwnedItems = ownedItems;
|
||||
PurchaseState.NextStep = DateTime.Now.AddSeconds(0.25);
|
||||
PurchaseState.NextStepMs = _202E_202E_202D_202D_202D_202D_206B_202B_200E_206D_206E_206C_206B_202C_200C_200D_206C_200E_200C_202E_200B_202D_206B_202C_200E_202E_202C_200C_200E_202A_206C_200C_206F_200D_200E_206D_202A_202E_206C_202E() + 250;
|
||||
num = 662202299;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe int GetItemCount(uint itemId)
|
||||
public virtual int GetCurrencyCount(uint currencyItemId)
|
||||
{
|
||||
return InventoryManager.Instance()->GetInventoryItemCount(itemId, isHq: false, checkEquipped: false, checkArmory: false, 0);
|
||||
return InventoryHelper.GetItemCount(currencyItemId);
|
||||
}
|
||||
|
||||
public int GetMaxItemsToPurchase()
|
||||
{
|
||||
if (ItemForSale == null)
|
||||
int num = ((ItemForSale != null) ? (-1965181968) : (-1965181966));
|
||||
int maxHoldableQuantity = default(int);
|
||||
while (true)
|
||||
{
|
||||
return 0;
|
||||
int num2 = num;
|
||||
int num3 = -1965181965;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 3:
|
||||
maxHoldableQuantity = InventoryHelper.GetMaxHoldableQuantity(ItemForSale.ItemId, _itemSheet);
|
||||
num = ((ItemForSale.Price != 0) ? (-1965181967) : (-1965181965));
|
||||
break;
|
||||
case 2:
|
||||
return _200E_202C_200C_202A_206C_202C_206E_206F_206D_202C_202C_200C_200B_200E_206D_206E_202D_206A_202D_202D_202D_202A_202B_200C_206E_206E_206D_206A_206D_206C_200E_206A_202B_206C_200D_200C_206F_206D_200C_202D_202E((int)(GetCurrencyCount(ItemForSale.CurrencyItemId) / ItemForSale.Price), maxHoldableQuantity);
|
||||
case 4:
|
||||
num = -1965181966;
|
||||
break;
|
||||
case 1:
|
||||
return 0;
|
||||
case 0:
|
||||
return maxHoldableQuantity;
|
||||
}
|
||||
}
|
||||
return (int)(_parentWindow.GetCurrencyCount() / ItemForSale.Price);
|
||||
}
|
||||
|
||||
public void CancelAutoPurchase()
|
||||
{
|
||||
PurchaseState = null;
|
||||
_parentWindow.RestoreExternalPluginState();
|
||||
}
|
||||
|
||||
public void StartAutoPurchase(int toPurchase)
|
||||
{
|
||||
PurchaseState = new PurchaseState((int)ItemForSale.OwnedItems + toPurchase, (int)ItemForSale.OwnedItems);
|
||||
_parentWindow.SaveExternalPluginState();
|
||||
}
|
||||
|
||||
public unsafe void HandleNextPurchaseStep()
|
||||
{
|
||||
if (ItemForSale == null || PurchaseState == null)
|
||||
int num = ((ItemForSale == null) ? (-639138042) : (-639138043));
|
||||
while (true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int num = DetermineMaxStackSize(ItemForSale.ItemId);
|
||||
if (num == 0 && !HasFreeInventorySlot())
|
||||
{
|
||||
_pluginLog.Warning("No free inventory slots, can't buy more " + ItemForSale.ItemName);
|
||||
PurchaseState = null;
|
||||
_parentWindow.RestoreExternalPluginState();
|
||||
}
|
||||
else if (!PurchaseState.IsComplete)
|
||||
{
|
||||
if (PurchaseState.NextStep <= DateTime.Now && _gameGui.TryGetAddonByName<AtkUnitBase>(_addonName, out var addonPtr))
|
||||
int num2 = num;
|
||||
int num3 = -639138041;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
int num2 = Math.Min(PurchaseState.ItemsLeftToBuy, num);
|
||||
_pluginLog.Information($"Buying {num2}x {ItemForSale.ItemName}");
|
||||
_parentWindow.TriggerPurchase(addonPtr, num2);
|
||||
PurchaseState.NextStep = DateTime.MaxValue;
|
||||
PurchaseState.IsAwaitingYesNo = true;
|
||||
case 1:
|
||||
return;
|
||||
case 2:
|
||||
num = ((PurchaseState == null) ? (-639138042) : (-639138044));
|
||||
break;
|
||||
case 0:
|
||||
num = -639138043;
|
||||
break;
|
||||
case 3:
|
||||
CompletePurchase(ItemForSale.ItemId, success: false);
|
||||
num = -639138042;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public void StartAutoPurchase(int toPurchase)
|
||||
{
|
||||
int num = ((ItemForSale != null) ? 547091109 : 547091110);
|
||||
while (true)
|
||||
{
|
||||
_pluginLog.Information($"Stopping item purchase (desired = {PurchaseState.DesiredItems}, owned = {PurchaseState.OwnedItems})");
|
||||
PurchaseState = null;
|
||||
_parentWindow.RestoreExternalPluginState();
|
||||
int num2 = num;
|
||||
int num3 = 547091111;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
goto IL_0046;
|
||||
case 1:
|
||||
throw _200D_200C_202A_202D_202C_206D_206F_202E_202A_206E_202B_200E_200C_200F_200C_206B_200E_202E_206E_202E_202B_206C_200E_200D_200C_206B_200D_200F_202D_206D_202E_206A_206B_200D_200E_200E_200F_202D_202A_202A_202E(global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(-1974882015));
|
||||
case 2:
|
||||
PurchaseState = new PurchaseState((int)ItemForSale.OwnedItems + toPurchase, (int)ItemForSale.OwnedItems);
|
||||
_parentWindow.SaveExternalPluginState();
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
IL_0046:
|
||||
num = 547091110;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe void HandleNextPurchaseStep()
|
||||
{
|
||||
int num = ((ItemForSale == null) ? (-1459965159) : (-1459965154));
|
||||
int num7 = default(int);
|
||||
AtkUnitBase* addonPtr = default(AtkUnitBase*);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1459965163;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 6:
|
||||
num = -1459965154;
|
||||
break;
|
||||
case 10:
|
||||
return;
|
||||
case 0:
|
||||
_206B_200E_206A_206A_202E_202E_202E_200F_206C_202B_206E_200C_202C_200F_202E_200E_206E_202E_202C_202C_206E_206B_206E_206C_200E_206F_202C_202B_202B_206E_202C_202C_202C_200F_202C_200C_206B_206D_200F_202B_202E(_pluginLog, _200E_206A_206B_200B_206E_200D_202B_200B_202C_200C_206A_202E_206F_202C_206E_200D_200B_200F_202D_202B_206A_202E_200D_206F_200B_206E_200F_202E_206D_200C_206C_200B_206F_202C_206E_200D_200C_202E_206D_202B_202E(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-1851945026), ItemForSale.ItemName), Array.Empty<object>());
|
||||
CompletePurchase(ItemForSale.ItemId, success: false);
|
||||
return;
|
||||
case 2:
|
||||
num = ((PurchaseState.NextStepMs != long.MaxValue) ? (-1459965153) : (-1459965155));
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
IPluginLog pluginLog2 = _pluginLog;
|
||||
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler2 = new DefaultInterpolatedStringHandler(45, 2);
|
||||
defaultInterpolatedStringHandler2.AppendLiteral(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(-1919731444));
|
||||
defaultInterpolatedStringHandler2.AppendFormatted(PurchaseState.DesiredItems);
|
||||
defaultInterpolatedStringHandler2.AppendLiteral(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(-1891359698));
|
||||
defaultInterpolatedStringHandler2.AppendFormatted(PurchaseState.OwnedItems);
|
||||
defaultInterpolatedStringHandler2.AppendLiteral(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-542666901));
|
||||
_202C_202E_200D_202B_202D_200B_200B_206E_202C_200D_202B_206E_206E_206B_202D_206B_202E_200D_202C_202D_206C_206E_202C_200C_206E_202B_202E_202A_202D_206F_200B_200D_206C_206C_200F_200B_206D_202D_202D_200E_202E(pluginLog2, defaultInterpolatedStringHandler2.ToStringAndClear(), Array.Empty<object>());
|
||||
CompletePurchase(ItemForSale.ItemId, success: true);
|
||||
return;
|
||||
}
|
||||
case 1:
|
||||
num = ((!PurchaseState.IsComplete) ? (-1459965168) : (-1459965160));
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
int maxHoldableQuantity = InventoryHelper.GetMaxHoldableQuantity(ItemForSale.ItemId, _itemSheet);
|
||||
num7 = _200E_202C_200C_202A_206C_202C_206E_206F_206D_202C_202C_200C_200B_200E_206D_206E_202D_206A_202D_202D_202D_202A_202B_200C_206E_206E_206D_206A_206D_206C_200E_206A_202B_206C_200D_200C_206F_206D_200C_202D_202E(99, maxHoldableQuantity);
|
||||
num = ((num7 != 0) ? (-1459965167) : (-1459965163));
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
num = ((!_gameGui.TryGetAddonByName<AtkUnitBase>(_addonName, out addonPtr)) ? (-1459965161) : (-1459965156));
|
||||
break;
|
||||
case 4:
|
||||
num = ((_202E_202E_202D_202D_202D_202D_206B_202B_200E_206D_206E_206C_206B_202C_200C_200D_206C_200E_200C_202E_200B_202D_206B_202C_200E_202E_202C_200C_200E_202A_206C_200C_206F_200D_200E_206D_202A_202E_206C_202E() < PurchaseState.NextStepMs) ? (-1459965161) : (-1459965162));
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
int num8 = _200E_202C_200C_202A_206C_202C_206E_206F_206D_202C_202C_200C_200B_200E_206D_206E_202D_206A_202D_202D_202D_202A_202B_200C_206E_206E_206D_206A_206D_206C_200E_206A_202B_206C_200D_200C_206F_206D_200C_202D_202E(PurchaseState.ItemsLeftToBuy, num7);
|
||||
IPluginLog pluginLog3 = _pluginLog;
|
||||
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler3 = new DefaultInterpolatedStringHandler(9, 2);
|
||||
defaultInterpolatedStringHandler3.AppendLiteral(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(-2017196427));
|
||||
defaultInterpolatedStringHandler3.AppendFormatted(num8);
|
||||
defaultInterpolatedStringHandler3.AppendLiteral(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(640094798));
|
||||
defaultInterpolatedStringHandler3.AppendFormatted(ItemForSale.ItemName);
|
||||
_202C_202E_200D_202B_202D_200B_200B_206E_202C_200D_202B_206E_206E_206B_202D_206B_202E_200D_202C_202D_206C_206E_202C_200C_206E_202B_202E_202A_202D_206F_200B_200D_206C_206C_200F_200B_206D_202D_202D_200E_202E(pluginLog3, defaultInterpolatedStringHandler3.ToStringAndClear(), Array.Empty<object>());
|
||||
_parentWindow.TriggerPurchase(addonPtr, num8);
|
||||
PurchaseState.NextStepMs = long.MaxValue;
|
||||
_purchaseDeadlineMs = _202E_202E_202D_202D_202D_202D_206B_202B_200E_206D_206E_206C_206B_202C_200C_200D_206C_200E_200C_202E_200B_202D_206B_202C_200E_202E_202C_200C_200E_202A_206C_200C_206F_200D_200E_206D_202A_202E_206C_202E() + 3000;
|
||||
PurchaseState.IsAwaitingYesNo = true;
|
||||
return;
|
||||
}
|
||||
case 11:
|
||||
num = ((PurchaseState != null) ? (-1459965164) : (-1459965159));
|
||||
break;
|
||||
case 8:
|
||||
num = ((_202E_202E_202D_202D_202D_202D_206B_202B_200E_206D_206E_206C_206B_202C_200C_200D_206C_200E_200C_202E_200B_202D_206B_202C_200E_202E_202C_200C_200E_202A_206C_200C_206F_200D_200E_206D_202A_202E_206C_202E() < _purchaseDeadlineMs) ? (-1459965153) : (-1459965166));
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
IPluginLog pluginLog = _pluginLog;
|
||||
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(51, 2);
|
||||
defaultInterpolatedStringHandler.AppendLiteral(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(785267404));
|
||||
defaultInterpolatedStringHandler.AppendFormatted(ItemForSale.ItemName);
|
||||
defaultInterpolatedStringHandler.AppendLiteral(global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(-1250823657));
|
||||
defaultInterpolatedStringHandler.AppendFormatted(3000);
|
||||
defaultInterpolatedStringHandler.AppendLiteral(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(1905813856));
|
||||
_206B_200E_206A_206A_202E_202E_202E_200F_206C_202B_206E_200C_202C_200F_202E_200E_206E_202E_202C_202C_206E_206B_206E_206C_200E_206F_202C_202B_202B_206E_202C_202C_202C_200F_202C_200C_206B_206D_200F_202B_202E(pluginLog, defaultInterpolatedStringHandler.ToStringAndClear(), Array.Empty<object>());
|
||||
CompletePurchase(ItemForSale.ItemId, success: false);
|
||||
num = -1459965153;
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CompletePurchase(uint itemId, bool success)
|
||||
{
|
||||
int num = ((!success) ? (-1114779348) : (-1114779346));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1114779347;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
int num7;
|
||||
int quantityPurchased;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
num7 = PurchaseState.OwnedItems - PurchaseState.InitialOwnedItems;
|
||||
goto IL_005e;
|
||||
case 3:
|
||||
num = ((PurchaseState != null) ? (-1114779345) : (-1114779348));
|
||||
break;
|
||||
case 0:
|
||||
num = -1114779346;
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
num7 = 0;
|
||||
goto IL_005e;
|
||||
}
|
||||
IL_005e:
|
||||
quantityPurchased = num7;
|
||||
PurchaseState = null;
|
||||
_parentWindow.RestoreExternalPluginState();
|
||||
this.PurchaseCompleted?.Invoke(this, new PurchaseCompletedEventArgs(itemId, success, quantityPurchased));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
int num = ((!disposing) ? 1043096164 : 1043096167);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1043096165;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
num = 1043096167;
|
||||
break;
|
||||
case 2:
|
||||
_200E_202B_202D_200C_206B_200F_202E_202D_206D_206F_202C_202E_206A_202A_206D_200E_202D_200D_202B_206A_206F_202C_206D_206E_200B_200E_206B_200F_200F_202C_206A_200E_206A_200F_206B_200B_202B_202C_200F_200F_202E(_addonLifecycle, AddonEvent.PostSetup, _addonName, (IAddonLifecycle.AddonEventDelegate)ShopPostSetup);
|
||||
_200E_202B_202D_200C_206B_200F_202E_202D_206D_206F_202C_202E_206A_202A_206D_200E_202D_200D_202B_206A_206F_202C_206D_206E_200B_200E_206B_200F_200F_202C_206A_200E_206A_200F_206B_200B_202B_202C_200F_200F_202E(_addonLifecycle, AddonEvent.PreFinalize, _addonName, (IAddonLifecycle.AddonEventDelegate)ShopPreFinalize);
|
||||
_200E_202B_202D_200C_206B_200F_202E_202D_206D_206F_202C_202E_206A_202A_206D_200E_202D_200D_202B_206A_206F_202C_206D_206E_200B_200E_206B_200F_200F_202C_206A_200E_206A_200F_206B_200B_202B_202C_200F_200F_202E(_addonLifecycle, AddonEvent.PostUpdate, _addonName, (IAddonLifecycle.AddonEventDelegate)ShopPostUpdate);
|
||||
num = 1043096164;
|
||||
break;
|
||||
case 1:
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_addonLifecycle.UnregisterListener(AddonEvent.PostSetup, _addonName, ShopPostSetup);
|
||||
_addonLifecycle.UnregisterListener(AddonEvent.PreFinalize, _addonName, ShopPreFinalize);
|
||||
_addonLifecycle.UnregisterListener(AddonEvent.PostUpdate, _addonName, ShopPostUpdate);
|
||||
Dispose(disposing: true);
|
||||
_200B_202C_202A_200E_200F_202E_202C_206C_206F_206B_206F_206C_206E_200B_200C_200F_202B_206D_206B_206E_202D_202E_200E_200E_206D_202E_200C_200B_202B_202D_200D_202A_206B_202C_200F_206B_202A_206C_206E_200F_202E((object)this);
|
||||
}
|
||||
|
||||
public bool HasFreeInventorySlot()
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
return CountFreeInventorySlots() > 0;
|
||||
//ILSpy generated this explicit interface implementation from .override directive in Dispose
|
||||
this.Dispose();
|
||||
}
|
||||
|
||||
public unsafe int CountFreeInventorySlots()
|
||||
static void _206B_206A_202C_200C_206E_200C_202C_206A_200D_202A_202D_206D_200E_200B_206E_206F_200B_206A_206F_202D_200F_202A_202C_200E_202C_202B_206A_202C_200F_202D_206D_202D_202A_206C_202C_206C_206B_200B_200D_200F_202E(object P_0, string P_1)
|
||||
{
|
||||
InventoryManager* ptr = InventoryManager.Instance();
|
||||
if (ptr == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int num = 0;
|
||||
for (InventoryType inventoryType = InventoryType.Inventory1; inventoryType <= InventoryType.Inventory4; inventoryType++)
|
||||
{
|
||||
InventoryContainer* inventoryContainer = ptr->GetInventoryContainer(inventoryType);
|
||||
for (int i = 0; i < inventoryContainer->Size; i++)
|
||||
{
|
||||
InventoryItem* inventorySlot = inventoryContainer->GetInventorySlot(i);
|
||||
if (inventorySlot == null || inventorySlot->ItemId == 0)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
ArgumentNullException.ThrowIfNull(P_0, P_1);
|
||||
}
|
||||
|
||||
private unsafe int DetermineMaxStackSize(uint itemId)
|
||||
static void _200F_206D_202A_206D_200C_206A_202D_200D_206E_200F_206E_206D_206F_202B_202C_202A_200E_202D_206C_202B_200E_202D_206F_206C_202B_202B_206F_206F_206D_202C_202B_202E_200D_202A_206D_206A_206C_200C_206F_200F_202E(string P_0, string P_1)
|
||||
{
|
||||
InventoryManager* ptr = InventoryManager.Instance();
|
||||
if (ptr == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int num = 0;
|
||||
for (InventoryType inventoryType = InventoryType.Inventory1; inventoryType <= InventoryType.Inventory4; inventoryType++)
|
||||
{
|
||||
InventoryContainer* inventoryContainer = ptr->GetInventoryContainer(inventoryType);
|
||||
for (int i = 0; i < inventoryContainer->Size; i++)
|
||||
{
|
||||
InventoryItem* inventorySlot = inventoryContainer->GetInventorySlot(i);
|
||||
if (inventorySlot == null || inventorySlot->ItemId == 0)
|
||||
{
|
||||
return 99;
|
||||
}
|
||||
if (inventorySlot->ItemId == itemId)
|
||||
{
|
||||
num += 999 - inventorySlot->Quantity;
|
||||
if (num >= 99)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Math.Min(99, num);
|
||||
ArgumentException.ThrowIfNullOrEmpty(P_0, P_1);
|
||||
}
|
||||
|
||||
public unsafe int CountInventorySlotsWithCondition(uint itemId, Predicate<int> predicate)
|
||||
static void _202B_200B_206D_200B_206F_200C_200C_206E_200B_206E_206D_206B_206E_202A_200B_206F_202B_206F_206F_206E_200D_200F_206D_200E_202C_200D_206E_200C_200D_202A_202C_200B_202A_202E_202D_202E_202A_206B_206F_200C_202E(IAddonLifecycle P_0, AddonEvent P_1, string P_2, IAddonLifecycle.AddonEventDelegate P_3)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(predicate, "predicate");
|
||||
InventoryManager* ptr = InventoryManager.Instance();
|
||||
if (ptr == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int num = 0;
|
||||
for (InventoryType inventoryType = InventoryType.Inventory1; inventoryType <= InventoryType.Inventory4; inventoryType++)
|
||||
{
|
||||
InventoryContainer* inventoryContainer = ptr->GetInventoryContainer(inventoryType);
|
||||
for (int i = 0; i < inventoryContainer->Size; i++)
|
||||
{
|
||||
InventoryItem* inventorySlot = inventoryContainer->GetInventorySlot(i);
|
||||
if (inventorySlot != null && inventorySlot->ItemId != 0 && inventorySlot->ItemId == itemId && predicate(inventorySlot->Quantity))
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
P_0.RegisterListener(P_1, P_2, P_3);
|
||||
}
|
||||
|
||||
static Delegate _202E_202D_202E_200D_200B_206C_202C_200F_206C_200C_206B_202A_200B_202A_200D_206B_202B_206B_200F_200C_206C_206C_206B_202B_202C_200D_206B_202A_200E_206D_206B_200E_200E_206E_202D_206D_200F_206E_202C_206E_202E(Delegate P_0, Delegate P_1)
|
||||
{
|
||||
return Delegate.Combine(P_0, P_1);
|
||||
}
|
||||
|
||||
static Delegate _200B_206D_202C_206D_206C_200D_202B_200D_202A_202E_200E_200C_200E_206D_202B_206E_200F_206E_200E_200B_202C_206E_202C_206A_206B_206F_206B_200B_206D_202D_202C_202C_206D_202B_202D_206B_200D_200C_200C_202C_202E(Delegate P_0, Delegate P_1)
|
||||
{
|
||||
return Delegate.Remove(P_0, P_1);
|
||||
}
|
||||
|
||||
static AtkUnitBasePtr _206F_200C_202D_200F_200F_206B_206F_200D_202B_206C_202E_206C_206F_200D_206F_206B_200C_200B_202E_200D_200B_200C_206B_200F_200B_202E_202C_202C_206A_200C_206D_200D_206D_200B_200E_202C_206D_200B_200C_202A_202E(AddonArgs P_0)
|
||||
{
|
||||
return P_0.Addon;
|
||||
}
|
||||
|
||||
static long _202E_202E_202D_202D_202D_202D_206B_202B_200E_206D_206E_206C_206B_202C_200C_200D_206C_200E_200C_202E_200B_202D_206B_202C_200E_202E_202C_200C_200E_202A_206C_200C_206F_200D_200E_206D_202A_202E_206C_202E()
|
||||
{
|
||||
return Environment.TickCount64;
|
||||
}
|
||||
|
||||
static int _200E_202C_200C_202A_206C_202C_206E_206F_206D_202C_202C_200C_200B_200E_206D_206E_202D_206A_202D_202D_202D_202A_202B_200C_206E_206E_206D_206A_206D_206C_200E_206A_202B_206C_200D_200C_206F_206D_200C_202D_202E(int P_0, int P_1)
|
||||
{
|
||||
return Math.Min(P_0, P_1);
|
||||
}
|
||||
|
||||
static InvalidOperationException _200D_200C_202A_202D_202C_206D_206F_202E_202A_206E_202B_200E_200C_200F_200C_206B_200E_202E_206E_202E_202B_206C_200E_200D_200C_206B_200D_200F_202D_206D_202E_206A_206B_200D_200E_200E_200F_202D_202A_202A_202E(string P_0)
|
||||
{
|
||||
return new InvalidOperationException(P_0);
|
||||
}
|
||||
|
||||
static void _202C_202E_200D_202B_202D_200B_200B_206E_202C_200D_202B_206E_206E_206B_202D_206B_202E_200D_202C_202D_206C_206E_202C_200C_206E_202B_202E_202A_202D_206F_200B_200D_206C_206C_200F_200B_206D_202D_202D_200E_202E(IPluginLog P_0, string P_1, object[] P_2)
|
||||
{
|
||||
P_0.Information(P_1, P_2);
|
||||
}
|
||||
|
||||
static string _200E_206A_206B_200B_206E_200D_202B_200B_202C_200C_206A_202E_206F_202C_206E_200D_200B_200F_202D_202B_206A_202E_200D_206F_200B_206E_200F_202E_206D_200C_206C_200B_206F_202C_206E_200D_200C_202E_206D_202B_202E(string P_0, string P_1)
|
||||
{
|
||||
return P_0 + P_1;
|
||||
}
|
||||
|
||||
static void _206B_200E_206A_206A_202E_202E_202E_200F_206C_202B_206E_200C_202C_200F_202E_200E_206E_202E_202C_202C_206E_206B_206E_206C_200E_206F_202C_202B_202B_206E_202C_202C_202C_200F_202C_200C_206B_206D_200F_202B_202E(IPluginLog P_0, string P_1, object[] P_2)
|
||||
{
|
||||
P_0.Warning(P_1, P_2);
|
||||
}
|
||||
|
||||
static void _200E_202B_202D_200C_206B_200F_202E_202D_206D_206F_202C_202E_206A_202A_206D_200E_202D_200D_202B_206A_206F_202C_206D_206E_200B_200E_206B_200F_200F_202C_206A_200E_206A_200F_206B_200B_202B_202C_200F_200F_202E(IAddonLifecycle P_0, AddonEvent P_1, string P_2, IAddonLifecycle.AddonEventDelegate P_3)
|
||||
{
|
||||
P_0.UnregisterListener(P_1, P_2, P_3);
|
||||
}
|
||||
|
||||
static void _200B_202C_202A_200E_200F_202E_202C_206C_206F_206B_206F_206C_206E_200B_200C_200F_202B_206D_206B_206E_202D_202E_200E_200E_206D_202E_200C_200B_202B_202D_200D_202A_206B_202C_200F_206B_202A_206C_206E_200F_202E(object P_0)
|
||||
{
|
||||
GC.SuppressFinalize(P_0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
580
LLib/LLib.Shop/SatisfactionSupplyActions.cs
Normal file
580
LLib/LLib.Shop/SatisfactionSupplyActions.cs
Normal file
|
|
@ -0,0 +1,580 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
using FFXIVClientStructs.Interop;
|
||||
using LLib.GameUI;
|
||||
|
||||
namespace LLib.Shop;
|
||||
|
||||
public static class SatisfactionSupplyActions
|
||||
{
|
||||
public readonly record struct NpcState(int Rank, int SatisfactionCurrent, int SatisfactionMax, int UsedDeliveries)
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
[CompilerGenerated]
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder stringBuilder = _206F_200F_202A_202D_202C_206E_202E_202A_202A_202D_200F_202B_206E_206D_206C_202B_206E_206B_200D_200C_200D_200C_200C_200E_202B_202D_200D_202E_206D_206C_200D_202A_202D_200D_206B_202A_206F_200B_202E_200D_202E();
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(stringBuilder, global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-1314736612));
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(stringBuilder, global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(1581517409));
|
||||
int num = ((!PrintMembers(stringBuilder)) ? 745418664 : 745418667);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 745418666;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
_200E_206F_202E_202A_202C_200C_200F_202D_206C_202D_200E_202A_202D_202B_200F_200C_202C_206A_200B_200B_202E_206D_206D_200E_200F_206A_202D_206A_200D_200F_200C_206D_206D_206B_200E_202E_200E_202A_202A_206F_202E(stringBuilder, '}');
|
||||
return _200C_200F_200B_200C_200C_202C_200E_200E_200C_202D_202C_200F_206F_200C_206C_206D_200F_206C_206E_200B_202E_200F_202C_206B_206D_206A_200D_202C_206B_206D_200E_200F_202B_206E_200E_202E_200C_202A_202B_206F_202E((object)stringBuilder);
|
||||
case 1:
|
||||
_200E_206F_202E_202A_202C_200C_200F_202D_206C_202D_200E_202A_202D_202B_200F_200C_202C_206A_200B_200B_202E_206D_206D_200E_200F_206A_202D_206A_200D_200F_200C_206D_206D_206B_200E_202E_200E_202A_202A_206F_202E(stringBuilder, ' ');
|
||||
num = 745418664;
|
||||
break;
|
||||
case 0:
|
||||
num = 745418667;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
[CompilerGenerated]
|
||||
private bool PrintMembers(StringBuilder builder)
|
||||
{
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(2105858442));
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, Rank.ToString());
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(2014742517));
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, SatisfactionCurrent.ToString());
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(1923626592));
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, SatisfactionMax.ToString());
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(564142829));
|
||||
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, UsedDeliveries.ToString());
|
||||
return true;
|
||||
}
|
||||
|
||||
[CompilerGenerated]
|
||||
public bool Equals(NpcState other)
|
||||
{
|
||||
int num = ((!EqualityComparer<int>.Default.Equals(Rank, other.Rank)) ? 1376880194 : 1376880192);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1376880193;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
return EqualityComparer<int>.Default.Equals(UsedDeliveries, other.UsedDeliveries);
|
||||
case 3:
|
||||
return false;
|
||||
case 4:
|
||||
num = ((!EqualityComparer<int>.Default.Equals(SatisfactionMax, other.SatisfactionMax)) ? 1376880194 : 1376880193);
|
||||
break;
|
||||
case 2:
|
||||
num = 1376880192;
|
||||
break;
|
||||
case 1:
|
||||
num = ((!EqualityComparer<int>.Default.Equals(SatisfactionCurrent, other.SatisfactionCurrent)) ? 1376880194 : 1376880197);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool IEquatable<NpcState>.Equals(NpcState other)
|
||||
{
|
||||
//ILSpy generated this explicit interface implementation from .override directive in Equals
|
||||
return this.Equals(other);
|
||||
}
|
||||
|
||||
static StringBuilder _206F_200F_202A_202D_202C_206E_202E_202A_202A_202D_200F_202B_206E_206D_206C_202B_206E_206B_200D_200C_200D_200C_200C_200E_202B_202D_200D_202E_206D_206C_200D_202A_202D_200D_206B_202A_206F_200B_202E_200D_202E()
|
||||
{
|
||||
return new StringBuilder();
|
||||
}
|
||||
|
||||
static StringBuilder _202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(StringBuilder P_0, string P_1)
|
||||
{
|
||||
return P_0.Append(P_1);
|
||||
}
|
||||
|
||||
static StringBuilder _200E_206F_202E_202A_202C_200C_200F_202D_206C_202D_200E_202A_202D_202B_200F_200C_202C_206A_200B_200B_202E_206D_206D_200E_200F_206A_202D_206A_200D_200F_200C_206D_206D_206B_200E_202E_200E_202A_202A_206F_202E(StringBuilder P_0, char P_1)
|
||||
{
|
||||
return P_0.Append(P_1);
|
||||
}
|
||||
|
||||
static string _200C_200F_200B_200C_200C_202C_200E_200E_200C_202D_202C_200F_206F_200C_206C_206D_200F_206C_206E_200B_202E_200F_202C_206B_206D_206A_200D_202C_206B_206D_200E_200F_202B_206E_200E_202E_200C_202A_202B_206F_202E(object P_0)
|
||||
{
|
||||
return P_0.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private const string SatisfactionSupplyAddon = "SatisfactionSupply";
|
||||
|
||||
private const string SatisfactionSupplyResultAddon = "SatisfactionSupplyResult";
|
||||
|
||||
private const string TalkAddon = "Talk";
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsSatisfactionSupplyReady(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-799124681), out addonPtr) ? 288080028 : 288080031);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 288080030;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
goto IL_0054;
|
||||
case 2:
|
||||
return LAddon.IsAddonReady(addonPtr);
|
||||
case 1:
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
IL_0054:
|
||||
num = 288080031;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsSatisfactionSupplyFullyReady(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(1887910937), out addonPtr) ? (-536091870) : (-536091865));
|
||||
AgentSatisfactionSupply* ptr = default(AgentSatisfactionSupply*);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -536091868;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 1:
|
||||
ptr = AgentSatisfactionSupply.Instance();
|
||||
num = ((ptr == null) ? (-536091871) : (-536091872));
|
||||
break;
|
||||
case 2:
|
||||
return ptr->NpcInfo.Initialized;
|
||||
case 6:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? (-536091867) : (-536091869));
|
||||
break;
|
||||
case 7:
|
||||
return false;
|
||||
case 8:
|
||||
num = ((!ptr->NpcInfo.Valid) ? (-536091871) : (-536091866));
|
||||
break;
|
||||
case 0:
|
||||
num = -536091865;
|
||||
break;
|
||||
case 4:
|
||||
num = ((!ptr->IsAgentActive()) ? (-536091871) : (-536091860));
|
||||
break;
|
||||
case 5:
|
||||
return false;
|
||||
case 3:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe static bool TrySelectDeliverySlot(IGameGui gameGui, int slot)
|
||||
{
|
||||
int num = (IsSatisfactionSupplyFullyReady(gameGui) ? 1316647877 : 1316647878);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1316647876;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
AgentSatisfactionSupply* ptr = AgentSatisfactionSupply.Instance();
|
||||
AtkValue atkValue = new AtkValue();
|
||||
Span<AtkValue> span = stackalloc AtkValue[2];
|
||||
span[0].SetInt(1);
|
||||
span[1].SetInt(slot);
|
||||
ptr->ReceiveEvent(&atkValue, span.GetPointer(0), 2u, 0uL);
|
||||
return true;
|
||||
}
|
||||
case 2:
|
||||
return false;
|
||||
case 0:
|
||||
goto IL_009f;
|
||||
}
|
||||
continue;
|
||||
IL_009f:
|
||||
num = 1316647878;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryCloseSatisfactionSupply(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(-304354033), out addonPtr) ? (-1559808430) : (-1559808431));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1559808429;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
goto IL_0052;
|
||||
case 1:
|
||||
addonPtr->FireCallbackInt(0);
|
||||
return true;
|
||||
case 2:
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
IL_0052:
|
||||
num = -1559808431;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsTalkInProgress(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(-5198087), out addonPtr) ? 208572511 : 208572508);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 208572510;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 3:
|
||||
num = 208572508;
|
||||
break;
|
||||
case 0:
|
||||
return LAddon.IsAddonReady(addonPtr);
|
||||
case 2:
|
||||
return false;
|
||||
case 4:
|
||||
return false;
|
||||
case 1:
|
||||
num = ((!addonPtr->IsVisible) ? 208572506 : 208572510);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryProgressTalk(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(1257507185), out addonPtr) ? 1712398322 : 1712398327);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1712398326;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 2:
|
||||
return false;
|
||||
case 1:
|
||||
return false;
|
||||
case 3:
|
||||
num = 1712398327;
|
||||
break;
|
||||
case 0:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? 1712398323 : 1712398324);
|
||||
break;
|
||||
case 5:
|
||||
addonPtr->FireCallbackInt(0);
|
||||
return true;
|
||||
case 4:
|
||||
num = ((!addonPtr->IsVisible) ? 1712398324 : 1712398326);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsSatisfactionSupplyResultVisible(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(-1902425193), out addonPtr) ? 744661943 : 744661940);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 744661941;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 2:
|
||||
return LAddon.IsAddonReady(addonPtr);
|
||||
case 1:
|
||||
return false;
|
||||
case 0:
|
||||
goto IL_005b;
|
||||
}
|
||||
continue;
|
||||
IL_005b:
|
||||
num = 744661940;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryCloseSatisfactionSupplyResult(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(-2097771631), out addonPtr) ? (-1858872072) : (-1858872069));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1858872071;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
goto IL_0054;
|
||||
case 2:
|
||||
return false;
|
||||
case 1:
|
||||
addonPtr->Close(fireCallback: true);
|
||||
return true;
|
||||
}
|
||||
continue;
|
||||
IL_0054:
|
||||
num = -1858872069;
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe static bool IsNpcTradeReady()
|
||||
{
|
||||
AgentNpcTrade* ptr = AgentNpcTrade.Instance();
|
||||
int num = ((ptr == null) ? 553633651 : 553633650);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 553633651;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
goto IL_004b;
|
||||
case 1:
|
||||
return ptr->IsAgentActive();
|
||||
case 0:
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
IL_004b:
|
||||
num = 553633650;
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe static (bool Exists, bool Active, int SelectedSlot) GetNpcTradeState()
|
||||
{
|
||||
AgentNpcTrade* ptr = AgentNpcTrade.Instance();
|
||||
int num = ((ptr != null) ? 1702648938 : 1702648937);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1702648939;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
goto IL_0049;
|
||||
case 2:
|
||||
return (Exists: false, Active: false, SelectedSlot: -99);
|
||||
case 1:
|
||||
return (Exists: true, Active: ptr->IsAgentActive(), SelectedSlot: ptr->SelectedTurnInSlot);
|
||||
}
|
||||
continue;
|
||||
IL_0049:
|
||||
num = 1702648937;
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe static bool TryConfirmTrade()
|
||||
{
|
||||
AgentNpcTrade* ptr = AgentNpcTrade.Instance();
|
||||
int num = ((ptr == null) ? (-859221764) : (-859221774));
|
||||
AtkValue atkValue = default(AtkValue);
|
||||
Span<AtkValue> span = default(Span<AtkValue>);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -859221772;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
return false;
|
||||
case 0:
|
||||
atkValue = new AtkValue();
|
||||
span = stackalloc AtkValue[4];
|
||||
num = ((ptr->SelectedTurnInSlot >= 0) ? (-859221771) : (-859221776));
|
||||
break;
|
||||
case 6:
|
||||
num = (ptr->IsAgentActive() ? (-859221772) : (-859221764));
|
||||
break;
|
||||
case 8:
|
||||
return false;
|
||||
case 7:
|
||||
return false;
|
||||
case 5:
|
||||
span[0].SetInt(0);
|
||||
span[1].SetInt(0);
|
||||
span[2].SetInt(0);
|
||||
span[3].SetInt(0);
|
||||
ptr->ReceiveEvent(&atkValue, span.GetPointer(0), 4u, 1uL);
|
||||
ptr->ReceiveEvent(&atkValue, span.GetPointer(0), 4u, 0uL);
|
||||
return true;
|
||||
case 1:
|
||||
num = ((ptr->SelectedTurnInSlot == 0) ? (-859221775) : (-859221770));
|
||||
break;
|
||||
case 9:
|
||||
num = -859221774;
|
||||
break;
|
||||
case 3:
|
||||
num = ((ptr->SelectedTurnInSlotItemOptions > 0) ? (-859221775) : (-859221773));
|
||||
break;
|
||||
case 4:
|
||||
span[0].SetInt(2);
|
||||
span[1].SetInt(0);
|
||||
span[2].SetInt(0);
|
||||
span[3].SetInt(0);
|
||||
ptr->ReceiveEvent(&atkValue, span.GetPointer(0), 4u, 0uL);
|
||||
num = ((ptr->SelectedTurnInSlot != 0) ? (-859221773) : (-859221769));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe static int GetRemainingAllowances()
|
||||
{
|
||||
SatisfactionSupplyManager* ptr = SatisfactionSupplyManager.Instance();
|
||||
int num = ((ptr != null) ? (-1768883873) : (-1768883876));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1768883874;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
goto IL_0049;
|
||||
case 2:
|
||||
return 0;
|
||||
case 1:
|
||||
return ptr->GetRemainingAllowances();
|
||||
}
|
||||
continue;
|
||||
IL_0049:
|
||||
num = -1768883876;
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe static NpcState GetNpcState(int npcIndex)
|
||||
{
|
||||
SatisfactionSupplyManager* ptr = SatisfactionSupplyManager.Instance();
|
||||
int num = ((ptr != null) ? (-1038874379) : (-1038874380));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1038874384;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 0:
|
||||
num = -1038874380;
|
||||
break;
|
||||
case 2:
|
||||
return new NpcState(ptr->SatisfactionRanks[npcIndex], ptr->Satisfaction[npcIndex], 0, ptr->UsedAllowances[npcIndex]);
|
||||
case 1:
|
||||
return default(NpcState);
|
||||
case 3:
|
||||
num = ((npcIndex < ptr->SatisfactionRanks.Length) ? (-1038874382) : (-1038874383));
|
||||
break;
|
||||
case 5:
|
||||
num = ((npcIndex < 0) ? (-1038874383) : (-1038874381));
|
||||
break;
|
||||
case 4:
|
||||
return default(NpcState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe static uint GetSupplySeed()
|
||||
{
|
||||
SatisfactionSupplyManager* ptr = SatisfactionSupplyManager.Instance();
|
||||
int num = ((ptr != null) ? (-919360628) : (-919360625));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -919360626;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
goto IL_004b;
|
||||
case 1:
|
||||
return 0u;
|
||||
case 2:
|
||||
return ptr->SupplySeed;
|
||||
}
|
||||
continue;
|
||||
IL_004b:
|
||||
num = -919360625;
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe static byte GetBonusGuaranteeRowId()
|
||||
{
|
||||
SatisfactionSupplyManager* ptr = SatisfactionSupplyManager.Instance();
|
||||
int num = ((ptr != null) ? (-1374760124) : (-1374760121));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1374760123;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 1:
|
||||
return ptr->BonusGuaranteeRowId;
|
||||
case 2:
|
||||
return byte.MaxValue;
|
||||
case 0:
|
||||
goto IL_0058;
|
||||
}
|
||||
continue;
|
||||
IL_0058:
|
||||
num = -1374760121;
|
||||
}
|
||||
}
|
||||
}
|
||||
302
LLib/LLib.Shop/VendorPurchaseActions.cs
Normal file
302
LLib/LLib.Shop/VendorPurchaseActions.cs
Normal file
|
|
@ -0,0 +1,302 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
using LLib.GameUI;
|
||||
|
||||
namespace LLib.Shop;
|
||||
|
||||
public static class VendorPurchaseActions
|
||||
{
|
||||
private const string ShopAddon = "Shop";
|
||||
|
||||
private const string SelectStringAddon = "SelectString";
|
||||
|
||||
private const string SelectIconStringAddon = "SelectIconString";
|
||||
|
||||
private const string SelectYesnoAddon = "SelectYesno";
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsDialogReady(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = ((!gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(-1862554063), out addonPtr)) ? 148759857 : 148759862);
|
||||
AtkUnitBase* addonPtr2 = default(AtkUnitBase*);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 148759859;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 3:
|
||||
return true;
|
||||
case 5:
|
||||
num = ((!LAddon.IsAddonReady(addonPtr)) ? 148759857 : 148759858);
|
||||
break;
|
||||
case 0:
|
||||
return false;
|
||||
case 2:
|
||||
num = ((!gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-1204054181), out addonPtr2)) ? 148759859 : 148759863);
|
||||
break;
|
||||
case 6:
|
||||
num = 148759862;
|
||||
break;
|
||||
case 1:
|
||||
return true;
|
||||
case 4:
|
||||
num = ((!LAddon.IsAddonReady(addonPtr2)) ? 148759859 : 148759856);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TrySelectDialogOption(IGameGui gameGui, int index)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = ((!gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(-1862554063), out addonPtr)) ? (-479532860) : (-479532861));
|
||||
AtkUnitBase* addonPtr2 = default(AtkUnitBase*);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -479532858;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 3:
|
||||
num = -479532861;
|
||||
break;
|
||||
case 2:
|
||||
num = ((!gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(-100229517), out addonPtr2)) ? (-479532857) : (-479532862));
|
||||
break;
|
||||
case 5:
|
||||
num = ((!LAddon.IsAddonReady(addonPtr)) ? (-479532860) : (-479532858));
|
||||
break;
|
||||
case 4:
|
||||
num = ((!LAddon.IsAddonReady(addonPtr2)) ? (-479532857) : (-479532864));
|
||||
break;
|
||||
case 6:
|
||||
AddonCallback.Fire(addonPtr2, index);
|
||||
return true;
|
||||
case 0:
|
||||
AddonCallback.Fire(addonPtr, index);
|
||||
return true;
|
||||
case 1:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool IsShopReady(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(854458650), out addonPtr) ? 1690879529 : 1690879530);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1690879531;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 0:
|
||||
goto IL_0054;
|
||||
case 1:
|
||||
return false;
|
||||
case 2:
|
||||
return LAddon.IsAddonReady(addonPtr);
|
||||
}
|
||||
continue;
|
||||
IL_0054:
|
||||
num = 1690879530;
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static int FindItemDisplayIndex(IGameGui gameGui, uint itemId)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(-526765299), out addonPtr) ? 2111523499 : 2111523488);
|
||||
int num6 = default(int);
|
||||
int num5 = default(int);
|
||||
uint uInt = default(uint);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 2111523490;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 8:
|
||||
num = ((addonPtr->AtkValues == null) ? 2111523494 : 2111523490);
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
int num7 = num6;
|
||||
num3 = 1;
|
||||
num4 = num7;
|
||||
num6 = (num4 | num3) + (num4 & num3);
|
||||
num = 2111523502;
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
num3 = num6;
|
||||
num4 = 441;
|
||||
int num8 = num4 ^ num3;
|
||||
int num9 = num4 & num3;
|
||||
num5 = num8 + (num9 + num9);
|
||||
num = ((num5 < addonPtr->AtkValuesCount) ? 2111523492 : 2111523503);
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
uInt = addonPtr->AtkValues[2].UInt;
|
||||
num6 = 0;
|
||||
num = 2111523502;
|
||||
break;
|
||||
case 12:
|
||||
num = ((num6 < uInt) ? 2111523495 : 2111523491);
|
||||
break;
|
||||
case 2:
|
||||
return -1;
|
||||
case 10:
|
||||
return -1;
|
||||
case 9:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? 2111523498 : 2111523496);
|
||||
break;
|
||||
case 3:
|
||||
return num6;
|
||||
case 0:
|
||||
num = ((addonPtr->AtkValuesCount > 2) ? 2111523500 : 2111523494);
|
||||
break;
|
||||
case 1:
|
||||
return -1;
|
||||
case 4:
|
||||
return -1;
|
||||
case 13:
|
||||
return -1;
|
||||
case 11:
|
||||
num = 2111523488;
|
||||
break;
|
||||
case 6:
|
||||
num = ((addonPtr->AtkValues[num5].UInt != itemId) ? 2111523493 : 2111523489);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryBuyItem(IGameGui gameGui, int itemIndex, int quantity)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-364498650), out addonPtr) ? (-705089016) : (-705089011));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -705089012;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 4:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? (-705089009) : (-705089012));
|
||||
break;
|
||||
case 0:
|
||||
return false;
|
||||
case 2:
|
||||
num = -705089011;
|
||||
break;
|
||||
case 1:
|
||||
return false;
|
||||
case 3:
|
||||
{
|
||||
AtkValue* values = stackalloc AtkValue[4]
|
||||
{
|
||||
new AtkValue
|
||||
{
|
||||
Type = AtkValueType.Int,
|
||||
Int = 0
|
||||
},
|
||||
new AtkValue
|
||||
{
|
||||
Type = AtkValueType.Int,
|
||||
Int = itemIndex
|
||||
},
|
||||
new AtkValue
|
||||
{
|
||||
Type = AtkValueType.Int,
|
||||
Int = quantity
|
||||
},
|
||||
new AtkValue
|
||||
{
|
||||
Type = AtkValueType.Undefined,
|
||||
Int = 0
|
||||
}
|
||||
};
|
||||
addonPtr->FireCallback(4u, values);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryConfirmPurchase(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-502173951), out addonPtr) ? 723548803 : 723548800);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 723548802;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 3:
|
||||
AddonCallback.ClickYes(addonPtr);
|
||||
return true;
|
||||
case 2:
|
||||
return false;
|
||||
case 4:
|
||||
num = 723548800;
|
||||
break;
|
||||
case 1:
|
||||
num = (LAddon.IsAddonReady(addonPtr) ? 723548801 : 723548802);
|
||||
break;
|
||||
case 0:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public unsafe static bool TryCloseShop(IGameGui gameGui)
|
||||
{
|
||||
AtkUnitBase* addonPtr;
|
||||
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-364498650), out addonPtr) ? 206614822 : 206614821);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 206614820;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
addonPtr->Close(fireCallback: true);
|
||||
return true;
|
||||
case 1:
|
||||
return false;
|
||||
case 0:
|
||||
goto IL_0060;
|
||||
}
|
||||
continue;
|
||||
IL_0060:
|
||||
num = 206614821;
|
||||
}
|
||||
}
|
||||
}
|
||||
117
LLib/LLib.Shop/VendorResolver.cs
Normal file
117
LLib/LLib.Shop/VendorResolver.cs
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
using System.Collections.Generic;
|
||||
using Dalamud.Plugin.Services;
|
||||
using LLib.Shop.Model;
|
||||
using LLib.Shop.Searchers;
|
||||
|
||||
namespace LLib.Shop;
|
||||
|
||||
public sealed class VendorResolver
|
||||
{
|
||||
private readonly GilShopSearcher _gilShopSearcher;
|
||||
|
||||
private readonly SpecialShopSearcher _specialShopSearcher;
|
||||
|
||||
private readonly GCShopSearcher _gcShopSearcher;
|
||||
|
||||
public VendorResolver(IDataManager dataManager, NpcPositionCache positionCache)
|
||||
{
|
||||
_gilShopSearcher = new GilShopSearcher(dataManager, positionCache);
|
||||
_specialShopSearcher = new SpecialShopSearcher(dataManager, positionCache);
|
||||
_gcShopSearcher = new GCShopSearcher(dataManager, positionCache);
|
||||
}
|
||||
|
||||
public IReadOnlyList<ShopSearchResult> FindVendorsForItem(uint itemId)
|
||||
{
|
||||
List<ShopSearchResult> list = new List<ShopSearchResult>();
|
||||
list.AddRange(_gilShopSearcher.Search(itemId));
|
||||
list.AddRange(_specialShopSearcher.Search(itemId));
|
||||
list.AddRange(_gcShopSearcher.Search(itemId));
|
||||
return list;
|
||||
}
|
||||
|
||||
public IReadOnlyList<ShopSearchResult> FindVendorsForItem(uint itemId, EShopType shopType)
|
||||
{
|
||||
int num;
|
||||
List<ShopSearchResult> result = default(List<ShopSearchResult>);
|
||||
switch (shopType)
|
||||
{
|
||||
default:
|
||||
num = -1685291890;
|
||||
goto IL_001d;
|
||||
case EShopType.SpecialShop:
|
||||
result = _specialShopSearcher.Search(itemId);
|
||||
num = -1685291895;
|
||||
goto IL_001d;
|
||||
case EShopType.GCShop:
|
||||
goto IL_006c;
|
||||
case EShopType.GilShop:
|
||||
goto IL_00ab;
|
||||
IL_001d:
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1685291889;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 6:
|
||||
return result;
|
||||
case 4:
|
||||
goto end_IL_001d;
|
||||
case 2:
|
||||
goto IL_006c;
|
||||
case 0:
|
||||
result = new List<ShopSearchResult>();
|
||||
num = -1685291895;
|
||||
break;
|
||||
case 5:
|
||||
num = -1685291890;
|
||||
break;
|
||||
case 1:
|
||||
num = -1685291889;
|
||||
break;
|
||||
case 3:
|
||||
goto IL_00ab;
|
||||
}
|
||||
continue;
|
||||
end_IL_001d:
|
||||
break;
|
||||
}
|
||||
goto case EShopType.SpecialShop;
|
||||
IL_00ab:
|
||||
result = _gilShopSearcher.Search(itemId);
|
||||
num = -1685291895;
|
||||
goto IL_001d;
|
||||
IL_006c:
|
||||
result = _gcShopSearcher.Search(itemId);
|
||||
num = -1685291895;
|
||||
goto IL_001d;
|
||||
}
|
||||
}
|
||||
|
||||
public ShopSearchResult? FindGilVendor(uint itemId)
|
||||
{
|
||||
List<ShopSearchResult> list = _gilShopSearcher.Search(itemId);
|
||||
int num = ((list.Count > 0) ? 274593349 : 274593348);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 274593349;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
goto IL_0056;
|
||||
case 1:
|
||||
return null;
|
||||
case 0:
|
||||
return list[0];
|
||||
}
|
||||
continue;
|
||||
IL_0056:
|
||||
num = 274593348;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue