mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/Spells: Rewrite Steady Shot damage to deal correct damage when using Heirloom Weapons (#17481)
This commit is contained in:
@@ -596,17 +596,13 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
if (Player* caster = m_caster->ToPlayer())
|
||||
{
|
||||
// Add Ammo and Weapon damage plus RAP * 0.1
|
||||
if (Item* item = caster->GetWeaponForAttack(RANGED_ATTACK))
|
||||
{
|
||||
ItemTemplate const* weaponTemplate = item->GetTemplate();
|
||||
float dmg_min = weaponTemplate->Damage[0].DamageMin;
|
||||
float dmg_max = weaponTemplate->Damage[0].DamageMax;
|
||||
if (dmg_max == 0.0f && dmg_min > dmg_max)
|
||||
damage += int32(dmg_min);
|
||||
else
|
||||
damage += irand(int32(dmg_min), int32(dmg_max));
|
||||
damage += int32(caster->GetAmmoDPS() * weaponTemplate->Delay * 0.001f);
|
||||
}
|
||||
float dmg_min = caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE);
|
||||
float dmg_max = caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE);
|
||||
if (dmg_max == 0.0f && dmg_min > dmg_max)
|
||||
damage += int32(dmg_min);
|
||||
else
|
||||
damage += irand(int32(dmg_min), int32(dmg_max));
|
||||
damage += int32(caster->GetAmmoDPS() * caster->GetAttackTime(RANGED_ATTACK) * 0.001f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user