Implement Academy level-up

This commit is contained in:
dongresource 2020-12-21 01:56:31 +01:00 committed by Gent S
parent 0a9f637123
commit 9057f31bff

View File

@ -462,13 +462,12 @@ void MissionManager::updateFusionMatter(CNSocket* sock, int fusion) {
if (plr->level == 4 && plr->PCStyle2.iPayzoneFlag == 0) if (plr->level == 4 && plr->PCStyle2.iPayzoneFlag == 0)
return; return;
// TODO: lower the player's FM immediately on level up in the Academy
#ifndef ACADEMY
// check if it is enough for the nano mission // check if it is enough for the nano mission
int fmNano = AvatarGrowth[plr->level]["m_iReqBlob_NanoCreate"]; int fmNano = AvatarGrowth[plr->level]["m_iReqBlob_NanoCreate"];
if (plr->fusionmatter < fmNano) if (plr->fusionmatter < fmNano)
return; return;
#ifndef ACADEMY
// check if the nano task is already started // check if the nano task is already started
for (int i = 0; i < ACTIVE_MISSION_COUNT; i++) { for (int i = 0; i < ACTIVE_MISSION_COUNT; i++) {
TaskData& task = *Tasks[plr->tasks[i]]; TaskData& task = *Tasks[plr->tasks[i]];
@ -482,6 +481,20 @@ void MissionManager::updateFusionMatter(CNSocket* sock, int fusion) {
INITSTRUCT(sP_FE2CL_REP_PC_TASK_START_SUCC, response); INITSTRUCT(sP_FE2CL_REP_PC_TASK_START_SUCC, response);
response.iTaskNum = AvatarGrowth[plr->level]["m_iNanoQuestTaskID"]; response.iTaskNum = AvatarGrowth[plr->level]["m_iNanoQuestTaskID"];
sock->sendPacket((void*)&response, P_FE2CL_REP_PC_TASK_START_SUCC, sizeof(sP_FE2CL_REP_PC_TASK_START_SUCC)); sock->sendPacket((void*)&response, P_FE2CL_REP_PC_TASK_START_SUCC, sizeof(sP_FE2CL_REP_PC_TASK_START_SUCC));
#else
if (plr->level >= 36)
return;
plr->fusionmatter -= (int)MissionManager::AvatarGrowth[plr->level]["m_iReqBlob_NanoCreate"];
plr->level++;
INITSTRUCT(sP_FE2CL_REP_PC_CHANGE_LEVEL, response);
response.iPC_ID = plr->iID;
response.iPC_Level = plr->level;
sock->sendPacket((void*)&response, P_FE2CL_REP_PC_CHANGE_LEVEL, sizeof(sP_FE2CL_REP_PC_CHANGE_LEVEL));
PlayerManager::sendToViewable(sock, (void*)&response, P_FE2CL_REP_PC_CHANGE_LEVEL, sizeof(sP_FE2CL_REP_PC_CHANGE_LEVEL));
#endif #endif
// play the beam animation for other players // play the beam animation for other players