aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA-Metaphysical-Drama <unknown.email@trinitycore.org>2011-05-12 22:38:16 +0700
committertobmaps <spambot42@yandex.ru>2011-05-12 22:38:16 +0700
commit0c0c93e62635b61ac1bfa6eb11e7c70dad64ca8f (patch)
tree94aebd46d2584314ef80feaa43f5cab4858f6607
parent029425d6fb2661df96456f125722aa4655387910 (diff)
Core/Spells: Spells with SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK cannot be blocked
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 1e296b5cce8..4c62895b3da 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2250,15 +2250,19 @@ void Unit::SendMeleeAttackStop(Unit* victim)
sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
}
-bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, WeaponAttackType attackType)
+bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * spellProto, WeaponAttackType attackType)
{
if (pVictim->HasInArc(M_PI, this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
{
// Check creatures flags_extra for disable block
if (pVictim->GetTypeId() == TYPEID_UNIT &&
- pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)
+ pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)
return false;
+ // These spells shouldn't be blocked
+ if (spellProto && spellProto->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)
+ return false;
+
float blockChance = pVictim->GetUnitBlockChance();
blockChance += (int32(GetWeaponSkillValue(attackType)) - int32(pVictim->GetMaxSkillValueForLevel()))*0.04f;
if (roll_chance_f(blockChance))