forked from aly/qstbak
89 lines
1.9 KiB
C#
89 lines
1.9 KiB
C#
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
|
|
|
|
namespace LLib.Gear;
|
|
|
|
public static class GearsetHelper
|
|
{
|
|
public unsafe static int GetCurrentGearsetIndex()
|
|
{
|
|
RaptureGearsetModule* ptr = RaptureGearsetModule.Instance();
|
|
int num = ((ptr != null) ? (-1692442216) : (-1692442213));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -1692442214;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 0:
|
|
goto IL_0049;
|
|
case 1:
|
|
return -1;
|
|
case 2:
|
|
return ptr->CurrentGearsetIndex;
|
|
}
|
|
continue;
|
|
IL_0049:
|
|
num = -1692442213;
|
|
}
|
|
}
|
|
|
|
public unsafe static bool TryEquipGearset(int gearsetIndex)
|
|
{
|
|
RaptureGearsetModule* ptr = RaptureGearsetModule.Instance();
|
|
int num = ((ptr == null) ? 231059237 : 231059236);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 231059239;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 0:
|
|
ptr->EquipGearset(gearsetIndex, 0);
|
|
return true;
|
|
case 1:
|
|
num = (ptr->IsValidGearset(gearsetIndex) ? 231059239 : 231059237);
|
|
break;
|
|
case 2:
|
|
return false;
|
|
case 3:
|
|
num = ((gearsetIndex < 0) ? 231059237 : 231059238);
|
|
break;
|
|
case 4:
|
|
num = 231059236;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
public unsafe static byte GetGearsetClassJob(int gearsetIndex)
|
|
{
|
|
RaptureGearsetModule* ptr = RaptureGearsetModule.Instance();
|
|
int num = ((ptr == null) ? (-76399401) : (-76399403));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -76399402;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 1:
|
|
return 0;
|
|
case 2:
|
|
num = (ptr->IsValidGearset(gearsetIndex) ? (-76399406) : (-76399401));
|
|
break;
|
|
case 4:
|
|
return ptr->GetGearset(gearsetIndex)->ClassJob;
|
|
case 0:
|
|
num = -76399403;
|
|
break;
|
|
case 3:
|
|
num = ((gearsetIndex < 0) ? (-76399401) : (-76399404));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|