mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[10829] Update SpellFamily check functions.
* Move SPELLFAMILY_* to DBCEnums.h and name it as SpellFamily * Use enum in Unit::GetAura, move family mask code to new SpellEntry helper function. * Avoid all auras scan in search of triggred spell for 20243.
This commit is contained in:
parent
695a64d42b
commit
b6ea36192e
8 changed files with 52 additions and 54 deletions
|
|
@ -5263,30 +5263,22 @@ void Spell::EffectWeaponDmg(SpellEffectIndex eff_idx)
|
|||
}
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
{
|
||||
// Devastate bonus and sunder armor refresh
|
||||
// Devastate
|
||||
if(m_spellInfo->SpellVisual[0] == 12295 && m_spellInfo->SpellIconID == 1508)
|
||||
{
|
||||
uint32 stack = 0;
|
||||
// Need refresh all Sunder Armor auras from this caster
|
||||
Unit::SpellAuraHolderMap& suAuras = unitTarget->GetSpellAuraHolderMap();
|
||||
SpellEntry const *spellInfo;
|
||||
for(Unit::SpellAuraHolderMap::iterator itr = suAuras.begin(); itr != suAuras.end(); ++itr)
|
||||
// Sunder Armor
|
||||
Aura* sunder = unitTarget->GetAura(SPELL_AURA_MOD_RESISTANCE_PCT, SPELLFAMILY_WARRIOR, UI64LIT(0x0000000000004000), 0x00000000, m_caster->GetObjectGuid());
|
||||
|
||||
// Devastate bonus and sunder armor refresh
|
||||
if (sunder)
|
||||
{
|
||||
spellInfo = (*itr).second->GetSpellProto();
|
||||
if( spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR &&
|
||||
(spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) &&
|
||||
(*itr).second->GetCasterGUID() == m_caster->GetGUID())
|
||||
{
|
||||
(*itr).second->RefreshHolder();
|
||||
stack = (*itr).second->GetStackAmount();
|
||||
break;
|
||||
}
|
||||
sunder->GetHolder()->RefreshHolder();
|
||||
spell_bonus += sunder->GetStackAmount() * CalculateDamage(EFFECT_INDEX_2, unitTarget);
|
||||
}
|
||||
if (stack)
|
||||
spell_bonus += stack * CalculateDamage(EFFECT_INDEX_2, unitTarget);
|
||||
if (!stack || stack < spellInfo->StackAmount)
|
||||
// Devastate causing Sunder Armor Effect
|
||||
// and no need to cast over max stack amount
|
||||
|
||||
// Devastate causing Sunder Armor Effect
|
||||
// and no need to cast over max stack amount
|
||||
if (!sunder || sunder->GetStackAmount() < sunder->GetSpellProto()->StackAmount)
|
||||
m_caster->CastSpell(unitTarget, 58567, true);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue