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
This commit is contained in:
1 parent
ea4bc6c02a
commit
946f928ee2
9 files changed
+122
-118
No files matched your search
@@ -1059,7 +1059,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_ATTR8_CANT_BLOCK))
|
||||
if (!spellInfo->HasAttribute(SPELL_ATTR8_CANT_BLOCK))
|
||||
{
|
||||
// Get blocked status
|
||||
blocked = isSpellBlocked(victim, spellInfo);
|
||||
@@ -2241,7 +2241,7 @@ bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto)
|
||||
// These spells can't be blocked
|
||||
if (spellProto
|
||||
&& (spellProto->HasAttribute(SPELL_ATTR0_NO_ACTIVE_DEFENSE)
|
||||
|| spellProto->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)
|
||||
|| spellProto->HasAttribute(SPELL_ATTR3_ALWAYS_HIT)
|
||||
|| spellProto->HasAttribute(SPELL_ATTR8_CANT_BLOCK)))
|
||||
return false;
|
||||
|
||||
@@ -2306,6 +2306,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
|
||||
@@ -4040,7 +4043,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_ON_ARENA_ENTER); // special marker, always remove
|
||||
});
|
||||
}
|
||||
@@ -6255,7 +6258,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;
|
||||
|
||||
// Totems get their bonus damage from their owner
|
||||
@@ -6339,7 +6342,16 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
|
||||
float spellPowerCoeff = spellProto->Effects[effIndex].BonusMultiplier;
|
||||
float attackPowerCoeff = spellProto->BonusCoefficient;
|
||||
|
||||
WeaponAttackType const attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK;
|
||||
WeaponAttackType const attType = [&]()
|
||||
{
|
||||
if ((spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE))
|
||||
return RANGED_ATTACK;
|
||||
|
||||
if (spellProto->HasAttribute(SPELL_ATTR3_REQUIRES_OFF_HAND_WEAPON) && !spellProto->HasAttribute(SPELL_ATTR3_REQUIRES_MAIN_HAND_WEAPON))
|
||||
return OFF_ATTACK;
|
||||
|
||||
return BASE_ATTACK;
|
||||
}();
|
||||
|
||||
if (SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id))
|
||||
{
|
||||
@@ -6403,7 +6415,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
|
||||
@@ -7019,7 +7031,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
|
||||
return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, effIndex, stack);
|
||||
|
||||
// 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 healamount;
|
||||
|
||||
// No bonus healing for potion spells
|
||||
@@ -7339,7 +7351,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))
|
||||
@@ -7488,7 +7500,7 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Worl
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
|
||||
if (!spellInfo->HasAttribute(SPELL_ATTR3_ALWAYS_HIT))
|
||||
{
|
||||
if (uint32 aura = spellInfo->Effects[index].ApplyAuraName)
|
||||
{
|
||||
@@ -10206,14 +10218,7 @@ void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProc
|
||||
if (aurApp->GetRemoveMode().HasAnyFlag())
|
||||
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)
|
||||
|
||||
Reference in new issue
Block a user