aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2011-08-31 11:24:45 -0700
committerQAston <qaston@gmail.com>2011-08-31 11:24:45 -0700
commitac9701afa78a21aec28556d279b2b0fb28d2a78f (patch)
treeee80a0a0703ab3913bd0ffd0dc20dbf5171febd5 /src
parentb83e8584559e0a162d4fa36bf2fabf51a9e60d0a (diff)
parent04d1bdf69c03f4a937ba3cf6e6e58673e5032f5a (diff)
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.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 94b661a6d3c..4cea8f56005 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2402,14 +2402,22 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
}
// Check for attack from behind
- if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
+ if (!victim->HasInArc(M_PI, this))
{
- // Can`t dodge from behind in PvP (but its possible in PvE)
- if (victim->GetTypeId() == TYPEID_PLAYER)
- canDodge = false;
- // Can`t parry or block
- canParry = false;
- canBlock = false;
+ if (!victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
+ {
+ // Can`t dodge from behind in PvP (but its possible in PvE)
+ if (victim->GetTypeId() == TYPEID_PLAYER)
+ canDodge = false;
+ // Can`t parry or block
+ canParry = 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
if (victim->GetTypeId() == TYPEID_UNIT)