Core/Scripts: Adding script hooks to allow for third party scripts to modify damage dealt.
Originally from the VAS Autobalance script, slightly modified. Only addresses Spells, Dots, and Melee Damage. I'll have look at the current modules on ways of doing this but, Environmental Damage(fire/lava/drowning), Fall Damage, and Potentially AoE aren't covered by these. Closes #7867 Signed-off-by: Nay <dnpd.dd@gmail.com>
This commit is contained in:
1 parent
ae4c4c1822
commit
6c6586fa43
4 files changed
+62
-6
No files matched your search
@@ -1038,6 +1038,9 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
||||
break;
|
||||
}
|
||||
|
||||
// Script Hook For CalculateSpellDamageTaken -- Allow scripts to change the Damage post class mitigation calculations
|
||||
sScriptMgr->ModifySpellDamageTaken(damageInfo->target, damageInfo->attacker, damage);
|
||||
|
||||
// Calculate absorb resist
|
||||
if (damage > 0)
|
||||
{
|
||||
@@ -1134,6 +1137,9 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
damage = MeleeDamageBonusDone(damageInfo->target, damage, damageInfo->attackType);
|
||||
damage = damageInfo->target->MeleeDamageBonusTaken(this, damage, damageInfo->attackType);
|
||||
|
||||
// Script Hook For CalculateMeleeDamage -- Allow scripts to change the Damage pre class mitigation calculations
|
||||
sScriptMgr->ModifyMeleeDamage(damageInfo->target, damageInfo->attacker, damage);
|
||||
|
||||
// Calculate armor reduction
|
||||
if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damageSchoolMask)))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user