mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
fix (Core/Unit) Apply Capacitor cooldown on trigger proc instead of on stack add (#18189)
fix capacitor cooldown
This commit is contained in:
@@ -9253,20 +9253,23 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cooldown && GetTypeId() == TYPEID_PLAYER)
|
if (cooldown && ToPlayer()->HasSpellCooldown(stack_spell_id))
|
||||||
{
|
{
|
||||||
if (ToPlayer()->HasSpellCooldown(stack_spell_id))
|
return false;
|
||||||
return false;
|
|
||||||
|
|
||||||
ToPlayer()->AddSpellCooldown(stack_spell_id, 0, cooldown);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CastSpell(this, stack_spell_id, true, nullptr, triggeredByAura);
|
CastSpell(this, stack_spell_id, true, nullptr, triggeredByAura);
|
||||||
|
|
||||||
Aura* dummy = GetAura(stack_spell_id);
|
Aura* dummy = GetAura(stack_spell_id);
|
||||||
if (!dummy || dummy->GetStackAmount() < triggerAmount)
|
if (!dummy || dummy->GetStackAmount() < triggerAmount)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cooldown)
|
||||||
|
{
|
||||||
|
ToPlayer()->AddSpellCooldown(stack_spell_id, 0, cooldown);
|
||||||
|
}
|
||||||
RemoveAurasDueToSpell(stack_spell_id);
|
RemoveAurasDueToSpell(stack_spell_id);
|
||||||
CastSpell(victim, trigger_spell_id, true, nullptr, triggeredByAura);
|
CastSpell(victim, trigger_spell_id, true, nullptr, triggeredByAura);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user