返回提交历史
Modified
src/controllers/custom/completeAllMissionsController.ts
+67
-2
XFEstudio/XFESpaceNinjaServer
chore: give missing achievements when unlocking all missions via cheat (#3658)
Gives all Saviour Of [Planet] incl. Eris challenge (name is exclusive to older versions besides that one junction challenge requirement in older versions contains killing Phorid). Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3658 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: Animan8000 <187183497+Veniman8000@users.noreply.github.com> Co-committed-by: Animan8000 <187183497+Veniman8000@users.noreply.github.com>
aa0e35a8
代码差异
1 个文件
+67
-2
@@ -1,6 +1,6 @@
1
1
import { addString } from "../../helpers/stringHelpers.ts";
2
import { getInventory } from "../../services/inventoryService.ts";
3
import { getAccountIdForRequest } from "../../services/loginService.ts";
2
import { addChallenges, getInventory } from "../../services/inventoryService.ts";
3
import { getAccountForRequest, getAccountIdForRequest } from "../../services/loginService.ts";
4
4
import { addFixedLevelRewards } from "../../services/missionInventoryUpdateService.ts";
5
5
import { handleStoreItemAcquisition } from "../../services/purchaseService.ts";
6
6
import type { IMissionReward } from "../../types/missionTypes.ts";
@@ -8,6 +8,7 @@ import type { RequestHandler } from "express";
8
8
import { ExportRegions } from "warframe-public-export-plus";
9
9
10
10
export const completeAllMissionsController: RequestHandler = async (req, res) => {
11
const account = await getAccountForRequest(req);
11
12
const accountId = await getAccountIdForRequest(req);
12
13
const inventory = await getInventory(accountId);
13
14
const MissionRewards: IMissionReward[] = [];
@@ -34,6 +35,70 @@ export const completeAllMissionsController: RequestHandler = async (req, res) =>
34
35
for (const reward of MissionRewards) {
35
36
await handleStoreItemAcquisition(reward.StoreItem, inventory, reward.ItemCount, undefined, true);
36
37
}
38
await addChallenges(
39
account,
40
inventory,
41
[
42
{
43
Progress: 1,
44
Name: `KillPhorid`
45
},
46
{
47
Progress: 1,
48
Name: `SaviourOfCeres`
49
},
50
{
51
Progress: 1,
52
Name: `SaviourOfEarth`
53
},
54
{
55
Progress: 1,
56
Name: `SaviourOfEuropa`
57
},
58
{
59
Progress: 1,
60
Name: `SaviourOfJupiter`
61
},
62
{
63
Progress: 1,
64
Name: `SaviourOfMars`
65
},
66
{
67
Progress: 1,
68
Name: `SaviourOfMercury`
69
},
70
{
71
Progress: 1,
72
Name: `SaviourOfNeptune`
73
},
74
{
75
Progress: 1,
76
Name: `SaviourOfPhobos`
77
},
78
{
79
Progress: 1,
80
Name: `SaviourOfPluto`
81
},
82
{
83
Progress: 1,
84
Name: `SaviourOfSaturn`
85
},
86
{
87
Progress: 1,
88
Name: `SaviourOfSedna`
89
},
90
{
91
Progress: 1,
92
Name: `SaviourOfUranus`
93
},
94
{
95
Progress: 1,
96
Name: `SaviourOfVenus`
97
}
98
],
99
[],
100
{}
101
);
37
102
addString(inventory.NodeIntrosCompleted, "TeshinHardModeUnlocked");
38
103
addString(inventory.NodeIntrosCompleted, "CetusInvasionNodeIntro");
39
104
addString(inventory.NodeIntrosCompleted, "CetusSyndicate_IntroJob");