mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
feat(Core/Scripting): Implement Unit hooks to modify damage before ca… (#17785)
This commit is contained in:
@@ -1308,6 +1308,11 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
||||
// Script Hook For CalculateSpellDamageTaken -- Allow scripts to change the Damage post class mitigation calculations
|
||||
sScriptMgr->ModifySpellDamageTaken(damageInfo->target, damageInfo->attacker, damage, spellInfo);
|
||||
|
||||
if (victim->GetAI())
|
||||
{
|
||||
victim->GetAI()->OnCalculateSpellDamageReceived(damage, this);
|
||||
}
|
||||
|
||||
int32 cleanDamage = 0;
|
||||
if (Unit::IsDamageReducedByArmor(damageSchoolMask, spellInfo))
|
||||
{
|
||||
@@ -1558,6 +1563,11 @@ void Unit::CalculateMeleeDamage(Unit* victim, CalcDamageInfo* damageInfo, Weapon
|
||||
// Script Hook For CalculateMeleeDamage -- Allow scripts to change the Damage pre class mitigation calculations
|
||||
sScriptMgr->ModifyMeleeDamage(damageInfo->target, damageInfo->attacker, damage);
|
||||
|
||||
if (victim->GetAI())
|
||||
{
|
||||
victim->GetAI()->OnCalculateMeleeDamageReceived(damage, this);
|
||||
}
|
||||
|
||||
// Calculate armor reduction
|
||||
if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damages[i].damageSchoolMask)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user