*Implement aura SPELL_AURA_IGNORE_HIT_DIRECTION(288).

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-17 20:38:36 +02:00
parent 596c0cd5f7
commit e27576ab45
2 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -341,8 +341,8 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleAuraModAttackPowerOfArmor, //285 SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR implemented in Player::UpdateAttackPowerAndDamage
&Aura::HandleNoImmediateEffect, //286 SPELL_AURA_ABILITY_PERIODIC_CRIT implemented in AuraEffect::PeriodicTick
&Aura::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult
&Aura::HandleUnused, //288 unused
&Aura::HandleUnused, //289 unused
&Aura::HandleNoImmediateEffect, //288 SPELL_AURA_IGNORE_HIT_DIRECTION implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult Unit::RollMeleeOutcomeAgainst
&Aura::HandleNULL, //289 unused
&Aura::HandleAuraModCritPct, //290 SPELL_AURA_MOD_CRIT_PCT
&Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
&Aura::HandleNULL, //292 call stabled pet
+6 -6
View File
@@ -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;