From ace81215a1964f9fe7e89abf9e24b6bb0a345f84 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 16 Aug 2018 17:13:34 -0400 Subject: [PATCH] Correct when tanks can be hit by AE Rampage Tanks will only be hit by AE Rampage if they're the only one on the NPC's hate list. Others on hate list out ranging AE Rampage will also prevent the tank from being hit by AE Rampage. --- zone/hate_list.cpp | 9 ++++++++- zone/mob_ai.cpp | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zone/hate_list.cpp b/zone/hate_list.cpp index f02cbe6b6..5649c0da4 100644 --- a/zone/hate_list.cpp +++ b/zone/hate_list.cpp @@ -575,12 +575,19 @@ int HateList::AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOption if (!target || !caster) return 0; + // tank will be hit ONLY if they are the only target on the hate list + // if there is anyone else on the hate list, the tank will not be hit, even if those others aren't hit either + if (list.size() == 1) { + caster->ProcessAttackRounds(target, opts); + return 1; + } + int hit_count = 0; // This should prevent crashes if something dies (or mainly more than 1 thing goes away) // This is a temp solution until the hate lists can be rewritten to not have that issue std::vector id_list; for (auto &h : list) { - if (h->entity_on_hatelist && h->entity_on_hatelist != caster && + if (h->entity_on_hatelist && h->entity_on_hatelist != caster && h->entity_on_hatelist != target && caster->CombatRange(h->entity_on_hatelist)) id_list.push_back(h->entity_on_hatelist->GetID()); if (count != -1 && id_list.size() > count) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 154575c40..e769bda95 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2255,8 +2255,6 @@ void Mob::AreaRampage(ExtraAttackOptions *opts) m_specialattacks = eSpecialAttacks::AERampage; index_hit = hate_list.AreaRampage(this, GetTarget(), rampage_targets, opts); - if(index_hit == 0) - ProcessAttackRounds(GetTarget(), opts); m_specialattacks = eSpecialAttacks::None; }