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;
|
let slot = 0;
|
||||||
avatars.forEach(avatar => {
|
avatars.forEach(avatar => {
|
||||||
// Fallback lineup
|
// Fallback lineup
|
||||||
|
if (!avatar) return; // Matsuko.
|
||||||
if (!avatar.lineup) avatar.lineup = {
|
if (!avatar.lineup) avatar.lineup = {
|
||||||
avatarType: AvatarType.AVATAR_FORMAL_TYPE,
|
avatarType: AvatarType.AVATAR_FORMAL_TYPE,
|
||||||
hp: 10000,
|
hp: 10000,
|
||||||
|
@ -6,16 +6,23 @@ import Session from "../kcp/Session";
|
|||||||
export default async function handle(session: Session, packet: Packet) {
|
export default async function handle(session: Session, packet: Packet) {
|
||||||
const body = packet.body as EnterMazeCsReq;
|
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", {
|
session.send("EnterMazeScRsp", {
|
||||||
retcode: 0,
|
retcode: 0,
|
||||||
maze: {
|
maze: {
|
||||||
floor: {
|
floor: {
|
||||||
floorId: mazeEntry.StartFloorID,
|
floorId: mazeEntry.FloorID,
|
||||||
scene: {
|
scene: {
|
||||||
planeId: mazeEntry.PlaneID,
|
planeId: mazeEntry.PlaneID,
|
||||||
floorId: mazeEntry.StartFloorID,
|
floorId: mazeEntry.FloorID,
|
||||||
gameModeType: 1,
|
gameModeType: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -55,4 +55,8 @@ export default class MazePlaneExcel {
|
|||||||
public static fromPlaneId(planeId: number): MazePlaneExcelTableEntry {
|
public static fromPlaneId(planeId: number): MazePlaneExcelTableEntry {
|
||||||
return MazePlaneExcelTable[planeId.toString()];
|
return MazePlaneExcelTable[planeId.toString()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static getEntry(entryId: number): MapEntryExcelTableEntry {
|
||||||
|
return MapEntryExcelTable[entryId.toString()];
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user