Skip to content

Commit

Permalink
Spell: Only trigger cooldown if any aura procced and fix attributes f…
Browse files Browse the repository at this point in the history
…or failure
  • Loading branch information
killerwife committed Aug 28, 2024
1 parent 9fc834e commit 8397e7b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/game/Spells/UnitAuraProcHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,7 @@ void Unit::ProcDamageAndSpellFor(ProcSystemArguments& argData, bool isVictim)
case SPELL_AURA_PROC_CANT_TRIGGER:
continue;
case SPELL_AURA_PROC_FAILED:
// example - drain soul vanilla - third effect fails when not have talent but charge should drop
if (!triggeredByHolder->GetSpellProto()->HasAttribute(SPELL_ATTR_PROC_FAILURE_BURNS_CHARGE))
procSuccess = false;
procSuccess = false;
break;
case SPELL_AURA_PROC_OK:
if (execData.procOnce && execData.spell)
Expand All @@ -607,11 +605,12 @@ void Unit::ProcDamageAndSpellFor(ProcSystemArguments& argData, bool isVictim)
anyAuraProc = true;
}

if (procSuccess && execData.cooldown)
if ((procSuccess || triggeredByHolder->GetSpellProto()->HasAttribute(SPELL_ATTR_EX2_PROC_COOLDOWN_ON_FAILURE)) && anyAuraProc && execData.cooldown)
triggeredByHolder->SetProcCooldown(std::chrono::seconds(execData.cooldown), GetMap()->GetCurrentClockTime());

// Remove charge (aura can be removed by triggers)
if (useCharges && procSuccess && anyAuraProc && !triggeredByHolder->IsDeleted())
// Attribute example - drain soul vanilla - third effect fails when not have talent but charge should drop
if (useCharges && (procSuccess || triggeredByHolder->GetSpellProto()->HasAttribute(SPELL_ATTR_PROC_FAILURE_BURNS_CHARGE)) && anyAuraProc && !triggeredByHolder->IsDeleted())
{
// If last charge dropped add spell to remove list
if (triggeredByHolder->DropAuraCharge())
Expand Down

0 comments on commit 8397e7b

Please sign in to comment.