[10475] Implement SPELL_AURA_HEAL_ABSORB (301)

Used for example in spells 66237 and 70659.

Also rename CalculateAbsorbAndResist -> CalculateDamageAbsorbAndResist
This commit is contained in:
VladimirMangos 2010-09-12 02:38:29 +04:00
parent ae53d49352
commit 84a915e1b1
9 changed files with 112 additions and 28 deletions

View file

@ -351,7 +351,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleUnused, //298 unused (3.2.2a)
&Aura::HandleUnused, //299 unused (3.2.2a)
&Aura::HandleNULL, //300 3 spells (share damage?)
&Aura::HandleNULL, //301 5 spells
&Aura::HandleNULL, //301 SPELL_AURA_HEAL_ABSORB 5 spells
&Aura::HandleUnused, //302 unused (3.2.2a)
&Aura::HandleNULL, //303 17 spells
&Aura::HandleNULL, //304 2 spells (alcohol effect?)
@ -1153,8 +1153,10 @@ void Aura::TriggerSpell()
// case 23184: break;
case 23493: // Restoration
{
int32 heal = triggerTarget->GetMaxHealth() / 10;
triggerTarget->DealHeal(triggerTarget, heal, auraSpellInfo);
uint32 heal = triggerTarget->GetMaxHealth() / 10;
uint32 absorb = 0;
triggerTarget->CalculateHealAbsorb(heal, &absorb);
triggerTarget->DealHeal(triggerTarget, heal - absorb, auraSpellInfo, false, absorb);
if (int32 mana = triggerTarget->GetMaxPower(POWER_MANA))
{
@ -6562,7 +6564,7 @@ void Aura::PeriodicTick()
if (pCaster->GetTypeId() == TYPEID_PLAYER)
pdamage -= target->GetSpellDamageReduction(pdamage);
target->CalculateAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !(GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED));
target->CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !(GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED));
DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), pdamage, GetId(),absorb);
@ -6651,7 +6653,7 @@ void Aura::PeriodicTick()
if (IS_PLAYER_GUID(GetCasterGUID()))
pdamage -= target->GetSpellDamageReduction(pdamage);
target->CalculateAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED));
target->CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED));
if(target->GetHealth() < pdamage)
pdamage = uint32(target->GetHealth());
@ -6686,7 +6688,10 @@ void Aura::PeriodicTick()
int32 heal = pCaster->SpellHealingBonusTaken(pCaster, spellProto, int32(new_damage * multiplier), DOT, GetStackAmount());
int32 gain = pCaster->DealHeal(pCaster, heal, spellProto);
uint32 absorbHeal = 0;
pCaster->CalculateHealAbsorb(heal, &absorbHeal);
int32 gain = pCaster->DealHeal(pCaster, heal, spellProto, false, absorbHeal);
pCaster->getHostileRefManager().threatAssist(pCaster, gain * 0.5f, spellProto);
break;
}