From 35e938b8c6023df06f290ca37f0dcbd0f5951de9 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Wed, 13 Apr 2022 08:51:50 -0400 Subject: [PATCH] ope --- src/Abilities.cpp | 9 ++++++--- src/Combat.cpp | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Abilities.cpp b/src/Abilities.cpp index f7730e3..d0c2a44 100644 --- a/src/Abilities.cpp +++ b/src/Abilities.cpp @@ -449,7 +449,8 @@ bool doDamageNDebuff(Mob* mob, sSkillResult_Damage_N_Debuff* respdata, int i, in respdata[i].iConditionBitFlag = plr->iConditionBitFlag; if (plr->HP <= 0) { - mob->transition(AIState::RETREAT, mob->target); + if (!MobAI::aggroCheck(mob, getTime())) + mob->transition(AIState::RETREAT, mob->target); } return true; @@ -523,7 +524,8 @@ bool doDamage(Mob* mob, sSkillResult_Damage* respdata, int i, int32_t targetID, respdata[i].iHP = plr->HP -= damage; if (plr->HP <= 0) { - mob->transition(AIState::RETREAT, mob->target); + if (!MobAI::aggroCheck(mob, getTime())) + mob->transition(AIState::RETREAT, mob->target); } return true; @@ -575,7 +577,8 @@ bool doLeech(Mob* mob, sSkillResult_Heal_HP* healdata, int i, int32_t targetID, damagedata->iHP = plr->HP -= damage; if (plr->HP <= 0) { - mob->transition(AIState::RETREAT, mob->target); + if (!MobAI::aggroCheck(mob, getTime())) + mob->transition(AIState::RETREAT, mob->target); } return true; diff --git a/src/Combat.cpp b/src/Combat.cpp index 2b9a251..1b83cdf 100644 --- a/src/Combat.cpp +++ b/src/Combat.cpp @@ -322,7 +322,8 @@ void Combat::npcAttackPc(Mob *mob, time_t currTime) { PlayerManager::sendToViewable(mob->target, respbuf, P_FE2CL_NPC_ATTACK_PCs); if (plr->HP <= 0) { - mob->transition(AIState::RETREAT, mob->target); + if (!MobAI::aggroCheck(mob, getTime())) + mob->transition(AIState::RETREAT, mob->target); } }