mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Units: Prevent dodge/parry/block while under the effects of fear or desorientation
This commit is contained in:
@@ -2652,7 +2652,7 @@ uint32 Unit::GetDefenseSkillValue(Unit const* target) const
|
||||
|
||||
float Unit::GetUnitDodgeChance() const
|
||||
{
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_STUNNED))
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED))
|
||||
return 0.0f;
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -2672,7 +2672,7 @@ float Unit::GetUnitDodgeChance() const
|
||||
|
||||
float Unit::GetUnitParryChance() const
|
||||
{
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_STUNNED))
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED))
|
||||
return 0.0f;
|
||||
|
||||
float chance = 0.0f;
|
||||
@@ -2703,7 +2703,7 @@ float Unit::GetUnitParryChance() const
|
||||
|
||||
float Unit::GetUnitBlockChance() const
|
||||
{
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_STUNNED))
|
||||
if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED))
|
||||
return 0.0f;
|
||||
|
||||
if (Player const* player = ToPlayer())
|
||||
|
||||
Reference in New Issue
Block a user