Merge pull request #2762 from Kapoeira/master

Core/Spells: Prevent deterrance from parrying spells that require the attacker to be behind the hunter, like Shred or Ambush.
This commit is contained in:
QAston
2011-08-31 11:24:45 -07:00
+9 -1
View File
@@ -2402,7 +2402,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
} }
// Check for attack from behind // Check for attack from behind
if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) if (!victim->HasInArc(M_PI, this))
{
if (!victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
{ {
// Can`t dodge from behind in PvP (but its possible in PvE) // Can`t dodge from behind in PvP (but its possible in PvE)
if (victim->GetTypeId() == TYPEID_PLAYER) if (victim->GetTypeId() == TYPEID_PLAYER)
@@ -2411,6 +2413,12 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
canParry = false; canParry = false;
canBlock = false; canBlock = false;
} }
else // Only deterrence as of 3.3.5
{
if (spell->AttributesCu & SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET)
canParry = false;
}
}
// Check creatures flags_extra for disable parry // Check creatures flags_extra for disable parry
if (victim->GetTypeId() == TYPEID_UNIT) if (victim->GetTypeId() == TYPEID_UNIT)
{ {