Update generator to add missing fields to quest json
default all quests to pmc quests all reward items are find in raid = true (we have no way to tell if that's correct or not until we get more quest dumps)
This commit is contained in:
parent
19c65814b2
commit
c783292278
@ -73,6 +73,8 @@ namespace GenerateQuestFile
|
||||
continue;
|
||||
}
|
||||
|
||||
AddMissingFields(quest);
|
||||
|
||||
// quest has start conditions, check to ensure they're carried over
|
||||
if (originalQuest.conditions.AvailableForStart.Count > 0)
|
||||
{
|
||||
@ -128,50 +130,49 @@ namespace GenerateQuestFile
|
||||
JsonWriter.WriteJson(questsToOutputToFile, "output", Directory.GetCurrentDirectory(), "quests");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Latest version of eft has changed the quest json structure, this method adds missing fields
|
||||
/// Mega hack as we dont have a full dump as of 30/06/2022
|
||||
/// </summary>
|
||||
/// <param name="quest">quest to add missing fields to</param>
|
||||
private static void AddMissingFields(KeyValuePair<string, Quest> quest)
|
||||
{
|
||||
//side
|
||||
if (String.IsNullOrEmpty(quest.Value.side))
|
||||
{
|
||||
quest.Value.side = "Pmc";
|
||||
LoggingHelpers.LogInfo($"Updated quest {quest.Value.QuestName} to have a side of 'pmc'");
|
||||
}
|
||||
|
||||
//changeQuestMessageText
|
||||
if (String.IsNullOrEmpty(quest.Value.changeQuestMessageText))
|
||||
{
|
||||
quest.Value.changeQuestMessageText = $"{quest.Value._id} changeQuestMessageText";
|
||||
LoggingHelpers.LogInfo($"Updated quest {quest.Value.QuestName} to have a changeQuestMessageText value");
|
||||
}
|
||||
|
||||
// findInRaid
|
||||
foreach (var success in quest.Value.rewards.Success)
|
||||
{
|
||||
if (string.Equals(success.type, "item", StringComparison.OrdinalIgnoreCase)
|
||||
&& success.findInRaid == null)
|
||||
{
|
||||
success.findInRaid = true;
|
||||
LoggingHelpers.LogInfo($"Updated quest {quest.Value.QuestName} to have a success item reward findInRaid value of 'true'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddMissingFailRewards(Quest originalQuest, KeyValuePair<string, Quest> quest)
|
||||
{
|
||||
quest.Value.rewards.Fail.AddRange(originalQuest.rewards.Fail);
|
||||
}
|
||||
|
||||
private static void CheckAndFixMissingProperties(Quest missingQuest)
|
||||
{
|
||||
if (missingQuest.description is null)
|
||||
{
|
||||
missingQuest.description = $"{missingQuest._id} description";
|
||||
}
|
||||
|
||||
if (missingQuest.failMessageText is null)
|
||||
{
|
||||
missingQuest.failMessageText = $"{missingQuest._id} failMessageText";
|
||||
}
|
||||
|
||||
if (missingQuest.name is null)
|
||||
{
|
||||
missingQuest.name = $"{missingQuest._id} name";
|
||||
}
|
||||
|
||||
if (missingQuest.note is null)
|
||||
{
|
||||
missingQuest.note = $"{missingQuest._id} note";
|
||||
}
|
||||
|
||||
|
||||
if (missingQuest.startedMessageText is null)
|
||||
{
|
||||
missingQuest.startedMessageText = $"{missingQuest._id} startedMessageText";
|
||||
}
|
||||
|
||||
if (missingQuest.successMessageText is null)
|
||||
{
|
||||
missingQuest.successMessageText = $"{missingQuest._id} successMessageText";
|
||||
}
|
||||
|
||||
if (missingQuest.templateId is null)
|
||||
{
|
||||
missingQuest.templateId = $"{missingQuest._id} successMessageText";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check original quest for start conditions and if missing from new quest, add them
|
||||
/// </summary>
|
||||
/// <param name="originalQuest"></param>
|
||||
/// <param name="questToUpdate">quest to add to output json</param>
|
||||
private static void AddMissingAvailableForStartConditions(Quest originalQuest, KeyValuePair<string, Quest> questToUpdate)
|
||||
{
|
||||
// Iterate over quest requirements in existing quest file
|
||||
|
Loading…
x
Reference in New Issue
Block a user