fix(Core/Creature): Add support for CREATURE_FLAG_EXTRA_NO_PARRY_HAST… (#19927)
This commit is contained in:
committed by
GitHub
parent
8d7463c670
commit
92ec34753f
@@ -1847,7 +1847,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
|||||||
if (damageInfo->blocked_amount && damageInfo->TargetState != VICTIMSTATE_BLOCKS)
|
if (damageInfo->blocked_amount && damageInfo->TargetState != VICTIMSTATE_BLOCKS)
|
||||||
victim->HandleEmoteCommand(EMOTE_ONESHOT_PARRY_SHIELD);
|
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
|
// Get attack timers
|
||||||
float offtime = float(victim->getAttackTimer(OFF_ATTACK));
|
float offtime = float(victim->getAttackTimer(OFF_ATTACK));
|
||||||
|
|||||||
Reference in New Issue
Block a user