Core/Spells: renamed SPELL_ATTR3_BLOCKABLE_SPELL to SPELL_ATTR3_COMPLETELY_BLOCKED and corrected its implementation
This commit is contained in:
1 parent
51d5ad93cf
commit
c13c2ec421
2 files changed
+9
-3
No files matched your search
@@ -1180,6 +1180,9 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
||||
uint32 value = victim->GetBlockPercent();
|
||||
if (victim->isBlockCritical())
|
||||
value *= 2; // double blocked percent
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR3_COMPLETELY_BLOCKED))
|
||||
value = 100;
|
||||
|
||||
damageInfo->blocked = CalculatePct(damage, value);
|
||||
if (damage <= int32(damageInfo->blocked))
|
||||
{
|
||||
@@ -2328,7 +2331,10 @@ void Unit::SendMeleeAttackStop(Unit* victim)
|
||||
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto)
|
||||
{
|
||||
// These spells can't be blocked
|
||||
if (spellProto && (spellProto->HasAttribute(SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK) || spellProto->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)))
|
||||
if (spellProto
|
||||
&& (spellProto->HasAttribute(SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)
|
||||
|| spellProto->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)
|
||||
|| spellProto->HasAttribute(SPELL_ATTR8_CANT_BLOCK)))
|
||||
return false;
|
||||
|
||||
// Can't block when casting/controlled
|
||||
@@ -2419,7 +2425,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
|
||||
|
||||
bool canDodge = !spellInfo->HasAttribute(SPELL_ATTR7_CANT_DODGE);
|
||||
bool canParry = !spellInfo->HasAttribute(SPELL_ATTR7_CANT_PARRY);
|
||||
bool canBlock = spellInfo->HasAttribute(SPELL_ATTR3_BLOCKABLE_SPELL) && !spellInfo->HasAttribute(SPELL_ATTR8_CANT_BLOCK);
|
||||
bool canBlock = !spellInfo->HasAttribute(SPELL_ATTR8_CANT_BLOCK);
|
||||
|
||||
// if victim is casting or cc'd it can't avoid attacks
|
||||
bool canUseDefenseWhileChanneling = victim->GetCurrentSpell(CURRENT_CHANNELED_SPELL) ? victim->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->GetSpellInfo()->HasAttribute(SPELL_ATTR10_ALLOW_DEFENSE_WHILE_CHANNELING) : false;
|
||||
|
||||
Reference in new issue
Block a user