Basic challenge info

This commit is contained in:
memetrollsXD 2022-08-02 18:22:34 +02:00
parent 8c1194eee4
commit 0b77031417
No known key found for this signature in database
GPG Key ID: 105C2F3417AC32CD
4 changed files with 102 additions and 4 deletions

View File

@ -1,10 +1,23 @@
import { GetChallengeScRsp } from "../../data/proto/StarRail";
import ChallengeActivityRaidConfigExcel from "../../util/excel/ChallengeActivityRaidConfigExcel";
import Packet from "../kcp/Packet";
import Session from "../kcp/Session";
export default async function handle(session: Session, packet: Packet) {
session.send("GetChallengeScRsp", {
const activities = ChallengeActivityRaidConfigExcel.all();
const dataObj: GetChallengeScRsp = {
retcode: 0,
challengeList: []
} as GetChallengeScRsp);
}
activities.forEach(activity => {
dataObj.challengeList.push({
challengeId: activity.ChallengeID,
stars: 0,
takenReward: 0
});
});
session.send("GetChallengeScRsp", dataObj);
}

View File

@ -1,11 +1,23 @@
import { GetChallengeRaidInfoScRsp } from "../../data/proto/StarRail";
import RaidConfigExcel from "../../util/excel/RaidConfigExcel";
import Packet from "../kcp/Packet";
import Session from "../kcp/Session";
export default async function handle(session: Session, packet: Packet) {
session.send("GetChallengeRaidInfoScRsp", {
const activities = RaidConfigExcel.all();
const dataObj: GetChallengeRaidInfoScRsp = {
retcode: 0,
challengeRaidList: [],
takenRewardIdList: []
} as GetChallengeRaidInfoScRsp);
}
activities.forEach(activity => {
dataObj.challengeRaidList.push({
maxScore: 0,
raidId: activity.RaidID
});
})
session.send("GetChallengeRaidInfoScRsp", dataObj);
}

View File

@ -0,0 +1,13 @@
import ChallengeActivityRaidConfigExcelTable from "../../data/excel/ChallengeActivityRaidConfigExcelTable.json";
export default class ChallengeActivityRaidConfigExcel {
private constructor() { }
public static fromId(id: number) {
return Object.values(ChallengeActivityRaidConfigExcelTable).find(x => x.ChallengeID === id);
}
public static all() {
return Object.values(ChallengeActivityRaidConfigExcelTable);
}
}

View File

@ -0,0 +1,60 @@
import _RaidConfigExcelTable from "../../data/excel/RaidConfigExcelTable.json";
const RaidConfigExcelTable = _RaidConfigExcelTable as { [key: string]: RaidConfigExcelTableEntry };
interface TextMap {
hash: number;
}
interface Param {
RawValue: number;
}
interface RaidConfigExcelTableEntry {
RaidID: number;
WorldLevel: number;
Type: string;
MappingInfoID: number;
MonsterList: number[];
MonsterHideList: number[];
DisplayEventID: number;
RaidName: TextMap;
RaidDesc: TextMap;
MapEntranceID: number;
GroupID: number;
ConfigIDList: number[];
NpcMonsterIDList: number[];
PlaneEventIDList: number[];
BuffDesc: TextMap;
ParamList: Param[];
LimitIDList: number[];
RecoverType: string[];
FinishType: string;
FinishParamList: number[];
FinishAutoQuit: boolean;
DropList: number[];
StaminaCost: number;
FailedType: string;
FailedResult: string;
LogoutType: string;
TeamType: string;
TrialAvatarList: number[];
MainMissionID: number;
IsEntryByProp: boolean;
}
export default class RaidExcelConfig {
private constructor() { }
public static fromId(id: number, wl: number = 0) {
const key = `${id}:${wl}`;
return RaidConfigExcelTable[key];
}
public static all() {
return Object.values(RaidConfigExcelTable);
}
public static find(id: number) {
return Object.values(RaidConfigExcelTable).find(x => x.RaidID === id);
}
}