From 1e5abc456b5c35d961cb40f72650fe83040d687b Mon Sep 17 00:00:00 2001 From: Fryguy Date: Mon, 22 Jul 2024 07:01:12 -0400 Subject: [PATCH] [Bug Fix] Proximity Aggro for Frustrated and Undead (#4411) * [Bug Fix] Prox aggro for frustrated and undead. If mob is frustrated (Rooted and has no one to kill or is undead will add prox aggro to hate list. * Update aggro.cpp --------- Co-authored-by: Kinglykrab --- zone/aggro.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index a8b23037e..4ddfb759a 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -452,8 +452,26 @@ bool Mob::CheckWillAggro(Mob *mob) { return false; } - // Don't aggro new clients if we are already engaged unless SpecialAbility::ProximityAggro is set - if (IsEngaged() && (!GetSpecialAbility(SpecialAbility::ProximityAggro) || (GetSpecialAbility(SpecialAbility::ProximityAggro) && !CombatRange(mob)))) { + // Don't aggro new clients if we are already engaged unless PROX_AGGRO is set + // Frustrated mobs (all rooted up with no one to kill) + // will engage without PROX_AGGRO ability if someone new is close now. + + const bool is_frustrated = IsRooted() && !CombatRange(target); + + if ( + !is_frustrated && + IsEngaged() && + ( + ( + !GetSpecialAbility(SpecialAbility::ProximityAggro) && + GetBodyType() != BodyType::Undead + ) || + ( + GetSpecialAbility(SpecialAbility::ProximityAggro) && + !CombatRange(mob) + ) + ) + ) { LogAggro( "[{}] is in combat, and does not have prox_aggro, or does and is out of combat range with [{}]", GetName(),