Core/Spells: Rename SpellAttr6 to use official attribute names
Port From (https://github.com/TrinityCore/TrinityCore/commit/94aac14b4da2d6d2b7565dfdb91313f09a87f168)
This commit is contained in:
@@ -1782,48 +1782,48 @@ namespace Framework.Constants
|
|||||||
NotOnTrivial = 0x400000, /*Nyi*/ // Not On Trivial
|
NotOnTrivial = 0x400000, /*Nyi*/ // Not On Trivial
|
||||||
NoPartialResists = 0x800000, /*Nyi*/ // No Partial Resists
|
NoPartialResists = 0x800000, /*Nyi*/ // No Partial Resists
|
||||||
IgnoreCasterRequirements = 0x1000000, /*Nyi*/ // Ignore Caster Requirements
|
IgnoreCasterRequirements = 0x1000000, /*Nyi*/ // Ignore Caster Requirements
|
||||||
AlwaysLineOfSight = 0x2000000, /*Nyi*/ // Always Line Of Sight
|
AlwaysLineOfSight = 0x2000000, // Always Line Of Sight
|
||||||
AlwaysAoeLineOfSight = 0x4000000, /*Wrong Impl*/ // Always Aoe Line Of Sight Description Requires Line Of Sight Between Caster And Target In Addition To Between Dest And Target
|
AlwaysAoeLineOfSight = 0x4000000, // Always Aoe Line Of Sight Description Requires Line Of Sight Between Caster And Target In Addition To Between Dest And Target
|
||||||
NoCasterAuraIcon = 0x8000000, // No Caster Aura Icon (Client Only)
|
NoCasterAuraIcon = 0x8000000, // No Caster Aura Icon (Client Only)
|
||||||
NoTargetAuraIcon = 0x10000000, // No Target Aura Icon (Client Only)
|
NoTargetAuraIcon = 0x10000000, // No Target Aura Icon (Client Only)
|
||||||
AuraUniquePerCaster = 0x20000000, /*Nyi*/ // Aura Unique Per Caster
|
AuraUniquePerCaster = 0x20000000, // Aura Unique Per Caster
|
||||||
AlwaysShowGroundTexture = 0x40000000, // Always Show Ground Texture
|
AlwaysShowGroundTexture = 0x40000000, // Always Show Ground Texture
|
||||||
AddMeleeHitRating = 0x80000000 /*Nyi*/ // Add Melee Hit Rating
|
AddMeleeHitRating = 0x80000000 /*Nyi*/ // Add Melee Hit Rating
|
||||||
}
|
}
|
||||||
public enum SpellAttr6 : uint
|
public enum SpellAttr6 : uint
|
||||||
{
|
{
|
||||||
DontDisplayCooldown = 0x01, // 0 Client Doesn'T Display Cooldown In Tooltip For These Spells
|
NoCooldownOnTooltip = 0x01, // No Cooldown On Tooltip (Client Only)
|
||||||
OnlyInArena = 0x02, // 1 Only Usable In Arena
|
DoNotResetCooldownInArena = 0x02, /*Nyi*/ // Do Not Reset Cooldown In Arena
|
||||||
IgnoreCasterAuras = 0x04, // 2
|
NotAnAttack = 0x04, /*Nyi*/ // Not An Attack
|
||||||
AssistIgnoreImmuneFlag = 0x08, // 3
|
CanAssistImmunePc = 0x08, // Can Assist Immune Pc
|
||||||
Unk4 = 0x10, // 4
|
IgnoreForModTimeRate = 0x10, /*Nyi, Time Rate Not Implemented*/ // Ignore For Mod Time Rate
|
||||||
DoNotConsumeResources = 0x20, // 5 dont consume proc charges
|
DoNotConsumeResources = 0x20, // Do Not Consume Resources
|
||||||
UseSpellCastEvent = 0x40, // 6
|
FloatingCombatTextOnCast = 0x40, // Floating Combat Text On Cast (Client Only)
|
||||||
Unk7 = 0x80, // 7
|
AuraIsWeaponProc = 0x80, /*Nyi*/ // Aura Is Weapon Proc
|
||||||
CantTargetCrowdControlled = 0x100, // 8
|
DoNotChainToCrowdControlledTargets = 0x100, // Do Not Chain To Crowd-Controlled Targets Description Implicit Targeting (Chaining And Area Targeting) Will Not Impact Crowd Controlled Targets
|
||||||
Unk9 = 0x200, // 9
|
AllowOnCharmedTargets = 0x200, /*Nyi*/ // Allow On Charmed Targets
|
||||||
CanTargetPossessedFriends = 0x400, // 10 Nyi!
|
NoAuraLog = 0x400, // No Aura Log
|
||||||
NotInRaidInstance = 0x800, // 11 Not Usable In Raid Instance
|
NotInRaidInstances = 0x800, // Not In Raid Instances
|
||||||
CastableWhileOnVehicle = 0x1000, // 12 Castable While Caster Is On Vehicle
|
AllowWhileRidingVehicle = 0x1000, // Allow While Riding Vehicle
|
||||||
CanTargetInvisible = 0x2000, // 13 Ignore Visibility Requirement For Spell Target (Phases, Invisibility, Etc.)
|
IgnorePhaseShift = 0x2000, // Ignore Phase Shift
|
||||||
Unk14 = 0x4000, // 14
|
AiPrimaryRangedAttack = 0x4000, /*Nyi*/ // Ai Primary Ranged Attack
|
||||||
Unk15 = 0x8000, // 15 Only 54368, 67892
|
NoPushback = 0x8000, /*Nyi*/ // No Pushback
|
||||||
Unk16 = 0x10000, // 16
|
NoJumpPathing = 0x10000, /*Nyi*/ // No Jump Pathing
|
||||||
Unk17 = 0x20000, // 17 Mount Spell
|
AllowEquipWhileCasting = 0x20000, /*Nyi*/ // Allow Equip While Casting
|
||||||
CastByCharmer = 0x40000, // 18 Client Won'T Allow To Cast These Spells When Unit Is Not Possessed && Charmer Of Caster Will Be Original Caster
|
OriginateFromController = 0x40000, // Originate From Controller Description Client Will Prevent Casting If Not Possessed, Charmer Will Be Caster For All Intents And Purposes
|
||||||
Unk19 = 0x80000, // 19 Only 47488, 50782
|
DelayCombatTimerDuringCast = 0x80000, /*Nyi*/ // Delay Combat Timer During Cast
|
||||||
OnlyVisibleToCaster = 0x100000, // 20 Only 58371, 62218
|
AuraIconOnlyForCasterLimit10 = 0x100000, // Aura Icon Only For Caster (Limit 10) (Client Only)
|
||||||
ClientUiTargetEffects = 0x200000, // 21 It'S Only Client-Side Attribute
|
ShowMechanicAsCombatText = 0x200000, // Show Mechanic As Combat Text (Client Only)
|
||||||
Unk22 = 0x400000, // 22 Only 72054
|
AbsorbCannotBeIgnore = 0x400000, /*Nyi*/ // Absorb Cannot Be Ignore
|
||||||
Unk23 = 0x800000, // 23
|
TapsImmediately = 0x800000, /*Nyi*/ // Taps Immediately
|
||||||
CanTargetUntargetable = 0x1000000, // 24
|
CanTargetUntargetable = 0x1000000, // Can Target Untargetable
|
||||||
NotResetSwingIfInstant = 0x2000000, // 25 Exorcism, Flash Of Light
|
DoesntResetSwingTimerIfInstant = 0x2000000, // Doesn'T Reset Swing Timer If Instant
|
||||||
Unk26 = 0x4000000, // 26 Related To Player Castable Positive Buff
|
VehicleImmunityCategory = 0x4000000, /*Nyi*/ // Vehicle Immunity Category
|
||||||
IgnoreHealingModifiers = 0x8000000, // 27 some custom rules - complicated
|
IgnoreHealingModifiers = 0x8000000, // Ignore Healing Modifiers Description This Prevents Certain Healing Modifiers From Applying - See Implementation If You Really Care About Details
|
||||||
Unk28 = 0x10000000, // 28 Death Grip
|
DoNotAutoSelectTargetWithInitiatesCombat = 0x10000000, // Do Not Auto Select Target With Initiates Combat (Client Only)
|
||||||
IgnoreCasterDamageModifiers = 0x20000000, // 29 ignores done percent damage mods? some custom rules - complicated
|
IgnoreCasterDamageModifiers = 0x20000000, // Ignore Caster Damage Modifiers Description This Prevents Certain Damage Modifiers From Applying - See Implementation If You Really Care About Details
|
||||||
Unk30 = 0x40000000, // 30
|
DisableTiedEffectPoints = 0x40000000, /*Nyi*/ // Disable Tied Effect Points
|
||||||
IgnoreCategoryCooldownMods = 0x80000000 // 31 Some Special Cooldown Calc? Only 2894
|
NoCategoryCooldownMods = 0x80000000 // No Category Cooldown Mods
|
||||||
}
|
}
|
||||||
public enum SpellAttr7 : uint
|
public enum SpellAttr7 : uint
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2525,7 +2525,7 @@ namespace Game.Entities
|
|||||||
if (unit != null)
|
if (unit != null)
|
||||||
{
|
{
|
||||||
// can't attack invisible
|
// can't attack invisible
|
||||||
if (bySpell == null || !bySpell.HasAttribute(SpellAttr6.CanTargetInvisible))
|
if (bySpell == null || !bySpell.HasAttribute(SpellAttr6.IgnorePhaseShift))
|
||||||
{
|
{
|
||||||
if (!unit.CanSeeOrDetect(target, bySpell != null && bySpell.IsAffectingArea()))
|
if (!unit.CanSeeOrDetect(target, bySpell != null && bySpell.IsAffectingArea()))
|
||||||
return false;
|
return false;
|
||||||
@@ -2557,7 +2557,7 @@ namespace Game.Entities
|
|||||||
unitOrOwner = go.GetOwner();
|
unitOrOwner = go.GetOwner();
|
||||||
|
|
||||||
// ignore immunity flags when assisting
|
// ignore immunity flags when assisting
|
||||||
if (unitOrOwner != null && unitTarget != null && !(isPositiveSpell && bySpell.HasAttribute(SpellAttr6.AssistIgnoreImmuneFlag)))
|
if (unitOrOwner != null && unitTarget != null && !(isPositiveSpell && bySpell.HasAttribute(SpellAttr6.CanAssistImmunePc)))
|
||||||
{
|
{
|
||||||
if (!unitOrOwner.HasUnitFlag(UnitFlags.PlayerControlled) && unitTarget.IsImmuneToNPC())
|
if (!unitOrOwner.HasUnitFlag(UnitFlags.PlayerControlled) && unitTarget.IsImmuneToNPC())
|
||||||
return false;
|
return false;
|
||||||
@@ -2687,7 +2687,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
// can't assist invisible
|
// can't assist invisible
|
||||||
if ((bySpell == null || !bySpell.HasAttribute(SpellAttr6.CanTargetInvisible)) && !CanSeeOrDetect(target, bySpell != null && bySpell.IsAffectingArea()))
|
if ((bySpell == null || !bySpell.HasAttribute(SpellAttr6.IgnorePhaseShift)) && !CanSeeOrDetect(target, bySpell != null && bySpell.IsAffectingArea()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// can't assist dead
|
// can't assist dead
|
||||||
@@ -2702,7 +2702,7 @@ namespace Game.Entities
|
|||||||
if (isNegativeSpell && unitTarget != null && unitTarget.HasUnitFlag(UnitFlags.NonAttackable | UnitFlags.OnTaxi | UnitFlags.NotAttackable1 | UnitFlags.NonAttackable2))
|
if (isNegativeSpell && unitTarget != null && unitTarget.HasUnitFlag(UnitFlags.NonAttackable | UnitFlags.OnTaxi | UnitFlags.NotAttackable1 | UnitFlags.NonAttackable2))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (isNegativeSpell || bySpell == null || !bySpell.HasAttribute(SpellAttr6.AssistIgnoreImmuneFlag))
|
if (isNegativeSpell || bySpell == null || !bySpell.HasAttribute(SpellAttr6.CanAssistImmunePc))
|
||||||
{
|
{
|
||||||
if (unit != null && unit.HasUnitFlag(UnitFlags.PlayerControlled))
|
if (unit != null && unit.HasUnitFlag(UnitFlags.PlayerControlled))
|
||||||
{
|
{
|
||||||
@@ -2748,7 +2748,7 @@ namespace Game.Entities
|
|||||||
// !target.HasFlag(UNIT_FIELD_FLAGS, UnitFlags.PvpAttackable) &&
|
// !target.HasFlag(UNIT_FIELD_FLAGS, UnitFlags.PvpAttackable) &&
|
||||||
else if (unit != null && unit.HasUnitFlag(UnitFlags.PlayerControlled))
|
else if (unit != null && unit.HasUnitFlag(UnitFlags.PlayerControlled))
|
||||||
{
|
{
|
||||||
if (bySpell == null || !bySpell.HasAttribute(SpellAttr6.AssistIgnoreImmuneFlag))
|
if (bySpell == null || !bySpell.HasAttribute(SpellAttr6.CanAssistImmunePc))
|
||||||
{
|
{
|
||||||
if (unitTarget != null && !unitTarget.IsPvP())
|
if (unitTarget != null && !unitTarget.IsPvP())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Game.Spells
|
|||||||
public Spell(WorldObject caster, SpellInfo info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID = default, ObjectGuid originalCastId = default)
|
public Spell(WorldObject caster, SpellInfo info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID = default, ObjectGuid originalCastId = default)
|
||||||
{
|
{
|
||||||
m_spellInfo = info;
|
m_spellInfo = info;
|
||||||
m_caster = (info.HasAttribute(SpellAttr6.CastByCharmer) && caster.GetCharmerOrOwner() != null ? caster.GetCharmerOrOwner() : caster);
|
m_caster = (info.HasAttribute(SpellAttr6.OriginateFromController) && caster.GetCharmerOrOwner() != null ? caster.GetCharmerOrOwner() : caster);
|
||||||
m_spellValue = new SpellValue(m_spellInfo, caster);
|
m_spellValue = new SpellValue(m_spellInfo, caster);
|
||||||
m_castItemLevel = -1;
|
m_castItemLevel = -1;
|
||||||
|
|
||||||
@@ -5861,10 +5861,6 @@ namespace Game.Spells
|
|||||||
if (unitCaster == null)
|
if (unitCaster == null)
|
||||||
return SpellCastResult.SpellCastOk;
|
return SpellCastResult.SpellCastOk;
|
||||||
|
|
||||||
// spells totally immuned to caster auras (wsg flag drop, give marks etc)
|
|
||||||
if (m_spellInfo.HasAttribute(SpellAttr6.IgnoreCasterAuras))
|
|
||||||
return SpellCastResult.SpellCastOk;
|
|
||||||
|
|
||||||
// these attributes only show the spell as usable on the client when it has related aura applied
|
// these attributes only show the spell as usable on the client when it has related aura applied
|
||||||
// still they need to be checked against certain mechanics
|
// still they need to be checked against certain mechanics
|
||||||
|
|
||||||
@@ -7156,7 +7152,7 @@ namespace Game.Spells
|
|||||||
if (IsTriggered())
|
if (IsTriggered())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (m_casttime == 0 && m_spellInfo.HasAttribute(SpellAttr6.NotResetSwingIfInstant))
|
if (m_casttime == 0 && m_spellInfo.HasAttribute(SpellAttr6.DoesntResetSwingTimerIfInstant))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ namespace Game.Spells
|
|||||||
if (cooldown >= TimeSpan.Zero)
|
if (cooldown >= TimeSpan.Zero)
|
||||||
applySpellMod(ref cooldown);
|
applySpellMod(ref cooldown);
|
||||||
|
|
||||||
if (categoryCooldown >= TimeSpan.Zero && !spellInfo.HasAttribute(SpellAttr6.IgnoreCategoryCooldownMods))
|
if (categoryCooldown >= TimeSpan.Zero && !spellInfo.HasAttribute(SpellAttr6.NoCategoryCooldownMods))
|
||||||
applySpellMod(ref categoryCooldown);
|
applySpellMod(ref categoryCooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -884,7 +884,7 @@ namespace Game.Spells
|
|||||||
var mapEntry = CliDB.MapStorage.LookupByKey(map_id);
|
var mapEntry = CliDB.MapStorage.LookupByKey(map_id);
|
||||||
|
|
||||||
// raid instance limitation
|
// raid instance limitation
|
||||||
if (HasAttribute(SpellAttr6.NotInRaidInstance))
|
if (HasAttribute(SpellAttr6.NotInRaidInstances))
|
||||||
{
|
{
|
||||||
if (mapEntry == null || mapEntry.IsRaid())
|
if (mapEntry == null || mapEntry.IsRaid())
|
||||||
return SpellCastResult.NotInRaidInstance;
|
return SpellCastResult.NotInRaidInstance;
|
||||||
@@ -1003,7 +1003,7 @@ namespace Game.Spells
|
|||||||
return SpellCastResult.BadTargets;
|
return SpellCastResult.BadTargets;
|
||||||
|
|
||||||
// check visibility - ignore stealth for implicit (area) targets
|
// check visibility - ignore stealth for implicit (area) targets
|
||||||
if (!HasAttribute(SpellAttr6.CanTargetInvisible) && !caster.CanSeeOrDetect(target, Implicit))
|
if (!HasAttribute(SpellAttr6.IgnorePhaseShift) && !caster.CanSeeOrDetect(target, Implicit))
|
||||||
return SpellCastResult.BadTargets;
|
return SpellCastResult.BadTargets;
|
||||||
|
|
||||||
Unit unitTarget = target.ToUnit();
|
Unit unitTarget = target.ToUnit();
|
||||||
@@ -1095,7 +1095,7 @@ namespace Game.Spells
|
|||||||
return SpellCastResult.TargetsDead;
|
return SpellCastResult.TargetsDead;
|
||||||
|
|
||||||
// check this flag only for implicit targets (chain and area), allow to explicitly target units for spells like Shield of Righteousness
|
// check this flag only for implicit targets (chain and area), allow to explicitly target units for spells like Shield of Righteousness
|
||||||
if (Implicit && HasAttribute(SpellAttr6.CantTargetCrowdControlled) && !unitTarget.CanFreeMove())
|
if (Implicit && HasAttribute(SpellAttr6.DoNotChainToCrowdControlledTargets) && !unitTarget.CanFreeMove())
|
||||||
return SpellCastResult.BadTargets;
|
return SpellCastResult.BadTargets;
|
||||||
|
|
||||||
if (!CheckTargetCreatureType(unitTarget))
|
if (!CheckTargetCreatureType(unitTarget))
|
||||||
@@ -1237,7 +1237,7 @@ namespace Game.Spells
|
|||||||
checkMask = VehicleSeatFlags.CanAttack;
|
checkMask = VehicleSeatFlags.CanAttack;
|
||||||
|
|
||||||
var vehicleSeat = vehicle.GetSeatForPassenger(caster);
|
var vehicleSeat = vehicle.GetSeatForPassenger(caster);
|
||||||
if (!HasAttribute(SpellAttr6.CastableWhileOnVehicle) && !HasAttribute(SpellAttr0.AllowWhileMounted)
|
if (!HasAttribute(SpellAttr6.AllowWhileRidingVehicle) && !HasAttribute(SpellAttr0.AllowWhileMounted)
|
||||||
&& (vehicleSeat.Flags & (int)checkMask) != (int)checkMask)
|
&& (vehicleSeat.Flags & (int)checkMask) != (int)checkMask)
|
||||||
return SpellCastResult.CantDoThatRightNow;
|
return SpellCastResult.CantDoThatRightNow;
|
||||||
|
|
||||||
|
|||||||
@@ -3328,7 +3328,7 @@ namespace Game.Entities
|
|||||||
41487 // Envenom - Black Temple
|
41487 // Envenom - Black Temple
|
||||||
}, spellInfo =>
|
}, spellInfo =>
|
||||||
{
|
{
|
||||||
spellInfo.AttributesEx6 |= SpellAttr6.CanTargetInvisible;
|
spellInfo.AttributesEx6 |= SpellAttr6.IgnorePhaseShift;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Oscillation Field
|
// Oscillation Field
|
||||||
@@ -4073,7 +4073,7 @@ namespace Game.Entities
|
|||||||
// Twilight Mending
|
// Twilight Mending
|
||||||
ApplySpellFix(new[] { 75509 }, spellInfo =>
|
ApplySpellFix(new[] { 75509 }, spellInfo =>
|
||||||
{
|
{
|
||||||
spellInfo.AttributesEx6 |= SpellAttr6.CanTargetInvisible;
|
spellInfo.AttributesEx6 |= SpellAttr6.IgnorePhaseShift;
|
||||||
spellInfo.AttributesEx2 |= SpellAttr2.IgnoreLineOfSight;
|
spellInfo.AttributesEx2 |= SpellAttr2.IgnoreLineOfSight;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ namespace Scripts.World.DuelReset
|
|||||||
if (cooldownMod != 0)
|
if (cooldownMod != 0)
|
||||||
totalCooldown += TimeSpan.FromMilliseconds(cooldownMod);
|
totalCooldown += TimeSpan.FromMilliseconds(cooldownMod);
|
||||||
|
|
||||||
if (!spellInfo.HasAttribute(SpellAttr6.IgnoreCategoryCooldownMods))
|
if (!spellInfo.HasAttribute(SpellAttr6.NoCategoryCooldownMods))
|
||||||
applySpellMod(ref categoryCooldown);
|
applySpellMod(ref categoryCooldown);
|
||||||
|
|
||||||
return remainingCooldown > TimeSpan.Zero
|
return remainingCooldown > TimeSpan.Zero
|
||||||
|
|||||||
Reference in New Issue
Block a user