Skip to content

Commit

Permalink
Core/Spells: Fixed AoE damage reduction auras, original patch by @Unh…
Browse files Browse the repository at this point in the history
…olychick
  • Loading branch information
Shauren committed Feb 4, 2014
1 parent 996e911 commit d006f4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/server/game/Spells/Auras/SpellAuraEffects.cpp
Expand Up @@ -5843,6 +5843,13 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
else
damage = uint32(target->CountPctFromMaxHealth(damage));

if (m_spellInfo->Effects[m_effIndex].IsTargetingArea() || m_spellInfo->Effects[m_effIndex].IsAreaAuraEffect() || m_spellInfo->Effects[m_effIndex].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA))
{
damage = int32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
if (caster->GetTypeId() != TYPEID_PLAYER)
damage = int32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
}

bool crit = IsPeriodicTickCrit(target, caster);
if (crit)
damage = caster->SpellCriticalDamageBonus(m_spellInfo, damage, target);
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/Spells/Spell.cpp
Expand Up @@ -6650,10 +6650,10 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier)

if (m_damage > 0)
{
if (m_spellInfo->Effects[i].IsTargetingArea())
if (m_spellInfo->Effects[i].IsTargetingArea() || m_spellInfo->Effects[i].IsAreaAuraEffect() || m_spellInfo->Effects[i].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA))
{
m_damage = int32(float(m_damage) * unit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
if (m_caster->GetTypeId() == TYPEID_UNIT)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
m_damage = int32(float(m_damage) * unit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));

if (m_caster->GetTypeId() == TYPEID_PLAYER)
Expand Down

10 comments on commit d006f4b

@digz6666
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems cool, I wonder what issues will be fixed by this?

@OneB1t
Copy link

@OneB1t OneB1t commented on d006f4b Feb 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pet avoidance for pve :-)

@digz6666
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OneB1t Pet AOE dmg reduction in PVP as well?

@Shauren
Copy link
Member Author

@Shauren Shauren commented on d006f4b Feb 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pets do not have aoe damage reduction in pvp, read the spell description (damage is reduced with resilience only)

@LuqJensen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will fix both player and pet aoe damage reduction by talents/auras on all types of aoe spells instead of only direct hit spells.
it now also checks for aoe from persistent area auras, one of the huge problems we had without this :)

@OneB1t
Copy link

@OneB1t OneB1t commented on d006f4b Feb 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work :)

@mik1893
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff!
But it generates a crash on some druid auras - here the crash log!
http://pastebin.com/c35ick5e

@LuqJensen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im very inexperienced with crashlogs, but i suppose Shauren can tell the issue :)

@Shauren
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related, you crash is not happening in HandlePeriodicDamageAurasTick/DoAllEffectOnLaunchTarget

@unholy
Copy link

@unholy unholy commented on d006f4b Apr 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know this is 1 month out but @mik's problem will probably lie in the repack or db that is being used and not Trinitys

from his crash dump posted above...
at /home/flcore/forgottencore434/src/server/game/Entities/Unit/Unit.cpp:4316

Please sign in to comment.