Respawn players at half health

Cleaned up the adjacent code slightly; might clean it up further later.
This commit is contained in:
dongresource 2021-10-19 16:42:54 +02:00
parent ed285e5d24
commit e2c85aa03f

View File

@ -385,14 +385,18 @@ static void revivePlayer(CNSocket* sock, CNPacketData* data) {
if (reviveData->iRegenType == 3 && plr->iConditionBitFlag & CSB_BIT_PHOENIX) { if (reviveData->iRegenType == 3 && plr->iConditionBitFlag & CSB_BIT_PHOENIX) {
// nano revive // nano revive
plr->Nanos[plr->activeNano].iStamina = 0; plr->Nanos[plr->activeNano].iStamina = 0;
plr->HP = PC_MAXHEALTH(plr->level); plr->HP = PC_MAXHEALTH(plr->level) / 2;
Nanos::applyBuff(sock, plr->Nanos[plr->activeNano].iSkillID, 2, 1, 0); Nanos::applyBuff(sock, plr->Nanos[plr->activeNano].iSkillID, 2, 1, 0);
} else if (reviveData->iRegenType == 4) { } else if (reviveData->iRegenType == 4) {
plr->HP = PC_MAXHEALTH(plr->level); // revived by group member's nano
} else { plr->HP = PC_MAXHEALTH(plr->level) / 2;
} else if (reviveData->iRegenType == 5) {
// warp away
move = true; move = true;
if (reviveData->iRegenType != 5) } else {
plr->HP = PC_MAXHEALTH(plr->level); // plain respawn
move = true;
plr->HP = PC_MAXHEALTH(plr->level) / 2;
} }
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {