Add additional flying steps if too far away from the mount-NPC for Vath + Vanu Vanu dailies

This commit is contained in:
Liza 2024-12-03 16:35:37 +01:00
parent 58ec1259f5
commit 6548b5206e
Signed by: liza
GPG Key ID: 8DD6D21C03BB0848
11 changed files with 540 additions and 259 deletions

View File

@ -20,6 +20,30 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"MaximumDistance": 50,
"TerritoryId": 401
}
}
}
},
{
"DataId": 1016093,
"Position": {
@ -57,7 +81,14 @@
"Action": "Buffet (Sanuwa)",
"StopDistance": 3,
"$": "0 0 0 0 0 0 --> 1 0 0 0 0 16",
"CompletionQuestVariablesFlags": [null,null,null,null,null,16]
"CompletionQuestVariablesFlags": [
null,
null,
null,
null,
null,
16
]
},
{
"Position": {
@ -81,7 +112,14 @@
"Action": "Buffet (Sanuwa)",
"StopDistance": 3,
"$": "1 0 0 0 0 16 --> 2 0 0 0 0 80",
"CompletionQuestVariablesFlags": [null,null,null,null,null,64]
"CompletionQuestVariablesFlags": [
null,
null,
null,
null,
null,
64
]
},
{
"Position": {
@ -105,7 +143,14 @@
"Action": "Buffet (Sanuwa)",
"StopDistance": 3,
"$": "2 0 0 0 0 80 --> 3 0 0 0 0 112",
"CompletionQuestVariablesFlags": [null,null,null,null,null,32]
"CompletionQuestVariablesFlags": [
null,
null,
null,
null,
null,
32
]
},
{
"Position": {

View File

@ -20,6 +20,30 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"MaximumDistance": 50,
"TerritoryId": 401
}
}
}
},
{
"DataId": 1016093,
"Position": {

View File

@ -20,6 +20,30 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"MaximumDistance": 50,
"TerritoryId": 401
}
}
}
},
{
"DataId": 1016093,
"Position": {

View File

@ -35,6 +35,30 @@
{
"Sequence": 2,
"Steps": [
{
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"MaximumDistance": 50,
"TerritoryId": 401
}
}
}
},
{
"DataId": 1016093,
"Position": {
@ -72,7 +96,14 @@
"InteractionType": "Action",
"Action": "Buffet (Sanuwa)",
"Fly": true,
"CompletionQuestVariablesFlags": [null,null,null,null,null,32]
"CompletionQuestVariablesFlags": [
null,
null,
null,
null,
null,
32
]
},
{
"DataId": 1016221,
@ -85,7 +116,14 @@
"InteractionType": "Action",
"Action": "Buffet (Sanuwa)",
"Fly": true,
"CompletionQuestVariablesFlags": [null,null,null,null,null,64]
"CompletionQuestVariablesFlags": [
null,
null,
null,
null,
null,
64
]
},
{
"DataId": 1016220,

View File

@ -36,6 +36,30 @@
{
"Sequence": 2,
"Steps": [
{
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"MaximumDistance": 50,
"TerritoryId": 401
}
}
}
},
{
"DataId": 1016093,
"Position": {

View File

@ -36,6 +36,30 @@
{
"Sequence": 2,
"Steps": [
{
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": -776.0281,
"Y": -133.35559,
"Z": -414.32825
},
"MaximumDistance": 50,
"TerritoryId": 401
}
}
}
},
{
"DataId": 1016093,
"Position": {

View File

@ -20,6 +20,30 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": 74.20459,
"Y": -48.533592,
"Z": -171.12994
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": 74.20459,
"Y": -48.533592,
"Z": -171.12994
},
"MaximumDistance": 50,
"TerritoryId": 398
}
}
}
},
{
"DataId": 1017031,
"Position": {

View File

@ -20,6 +20,30 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": 74.20459,
"Y": -48.533592,
"Z": -171.12994
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": 74.20459,
"Y": -48.533592,
"Z": -171.12994
},
"MaximumDistance": 50,
"TerritoryId": 398
}
}
}
},
{
"DataId": 1017031,
"Position": {

View File

@ -20,6 +20,30 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": 74.20459,
"Y": -48.533592,
"Z": -171.12994
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": 74.20459,
"Y": -48.533592,
"Z": -171.12994
},
"MaximumDistance": 50,
"TerritoryId": 398
}
}
}
},
{
"DataId": 1017031,
"Position": {

View File

@ -20,6 +20,30 @@
{
"Sequence": 1,
"Steps": [
{
"Position": {
"X": 74.20459,
"Y": -48.533592,
"Z": -171.12994
},
"StopDistance": 3,
"TerritoryId": 398,
"InteractionType": "WalkTo",
"Fly": true,
"SkipConditions": {
"StepIf": {
"NearPosition": {
"Position": {
"X": 74.20459,
"Y": -48.533592,
"Z": -171.12994
},
"MaximumDistance": 50,
"TerritoryId": 398
}
}
}
},
{
"DataId": 1017031,
"Position": {

View File

@ -152,11 +152,13 @@ internal sealed unsafe class QuestFunctions
{
// if we have multiple quests to turn in for an allied society, try and complete all of them
var (firstTrackedQuest, firstTrackedSequence) = trackedQuests.First();
EAlliedSociety firstTrackedAlliedSociety = _alliedSocietyData.GetCommonAlliedSocietyTurnIn(firstTrackedQuest);
EAlliedSociety firstTrackedAlliedSociety =
_alliedSocietyData.GetCommonAlliedSocietyTurnIn(firstTrackedQuest);
if (firstTrackedAlliedSociety != EAlliedSociety.None)
{
var alliedQuestsForSameSociety = trackedQuests.Skip(1)
.Where(quest => _alliedSocietyData.GetCommonAlliedSocietyTurnIn(quest.Quest) == firstTrackedAlliedSociety)
.Where(quest =>
_alliedSocietyData.GetCommonAlliedSocietyTurnIn(quest.Quest) == firstTrackedAlliedSociety)
.ToList();
if (alliedQuestsForSameSociety.Count > 0)
{
@ -177,14 +179,15 @@ internal sealed unsafe class QuestFunctions
// also include the first quest in the list for those
alliedQuestsForSameSociety.Insert(0, (firstTrackedQuest, firstTrackedSequence));
_alliedSocietyData.GetCommonAlliedSocietyNpcs(firstTrackedAlliedSociety, out uint[]? normalNpcs,
_alliedSocietyData.GetCommonAlliedSocietyNpcs(firstTrackedAlliedSociety,
out uint[]? normalNpcs,
out _);
if (normalNpcs.Length > 0)
{
var talkToNormalNpcs = alliedQuestsForSameSociety
.Where(x => x.Sequence < 255)
.Where(x => IsInteractStep(x.Quest, x.Sequence, normalNpcs))
.Where(x => IsInteractSequence(x.Quest, x.Sequence, normalNpcs))
.Cast<(ElementId, byte)?>()
.FirstOrDefault();
if (talkToNormalNpcs != null)
@ -299,13 +302,16 @@ internal sealed unsafe class QuestFunctions
_alliedSocietyData.Mounts.ContainsKey(battleChara->Mount.MountId);
}
private bool IsInteractStep(ElementId questId, byte sequence, uint[] dataIds)
private bool IsInteractSequence(ElementId questId, byte sequenceNo, uint[] dataIds)
{
if (_questRegistry.TryGetQuest(questId, out var quest))
{
QuestStep? firstStepOfSequence = quest.FindSequence(sequence)?.FindStep(0);
return firstStepOfSequence is { InteractionType: EInteractionType.Interact, DataId: { } dataId } &&
dataIds.Contains(dataId);
QuestSequence? sequence = quest.FindSequence(sequenceNo);
return sequence != null &&
sequence.Steps.All(x =>
x is { InteractionType: EInteractionType.WalkTo } ||
(x is { InteractionType: EInteractionType.Interact, DataId: { } dataId } &&
dataIds.Contains(dataId)));
}
return false;