aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-04-30 16:57:32 +0200
committerShauren <shauren.trinity@gmail.com>2022-04-30 16:57:32 +0200
commit88d7b58a3dd8b0eb95c233a20c1608ddce73d9ea (patch)
treedb38ff659b4105a3b60888bbb67339921d6ae2a0 /src/server/game/Entities/Unit
parentb409a37c800b9d572048ee409f1bb138e97b8d8c (diff)
Core/Spells: Rename SpellAttr3 to use official attribute names
* Implemented SPELL_ATTR3_NO_AVOIDANCE * Implemented SPELL_ATTR3_ONLY_PROC_OUTDOORS * Implemented SPELL_ATTR3_ONLY_PROC_ON_CASTER * Implemented SPELL_ATTR3_PVP_ENABLING * Implemented SPELL_ATTR3_SUPPRESS_CASTER_PROCS * Implemented SPELL_ATTR3_SUPPRESS_TARGET_PROCS
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 65e78d8cff9..7aca0596c47 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -1100,7 +1100,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
if (damageSchoolMask & SPELL_SCHOOL_MASK_NORMAL)
{
// Spells with this attribute were already calculated in MeleeSpellHitResult
- if (!spellInfo->HasAttribute(SPELL_ATTR3_BLOCKABLE_SPELL))
+ if (!spellInfo->HasAttribute(SPELL_ATTR3_COMPLETELY_BLOCKED))
{
// Get blocked status
blocked = isSpellBlocked(victim, spellInfo, attackType);
@@ -2317,7 +2317,7 @@ void Unit::SendMeleeAttackStop(Unit* victim)
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType)
{
// These spells can't be blocked
- if (spellProto && (spellProto->HasAttribute(SPELL_ATTR0_NO_ACTIVE_DEFENSE) || spellProto->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)))
+ if (spellProto && (spellProto->HasAttribute(SPELL_ATTR0_NO_ACTIVE_DEFENSE) || spellProto->HasAttribute(SPELL_ATTR3_ALWAYS_HIT)))
return false;
// Can't block when casting/controlled
@@ -2382,6 +2382,9 @@ bool Unit::CanUseAttackType(uint8 attacktype) const
// Melee based spells hit result calculations
SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo) const
{
+ if (spellInfo->HasAttribute(SPELL_ATTR3_NO_AVOIDANCE))
+ return SPELL_MISS_NONE;
+
WeaponAttackType attType = BASE_ATTACK;
// Check damage class instead of attack type to correctly handle judgements
@@ -2410,7 +2413,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
bool canDodge = !spellInfo->HasAttribute(SPELL_ATTR7_NO_ATTACK_DODGE);
bool canParry = !spellInfo->HasAttribute(SPELL_ATTR7_NO_ATTACK_PARRY);
- bool canBlock = spellInfo->HasAttribute(SPELL_ATTR3_BLOCKABLE_SPELL);
+ bool canBlock = spellInfo->HasAttribute(SPELL_ATTR3_COMPLETELY_BLOCKED);
// if victim is casting or cc'd it can't avoid attacks
if (victim->IsNonMeleeSpellCast(false, false, true) || victim->HasUnitState(UNIT_STATE_CONTROLLED))
@@ -4150,7 +4153,7 @@ void Unit::RemoveArenaAuras()
Aura const* aura = aurApp->GetBase();
return (!aura->GetSpellInfo()->HasAttribute(SPELL_ATTR4_DONT_REMOVE_IN_ARENA) // don't remove stances, shadowform, pally/hunter auras
&& !aura->IsPassive() // don't remove passive auras
- && (aurApp->IsPositive() || !aura->GetSpellInfo()->HasAttribute(SPELL_ATTR3_DEATH_PERSISTENT))) || // not negative death persistent auras
+ && (aurApp->IsPositive() || !aura->GetSpellInfo()->HasAttribute(SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD))) || // not negative death persistent auras
aura->GetSpellInfo()->HasAttribute(SPELL_ATTR5_REMOVE_ENTERING_ARENA); // special marker, always remove
});
}
@@ -6449,7 +6452,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
return pdamage;
// Some spells don't benefit from done mods
- if (spellProto->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS))
+ if (spellProto->HasAttribute(SPELL_ATTR3_IGNORE_CASTER_MODIFIERS))
return pdamage;
// For totems get damage bonus from owner
@@ -6486,7 +6489,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
if ((spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE))
return RANGED_ATTACK;
- if (spellProto->HasAttribute(SPELL_ATTR3_REQ_OFFHAND) && !spellProto->HasAttribute(SPELL_ATTR3_MAIN_HAND))
+ if (spellProto->HasAttribute(SPELL_ATTR3_REQUIRES_OFF_HAND_WEAPON) && !spellProto->HasAttribute(SPELL_ATTR3_REQUIRES_MAIN_HAND_WEAPON))
return OFF_ATTACK;
return BASE_ATTACK;
@@ -6531,7 +6534,7 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
return 1.0f;
// Some spells don't benefit from done mods
- if (spellProto->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS))
+ if (spellProto->HasAttribute(SPELL_ATTR3_IGNORE_CASTER_MODIFIERS))
return 1.0f;
// Some spells don't benefit from pct done mods
@@ -7027,7 +7030,7 @@ float Unit::SpellHealingPctDone(Unit* victim, SpellInfo const* spellProto) const
return owner->SpellHealingPctDone(victim, spellProto);
// Some spells don't benefit from done mods
- if (spellProto->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS))
+ if (spellProto->HasAttribute(SPELL_ATTR3_IGNORE_CASTER_MODIFIERS))
return 1.0f;
// Some spells don't benefit from done mods
@@ -7185,7 +7188,7 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const
return false;
// for example 40175
- if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
+ if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && spellInfo->HasAttribute(SPELL_ATTR3_ALWAYS_HIT))
return false;
if (spellInfo->HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS) || spellInfo->HasAttribute(SPELL_ATTR2_NO_SCHOOL_IMMUNITIES))
@@ -7333,7 +7336,7 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, SpellEffectInfo co
if (AuraType aura = spellEffectInfo.ApplyAuraName)
{
- if (!spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
+ if (!spellInfo->HasAttribute(SPELL_ATTR3_ALWAYS_HIT))
{
SpellImmuneContainer const& list = m_spellImmune[IMMUNITY_STATE];
if (list.count(aura) > 0)
@@ -9916,14 +9919,7 @@ void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProc
if (aurApp->GetRemoveMode())
continue;
- SpellInfo const* spellInfo = aurApp->GetBase()->GetSpellInfo();
- if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC))
- SetCantProc(true);
-
aurApp->GetBase()->TriggerProcOnEvent(procEffectMask, aurApp, eventInfo);
-
- if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC))
- SetCantProc(false);
}
if (disableProcs)