Core/Units: ported base attack time refactors from master branch
This commit is contained in:
1 parent
ab866ca985
commit
4539f848ac
14 files changed
+69
-45
No files matched your search
@@ -5064,10 +5064,10 @@ void Player::SetRegularAttackTime()
|
||||
{
|
||||
ItemTemplate const* proto = tmpitem->GetTemplate();
|
||||
if (proto->GetDelay())
|
||||
SetAttackTime(WeaponAttackType(i), proto->GetDelay());
|
||||
SetBaseAttackTime(WeaponAttackType(i), proto->GetDelay());
|
||||
}
|
||||
else
|
||||
SetAttackTime(WeaponAttackType(i), BASE_ATTACK_TIME); // If there is no weapon reset attack time to base (might have been changed from forms)
|
||||
SetBaseAttackTime(WeaponAttackType(i), BASE_ATTACK_TIME); // If there is no weapon reset attack time to base (might have been changed from forms)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7583,7 +7583,7 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, bool appl
|
||||
}
|
||||
|
||||
if (proto->GetDelay() && !IsInFeralForm())
|
||||
SetAttackTime(attType, apply ? proto->GetDelay() : BASE_ATTACK_TIME);
|
||||
SetBaseAttackTime(attType, apply ? proto->GetDelay() : BASE_ATTACK_TIME);
|
||||
|
||||
// No need to modify any physical damage for ferals as it is calculated from stats only
|
||||
if (IsInFeralForm())
|
||||
@@ -7906,7 +7906,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
|
||||
|
||||
if (proto->SpellPPMRate)
|
||||
{
|
||||
uint32 WeaponSpeed = GetAttackTime(damageInfo.GetAttackType());
|
||||
uint32 WeaponSpeed = GetBaseAttackTime(damageInfo.GetAttackType());
|
||||
chance = GetPPMProcChance(WeaponSpeed, proto->SpellPPMRate, spellInfo);
|
||||
}
|
||||
else if (chance > 100.0f)
|
||||
@@ -19911,7 +19911,7 @@ void Player::outDebugValues() const
|
||||
TC_LOG_DEBUG("entities.unit", "MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f", GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE));
|
||||
TC_LOG_DEBUG("entities.unit", "MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE));
|
||||
TC_LOG_DEBUG("entities.unit", "MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE));
|
||||
TC_LOG_DEBUG("entities.unit", "ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u", GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK));
|
||||
TC_LOG_DEBUG("entities.unit", "ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u", GetBaseAttackTime(BASE_ATTACK), GetBaseAttackTime(RANGED_ATTACK));
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
@@ -21464,9 +21464,9 @@ void Player::InitDataForForm(bool reapplyMods)
|
||||
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form);
|
||||
if (ssEntry && ssEntry->CombatRoundTime)
|
||||
{
|
||||
SetAttackTime(BASE_ATTACK, ssEntry->CombatRoundTime);
|
||||
SetAttackTime(OFF_ATTACK, ssEntry->CombatRoundTime);
|
||||
SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME);
|
||||
SetBaseAttackTime(BASE_ATTACK, ssEntry->CombatRoundTime);
|
||||
SetBaseAttackTime(OFF_ATTACK, ssEntry->CombatRoundTime);
|
||||
SetBaseAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME);
|
||||
}
|
||||
else
|
||||
SetRegularAttackTime();
|
||||
|
||||
Reference in new issue
Block a user