feat(Core/Scripting): Expand ModifyHealReceived() to also include hea… (#13655)
feat(Core/Scripting): Expand ModifyHealReceived() to also include healing over time
This commit is contained in:
@@ -11183,7 +11183,7 @@ void Unit::SendHealSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, uint32
|
|||||||
int32 Unit::HealBySpell(HealInfo& healInfo, bool critical)
|
int32 Unit::HealBySpell(HealInfo& healInfo, bool critical)
|
||||||
{
|
{
|
||||||
uint32 heal = healInfo.GetHeal();
|
uint32 heal = healInfo.GetHeal();
|
||||||
sScriptMgr->ModifyHealRecieved(this, healInfo.GetTarget(), heal);
|
sScriptMgr->ModifyHealReceived(this, healInfo.GetTarget(), heal, healInfo.GetSpellInfo());
|
||||||
healInfo.SetHeal(heal);
|
healInfo.SetHeal(heal);
|
||||||
|
|
||||||
// calculate heal absorb and reduce healing
|
// calculate heal absorb and reduce healing
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ void ScriptMgr::ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& dama
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptMgr::ModifyHealRecieved(Unit* target, Unit* attacker, uint32& damage)
|
void ScriptMgr::ModifyHealReceived(Unit* target, Unit* healer, uint32& heal, SpellInfo const* spellInfo)
|
||||||
{
|
{
|
||||||
ExecuteScript<UnitScript>([&](UnitScript* script)
|
ExecuteScript<UnitScript>([&](UnitScript* script)
|
||||||
{
|
{
|
||||||
script->ModifyHealRecieved(target, attacker, damage);
|
script->ModifyHealReceived(target, healer, heal, spellInfo);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ public:
|
|||||||
virtual void ModifySpellDamageTaken(Unit* /*target*/, Unit* /*attacker*/, int32& /*damage*/) { }
|
virtual void ModifySpellDamageTaken(Unit* /*target*/, Unit* /*attacker*/, int32& /*damage*/) { }
|
||||||
|
|
||||||
// Called when Heal is Recieved
|
// Called when Heal is Recieved
|
||||||
virtual void ModifyHealRecieved(Unit* /*target*/, Unit* /*attacker*/, uint32& /*damage*/) { }
|
virtual void ModifyHealReceived(Unit* /*target*/, Unit* /*healer*/, uint32& /*heal*/, SpellInfo const* /*spellInfo*/) { }
|
||||||
|
|
||||||
//Called when Damage is Dealt
|
//Called when Damage is Dealt
|
||||||
virtual uint32 DealDamage(Unit* /*AttackerUnit*/, Unit* /*pVictim*/, uint32 damage, DamageEffectType /*damagetype*/) { return damage; }
|
virtual uint32 DealDamage(Unit* /*AttackerUnit*/, Unit* /*pVictim*/, uint32 damage, DamageEffectType /*damagetype*/) { return damage; }
|
||||||
@@ -2431,7 +2431,7 @@ public: /* UnitScript */
|
|||||||
void ModifyPeriodicDamageAurasTick(Unit* target, Unit* attacker, uint32& damage);
|
void ModifyPeriodicDamageAurasTick(Unit* target, Unit* attacker, uint32& damage);
|
||||||
void ModifyMeleeDamage(Unit* target, Unit* attacker, uint32& damage);
|
void ModifyMeleeDamage(Unit* target, Unit* attacker, uint32& damage);
|
||||||
void ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage);
|
void ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage);
|
||||||
void ModifyHealRecieved(Unit* target, Unit* attacker, uint32& addHealth);
|
void ModifyHealReceived(Unit* target, Unit* healer, uint32& addHealth, SpellInfo const* spellInfo);
|
||||||
uint32 DealDamage(Unit* AttackerUnit, Unit* pVictim, uint32 damage, DamageEffectType damagetype);
|
uint32 DealDamage(Unit* AttackerUnit, Unit* pVictim, uint32 damage, DamageEffectType damagetype);
|
||||||
void OnBeforeRollMeleeOutcomeAgainst(Unit const* attacker, Unit const* victim, WeaponAttackType attType, int32& attackerMaxSkillValueForLevel, int32& victimMaxSkillValueForLevel, int32& attackerWeaponSkill, int32& victimDefenseSkill, int32& crit_chance, int32& miss_chance, int32& dodge_chance, int32& parry_chance, int32& block_chance);
|
void OnBeforeRollMeleeOutcomeAgainst(Unit const* attacker, Unit const* victim, WeaponAttackType attType, int32& attackerMaxSkillValueForLevel, int32& victimMaxSkillValueForLevel, int32& attackerWeaponSkill, int32& victimDefenseSkill, int32& crit_chance, int32& miss_chance, int32& dodge_chance, int32& parry_chance, int32& block_chance);
|
||||||
void OnAuraRemove(Unit* unit, AuraApplication* aurApp, AuraRemoveMode mode);
|
void OnAuraRemove(Unit* unit, AuraApplication* aurApp, AuraRemoveMode mode);
|
||||||
|
|||||||
@@ -6619,6 +6619,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
|||||||
|
|
||||||
// Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
|
// Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
|
||||||
sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, heal);
|
sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, heal);
|
||||||
|
sScriptMgr->ModifyHealReceived(target, caster, heal, GetSpellInfo());
|
||||||
|
|
||||||
HealInfo healInfo(caster, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
|
HealInfo healInfo(caster, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
|
||||||
Unit::CalcHealAbsorb(healInfo);
|
Unit::CalcHealAbsorb(healInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user