Core/SpellScripts: Add possibility to access real damage/healing done by SpellScript from AfterHit hooks.
This commit is contained in:
@@ -1239,6 +1239,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||||||
|
|
||||||
int32 gain = caster->HealBySpell(unitTarget, m_spellInfo, addhealth, crit);
|
int32 gain = caster->HealBySpell(unitTarget, m_spellInfo, addhealth, crit);
|
||||||
unitTarget->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo);
|
unitTarget->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo);
|
||||||
|
m_healing = gain;
|
||||||
}
|
}
|
||||||
// Do damage and triggers
|
// Do damage and triggers
|
||||||
else if (m_damage > 0)
|
else if (m_damage > 0)
|
||||||
@@ -1273,6 +1274,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||||||
AuraEffect* aurEff = m_spellAura->GetEffect(1);
|
AuraEffect* aurEff = m_spellAura->GetEffect(1);
|
||||||
aurEff->SetAmount(CalculatePctU(aurEff->GetAmount(), damageInfo.damage));
|
aurEff->SetAmount(CalculatePctU(aurEff->GetAmount(), damageInfo.damage));
|
||||||
}
|
}
|
||||||
|
m_damage = damageInfo.damage;
|
||||||
}
|
}
|
||||||
// Passive spell hits/misses or active spells only misses (only triggers)
|
// Passive spell hits/misses or active spells only misses (only triggers)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -287,10 +287,12 @@ class SpellScript : public _SpellScript
|
|||||||
// returns: target of current effect if it was GameObject otherwise NULL
|
// returns: target of current effect if it was GameObject otherwise NULL
|
||||||
GameObject* GetHitGObj();
|
GameObject* GetHitGObj();
|
||||||
// setter/getter for for damage done by spell to target of spell hit
|
// 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();
|
int32 GetHitDamage();
|
||||||
void SetHitDamage(int32 damage);
|
void SetHitDamage(int32 damage);
|
||||||
void PreventHitDamage() { SetHitDamage(0); }
|
void PreventHitDamage() { SetHitDamage(0); }
|
||||||
// setter/getter for for heal done by spell to target of spell hit
|
// 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();
|
int32 GetHitHeal();
|
||||||
void SetHitHeal(int32 heal);
|
void SetHitHeal(int32 heal);
|
||||||
void PreventHitHeal() { SetHitHeal(0); }
|
void PreventHitHeal() { SetHitHeal(0); }
|
||||||
|
|||||||
Reference in New Issue
Block a user