From a2d9467428a68c4e9a7cc83abba88b4fff08fc64 Mon Sep 17 00:00:00 2001 From: ApoC Date: Sun, 5 Jul 2009 20:06:26 +0200 Subject: [PATCH] [8129] More work on spell 20243 * No need to loop over rest of auras if correct one found * Fixed spell not applied 58567 Signed-off-by: ApoC --- src/game/SpellEffects.cpp | 8 +++++++- src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 0ed28d587..c808c1fd9 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4336,19 +4336,25 @@ void Spell::EffectWeaponDmg(uint32 i) uint32 stack = 0; // Need refresh all Sunder Armor auras from this caster Unit::AuraMap& suAuras = unitTarget->GetAuras(); + SpellEntry const *spellInfo; for(Unit::AuraMap::iterator itr = suAuras.begin(); itr != suAuras.end(); ++itr) { - SpellEntry const *spellInfo = (*itr).second->GetSpellProto(); + spellInfo = (*itr).second->GetSpellProto(); if( spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) && (*itr).second->GetCasterGUID() == m_caster->GetGUID()) { (*itr).second->RefreshAura(); stack = (*itr).second->GetStackAmount(); + break; } } if (stack) spell_bonus += stack * CalculateDamage(2, unitTarget); + if (!stack || stack < spellInfo->StackAmount) + // Devastate causing Sunder Armor Effect + // and no need to cast over max stack amount + m_caster->CastSpell(unitTarget, 58567, true); } break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 12c079eea..277d379df 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8128" + #define REVISION_NR "8129" #endif // __REVISION_NR_H__