141 lines
6.5 KiB
C#
141 lines
6.5 KiB
C#
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using Dalamud.Game.ClientState.Conditions;
|
|
using Dalamud.Game.ClientState.Objects.SubKinds;
|
|
using Dalamud.Game.ClientState.Objects.Types;
|
|
using Dalamud.Plugin.Services;
|
|
using FFXIVClientStructs.FFXIV.Client.Game;
|
|
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace Questionable.Controller.Steps.Movement;
|
|
|
|
internal sealed class LandExecutor(IObjectTable objectTable, ICondition condition, ILogger<LandExecutor> logger) : TaskExecutor<LandTask>()
|
|
{
|
|
private bool _landing;
|
|
|
|
private long _continueAt;
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
protected override bool Start()
|
|
{
|
|
int num = (_206F_200C_200B_202A_202A_200E_206B_200D_200F_202D_206F_202D_206B_206D_202E_200B_206E_206A_202B_202D_202C_206B_206B_206E_200E_206C_206D_206E_200E_206A_206A_206C_202C_202B_200C_202A_206F_200F_206B_206C_202E(condition, ConditionFlag.InFlight) ? 1222817093 : 1222817094);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 1222817092;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 1:
|
|
_landing = AttemptLanding();
|
|
_continueAt = _202B_202D_200D_206B_206F_206D_200D_206D_206C_202D_202E_202B_200E_202B_200B_206B_206D_206B_206A_200B_202A_202B_206F_200D_200F_206F_202D_200F_206C_202B_200C_202C_206E_202A_200E_200B_206E_202C_200D_200D_202E() + 250;
|
|
return true;
|
|
case 2:
|
|
_206C_206E_200B_202E_200E_200D_202E_206C_200B_200C_202D_202B_200E_206D_200B_206E_206F_202B_202D_200E_200D_206A_200C_200C_202C_202E_200D_206F_200C_206A_206F_206D_202A_200F_202D_200B_200D_202A_202A_200D_202E((ILogger)logger, global::_003CModule_003E._206C_202A_206D_206A_206E_202A_202B_206F_206D_200F_202D_200F_202D_206A_202C_202B_206D_206A_200E_200E_202D_202D_200D_200C_200D_200D_206D_206E_202A_200F_206E_206C_206D_206A_206D_202B_200F_200D_206E_200C_202E<string>(568911902), Array.Empty<object>());
|
|
return false;
|
|
case 0:
|
|
goto IL_0089;
|
|
}
|
|
continue;
|
|
IL_0089:
|
|
num = 1222817094;
|
|
}
|
|
}
|
|
|
|
public override ETaskResult Update()
|
|
{
|
|
int num = ((_202B_202D_200D_206B_206F_206D_200D_206D_206C_202D_202E_202B_200E_202B_200B_206B_206D_206B_206A_200B_202A_202B_206F_200D_200F_206F_202D_200F_206C_202B_200C_202C_206E_202A_200E_200B_206E_202C_200D_200D_202E() >= _continueAt) ? (-1155847244) : (-1155847247));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -1155847244;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 4:
|
|
return ETaskResult.TaskComplete;
|
|
case 5:
|
|
return ETaskResult.StillRunning;
|
|
case 6:
|
|
num = (_landing ? (-1155847243) : (-1155847241));
|
|
break;
|
|
case 0:
|
|
num = ((!_206F_200C_200B_202A_202A_200E_206B_200D_200F_202D_206F_202D_206B_206D_202E_200B_206E_206A_202B_202D_202C_206B_206B_206E_200E_206C_206D_206E_200E_206A_206A_206C_202C_202B_200C_202A_206F_200F_206B_206C_202E(condition, ConditionFlag.InFlight)) ? (-1155847248) : (-1155847246));
|
|
break;
|
|
case 1:
|
|
return ETaskResult.StillRunning;
|
|
case 2:
|
|
num = -1155847247;
|
|
break;
|
|
case 3:
|
|
_landing = AttemptLanding();
|
|
_continueAt = _202B_202D_200D_206B_206F_206D_200D_206D_206C_202D_202E_202B_200E_202B_200B_206B_206D_206B_206A_200B_202A_202B_206F_200D_200F_206F_202D_200F_206C_202B_200C_202C_206E_202A_200E_200B_206E_202C_200D_200D_202E() + 250;
|
|
num = -1155847243;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
private unsafe bool AttemptLanding()
|
|
{
|
|
IPlayerCharacter playerCharacter = _200E_206D_206D_200C_200C_202B_202B_202C_200C_202A_206F_206A_200E_202C_200D_206D_202E_200D_202D_206D_202E_202B_200C_200B_206B_206E_200F_206D_202A_206B_200B_206A_200D_202C_206D_200B_200B_202B_206A_202C_202E(objectTable);
|
|
Character* ptr = (Character*)((playerCharacter != null) ? _206C_202E_202A_200C_206E_202C_206B_202B_202D_206C_206E_200F_206B_202A_200E_202E_202E_206D_200F_206B_202E_206B_200E_202E_200C_206F_202B_206C_200F_202E_206D_206A_200D_202C_206B_200E_202C_206D_200F_202E((IGameObject)playerCharacter) : 0);
|
|
int num = ((ptr == null) ? (-1147951571) : (-1147951570));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -1147951569;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 2:
|
|
return false;
|
|
case 1:
|
|
num = ((ActionManager.Instance()->GetActionStatus(ActionType.GeneralAction, 23u, 3758096384uL, checkRecastActive: true, checkCastingActive: true, null) != 0) ? (-1147951571) : (-1147951569));
|
|
break;
|
|
case 0:
|
|
_206C_206E_200B_202E_200E_200D_202E_206C_200B_200C_202D_202B_200E_206D_200B_206E_206F_202B_202D_200E_200D_206A_200C_200C_202C_202E_200D_206F_200C_206A_206F_206D_202A_200F_202D_200B_200D_202A_202A_200D_202E((ILogger)logger, global::_003CModule_003E._202E_206C_200F_206B_206A_202A_202C_206F_200C_206C_202B_206B_206D_206D_206D_202D_206E_202E_206C_206E_206D_202C_206F_200D_202D_202E_206A_206D_202A_206A_202B_200D_200C_206D_202B_200B_200D_200C_206E_206B_202E<string>(1670122022), Array.Empty<object>());
|
|
return ActionManager.Instance()->UseAction(ActionType.GeneralAction, 23u, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null);
|
|
case 3:
|
|
num = -1147951570;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
public override bool ShouldInterruptOnDamage()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static bool _206F_200C_200B_202A_202A_200E_206B_200D_200F_202D_206F_202D_206B_206D_202E_200B_206E_206A_202B_202D_202C_206B_206B_206E_200E_206C_206D_206E_200E_206A_206A_206C_202C_202B_200C_202A_206F_200F_206B_206C_202E(ICondition P_0, ConditionFlag P_1)
|
|
{
|
|
return P_0[P_1];
|
|
}
|
|
|
|
static void _206C_206E_200B_202E_200E_200D_202E_206C_200B_200C_202D_202B_200E_206D_200B_206E_206F_202B_202D_200E_200D_206A_200C_200C_202C_202E_200D_206F_200C_206A_206F_206D_202A_200F_202D_200B_200D_202A_202A_200D_202E(ILogger P_0, string P_1, object[] P_2)
|
|
{
|
|
P_0.LogDebug(P_1, P_2);
|
|
}
|
|
|
|
static long _202B_202D_200D_206B_206F_206D_200D_206D_206C_202D_202E_202B_200E_202B_200B_206B_206D_206B_206A_200B_202A_202B_206F_200D_200F_206F_202D_200F_206C_202B_200C_202C_206E_202A_200E_200B_206E_202C_200D_200D_202E()
|
|
{
|
|
return Environment.TickCount64;
|
|
}
|
|
|
|
static IPlayerCharacter _200E_206D_206D_200C_200C_202B_202B_202C_200C_202A_206F_206A_200E_202C_200D_206D_202E_200D_202D_206D_202E_202B_200C_200B_206B_206E_200F_206D_202A_206B_200B_206A_200D_202C_206D_200B_200B_202B_206A_202C_202E(IObjectTable P_0)
|
|
{
|
|
return P_0.LocalPlayer;
|
|
}
|
|
|
|
static nint _206C_202E_202A_200C_206E_202C_206B_202B_202D_206C_206E_200F_206B_202A_200E_202E_202E_206D_200F_206B_202E_206B_200E_202E_200C_206F_202B_206C_200F_202E_206D_206A_200D_202C_206B_200E_202C_206D_200F_202E(IGameObject P_0)
|
|
{
|
|
return P_0.Address;
|
|
}
|
|
}
|