using System.Collections.Generic; using System.Numerics; using System.Text.Json.Serialization; using Questionable.Model.Converter; using Questionable.Model.Questing.Converter; using SmartNav.Model; using SmartNav.Model.Converter; namespace Questionable.Model.Questing; public sealed class QuestStep { public const float DefaultStopDistance = 3f; public const int VesperBayAetheryteTicket = 30362; public uint? DataId { get; set; } public List DataIds { get; set; } = new List(); [JsonConverter(typeof(VectorListConverter))] public List WaypointPositions { get; set; } = new List(); [JsonConverter(typeof(VectorConverter))] public Vector3? Position { get; set; } public float? StopDistance { get; set; } public List? LandingZones { get; set; } public ushort TerritoryId { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public EInteractionType InteractionType { get; set; } public float? NpcWaitDistance { get; set; } public ushort? TargetTerritoryId { get; set; } public float? DelaySecondsAtStart { get; set; } public uint? PickUpItemId { get; set; } public bool Disabled { get; set; } public bool DisableNavmesh { get; set; } public bool? Mount { get; set; } public bool MountRequired { get; set; } public bool DismountRequired { get; set; } public bool? Fly { get; set; } public bool? Land { get; set; } public bool? Sprint { get; set; } public bool? IgnoreDistanceToObject { get; set; } public bool? RestartNavigationIfCancelled { get; set; } public bool IgnoreQuestMarker { get; set; } public string? Comment { get; set; } public EAetheryteLocation? Aetheryte { get; set; } [JsonConverter(typeof(AethernetShardConverter))] public EAetheryteLocation? AethernetShard { get; set; } public uint? AetherCurrentId { get; set; } public uint? ItemId { get; set; } public bool? GroundTarget { get; set; } public int? ItemCount { get; set; } public bool? RequireHq { get; set; } public EEmote? Emote { get; set; } public ChatMessage? ChatMessage { get; set; } public EAction? Action { get; set; } public EStatus? Status { get; set; } public EExtendedClassJob TargetClass { get; set; } public byte? TaxiStandId { get; set; } public EEnemySpawnType? EnemySpawnType { get; set; } public List KillEnemyDataIds { get; set; } = new List(); public List ComplexCombatData { get; set; } = new List(); public List FateActionTargets { get; set; } = new List(); public ushort? CriticalEncounterId { get; set; } public CombatItemUse? CombatItemUse { get; set; } public float? CombatDelaySecondsAtStart { get; set; } public JumpDestination? JumpDestination { get; set; } public DutyOptions? DutyOptions { get; set; } public SinglePlayerDutyOptions? SinglePlayerDutyOptions { get; set; } public byte SinglePlayerDutyIndex => SinglePlayerDutyOptions?.Index ?? 0; public SkipConditions? SkipConditions { get; set; } public List?> RequiredQuestVariables { get; set; } = new List>(); public List RequiredCurrentJob { get; set; } = new List(); public List RequiredQuestAcceptedJob { get; set; } = new List(); public List ItemsToGather { get; set; } = new List(); public List CompletionQuestVariablesFlags { get; set; } = new List(); public List DialogueChoices { get; set; } = new List(); public List PointMenuChoices { get; set; } = new List(); public PurchaseMenu? PurchaseMenu { get; set; } public GCPurchaseInfo? GCPurchase { get; set; } [JsonConverter(typeof(ElementIdConverter))] public ElementId? PickUpQuestId { get; set; } [JsonConverter(typeof(ElementIdConverter))] public ElementId? TurnInQuestId { get; set; } [JsonConverter(typeof(ElementIdConverter))] public ElementId? NextQuestId { get; set; } [JsonConstructor] public QuestStep() { } public QuestStep(EInteractionType interactionType, uint? dataId, Vector3? position, ushort territoryId) { InteractionType = interactionType; DataId = dataId; Position = position; TerritoryId = territoryId; } public float CalculateActualStopDistance() { float? stopDistance = StopDistance; int num = ((!stopDistance.HasValue) ? (-455732266) : (-455732271)); float result = default(float); EInteractionType interactionType = default(EInteractionType); while (true) { int num2 = num; int num3 = -455732267; int num4 = num2; switch ((num4 | num3) - (num4 & num3)) { case 2: result = 10f; num = -455732268; break; case 4: return stopDistance.GetValueOrDefault(); case 8: num = (((uint)(interactionType - 4) <= 1u) ? (-455732265) : (-455732272)); break; case 5: num = -455732270; break; case 3: interactionType = InteractionType; num = ((interactionType == EInteractionType.WalkTo) ? (-455732269) : (-455732259)); break; case 0: num = -455732271; break; case 7: result = 3f; num = -455732268; break; case 6: result = 0.25f; num = -455732268; break; case 1: return result; } } } }