From 1b82e6b2839e5347355c2c676a5e24e99937997f Mon Sep 17 00:00:00 2001 From: Aeadoin <109764533+Aeadoin@users.noreply.github.com> Date: Thu, 13 Oct 2022 22:02:59 -0400 Subject: [PATCH] [Feature] Add Hate Override for Heals (#2485) * [Feature] Add Hate Override for Heals * Formatting Co-authored-by: Akkadius --- zone/aggro.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 4d020ce3d..295bedde5 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -1372,11 +1372,19 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possib break; } } - if (GetOwner() && IsPet()) - AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100; - if (!ignore_default_buff && IsBuffSpell(spell_id) && IsBeneficialSpell(spell_id)) + if (GetOwner() && IsPet()) { + AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100; + } + + if (!ignore_default_buff && IsBuffSpell(spell_id) && IsBeneficialSpell(spell_id)) { AggroAmount = IsBardSong(spell_id) ? 2 : 9; + } + + // overrides the hate (ex. Healing Splash), can be negative (but function will return 0). + if (spells[spell_id].hate_added != 0) { + AggroAmount = spells[spell_id].hate_added; + } if (AggroAmount > 0) { int HateMod = RuleI(Aggro, SpellAggroMod); @@ -1385,7 +1393,7 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possib AggroAmount = (AggroAmount * HateMod) / 100; } - return std::max(0, AggroAmount); + return std::max(0, AggroAmount + spells[spell_id].bonus_hate); //Bonus Hate from spells like Aurora of Morrow } void Mob::AddFeignMemory(Mob* attacker) {