give the blueprint when creating a guild

This commit is contained in:
Sainan 2025-03-10 17:58:53 +01:00
parent d468078b2e
commit fd329f78f1

View File

@ -3,6 +3,7 @@ import { getAccountIdForRequest } from "@/src/services/loginService";
import { getJSONfromString } from "@/src/helpers/stringHelpers";
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
import { Guild, GuildMember } from "@/src/models/guildModel";
import { addRecipes } from "@/src/services/inventoryService";
export const createGuildController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
@ -28,11 +29,13 @@ export const createGuildController: RequestHandler = async (req, res) => {
// Set GuildId
inventory.GuildId = guild._id;
// Give clan key (TODO: This should only be a blueprint)
inventory.LevelKeys.push({
ItemType: "/Lotus/Types/Keys/DojoKey",
ItemCount: 1
});
// Give clan key blueprint
addRecipes(inventory, [
{
ItemType: "/Lotus/Types/Keys/DojoKeyBlueprint",
ItemCount: 1
}
]);
await inventory.save();
}