fix(Core/Creature): Add support for CREATURE_FLAG_EXTRA_NO_PARRY_HAST… (#19927)

This commit is contained in:
Anton Popovichenko
2024-09-13 19:23:05 +00:00
committed by GitHub
parent 8d7463c670
commit 92ec34753f

View File

@@ -1847,7 +1847,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
if (damageInfo->blocked_amount && damageInfo->TargetState != VICTIMSTATE_BLOCKS)
victim->HandleEmoteCommand(EMOTE_ONESHOT_PARRY_SHIELD);
if (damageInfo->TargetState == VICTIMSTATE_PARRY)
// Parry haste is enabled if it's not a creature or if the creature doesn't have the NO_PARRY_HASTEN flag.
bool isParryHasteEnabled = !victim->IsCreature() ||
!victim->ToCreature()->GetCreatureTemplate()->HasFlagsExtra(CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN);
if (damageInfo->TargetState == VICTIMSTATE_PARRY && isParryHasteEnabled)
{
// Get attack timers
float offtime = float(victim->getAttackTimer(OFF_ATTACK));