Add battery caps for combat rewards & commands

This commit is contained in:
Gent 2020-11-07 21:51:16 -05:00
parent 83c378c9c2
commit 26460c0167
2 changed files with 12 additions and 1 deletions

View File

@ -191,6 +191,11 @@ void MobManager::giveReward(CNSocket *sock, Mob* mob) {
if (rand() % 3 == 0)
plr->batteryW += drop.boosts;
}
// caps
if (plr->batteryW > 9999)
plr->batteryW = 9999;
if (plr->batteryN > 9999)
plr->batteryN = 9999;
// simple rewards
reward->m_iCandy = plr->money;
@ -1154,4 +1159,4 @@ void MobManager::clearDebuff(Mob *mob) {
pkt1.iID = mob->appearanceData.iNPC_ID;
pkt1.iConditionBitFlag = mob->appearanceData.iConditionBitFlag;
NPCManager::sendToViewable(mob, &pkt1, P_FE2CL_CHAR_TIME_BUFF_TIME_OUT, sizeof(sP_FE2CL_CHAR_TIME_BUFF_TIME_OUT));
}
}

View File

@ -746,9 +746,15 @@ void PlayerManager::setSpecialPlayer(CNSocket* sock, CNPacketData* data) {
break;
case 2:
plr->batteryW = setData->iSetValue;
// caps
if (plr->batteryW > 9999)
plr->batteryW = 9999;
break;
case 3:
plr->batteryN = setData->iSetValue;
// caps
if (plr->batteryN > 9999)
plr->batteryN = 9999;
break;
case 4:
plr->fusionmatter = setData->iSetValue;