From 5bdb09c7543480f59a5b1575b1ba084025515048 Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 8 Sep 2021 20:14:39 +0100 Subject: [PATCH] Check item success rewards sub-items match --- QuestValidator/Program.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/QuestValidator/Program.cs b/QuestValidator/Program.cs index 498cb29..395a3da 100644 --- a/QuestValidator/Program.cs +++ b/QuestValidator/Program.cs @@ -122,6 +122,22 @@ namespace QuestValidator { CheckValuesMatch(questSuccessRewardItem.items[0].upd.StackObjectsCount, questSuccessRewardItem.items[0].upd.StackObjectsCount, "mismatch for success item StackObjectsCount", questSuccessRewardItem.items[0]._id); } + + // check sub items match + foreach (var subItem in questSuccessRewardItem.items.Where(x=> !string.IsNullOrEmpty(x.slotId))) + { + // find matching live counterpart + var liveCounterpart = relatedLiveRewardItem.items.FirstOrDefault(x=> x.slotId == subItem.slotId); + + if (liveCounterpart == null) + { + LoggingHelpers.LogWarning($"a live counterpart for the subItem {subItem.slotId} could not be found, skipping subItem check"); + continue; + } + + CheckValuesMatch(subItem._tpl, liveCounterpart._tpl, $"mismatch for success subItem({subItem.slotId}) reward templateId", subItem._id); + + } } foreach (var questSuccessRewardItem in quest.rewards.Success.Where(x => x.type == "Experience")) @@ -266,6 +282,9 @@ namespace QuestValidator // check AvailableForFinish target CheckValuesMatch(Convert.ToString(availableForFinishItem._props.target), Convert.ToString(liveFinishItem._props.target), "AvailableForFinish target value mismatch", availableForFinishItem._props.id); + // check weapons allowed match + //CheckValuesMatch(availableForFinishItem._props.weapon.Count, liveFinishItem._props.counter.conditions), "AvailableForFinish target value mismatch", availableForFinishItem._props.id); + } }