Core/Spells: Rename SpellAttr0 to use official attribute names
Port From (https://github.com/TrinityCore/TrinityCore/commit/a31e6819447626cd7b6967665001ea89bf6a0298)
This commit is contained in:
@@ -1914,10 +1914,10 @@ namespace Game.Entities
|
||||
if (!unitCaster)
|
||||
return;
|
||||
|
||||
if (!(spellInfo.HasAttribute(SpellAttr0.Ability) || spellInfo.HasAttribute(SpellAttr0.Tradespell) || spellInfo.HasAttribute(SpellAttr3.NoDoneBonus)) &&
|
||||
if (!(spellInfo.HasAttribute(SpellAttr0.IsAbility) || spellInfo.HasAttribute(SpellAttr0.IsTradeskill) || spellInfo.HasAttribute(SpellAttr3.NoDoneBonus)) &&
|
||||
((IsPlayer() && spellInfo.SpellFamilyName != 0) || IsCreature()))
|
||||
castTime = unitCaster.CanInstantCast() ? 0 : (int)(castTime * unitCaster.m_unitData.ModCastingSpeed);
|
||||
else if (spellInfo.HasAttribute(SpellAttr0.ReqAmmo) && !spellInfo.HasAttribute(SpellAttr2.AutorepeatFlag))
|
||||
else if (spellInfo.HasAttribute(SpellAttr0.UsesRangedSlot) && !spellInfo.HasAttribute(SpellAttr2.AutorepeatFlag))
|
||||
castTime = (int)(castTime * unitCaster.m_modAttackSpeedPct[(int)WeaponAttackType.RangedAttack]);
|
||||
else if (Global.SpellMgr.IsPartOfSkillLine(SkillType.Cooking, spellInfo.Id) && unitCaster.HasAura(67556)) // cooking with Chef Hat.
|
||||
castTime = 500;
|
||||
@@ -1940,10 +1940,10 @@ namespace Game.Entities
|
||||
if (!unitCaster)
|
||||
return;
|
||||
|
||||
if (!(spellInfo.HasAttribute(SpellAttr0.Ability) || spellInfo.HasAttribute(SpellAttr0.Tradespell) || spellInfo.HasAttribute(SpellAttr3.NoDoneBonus)) &&
|
||||
if (!(spellInfo.HasAttribute(SpellAttr0.IsAbility) || spellInfo.HasAttribute(SpellAttr0.IsTradeskill) || spellInfo.HasAttribute(SpellAttr3.NoDoneBonus)) &&
|
||||
((IsPlayer() && spellInfo.SpellFamilyName != 0) || IsCreature()))
|
||||
duration = (int)(duration * unitCaster.m_unitData.ModCastingSpeed);
|
||||
else if (spellInfo.HasAttribute(SpellAttr0.ReqAmmo) && !spellInfo.HasAttribute(SpellAttr2.AutorepeatFlag))
|
||||
else if (spellInfo.HasAttribute(SpellAttr0.UsesRangedSlot) && !spellInfo.HasAttribute(SpellAttr2.AutorepeatFlag))
|
||||
duration = (int)(duration * unitCaster.m_modAttackSpeedPct[(int)WeaponAttackType.RangedAttack]);
|
||||
}
|
||||
|
||||
@@ -2750,7 +2750,7 @@ namespace Game.Entities
|
||||
public Unit GetMagicHitRedirectTarget(Unit victim, SpellInfo spellInfo)
|
||||
{
|
||||
// Patch 1.2 notes: Spell Reflection no longer reflects abilities
|
||||
if (spellInfo.HasAttribute(SpellAttr0.Ability) || spellInfo.HasAttribute(SpellAttr1.CantBeRedirected) || spellInfo.HasAttribute(SpellAttr0.UnaffectedByInvulnerability))
|
||||
if (spellInfo.HasAttribute(SpellAttr0.IsAbility) || spellInfo.HasAttribute(SpellAttr1.CantBeRedirected) || spellInfo.HasAttribute(SpellAttr0.NoImmunities))
|
||||
return victim;
|
||||
|
||||
var magnetAuras = victim.GetAuraEffectsByType(AuraType.SpellMagnet);
|
||||
|
||||
@@ -6398,8 +6398,8 @@ namespace Game.Entities
|
||||
if (IsInFlight())
|
||||
return;
|
||||
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.VmapIndoorCheck) && !IsOutdoors())
|
||||
RemoveAurasWithAttribute(SpellAttr0.OutdoorsOnly);
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.VmapIndoorCheck))
|
||||
RemoveAurasWithAttribute(IsOutdoors() ? SpellAttr0.OnlyIndoors : SpellAttr0.OnlyOutdoors);
|
||||
|
||||
uint areaId = GetAreaId();
|
||||
if (areaId == 0)
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Game.Entities
|
||||
Spell spell = GetCurrentSpell(CurrentSpellTypes.Generic);
|
||||
if (spell != null)
|
||||
if (spell.GetState() == SpellState.Preparing
|
||||
&& spell.m_spellInfo.HasAttribute(SpellAttr0.CantUsedInCombat)
|
||||
&& spell.m_spellInfo.HasAttribute(SpellAttr0.NotInCombatOnlyPeaceful)
|
||||
&& spell.m_spellInfo.InterruptFlags.HasFlag(SpellInterruptFlags.Combat))
|
||||
InterruptNonMeleeSpells(false);
|
||||
|
||||
|
||||
@@ -758,7 +758,7 @@ namespace Game.Entities
|
||||
return SpellMissInfo.Resist;
|
||||
|
||||
// Same spells cannot be parried/dodged
|
||||
if (spellInfo.HasAttribute(SpellAttr0.ImpossibleDodgeParryBlock))
|
||||
if (spellInfo.HasAttribute(SpellAttr0.NoActiveDefense))
|
||||
return SpellMissInfo.None;
|
||||
|
||||
bool canDodge = !spellInfo.HasAttribute(SpellAttr7.NoAttackDodge);
|
||||
@@ -1223,7 +1223,7 @@ namespace Game.Entities
|
||||
if (idList.ContainsKey(spellInfo.Id))
|
||||
return true;
|
||||
|
||||
if (spellInfo.HasAttribute(SpellAttr0.UnaffectedByInvulnerability))
|
||||
if (spellInfo.HasAttribute(SpellAttr0.NoImmunities))
|
||||
return false;
|
||||
|
||||
uint dispel = (uint)spellInfo.Dispel;
|
||||
@@ -1379,7 +1379,7 @@ namespace Game.Entities
|
||||
return false;
|
||||
|
||||
// for example 40175
|
||||
if (spellInfo.HasAttribute(SpellAttr0.UnaffectedByInvulnerability) && spellInfo.HasAttribute(SpellAttr3.IgnoreHitResult))
|
||||
if (spellInfo.HasAttribute(SpellAttr0.NoImmunities) && spellInfo.HasAttribute(SpellAttr3.IgnoreHitResult))
|
||||
return false;
|
||||
|
||||
if (spellInfo.HasAttribute(SpellAttr1.UnaffectedBySchoolImmune) || spellInfo.HasAttribute(SpellAttr2.UnaffectedByAuraSchoolImmune))
|
||||
@@ -1748,7 +1748,7 @@ namespace Game.Entities
|
||||
bool IsSpellBlocked(Unit victim, SpellInfo spellProto, WeaponAttackType attackType = WeaponAttackType.BaseAttack)
|
||||
{
|
||||
// These spells can't be blocked
|
||||
if (spellProto != null && (spellProto.HasAttribute(SpellAttr0.ImpossibleDodgeParryBlock) || spellProto.HasAttribute(SpellAttr3.IgnoreHitResult)))
|
||||
if (spellProto != null && (spellProto.HasAttribute(SpellAttr0.NoActiveDefense) || spellProto.HasAttribute(SpellAttr3.IgnoreHitResult)))
|
||||
return false;
|
||||
|
||||
// Can't block when casting/controlled
|
||||
|
||||
@@ -292,7 +292,7 @@ namespace Game.Entities
|
||||
{
|
||||
SpellInfo transformSpellInfo = Global.SpellMgr.GetSpellInfo(spellId, GetMap().GetDifficultyID());
|
||||
if (transformSpellInfo != null)
|
||||
if (transformSpellInfo.HasAttribute(SpellAttr0.CastableWhileMounted))
|
||||
if (transformSpellInfo.HasAttribute(SpellAttr0.AllowWhileMounted))
|
||||
return false;
|
||||
|
||||
if (form != 0)
|
||||
@@ -656,7 +656,7 @@ namespace Game.Entities
|
||||
{
|
||||
SpellInfo createBySpell = Global.SpellMgr.GetSpellInfo(gameObj.GetSpellId(), GetMap().GetDifficultyID());
|
||||
// Need disable spell use for owner
|
||||
if (createBySpell != null && createBySpell.HasAttribute(SpellAttr0.DisabledWhileActive))
|
||||
if (createBySpell != null && createBySpell.IsCooldownStartedOnEvent())
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
|
||||
GetSpellHistory().StartCooldown(createBySpell, 0, null, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user