From e2c85aa03f9e1f2582d77a8a63004f7a98cf27b9 Mon Sep 17 00:00:00 2001 From: dongresource Date: Tue, 19 Oct 2021 16:42:54 +0200 Subject: [PATCH] Respawn players at half health Cleaned up the adjacent code slightly; might clean it up further later. --- src/PlayerManager.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/PlayerManager.cpp b/src/PlayerManager.cpp index c817f7e..29c5ec4 100644 --- a/src/PlayerManager.cpp +++ b/src/PlayerManager.cpp @@ -385,14 +385,18 @@ static void revivePlayer(CNSocket* sock, CNPacketData* data) { if (reviveData->iRegenType == 3 && plr->iConditionBitFlag & CSB_BIT_PHOENIX) { // nano revive 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); } else if (reviveData->iRegenType == 4) { - plr->HP = PC_MAXHEALTH(plr->level); - } else { + // revived by group member's nano + plr->HP = PC_MAXHEALTH(plr->level) / 2; + } else if (reviveData->iRegenType == 5) { + // warp away move = true; - if (reviveData->iRegenType != 5) - plr->HP = PC_MAXHEALTH(plr->level); + } else { + // plain respawn + move = true; + plr->HP = PC_MAXHEALTH(plr->level) / 2; } for (int i = 0; i < 3; i++) {