Save new planeID on EnterMaze
And matsuko...
This commit is contained in:
parent
64219d5895
commit
639ae9b186
@ -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,
|
||||
|
@ -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,
|
||||
}
|
||||
},
|
||||
|
@ -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()];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user