mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Implement Academy level-up
This commit is contained in:
parent
0a9f637123
commit
9057f31bff
@ -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
|
||||||
@ -541,7 +554,7 @@ void MissionManager::mobKilled(CNSocket *sock, int mobid) {
|
|||||||
|
|
||||||
void MissionManager::saveMission(Player* player, int missionId) {
|
void MissionManager::saveMission(Player* player, int missionId) {
|
||||||
// sanity check missionID so we don't get exceptions
|
// sanity check missionID so we don't get exceptions
|
||||||
if (missionId < 0 || missionId>1023) {
|
if (missionId < 0 || missionId > 1023) {
|
||||||
std::cout << "[WARN] Client submitted invalid missionId: " <<missionId<< std::endl;
|
std::cout << "[WARN] Client submitted invalid missionId: " <<missionId<< std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user