diff options
author | ariel- <ariel-@users.noreply.github.com> | 2016-10-09 01:48:48 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2016-10-09 01:48:48 -0300 |
commit | 86903f701540fab062c4d7772c201507fc031c63 (patch) | |
tree | 2474be2dac062d672def7eaa7506bfbd99d407db | |
parent | ae6c35541b7725592c4fb1b00f2cadd36c5d513b (diff) |
Core/Auras: moved check for CC auras out of proc handler, and fixed its logic
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e19512b9cad..997c2904e9e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -965,33 +965,56 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); switch (GetAuraType()) { + case SPELL_AURA_MOD_CONFUSE: + case SPELL_AURA_MOD_FEAR: + case SPELL_AURA_MOD_STUN: + case SPELL_AURA_MOD_ROOT: + case SPELL_AURA_TRANSFORM: + { + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return false; + + // Spell own damage at apply won't break CC + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + { + if (spellInfo == GetSpellInfo()) + { + Aura* aura = GetBase(); + // called from spellcast, should not have ticked yet + if (aura->GetDuration() == aura->GetMaxDuration()) + return false; + } + } + break; + } case SPELL_AURA_MECHANIC_IMMUNITY: case SPELL_AURA_MOD_MECHANIC_RESISTANCE: // compare mechanic if (!spellInfo || static_cast<int32>(spellInfo->Mechanic) != GetMiscValue()) - result = false; + return false; break; case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK: // skip melee hits and instant cast spells if (!spellInfo || !spellInfo->CalcCastTime()) - result = false; + return false; break; case SPELL_AURA_MOD_DAMAGE_FROM_CASTER: // Compare casters if (GetCasterGUID() != eventInfo.GetActor()->GetGUID()) - result = false; + return false; break; case SPELL_AURA_MOD_POWER_COST_SCHOOL: case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT: // Skip melee hits and spells with wrong school or zero cost if (!spellInfo || (!spellInfo->ManaCost && !spellInfo->ManaCostPercentage) || // Cost Check !(spellInfo->GetSchoolMask() & GetMiscValue())) // School Check - result = false; + return false; break; case SPELL_AURA_REFLECT_SPELLS_SCHOOL: // Skip melee hits and spells with wrong school if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue())) - result = false; + return false; break; case SPELL_AURA_PROC_TRIGGER_SPELL: case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: @@ -1000,7 +1023,7 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell; if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) if (aurApp->GetTarget()->m_extraAttacks && triggeredSpellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) - result = false; + return false; break; } default: @@ -6409,23 +6432,12 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con void AuraEffect::HandleBreakableCCAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) { - DamageInfo* damageInfo = eventInfo.GetDamageInfo(); - if (!damageInfo) - return; - - // aura own damage at apply won't break CC - if (eventInfo.GetSpellPhaseMask() & PROC_SPELL_PHASE_CAST) - { - if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) - if (spellInfo == GetSpellInfo()) - return; - } + int32 const damageLeft = GetAmount() - static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage()); - int32 damageLeft = GetAmount(); - if (damageLeft < int32(damageInfo->GetDamage())) + if (damageLeft <= 0) aurApp->GetTarget()->RemoveAura(aurApp); else - SetAmount(damageLeft - damageInfo->GetDamage()); + SetAmount(damageLeft); } void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) |