Override journal genre for some Radz-at-Han/Thavnair side quests

This commit is contained in:
Liza 2025-01-05 14:23:38 +01:00
parent 459b832ef2
commit 563a11d47d
Signed by: liza
GPG Key ID: 2C41B84815CF6445
3 changed files with 21 additions and 3 deletions

View File

@ -40,6 +40,12 @@ internal sealed class QuestData
public QuestData(IDataManager dataManager)
{
JournalGenreOverrides journalGenreOverrides = new()
{
RadzAtHanSideQuests = dataManager.GetExcelSheet<Quest>().GetRow(69805).JournalGenre.RowId,
ThavnairSideQuests = dataManager.GetExcelSheet<Quest>().GetRow(70025).JournalGenre.RowId,
};
Dictionary<uint, uint> questChapters =
dataManager.GetExcelSheet<QuestChapter>()
.Where(x => x.RowId > 0 && x.Quest.RowId > 0)
@ -59,7 +65,7 @@ internal sealed class QuestData
.Where(x => x.RowId > 0)
.Where(x => x.IssuerLocation.RowId > 0)
.Select(x => new QuestInfo(x, questChapters.GetValueOrDefault(x.RowId),
startingCities.GetValueOrDefault(x.RowId))),
startingCities.GetValueOrDefault(x.RowId), journalGenreOverrides)),
..dataManager.GetExcelSheet<SatisfactionNpc>()
.Where(x => x is { RowId: > 0, Npc.RowId: > 0 })
.Select(x => new SatisfactionSupplyInfo(x)),

View File

@ -0,0 +1,7 @@
namespace Questionable.Model;
internal sealed class JournalGenreOverrides
{
public required uint ThavnairSideQuests { get; init; }
public required uint RadzAtHanSideQuests { get; init; }
}

View File

@ -12,7 +12,7 @@ namespace Questionable.Model;
internal sealed class QuestInfo : IQuestInfo
{
public QuestInfo(ExcelQuest quest, uint newGamePlusChapter, byte startingCity)
public QuestInfo(ExcelQuest quest, uint newGamePlusChapter, byte startingCity, JournalGenreOverrides journalGenreOverrides)
{
QuestId = new QuestId((ushort)(quest.RowId & 0xFFFF));
@ -53,7 +53,12 @@ internal sealed class QuestInfo : IQuestInfo
.Where(x => x.Value != 0)
.ToImmutableList();
QuestLockJoin = (EQuestJoin)quest.QuestLockJoin;
JournalGenre = quest.JournalGenre.ValueNullable?.RowId;
JournalGenre = QuestId.Value switch
{
>= 4196 and <= 4209 => journalGenreOverrides.ThavnairSideQuests,
4173 => journalGenreOverrides.RadzAtHanSideQuests,
_ => quest.JournalGenre.ValueNullable?.RowId,
};
SortKey = quest.SortKey;
IsMainScenarioQuest = quest.JournalGenre.ValueNullable?.JournalCategory.ValueNullable?.JournalSection
.ValueNullable?.RowId is 0 or 1;