This commit is contained in:
parent
aaa985e1ae
commit
568b2913ba
@ -75,12 +75,10 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
|
|||||||
const { MissionRewards, inventoryChanges, credits, AffiliationMods, SyndicateXPItemReward } =
|
const { MissionRewards, inventoryChanges, credits, AffiliationMods, SyndicateXPItemReward } =
|
||||||
await addMissionRewards(inventory, missionReport, firstCompletion);
|
await addMissionRewards(inventory, missionReport, firstCompletion);
|
||||||
|
|
||||||
await inventory.save();
|
|
||||||
const inventoryResponse = await getInventoryResponse(inventory, true);
|
|
||||||
|
|
||||||
//TODO: figure out when to send inventory. it is needed for many cases.
|
//TODO: figure out when to send inventory. it is needed for many cases.
|
||||||
const response: IMissionInventoryUpdateResponse = {
|
const response: IMissionInventoryUpdateResponse = {
|
||||||
InventoryJson: JSON.stringify(inventoryResponse),
|
|
||||||
InventoryChanges: inventoryChanges,
|
InventoryChanges: inventoryChanges,
|
||||||
MissionRewards,
|
MissionRewards,
|
||||||
...credits,
|
...credits,
|
||||||
@ -89,10 +87,50 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
|
|||||||
SyndicateXPItemReward,
|
SyndicateXPItemReward,
|
||||||
AffiliationMods
|
AffiliationMods
|
||||||
};
|
};
|
||||||
|
|
||||||
if (missionReport.ConquestMissionsCompleted !== undefined) {
|
if (missionReport.ConquestMissionsCompleted !== undefined) {
|
||||||
response.ConquestCompletedMissionsCount =
|
response.ConquestCompletedMissionsCount =
|
||||||
missionReport.ConquestMissionsCompleted == 2 ? 0 : missionReport.ConquestMissionsCompleted + 1;
|
missionReport.ConquestMissionsCompleted == 2 ? 0 : missionReport.ConquestMissionsCompleted + 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let score = 1;
|
||||||
|
if(missionReport.RewardInfo?.ConquestHardModeActive === 1)
|
||||||
|
score += 3
|
||||||
|
|
||||||
|
if (missionReport.RewardInfo?.ConquestPersonalModifiersActive !== undefined)
|
||||||
|
score += missionReport.RewardInfo?.ConquestPersonalModifiersActive;
|
||||||
|
if (missionReport.RewardInfo?.ConquestEquipmentSuggestionsFulfilled !== undefined)
|
||||||
|
score += missionReport.RewardInfo?.ConquestEquipmentSuggestionsFulfilled;
|
||||||
|
|
||||||
|
score *= missionReport.ConquestMissionsCompleted + 1
|
||||||
|
|
||||||
|
if(missionReport.ConquestMissionsCompleted == 2 && missionReport.RewardInfo?.ConquestHardModeActive === 1)
|
||||||
|
score += 1;
|
||||||
|
|
||||||
|
const conquestType = missionReport.RewardInfo?.ConquestType;
|
||||||
|
const conquestNode = conquestType == "HexConquest" ? "EchoesHexConquestHardModeUnlocked" : "EntratiLabConquestHardModeUnlocked";
|
||||||
|
if(score >= 25 && inventory.NodeIntrosCompleted.find(x => x == conquestNode) === undefined)
|
||||||
|
inventory.NodeIntrosCompleted.push(conquestNode);
|
||||||
|
|
||||||
|
if(conquestType == "HexConquest")
|
||||||
|
{
|
||||||
|
inventory.EchoesHexConquestCacheScoreMission ??= 0;
|
||||||
|
|
||||||
|
if(score > inventory.EchoesHexConquestCacheScoreMission )
|
||||||
|
inventory.EchoesHexConquestCacheScoreMission = score;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
inventory.EntratiLabConquestCacheScoreMission ??= 0;
|
||||||
|
|
||||||
|
if(score > inventory.EntratiLabConquestCacheScoreMission )
|
||||||
|
inventory.EntratiLabConquestCacheScoreMission = score;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await inventory.save();
|
||||||
|
const inventoryResponse = await getInventoryResponse(inventory, true);
|
||||||
|
response.InventoryJson = JSON.stringify(inventoryResponse);
|
||||||
res.json(response);
|
res.json(response);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -151,7 +151,12 @@ export interface IRewardInfo {
|
|||||||
PurgatoryRewardQualifications?: string;
|
PurgatoryRewardQualifications?: string;
|
||||||
rewardSeed?: number | bigint;
|
rewardSeed?: number | bigint;
|
||||||
periodicMissionTag?: string;
|
periodicMissionTag?: string;
|
||||||
|
ConquestType?: string;
|
||||||
|
ConquestCompleted?: number;
|
||||||
|
ConquestEquipmentSuggestionsFulfilled?: number;
|
||||||
|
ConquestPersonalModifiersActive?: number;
|
||||||
|
ConquestStickersActive?: number;
|
||||||
|
ConquestHardModeActive?: number;
|
||||||
// for bounties, only EOM_AFK and node are given from above, plus:
|
// for bounties, only EOM_AFK and node are given from above, plus:
|
||||||
JobTier?: number;
|
JobTier?: number;
|
||||||
jobId?: string;
|
jobId?: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user