feat: mastery rank up inbox message (#1206)
All checks were successful
Build / build (18) (push) Successful in 41s
Build / build (22) (push) Successful in 1m4s
Build / build (20) (push) Successful in 1m4s
Build Docker image / docker (push) Successful in 32s

Closes #1203

Reviewed-on: #1206
Co-authored-by: Sainan <sainan@calamity.inc>
Co-committed-by: Sainan <sainan@calamity.inc>
This commit is contained in:
Sainan 2025-03-17 12:23:17 -07:00 committed by OrdisPrime
parent f2afa6bb55
commit b4da457501
2 changed files with 22 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import { IMongoDate } from "@/src/types/commonTypes";
import { RequestHandler } from "express";
import { unixTimesInMs } from "@/src/constants/timeConstants";
import { IInventoryChanges } from "@/src/types/purchaseTypes";
import { createMessage } from "@/src/services/inboxService";
interface ITrainingResultsRequest {
numLevelsGained: number;
@ -26,6 +27,25 @@ const trainingResultController: RequestHandler = async (req, res): Promise<void>
if (trainingResults.numLevelsGained == 1) {
inventory.TrainingDate = new Date(Date.now() + unixTimesInMs.hour * 23);
inventory.PlayerLevel += 1;
await createMessage(accountId, [
{
sndr: "/Lotus/Language/Menu/Mailbox_WarframeSender",
msg: "/Lotus/Language/Inbox/MasteryRewardMsg",
arg: [
{
Key: "NEW_RANK",
Tag: inventory.PlayerLevel
}
],
att: [
`/Lotus/Types/Items/ShipDecos/MasteryTrophies/Rank${inventory.PlayerLevel.toString().padStart(2, "0")}Trophy`
],
sub: "/Lotus/Language/Inbox/MasteryRewardTitle",
icon: "/Lotus/Interface/Icons/Npcs/Lotus_d.png",
highPriority: true
}
]);
}
const changedinventory = await inventory.save();

View File

@ -40,7 +40,7 @@ export interface IMessage {
export interface Arg {
Key: string;
Tag: string;
Tag: string | number;
}
//types are wrong
@ -99,7 +99,7 @@ const messageSchema = new Schema<IMessageDatabase>(
type: [
{
Key: String,
Tag: String,
Tag: Schema.Types.Mixed,
_id: false
}
],