Save new planeID on EnterMaze

And matsuko...
This commit is contained in:
memetrollsXD 2022-08-02 23:32:59 +02:00
parent 64219d5895
commit 639ae9b186
No known key found for this signature in database
GPG Key ID: 105C2F3417AC32CD
3 changed files with 15 additions and 3 deletions

View File

@ -78,6 +78,7 @@ export default class Player {
let slot = 0;
avatars.forEach(avatar => {
// Fallback lineup
if (!avatar) return; // Matsuko.
if (!avatar.lineup) avatar.lineup = {
avatarType: AvatarType.AVATAR_FORMAL_TYPE,
hp: 10000,

View File

@ -6,16 +6,23 @@ import Session from "../kcp/Session";
export default async function handle(session: Session, packet: Packet) {
const body = packet.body as EnterMazeCsReq;
const mazeEntry = MazePlaneExcel.fromEntryId(body.entryId);
const mazeEntry = MazePlaneExcel.getEntry(body.entryId);
let curLineup = await session.player.getLineup();
curLineup.planeId = mazeEntry.PlaneID;
session.player.setLineup(curLineup);
session.player.db.posData.floorID = mazeEntry.FloorID;
session.player.db.posData.planeID = mazeEntry.PlaneID;
session.player.save();
session.send("EnterMazeScRsp", {
retcode: 0,
maze: {
floor: {
floorId: mazeEntry.StartFloorID,
floorId: mazeEntry.FloorID,
scene: {
planeId: mazeEntry.PlaneID,
floorId: mazeEntry.StartFloorID,
floorId: mazeEntry.FloorID,
gameModeType: 1,
}
},

View File

@ -55,4 +55,8 @@ export default class MazePlaneExcel {
public static fromPlaneId(planeId: number): MazePlaneExcelTableEntry {
return MazePlaneExcelTable[planeId.toString()];
}
public static getEntry(entryId: number): MapEntryExcelTableEntry {
return MapEntryExcelTable[entryId.toString()];
}
}