Update questassort code to include assort unlocks by starting a quest
This commit is contained in:
parent
34fe602c9c
commit
89f1b6e998
@ -63,7 +63,7 @@ namespace AssortGenerator.Common.Helpers
|
|||||||
QuestRewardId = reward.id,
|
QuestRewardId = reward.id,
|
||||||
TraderId = reward.traderId,
|
TraderId = reward.traderId,
|
||||||
TraderType = TraderHelper.GetTraderTypeById(reward.traderId),
|
TraderType = TraderHelper.GetTraderTypeById(reward.traderId),
|
||||||
Criteria = "Success"
|
Criteria = "Started"
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -207,10 +207,9 @@ namespace AssortGenerator
|
|||||||
// Find assort unlocks
|
// Find assort unlocks
|
||||||
List<AssortUnlocks> assortUnlocks = QuestHelper.GetAssortUnlocks();
|
List<AssortUnlocks> assortUnlocks = QuestHelper.GetAssortUnlocks();
|
||||||
var assortItemsThatMatchBlackList = new List<string>(); // store items already matched here
|
var assortItemsThatMatchBlackList = new List<string>(); // store items already matched here
|
||||||
// TODO: find out how the fuck the assort unlock is associated to the quest
|
|
||||||
foreach (var assortUnlock in assortUnlocks.Where(x => x.TraderType == trader))
|
foreach (var assortUnlock in assortUnlocks.Where(x => x.TraderType == trader))
|
||||||
{
|
{
|
||||||
if (assortUnlock.AssortUnlockId == "5ac653ed86f77405d4729344")
|
if (assortUnlock.ItemUnlockedTemplateId == "62a0a043cf4a99369e2624a5")
|
||||||
{
|
{
|
||||||
var x = 2;
|
var x = 2;
|
||||||
}
|
}
|
||||||
@ -223,8 +222,8 @@ namespace AssortGenerator
|
|||||||
// TODO: handle fail
|
// TODO: handle fail
|
||||||
|
|
||||||
// Handle quest success for now
|
// Handle quest success for now
|
||||||
if (assortUnlock.Criteria.ToLower() == "success")
|
//if (assortUnlock.Criteria.ToLower() == "success")
|
||||||
{
|
//{
|
||||||
//Find assorts that match the quest unlocks item template
|
//Find assorts that match the quest unlocks item template
|
||||||
List<Item> assortItemsThatMatch = assortRoot.items
|
List<Item> assortItemsThatMatch = assortRoot.items
|
||||||
.Where(x => x._tpl == assortUnlock.ItemUnlockedTemplateId && x.slotId == "hideout")
|
.Where(x => x._tpl == assortUnlock.ItemUnlockedTemplateId && x.slotId == "hideout")
|
||||||
@ -288,18 +287,32 @@ namespace AssortGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
LoggingHelpers.LogSuccess($"{trader} item templateId: {assortUnlock.ItemUnlockedTemplateId} ({assortItemName}). questId: {assortUnlock.QuestId}. ADDING TO QUEST-ASSORT");
|
LoggingHelpers.LogSuccess($"{trader} item templateId: {assortUnlock.ItemUnlockedTemplateId} ({assortItemName}). questId: {assortUnlock.QuestId}. ADDING TO QUEST-ASSORT");
|
||||||
|
|
||||||
|
if (assortUnlock.Criteria == "Success")
|
||||||
|
{
|
||||||
result.success.Add(assortIdUnlockedByQuest, assortUnlock.QuestId);
|
result.success.Add(assortIdUnlockedByQuest, assortUnlock.QuestId);
|
||||||
}
|
}
|
||||||
|
else if (assortUnlock.Criteria == "Started")
|
||||||
if (assortUnlock.Criteria.ToLower() == "fail")
|
|
||||||
{
|
{
|
||||||
LoggingHelpers.LogError("Fail quest criteria not handled");
|
result.started.Add(assortIdUnlockedByQuest, assortUnlock.QuestId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LoggingHelpers.LogError($"{assortUnlock.Criteria} quest criteria not handled");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assortUnlock.Criteria.ToLower() == "started")
|
|
||||||
{
|
//}
|
||||||
LoggingHelpers.LogError("started quest criteria not handled");
|
|
||||||
}
|
//if (assortUnlock.Criteria.ToLower() == "fail")
|
||||||
|
//{
|
||||||
|
// LoggingHelpers.LogError("Fail quest criteria not handled");
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (assortUnlock.Criteria.ToLower() == "started")
|
||||||
|
//{
|
||||||
|
// LoggingHelpers.LogError("started quest criteria not handled");
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user