Core/Auras: change from if to switch and fix calculation for inifinite replenishment.

This commit is contained in:
Kandera
2012-05-24 16:58:09 -04:00
parent aa34135395
commit b7573a1bc7

View File

@@ -660,19 +660,25 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
}
break;
case SPELL_AURA_PERIODIC_ENERGIZE:
if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC)
switch (m_spellInfo->Id)
{
// Replenishment (0.2% from max)
// Infinite Replenishment
case 57669: // Replenishment (0.2% from max)
if (m_spellInfo->SpellIconID == 3184 && m_spellInfo->SpellVisual[0] == 12495)
amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f;
}
// Innervate
else if (m_spellInfo->Id == 29166)
break;
case 61782: // Infinite Replenishment
if (m_spellInfo->SpellIconID == 3184 && m_spellInfo->SpellVisual[0] == 12495)
amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f;
break;
case 29166: // Innervate
ApplyPctF(amount, float(GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)) / GetTotalTicks());
// Owlkin Frenzy
else if (m_spellInfo->Id == 48391)
break;
case 48391: // Owlkin Frenzy
ApplyPctU(amount, GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA));
break;
default:
break;
}
break;
case SPELL_AURA_PERIODIC_HEAL:
if (!caster)