feat(Core/Items): Implemented elemental weapon damage. Source: Trinit… (#13050)

...yCore.
This commit is contained in:
UltraNix
2022-10-08 19:34:52 +02:00
committed by GitHub
parent 02b3f74d6d
commit e390087efd
13 changed files with 778 additions and 287 deletions

View File

@@ -648,10 +648,13 @@ class spell_dk_dancing_rune_weapon : public AuraScript
{
target = player->GetMeleeHitRedirectTarget(target);
CalcDamageInfo damageInfo;
player->CalculateMeleeDamage(target, 0, &damageInfo, eventInfo.GetDamageInfo()->GetAttackType());
Unit::DealDamageMods(target, damageInfo.damage, &damageInfo.absorb);
player->CalculateMeleeDamage(target, &damageInfo, eventInfo.GetDamageInfo()->GetAttackType());
for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
{
Unit::DealDamageMods(target, damageInfo.damages[i].damage, &damageInfo.damages[i].absorb);
damageInfo.damages[i].damage /= 2.0f;
}
damageInfo.attacker = dancingRuneWeapon;
damageInfo.damage /= 2.0f;
dancingRuneWeapon->SendAttackStateUpdate(&damageInfo);
dancingRuneWeapon->DealMeleeDamage(&damageInfo, true);
}