Core/Spells: Correct implementation of SPELL_ATTR2_TRIGGERED_CAN_TRIGGER_PROC, SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2, SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED and rename them (SPELL_ATTR2_ACTIVE_THREAT, SPELL_ATTR3_NOT_A_PROC, SPELL_ATTR3_CAN_PROC_FROM_PROCS)
Port From (https://github.com/TrinityCore/TrinityCore/commit/b6bc8a50acaf153849f58c8b408e236bb2b70c35)
This commit is contained in:
@@ -1673,7 +1673,7 @@ namespace Framework.Constants
|
|||||||
Unk27 = 0x8000000, // 27
|
Unk27 = 0x8000000, // 27
|
||||||
IgnoreActionAuraInterruptFlags = 0x10000000, // 28 doesnt break auras with SpellAuraInterruptFlags::Action and SpellAuraInterruptFlags::ActionDelayed
|
IgnoreActionAuraInterruptFlags = 0x10000000, // 28 doesnt break auras with SpellAuraInterruptFlags::Action and SpellAuraInterruptFlags::ActionDelayed
|
||||||
CantCrit = 0x20000000, // 29 Spell Can'T Crit
|
CantCrit = 0x20000000, // 29 Spell Can'T Crit
|
||||||
TriggeredCanTriggerProc = 0x40000000, // 30 Spell Can Trigger Even If Triggered
|
ActiveThreat = 0x40000000, // 30 Active Threat
|
||||||
FoodBuff = 0x80000000 // 31 Food Or Drink Buff (Like Well Fed)
|
FoodBuff = 0x80000000 // 31 Food Or Drink Buff (Like Well Fed)
|
||||||
}
|
}
|
||||||
public enum SpellAttr3 : uint
|
public enum SpellAttr3 : uint
|
||||||
@@ -1687,7 +1687,7 @@ namespace Framework.Constants
|
|||||||
Unk6 = 0x40, // 6
|
Unk6 = 0x40, // 6
|
||||||
StackForDiffCasters = 0x80, // 7 Separate Stack For Every Caster
|
StackForDiffCasters = 0x80, // 7 Separate Stack For Every Caster
|
||||||
OnlyTargetPlayers = 0x100, // 8 Can Only Target Players
|
OnlyTargetPlayers = 0x100, // 8 Can Only Target Players
|
||||||
TriggeredCanTriggerProc2 = 0x200, // 9 Triggered From Effect?
|
NotAProc = 0x200, // 9 Without this attribute, any triggered spell will be unable to trigger other auras' procs
|
||||||
MainHand = 0x400, // 10 Main Hand Weapon Required
|
MainHand = 0x400, // 10 Main Hand Weapon Required
|
||||||
Battleground = 0x800, // 11 Can Casted Only On Battleground
|
Battleground = 0x800, // 11 Can Casted Only On Battleground
|
||||||
OnlyTargetGhosts = 0x1000, // 12
|
OnlyTargetGhosts = 0x1000, // 12
|
||||||
@@ -1704,7 +1704,7 @@ namespace Framework.Constants
|
|||||||
Unk23 = 0x800000, // 23
|
Unk23 = 0x800000, // 23
|
||||||
ReqOffhand = 0x1000000, // 24 Req Offhand Weapon
|
ReqOffhand = 0x1000000, // 24 Req Offhand Weapon
|
||||||
TreatAsPeriodic = 0x2000000, // 25 Makes the spell appear as periodic in client combat logs - used by spells that trigger another spell on each tick
|
TreatAsPeriodic = 0x2000000, // 25 Makes the spell appear as periodic in client combat logs - used by spells that trigger another spell on each tick
|
||||||
CanProcWithTriggered = 0x4000000, // 26 Auras With This Attribute Can Proc From Triggered Spell Casts With TriggeredCanTriggerProc2 (67736 + 52999)
|
CanProcFromProcs = 0x4000000, // 26 Can Proc From Procs
|
||||||
DrainSoul = 0x8000000, // 27 Only Drain Soul Has This Flag
|
DrainSoul = 0x8000000, // 27 Only Drain Soul Has This Flag
|
||||||
Unk28 = 0x10000000, // 28
|
Unk28 = 0x10000000, // 28
|
||||||
NoDoneBonus = 0x20000000, // 29 Ignore Caster Spellpower And Done Damage Mods? Client Doesn'T Apply Spellmods For Those Spells
|
NoDoneBonus = 0x20000000, // 29 Ignore Caster Spellpower And Done Damage Mods? Client Doesn'T Apply Spellmods For Those Spells
|
||||||
|
|||||||
@@ -1709,8 +1709,8 @@ namespace Game.Spells
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// check if aura can proc when spell is triggered (exception for hunter auto shot & wands)
|
// check if aura can proc when spell is triggered (exception for hunter auto shot & wands)
|
||||||
if (spell.IsTriggered() && !procEntry.AttributesMask.HasAnyFlag(ProcAttributes.TriggeredCanProc) && !eventInfo.GetTypeMask().HasFlag(ProcFlags.AutoAttackMask))
|
if (!GetSpellInfo().HasAttribute(SpellAttr3.CanProcFromProcs) && !procEntry.AttributesMask.HasFlag(ProcAttributes.TriggeredCanProc) && !eventInfo.GetTypeMask().HasFlag(ProcFlags.AutoAttackMask))
|
||||||
if (!GetSpellInfo().HasAttribute(SpellAttr3.CanProcWithTriggered))
|
if (spell.IsTriggered() && !spell.GetSpellInfo().HasAttribute(SpellAttr3.NotAProc))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -487,22 +487,6 @@ namespace Game.Entities
|
|||||||
if (eventInfo.GetTypeMask().HasAnyFlag(ProcFlags.Killed | ProcFlags.Kill | ProcFlags.Death))
|
if (eventInfo.GetTypeMask().HasAnyFlag(ProcFlags.Killed | ProcFlags.Kill | ProcFlags.Death))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Do not consider autoattacks as triggered spells
|
|
||||||
if (!procEntry.AttributesMask.HasAnyFlag(ProcAttributes.TriggeredCanProc) && !eventInfo.GetTypeMask().HasFlag(ProcFlags.AutoAttackMask))
|
|
||||||
{
|
|
||||||
Spell spell = eventInfo.GetProcSpell();
|
|
||||||
if (spell)
|
|
||||||
{
|
|
||||||
if (spell.IsTriggered())
|
|
||||||
{
|
|
||||||
SpellInfo spellInfo = spell.GetSpellInfo();
|
|
||||||
if (!spellInfo.HasAttribute(SpellAttr3.TriggeredCanTriggerProc2) &&
|
|
||||||
!spellInfo.HasAttribute(SpellAttr2.TriggeredCanTriggerProc))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// check school mask (if set) for other trigger types
|
// check school mask (if set) for other trigger types
|
||||||
if (procEntry.SchoolMask != 0 && !Convert.ToBoolean(eventInfo.GetSchoolMask() & procEntry.SchoolMask))
|
if (procEntry.SchoolMask != 0 && !Convert.ToBoolean(eventInfo.GetSchoolMask() & procEntry.SchoolMask))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user