Core/Spell: reimplemented TRIGGERED_DISALLOW_PROC_EVENTS trigger flag
This commit is contained in:
@@ -1171,6 +1171,7 @@ namespace Framework.Constants
|
||||
IgnoreSetFacing = 0x200, //! Will Not Adjust Facing To Target (If Any)
|
||||
IgnoreShapeshift = 0x400, //! Will Ignore Shapeshift Checks
|
||||
IgnoreCasterAurastate = 0x800, //! Will Ignore Caster Aura States Including Combat Requirements And Death State
|
||||
DisallowProcEvents = 0x1000, //! Disallows proc events from triggered spell (default)
|
||||
IgnoreCasterMountedOrOnVehicle = 0x2000, //! Will Ignore Mounted/On Vehicle Restrictions
|
||||
IgnoreCasterAuras = 0x10000, //! Will Ignore Caster Aura Restrictions Or Requirements
|
||||
DontResetPeriodicTimer = 0x20000, //! Will allow periodic aura timers to keep ticking (instead of resetting)
|
||||
|
||||
@@ -1893,6 +1893,11 @@ namespace Game.Entities
|
||||
|
||||
void TriggerAurasProcOnEvent(ProcEventInfo eventInfo, List<Tuple<uint, AuraApplication>> aurasTriggeringProc)
|
||||
{
|
||||
Spell triggeringSpell = eventInfo.GetProcSpell();
|
||||
bool disableProcs = triggeringSpell && triggeringSpell.IsProcDisabled();
|
||||
if (disableProcs)
|
||||
SetCantProc(true);
|
||||
|
||||
foreach (var aurAppProc in aurasTriggeringProc)
|
||||
{
|
||||
AuraApplication aurApp = aurAppProc.Item2;
|
||||
@@ -1910,6 +1915,9 @@ namespace Game.Entities
|
||||
if (spellInfo.HasAttribute(SpellAttr3.DisableProc))
|
||||
SetCantProc(false);
|
||||
}
|
||||
|
||||
if (disableProcs)
|
||||
SetCantProc(false);
|
||||
}
|
||||
|
||||
void SetCantProc(bool apply)
|
||||
|
||||
@@ -7125,6 +7125,7 @@ namespace Game.Spells
|
||||
|
||||
public bool IsTriggered() { return _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.FullMask); }
|
||||
public bool IsIgnoringCooldowns() { return _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.IgnoreSpellAndCategoryCD); }
|
||||
public bool IsProcDisabled() { return _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.DisallowProcEvents); }
|
||||
public bool IsChannelActive() { return m_caster.GetChannelSpellId() != 0; }
|
||||
|
||||
public bool IsDeletable()
|
||||
|
||||
@@ -1274,9 +1274,14 @@ namespace Game.Entities
|
||||
if (spellInfo == null)
|
||||
continue;
|
||||
|
||||
// Data already present in DB, overwrites default proc
|
||||
if (mSpellProcMap.ContainsKey(spellInfo.Id))
|
||||
continue;
|
||||
|
||||
// Nothing to do if no flags set
|
||||
if (spellInfo.ProcFlags == 0)
|
||||
continue;
|
||||
|
||||
bool addTriggerFlag = false;
|
||||
ProcFlagsSpellType procSpellTypeMask = ProcFlagsSpellType.None;
|
||||
foreach (SpellEffectInfo effect in spellInfo.GetEffectsForDifficulty(Difficulty.None))
|
||||
@@ -1294,15 +1299,27 @@ namespace Game.Entities
|
||||
procSpellTypeMask |= getSpellTypeMask(auraName);
|
||||
if (isAlwaysTriggeredAura(auraName))
|
||||
addTriggerFlag = true;
|
||||
|
||||
// many proc auras with taken procFlag mask don't have attribute "can proc with triggered"
|
||||
// they should proc nevertheless (example mage armor spells with judgement)
|
||||
if (!addTriggerFlag && spellInfo.ProcFlags.HasAnyFlag(ProcFlags.TakenHitMask))
|
||||
{
|
||||
switch (auraName)
|
||||
{
|
||||
case AuraType.ProcTriggerSpell:
|
||||
case AuraType.ProcTriggerDamage:
|
||||
addTriggerFlag = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (procSpellTypeMask == 0)
|
||||
continue;
|
||||
|
||||
if (spellInfo.ProcFlags == 0)
|
||||
continue;
|
||||
|
||||
SpellProcEntry procEntry = new SpellProcEntry();
|
||||
procEntry.SchoolMask = 0;
|
||||
procEntry.ProcFlags = spellInfo.ProcFlags;
|
||||
|
||||
Reference in New Issue
Block a user