2024-07-27 13:39:47 +00:00
|
|
|
|
using System.Collections.Generic;
|
2024-08-15 23:51:12 +00:00
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2024-05-26 13:43:33 +00:00
|
|
|
|
using System.Numerics;
|
|
|
|
|
using System.Text.Json.Serialization;
|
2024-08-02 16:30:21 +00:00
|
|
|
|
using Questionable.Model.Common;
|
|
|
|
|
using Questionable.Model.Common.Converter;
|
|
|
|
|
using Questionable.Model.Questing.Converter;
|
2024-05-25 21:51:37 +00:00
|
|
|
|
|
2024-08-02 16:30:21 +00:00
|
|
|
|
namespace Questionable.Model.Questing;
|
2024-05-25 21:51:37 +00:00
|
|
|
|
|
2024-08-15 23:51:12 +00:00
|
|
|
|
[SuppressMessage("ReSharper", "CollectionNeverUpdated.Global")]
|
2024-06-14 09:37:33 +00:00
|
|
|
|
public sealed class QuestStep
|
2024-05-25 21:51:37 +00:00
|
|
|
|
{
|
2024-07-10 16:53:34 +00:00
|
|
|
|
public const float DefaultStopDistance = 3f;
|
2024-09-02 20:03:29 +00:00
|
|
|
|
public const int VesperBayAetheryteTicket = 30362;
|
2024-07-10 16:53:34 +00:00
|
|
|
|
|
2024-05-26 19:45:26 +00:00
|
|
|
|
public uint? DataId { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonConverter(typeof(VectorConverter))]
|
|
|
|
|
public Vector3? Position { get; set; }
|
|
|
|
|
|
|
|
|
|
public float? StopDistance { get; set; }
|
2024-05-25 21:51:37 +00:00
|
|
|
|
public ushort TerritoryId { get; set; }
|
2024-08-15 23:51:12 +00:00
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
|
|
|
|
public EInteractionType InteractionType { get; set; }
|
|
|
|
|
|
|
|
|
|
public float? NpcWaitDistance { get; set; }
|
2024-05-28 20:24:06 +00:00
|
|
|
|
public ushort? TargetTerritoryId { get; set; }
|
2024-06-18 15:48:45 +00:00
|
|
|
|
public float? DelaySecondsAtStart { get; set; }
|
2024-08-22 10:14:12 +00:00
|
|
|
|
public uint? PickUpItemId { get; set; }
|
2024-05-28 20:24:06 +00:00
|
|
|
|
|
2024-05-26 13:43:33 +00:00
|
|
|
|
public bool Disabled { get; set; }
|
2024-05-27 19:54:34 +00:00
|
|
|
|
public bool DisableNavmesh { get; set; }
|
|
|
|
|
public bool? Mount { get; set; }
|
2024-06-01 16:46:57 +00:00
|
|
|
|
public bool? Fly { get; set; }
|
2024-07-12 21:58:48 +00:00
|
|
|
|
public bool? Land { get; set; }
|
2024-06-01 16:46:57 +00:00
|
|
|
|
public bool? Sprint { get; set; }
|
2024-07-13 20:01:06 +00:00
|
|
|
|
public bool? IgnoreDistanceToObject { get; set; }
|
2024-08-29 13:45:16 +00:00
|
|
|
|
public bool? RestartNavigationIfCancelled { get; set; }
|
2024-05-26 19:45:26 +00:00
|
|
|
|
public string? Comment { get; set; }
|
|
|
|
|
|
2024-07-17 10:58:08 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Only used when attuning to an aetheryte.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public EAetheryteLocation? Aetheryte { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Only used when attuning to an aethernet shard.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[JsonConverter(typeof(AethernetShardConverter))]
|
|
|
|
|
public EAetheryteLocation? AethernetShard { get; set; }
|
|
|
|
|
|
2024-05-26 19:45:26 +00:00
|
|
|
|
public EAetheryteLocation? AetheryteShortcut { get; set; }
|
2024-05-26 13:43:33 +00:00
|
|
|
|
|
2024-05-26 19:45:26 +00:00
|
|
|
|
public AethernetShortcut? AethernetShortcut { get; set; }
|
2024-05-27 19:54:34 +00:00
|
|
|
|
public uint? AetherCurrentId { get; set; }
|
|
|
|
|
|
|
|
|
|
public uint? ItemId { get; set; }
|
2024-05-28 22:17:19 +00:00
|
|
|
|
public bool? GroundTarget { get; set; }
|
2024-08-16 19:57:35 +00:00
|
|
|
|
public int? ItemCount { get; set; }
|
2024-05-27 19:54:34 +00:00
|
|
|
|
|
|
|
|
|
public EEmote? Emote { get; set; }
|
2024-06-03 12:20:02 +00:00
|
|
|
|
public ChatMessage? ChatMessage { get; set; }
|
2024-07-10 19:01:41 +00:00
|
|
|
|
public EAction? Action { get; set; }
|
2024-10-19 15:24:21 +00:00
|
|
|
|
public EStatus? Status { get; set; }
|
2024-11-11 21:38:20 +00:00
|
|
|
|
public EExtendedClassJob TargetClass { get; set; } = EExtendedClassJob.None;
|
2024-05-27 19:54:34 +00:00
|
|
|
|
|
|
|
|
|
public EEnemySpawnType? EnemySpawnType { get; set; }
|
2024-08-15 23:51:12 +00:00
|
|
|
|
public List<uint> KillEnemyDataIds { get; set; } = [];
|
|
|
|
|
public List<ComplexCombatData> ComplexCombatData { get; set; } = [];
|
2024-10-12 20:11:54 +00:00
|
|
|
|
public CombatItemUse? CombatItemUse { get; set; }
|
2024-07-21 19:33:38 +00:00
|
|
|
|
public float? CombatDelaySecondsAtStart { get; set; }
|
2024-06-14 09:37:33 +00:00
|
|
|
|
|
2024-06-01 12:30:20 +00:00
|
|
|
|
public JumpDestination? JumpDestination { get; set; }
|
|
|
|
|
public uint? ContentFinderConditionId { get; set; }
|
2024-07-27 13:39:47 +00:00
|
|
|
|
public SkipConditions? SkipConditions { get; set; }
|
2024-05-29 19:22:58 +00:00
|
|
|
|
|
2024-07-20 17:09:51 +00:00
|
|
|
|
public List<List<QuestWorkValue>?> RequiredQuestVariables { get; set; } = new();
|
2024-11-04 16:19:49 +00:00
|
|
|
|
public List<EExtendedClassJob> RequiredCurrentJob { get; set; } = [];
|
|
|
|
|
public List<EExtendedClassJob> RequiredQuestAcceptedJob { get; set; } = [];
|
2024-09-16 18:22:12 +00:00
|
|
|
|
public List<GatheredItem> ItemsToGather { get; set; } = [];
|
2024-08-15 23:51:12 +00:00
|
|
|
|
public List<QuestWorkValue?> CompletionQuestVariablesFlags { get; set; } = [];
|
|
|
|
|
public List<DialogueChoice> DialogueChoices { get; set; } = [];
|
|
|
|
|
public List<uint> PointMenuChoices { get; set; } = [];
|
2024-09-22 12:31:14 +00:00
|
|
|
|
public PurchaseMenu? PurchaseMenu { get; set; }
|
2024-07-11 00:56:42 +00:00
|
|
|
|
|
|
|
|
|
// TODO: Not implemented
|
2024-08-03 20:17:18 +00:00
|
|
|
|
[JsonConverter(typeof(ElementIdConverter))]
|
|
|
|
|
public ElementId? PickUpQuestId { get; set; }
|
2024-07-11 00:56:42 +00:00
|
|
|
|
|
2024-08-03 20:17:18 +00:00
|
|
|
|
[JsonConverter(typeof(ElementIdConverter))]
|
|
|
|
|
public ElementId? TurnInQuestId { get; set; }
|
2024-08-03 18:30:18 +00:00
|
|
|
|
|
2024-08-03 20:17:18 +00:00
|
|
|
|
[JsonConverter(typeof(ElementIdConverter))]
|
|
|
|
|
public ElementId? NextQuestId { get; set; }
|
2024-06-01 16:46:57 +00:00
|
|
|
|
|
2024-06-14 09:37:33 +00:00
|
|
|
|
[JsonConstructor]
|
|
|
|
|
public QuestStep()
|
2024-06-01 16:46:57 +00:00
|
|
|
|
{
|
2024-06-14 09:37:33 +00:00
|
|
|
|
}
|
2024-06-01 16:46:57 +00:00
|
|
|
|
|
2024-06-14 09:37:33 +00:00
|
|
|
|
public QuestStep(EInteractionType interactionType, uint? dataId, Vector3? position, ushort territoryId)
|
|
|
|
|
{
|
|
|
|
|
InteractionType = interactionType;
|
|
|
|
|
DataId = dataId;
|
|
|
|
|
Position = position;
|
|
|
|
|
TerritoryId = territoryId;
|
2024-06-01 16:46:57 +00:00
|
|
|
|
}
|
2024-07-10 16:53:34 +00:00
|
|
|
|
|
|
|
|
|
public float CalculateActualStopDistance()
|
|
|
|
|
{
|
|
|
|
|
if (InteractionType == EInteractionType.WalkTo)
|
|
|
|
|
return StopDistance ?? 0.25f;
|
2024-07-17 10:58:08 +00:00
|
|
|
|
if (InteractionType == EInteractionType.AttuneAetheryte)
|
|
|
|
|
return StopDistance ?? 10f;
|
2024-07-10 16:53:34 +00:00
|
|
|
|
else
|
|
|
|
|
return StopDistance ?? DefaultStopDistance;
|
|
|
|
|
}
|
2024-09-02 20:03:29 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Only relevant for the step 0 in sequence 0: Whether this step is valid for teleporting to it.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public bool IsTeleportableForPriorityQuests()
|
|
|
|
|
{
|
|
|
|
|
if (AetheryteShortcut != null)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
if (InteractionType == EInteractionType.UseItem && ItemId == VesperBayAetheryteTicket)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-05-25 21:51:37 +00:00
|
|
|
|
}
|