mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-16 14:05:28 +00:00
fix(Core/Spells): Port SPELL_ATTR3_INSTANT_TARGET_PROCS cascade proc suppression from TrinityCore (#24936)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: QAston <126822+QAston@users.noreply.github.com>
This commit is contained in:
@@ -492,6 +492,40 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Cascade Proc Suppression - simulates Unit.cpp TriggerAurasProcOnEvent
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* @brief Configuration for simulating cascade proc suppression
|
||||
*
|
||||
* Models the two paths in TriggerAurasProcOnEvent that call SetCantProc():
|
||||
* 1. Outer check: triggering spell has TRIGGERED_DISALLOW_PROC_EVENTS
|
||||
* 2. Per-aura check: aura has SPELL_ATTR3_INSTANT_TARGET_PROCS (0x80000)
|
||||
*/
|
||||
struct CascadeProcConfig
|
||||
{
|
||||
bool triggeringSpellIsProcDisabled = false; // Spell::IsProcDisabled()
|
||||
bool auraHasDisableProcAttr = false; // SpellInfo::HasAttribute(SPELL_ATTR3_INSTANT_TARGET_PROCS)
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Returns true if cascading procs should be suppressed for this aura
|
||||
*
|
||||
* @param config Cascade proc configuration
|
||||
* @return true if SetCantProc(true) would be active during this aura's proc
|
||||
*/
|
||||
static bool ShouldSuppressCascadingProc(CascadeProcConfig const& config)
|
||||
{
|
||||
// Outer check: triggering spell disables all cascading procs
|
||||
if (config.triggeringSpellIsProcDisabled)
|
||||
return true;
|
||||
// Per-aura check: aura itself suppresses cascading
|
||||
if (config.auraHasDisableProcAttr)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Conditions System - simulates SpellAuras.cpp:2232-2236
|
||||
// =============================================================================
|
||||
|
||||
@@ -96,6 +96,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
TestSpellEntryHelper& WithAttributesEx3(uint32 attr)
|
||||
{
|
||||
_entry.AttributesEx3 = attr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TestSpellEntryHelper& WithEffect(uint8 effIndex, uint32 effect, uint32 auraType = 0)
|
||||
{
|
||||
if (effIndex < MAX_SPELL_EFFECTS)
|
||||
@@ -183,6 +189,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
SpellInfoBuilder& WithAttributesEx3(uint32 attr)
|
||||
{
|
||||
_entryHelper.WithAttributesEx3(attr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
SpellInfoBuilder& WithEffect(uint8 effIndex, uint32 effect, uint32 auraType = 0)
|
||||
{
|
||||
_entryHelper.WithEffect(effIndex, effect, auraType);
|
||||
|
||||
Reference in New Issue
Block a user