[Spells] Support for 'HateAdded' spell field to apply negative values to reduce hate. (#1953)

* HateAdded field can be negative

* [Spells] Support for 'HateAdded' spell field to apply negative values to reduce hate.
This commit is contained in:
KayenEQ 2022-02-02 21:43:17 -05:00 committed by GitHub
parent 7b235a6ede
commit 00c41dda8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1319,10 +1319,10 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
if (dispel && target && target->GetHateAmount(this) < 100) if (dispel && target && target->GetHateAmount(this) < 100)
AggroAmount += 50; AggroAmount += 50;
if (spells[spell_id].hate_added > 0) // overrides the hate (ex. tash) if (spells[spell_id].hate_added != 0) // overrides the hate (ex. tash), can be negative.
AggroAmount = spells[spell_id].hate_added; AggroAmount = spells[spell_id].hate_added;
if (GetOwner() && IsPet()) if (GetOwner() && IsPet() && AggroAmount > 0)
AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100; AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100;
// hate focus ignored on first action for some reason // hate focus ignored on first action for some reason