Core/Spells: Check SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK before HasInArc in Unit::isSpellBlocked.
This commit is contained in:
@@ -2250,21 +2250,21 @@ 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());
|
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* victim, SpellEntry const * spellProto, WeaponAttackType attackType)
|
||||||
{
|
{
|
||||||
if (pVictim->HasInArc(M_PI, this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
// These spells can't be blocked
|
||||||
|
if (spellProto && spellProto->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (victim->HasInArc(M_PI, this) || victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||||
{
|
{
|
||||||
// Check creatures flags_extra for disable block
|
// Check creatures flags_extra for disable block
|
||||||
if (pVictim->GetTypeId() == TYPEID_UNIT &&
|
if (victim->GetTypeId() == TYPEID_UNIT &&
|
||||||
pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)
|
victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// These spells shouldn't be blocked
|
float blockChance = victim->GetUnitBlockChance();
|
||||||
if (spellProto && spellProto->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)
|
blockChance += (int32(GetWeaponSkillValue(attackType)) - int32(victim->GetMaxSkillValueForLevel())) * 0.04f;
|
||||||
return false;
|
|
||||||
|
|
||||||
float blockChance = pVictim->GetUnitBlockChance();
|
|
||||||
blockChance += (int32(GetWeaponSkillValue(attackType)) - int32(pVictim->GetMaxSkillValueForLevel()))*0.04f;
|
|
||||||
if (roll_chance_f(blockChance))
|
if (roll_chance_f(blockChance))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user