mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 01:53:47 +00:00
feat(Core/Scripting): Implement Unit hooks to modify damage before ca… (#17785)
This commit is contained in:
@@ -6701,6 +6701,11 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
|
||||
// Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
|
||||
sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
|
||||
|
||||
if (target->GetAI())
|
||||
{
|
||||
target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
|
||||
}
|
||||
|
||||
if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE)
|
||||
{
|
||||
// xinef: leave only target depending bonuses, rest is handled in calculate amount
|
||||
@@ -6811,6 +6816,11 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
|
||||
// Script Hook For HandlePeriodicHealthLeechAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
|
||||
sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
|
||||
|
||||
if (target->GetAI())
|
||||
{
|
||||
target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
|
||||
}
|
||||
|
||||
if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
|
||||
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
|
||||
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
|
||||
@@ -7020,6 +7030,11 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
||||
sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, heal, GetSpellInfo());
|
||||
sScriptMgr->ModifyHealReceived(target, caster, heal, GetSpellInfo());
|
||||
|
||||
if (target->GetAI())
|
||||
{
|
||||
target->GetAI()->OnCalculatePeriodicTickReceived(heal, caster);
|
||||
}
|
||||
|
||||
HealInfo healInfo(caster, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
|
||||
Unit::CalcHealAbsorb(healInfo);
|
||||
int32 gain = Unit::DealHeal(caster, target, healInfo.GetHeal());
|
||||
|
||||
Reference in New Issue
Block a user