[Spells] Bug fix for AOE Harmony/Lull (#1472)

* Bug fix for AOE Harmony/Lull type spells.

Fixed bug with SPA 30 SE_SE_ChangeFrenzyRad and SPA 86 SE_Harmony allowing those spells to affect NPC's above their level restrictions when cast as a 'Targeted AE' spell (ie. Harmony, Wake of Tranquility) when the targeted NPC was bellow level restricted range, but the NPC's next to them were above it.

As coded now, the adjacent NPC's if over level limit will still get the buff applied to them BUT will not get any benefits from the buff.

This bug was originally reported by: Isaaru

* Live like behavior

Implemented the live like behavior, if this case occurs on live, the buff is not applied to the targets over the level limit and "Your target looks unaffected" message is given.

* code optimization

code optimization
This commit is contained in:
KayenEQ
2021-07-29 19:20:21 -04:00
committed by GitHub
parent 78b15a0214
commit 187d6e9dc4
4 changed files with 33 additions and 12 deletions
+5 -1
View File
@@ -1750,7 +1750,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_ChangeFrenzyRad:
{
// redundant to have level check here
if (max != 0 && GetLevel() > max)
break;
if(new_bonus->AggroRange == -1 || effect_value < new_bonus->AggroRange)
{
new_bonus->AggroRange = static_cast<float>(effect_value);
@@ -1760,6 +1762,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_Harmony:
{
if (max != 0 && GetLevel() > max)
break;
// Harmony effect as buff - kinda tricky
// harmony could stack with a lull spell, which has better aggro range
// take the one with less range in any case