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;
|
||||
|
||||
@@ -464,7 +464,7 @@ enum SpellAttr3
|
||||
SPELL_ATTR3_UNK0 = 0x00000001, // 0
|
||||
SPELL_ATTR3_IGNORE_PROC_SUBCLASS_MASK = 0x00000002, // 1 Ignores subclass mask check when checking proc
|
||||
SPELL_ATTR3_UNK2 = 0x00000004, // 2
|
||||
SPELL_ATTR3_BLOCKABLE_SPELL = 0x00000008, // 3 Only dmg class melee in 3.1.3
|
||||
SPELL_ATTR3_COMPLETELY_BLOCKED = 0x00000008, // 3 Completely Blocked
|
||||
SPELL_ATTR3_IGNORE_RESURRECTION_TIMER = 0x00000010, // 4 you don't have to wait to be resurrected with these spells
|
||||
SPELL_ATTR3_UNK5 = 0x00000020, // 5
|
||||
SPELL_ATTR3_UNK6 = 0x00000040, // 6
|
||||
|
||||
Reference in new issue
Block a user