Core/Units: Prevent dodge/parry/block while under the effects of fear or desorientation

This commit is contained in:
Sarjuuk
2011-07-24 06:22:53 +07:00
committed by tobmaps
parent ec9d738f3e
commit 3e70742e81

View File

@@ -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())