Core/Spells: Spells with SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK cannot be blocked
This commit is contained in:
committed by
tobmaps
parent
029425d6fb
commit
0c0c93e626
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user