*Implement aura SPELL_AURA_IGNORE_HIT_DIRECTION(288).
--HG-- branch : trunk
This commit is contained in:
1 parent
596c0cd5f7
commit
e27576ab45
2 files changed
+8
-8
No files matched your search
+6
-6
@@ -2289,7 +2289,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
// Dodge chance
|
||||
|
||||
// only players can't dodge if attacker is behind
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI,this))
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
|
||||
}
|
||||
@@ -2316,7 +2316,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
// parry & block chances
|
||||
|
||||
// check if attack comes from behind, nobody can parry or block if attacker is behind
|
||||
if (!pVictim->HasInArc(M_PI,this))
|
||||
if (!pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind.");
|
||||
}
|
||||
@@ -2497,7 +2497,7 @@ void Unit::SendMeleeAttackStop(Unit* victim)
|
||||
|
||||
bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, WeaponAttackType attackType)
|
||||
{
|
||||
if (pVictim->HasInArc(M_PI,this))
|
||||
if (pVictim->HasInArc(M_PI,this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
/* Currently not exist spells with ignore block
|
||||
// Ignore combat result aura (parry/dodge check on prepare)
|
||||
@@ -2660,7 +2660,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||
if (attType == RANGED_ATTACK)
|
||||
{
|
||||
// only if in front
|
||||
if (pVictim->HasInArc(M_PI,this))
|
||||
if (pVictim->HasInArc(M_PI,this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
|
||||
tmp+=deflect_chance;
|
||||
@@ -2671,7 +2671,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||
}
|
||||
|
||||
// Check for attack from behind
|
||||
if (!pVictim->HasInArc(M_PI,this))
|
||||
if (!pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
// Can`t dodge from behind in PvP (but its possible in PvE)
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -2813,7 +2813,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||
return SPELL_MISS_RESIST;
|
||||
|
||||
// cast by caster in front of victim
|
||||
if (pVictim->HasInArc(M_PI,this))
|
||||
if (pVictim->HasInArc(M_PI,this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
|
||||
tmp+=deflect_chance;
|
||||
|
||||
Reference in new issue
Block a user