mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 15:27:47 -04:00
Core/Spells: Fixed a mistake in obtaining class for scaling, also fixed crash in feral damage calculations
This commit is contained in:
@@ -416,7 +416,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
|
||||
|
||||
float att_speed = GetAPMultiplier(attType, normalized);
|
||||
|
||||
float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType)/ 14.0f * att_speed;
|
||||
float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType) / 14.0f * att_speed;
|
||||
float base_pct = GetModifierValue(unitMod, BASE_PCT);
|
||||
float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
|
||||
float total_pct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
|
||||
@@ -426,15 +426,19 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
|
||||
|
||||
if (IsInFeralForm()) //check if player is druid and in cat or bear forms
|
||||
{
|
||||
float weaponSpeed = BASE_ATTACK_TIME / 1000.f;
|
||||
if (Item* weapon = GetWeaponForAttack(BASE_ATTACK, true))
|
||||
weaponSpeed = weapon->GetTemplate()->Delay / 1000;
|
||||
|
||||
if (GetShapeshiftForm() == FORM_CAT)
|
||||
{
|
||||
weapon_mindamage = weapon_mindamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000;
|
||||
weapon_maxdamage = weapon_maxdamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000;
|
||||
weapon_mindamage = weapon_mindamage / weaponSpeed;
|
||||
weapon_maxdamage = weapon_maxdamage / weaponSpeed;
|
||||
}
|
||||
else if (GetShapeshiftForm() == FORM_BEAR)
|
||||
{
|
||||
weapon_mindamage = weapon_mindamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000 + weapon_mindamage / 2.5;
|
||||
weapon_maxdamage = weapon_mindamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000 + weapon_maxdamage / 2.5;
|
||||
weapon_mindamage = weapon_mindamage / weaponSpeed + weapon_mindamage / 2.5;
|
||||
weapon_maxdamage = weapon_mindamage / weaponSpeed + weapon_maxdamage / 2.5;
|
||||
}
|
||||
}
|
||||
else if (!CanUseAttackType(attType)) //check if player not in form but still can't use (disarm case)
|
||||
|
||||
Reference in New Issue
Block a user