[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 <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-07-05 20:06:26 +02:00
parent de974e5537
commit a2d9467428
2 changed files with 8 additions and 2 deletions

View file

@ -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;
}