Core/SpellScripts: Add possibility to access real damage/healing done by SpellScript from AfterHit hooks.

This commit is contained in:
QAston
2011-08-20 00:45:34 +02:00
parent e2d8faea09
commit 03f3a2a636
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -1239,6 +1239,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
int32 gain = caster->HealBySpell(unitTarget, m_spellInfo, addhealth, crit);
unitTarget->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo);
m_healing = gain;
}
// Do damage and triggers
else if (m_damage > 0)
@@ -1273,6 +1274,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
AuraEffect* aurEff = m_spellAura->GetEffect(1);
aurEff->SetAmount(CalculatePctU(aurEff->GetAmount(), damageInfo.damage));
}
m_damage = damageInfo.damage;
}
// Passive spell hits/misses or active spells only misses (only triggers)
else
+2
View File
@@ -287,10 +287,12 @@ class SpellScript : public _SpellScript
// returns: target of current effect if it was GameObject otherwise NULL
GameObject* GetHitGObj();
// setter/getter for for damage done by spell to target of spell hit
// returns damage calculated before hit, and real dmg done after hit
int32 GetHitDamage();
void SetHitDamage(int32 damage);
void PreventHitDamage() { SetHitDamage(0); }
// setter/getter for for heal done by spell to target of spell hit
// returns healing calculated before hit, and real dmg done after hit
int32 GetHitHeal();
void SetHitHeal(int32 heal);
void PreventHitHeal() { SetHitHeal(0); }