This commit is contained in:
vvo
2024-09-05 16:56:57 +08:00
parent 825e2621b0
commit 20ba236f5b
9 changed files with 438 additions and 46 deletions
+10
View File
@@ -125,6 +125,16 @@ export const common: EPR = async (info, data, send) => {
limited: K.ITEM('u8', limitedNo),
});
}
// Licensed songs released pre-exceed gear
else if (LICENSED_SONGS6.includes(i.toString())) {
for(let j = 0; j < 5; j++) {
songs.push({
music_id: K.ITEM('s32', i),
music_type: K.ITEM('u8', j),
limited: K.ITEM('u8', limitedNo),
});
}
}
}
}
}
+19
View File
@@ -5,6 +5,7 @@ import { Skill } from '../models/skill';
import { getVersion, IDToCode, GetCounter } from '../utils';
import { Mix } from '../models/mix';
import { Rival } from '../models/rival';
import { Item } from '../models/item';
import { PREGENE, COURSES6} from '../data/exg';
import { textureslist } from '../data/webui'
import * as fs from 'fs';
@@ -810,6 +811,24 @@ export const preGeneRoll = async (data: { set: number, refid: string, items: []
} else console.log('pregeneset none')
}
export const preGeneReward = async (data: { reward: [], refid: string }, send: WebUISend) => {
let reward = Object.values(data.reward)
let rewardItem = await DB.Find<Item>(data.refid, {collection: 'item', type: reward[0], id: reward[1], param: reward[2]})
if(rewardItem.length === 0) {
DB.Upsert(data.refid, { collection: "item", type: reward[0], id: reward[1] }, { $set: { param: reward[2] } })
send.json({
received: true,
reward: reward
})
} else {
send.json({
received: false,
reward: reward
})
}
}
export const manageEvents = async (data: { eventConfig: {} }) => {
IO.WriteFile('webui/asset/config/events.json', JSON.stringify(data.eventConfig, null, 4));
}