[Feature] Add Hate Override for Heals (#2485)

* [Feature] Add Hate Override for Heals

* Formatting

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Aeadoin 2022-10-13 22:02:59 -04:00 committed by GitHub
parent 0240a9cc76
commit 1b82e6b283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {