fix(Core/Unit): Remove delay for Conflagrate aura state (#18068)

Removes ConflagrateAuraStateDelayEvent

Cherry-picked from: e27c385b48

Co-authored-by: Ariel Silva <ariel-@users.noreply.github.com>
This commit is contained in:
Alethrion
2024-01-01 05:59:23 -05:00
committed by GitHub
parent 88beea55e0
commit b2fcc1babf
3 changed files with 18 additions and 40 deletions

View File

@@ -4468,19 +4468,12 @@ void Unit::_ApplyAura(AuraApplication* aurApp, uint8 effMask)
SpellInfo const* spellInfo = aura->GetSpellInfo();
if (AuraStateType aState = spellInfo->GetAuraState())
{
if (aState != AURA_STATE_CONFLAGRATE)
{
// Sting (hunter's pet ability), Faerie Fire (druid versions)
if (aState == AURA_STATE_FAERIE_FIRE)
aurApp->GetTarget()->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
uint32 aStateMask = (1 << (aState - 1));
// force update so the new caster registers it
if ((aStateMask & PER_CASTER_AURA_STATE_MASK) && HasFlag(UNIT_FIELD_AURASTATE, aStateMask))
ForceValuesUpdateAtIndex(UNIT_FIELD_AURASTATE);
else
ModifyAuraState(aState, true);
}
else if (caster)
{
ConflagrateAuraStateDelayEvent* pEvent = new ConflagrateAuraStateDelayEvent(this, caster->GetGUID());
m_Events.AddEvent(pEvent, m_Events.CalculateTime(700)); // intended 700ms delay before allowing to cast conflagrate
}
}
if (aurApp->GetRemoveMode())
@@ -4575,9 +4568,19 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator& i, AuraRemoveMode removeMo
ToTotem()->setDeathState(DeathState::JustDied);
}
// Remove aurastates only if were not found
if (!auraStateFound)
ModifyAuraState(auraState, false);
// Remove aurastates only if needed and were not found
if (auraState)
{
if (!auraStateFound)
ModifyAuraState(auraState, false);
else
{
// update for casters, some shouldn't 'see' the aura state
uint32 aStateMask = (1 << (auraState - 1));
if ((aStateMask & PER_CASTER_AURA_STATE_MASK) != 0)
ForceValuesUpdateAtIndex(UNIT_FIELD_AURASTATE);
}
}
aura->HandleAuraSpecificMods(aurApp, caster, false, false);
@@ -20731,16 +20734,6 @@ int32 Unit::CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, Unit* c
return damage;
}
bool ConflagrateAuraStateDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
{
if (m_owner->IsInWorld())
if (m_owner->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x4, 0, 0, m_casterGUID) || // immolate
m_owner->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0, 0, 0x2, m_casterGUID)) // shadowflame
m_owner->ModifyAuraState(AURA_STATE_CONFLAGRATE, true);
return true;
}
void Unit::ExecuteDelayedUnitRelocationEvent()
{
this->RemoveFromNotify(NOTIFY_VISIBILITY_CHANGED);