aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index d44e9343f77..2605f760faf 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1701,6 +1701,10 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
// Need remove expired auras after
bool existExpired = false;
TriggeredSpellInfoVct triggeredSpells;
+
+ // Incanter's Absorption, for converting to spell power
+ int32 incanterAbsorption = 0;
+
// absorb without mana cost
AuraEffectList const& vSchoolAbsorb = pVictim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB);
for (AuraEffectList::const_iterator i = vSchoolAbsorb.begin(); i != vSchoolAbsorb.end() && RemainingDamage > 0; ++i)
@@ -1950,6 +1954,11 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
RemainingDamage -= currentAbsorb;
+ // Fire Ward or Frost Ward or Ice Barrier (or Mana Shield)
+ // for Incanter's Absorption converting to spell power
+ if (spellProto->SpellFamilyName == SPELLFAMILY_MAGE && spellProto->SpellFamilyFlags[2] & 0x000008)
+ incanterAbsorption += currentAbsorb;
+
// Reduce shield amount
(*i)->SetAmount((*i)->GetAmount() -currentAbsorb);
// Need remove it later
@@ -2015,6 +2024,11 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
pVictim->ApplyPowerMod(POWER_MANA, manaReduction, false);
}
+ // Mana Shield (or Fire Ward or Frost Ward or Ice Barrier)
+ // for Incanter's Absorption converting to spell power
+ if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_MAGE && (*i)->GetSpellProto()->SpellFamilyFlags[2] & 0x000008)
+ incanterAbsorption += currentAbsorb;
+
(*i)->SetAmount((*i)->GetAmount()-currentAbsorb);
if ((*i)->GetAmount() <= 0)
{
@@ -2137,7 +2151,8 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
*absorb = RemainingDamage > 0 ? (damage - RemainingDamage - *resist) : (damage - *resist);
- if (*absorb)
+ // Incanter's Absorption, if have affective absorbing
+ if (incanterAbsorption)
{
// Incanter's Absorption
// TODO: move this code to procflag
@@ -2151,10 +2166,6 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
current_dmg += bonusEff->GetAmount();
int32 new_dmg = (int32)*absorb * aurEff->GetAmount() / 100;
- int32 max_dmg = (int32)pVictim->GetMaxHealth() * 5 / 100;
- // Do not apply more auras if more than 5% hp
- if (current_dmg + new_dmg > max_dmg)
- new_dmg = max_dmg - current_dmg;
if (new_dmg > 0)
pVictim->CastCustomSpell(pVictim, 44413, &new_dmg, NULL, NULL, true);
}