mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-12-23 03:40:05 +00:00
updateFusionMatter now sets fusion matter
This commit is contained in:
parent
4caca07856
commit
c33f218e56
@ -302,7 +302,7 @@ int MissionManager::giveMissionReward(CNSocket *sock, int task) {
|
||||
|
||||
// update player
|
||||
plr->money += reward->money;
|
||||
plr->fusionmatter += reward->fusionmatter;
|
||||
MissionManager::updateFusionMatter(sock, reward->fusionmatter);
|
||||
|
||||
// simple rewards
|
||||
resp->m_iCandy = plr->money;
|
||||
@ -323,15 +323,15 @@ int MissionManager::giveMissionReward(CNSocket *sock, int task) {
|
||||
|
||||
sock->sendPacket((void*)respbuf, P_FE2CL_REP_REWARD_ITEM, resplen);
|
||||
|
||||
MissionManager::updateFusionMatter(sock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MissionManager::updateFusionMatter(CNSocket* sock) {
|
||||
void MissionManager::updateFusionMatter(CNSocket* sock, int fusion) {
|
||||
Player *plr = PlayerManager::getPlayer(sock);
|
||||
|
||||
plr->fusionmatter += fusion;
|
||||
|
||||
// check if it is over the limit
|
||||
std::cout << plr->fusionmatter << " > " << AvatarGrowth[plr->level]["m_iReqBlob_NanoCreate"] << std::endl;
|
||||
if (plr->fusionmatter > AvatarGrowth[plr->level]["m_iReqBlob_NanoCreate"]) {
|
||||
// check if the nano task is already started
|
||||
|
||||
@ -347,6 +347,7 @@ void MissionManager::updateFusionMatter(CNSocket* sock) {
|
||||
INITSTRUCT(sP_FE2CL_REP_PC_TASK_START_SUCC, response);
|
||||
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));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace MissionManager {
|
||||
//checks if player doesn't have n/n quest items
|
||||
bool isQuestItemFull(CNSocket* sock, int itemId, int itemCount);
|
||||
int giveMissionReward(CNSocket *sock, int task);
|
||||
void updateFusionMatter(CNSocket* sock);
|
||||
void updateFusionMatter(CNSocket* sock, int fusion);
|
||||
|
||||
void mobKilled(CNSocket *sock, int mobid);
|
||||
|
||||
|
@ -105,7 +105,7 @@ void MobManager::giveReward(CNSocket *sock) {
|
||||
|
||||
// update player
|
||||
plr->money += 50;
|
||||
plr->fusionmatter += 70;
|
||||
MissionManager::updateFusionMatter(sock, 70);
|
||||
|
||||
// simple rewards
|
||||
reward->m_iCandy = plr->money;
|
||||
@ -132,7 +132,6 @@ void MobManager::giveReward(CNSocket *sock) {
|
||||
sock->sendPacket((void*)respbuf, P_FE2CL_REP_REWARD_ITEM, resplen);
|
||||
}
|
||||
|
||||
MissionManager::updateFusionMatter(sock);
|
||||
}
|
||||
|
||||
void MobManager::killMob(CNSocket *sock, Mob *mob) {
|
||||
|
Loading…
Reference in New Issue
Block a user