Compare commits

...

2 Commits

Author SHA1 Message Date
c35b764f4f Merge branch 'unlock-all-quests' of http://209.141.38.3/OpenWF/SpaceNinjaServer into unlock-all-quests
Some checks failed
Build / build (22) (push) Failing after 34s
Build / build (20) (push) Failing after 56s
Build / build (18) (push) Failing after 1m9s
Build / build (18) (pull_request) Failing after 36s
Build / build (20) (pull_request) Failing after 56s
Build / build (22) (pull_request) Failing after 58s
2025-02-19 01:26:19 +01:00
256a1ce3e7 add Progress 2025-02-19 01:26:05 +01:00

View File

@ -2,6 +2,7 @@ import { addString } from "@/src/controllers/api/inventoryController";
import { getInventory } from "@/src/services/inventoryService";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { addQuestKey, IUpdateQuestRequest, updateQuestKey } from "@/src/services/questService";
import { IQuestKeyDatabase, IQuestStage } from "@/src/types/inventoryTypes/inventoryTypes";
import { logger } from "@/src/utils/logger";
import { RequestHandler } from "express";
import { ExportKeys } from "warframe-public-export-plus";
@ -39,12 +40,15 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
case "completeAll": {
logger.info("completing all quests..");
for (const questKey of allQuestKeys) {
const chainStageTotal = ExportKeys[questKey].chainStages?.length ?? 0;
const Progress = Array(chainStageTotal).fill({ c: 0, i: true, m: true, b: [] } satisfies IQuestStage);
const inventoryQuestKey = inventory.QuestKeys.find(qk => qk.ItemType === questKey);
if (inventoryQuestKey) {
inventoryQuestKey.Completed = true;
inventoryQuestKey.Progress = Progress;
continue;
}
addQuestKey(inventory, { ItemType: questKey, Completed: true, unlock: true, Progress: [] });
addQuestKey(inventory, { ItemType: questKey, Completed: true, unlock: true, Progress: Progress });
}
inventory.ArchwingEnabled = true;
inventory.ActiveQuest = "";