fix(Scripts/Spells): warlock demonic pact (#19386)
* add Demonic Pact Aura script https://github.com/TrinityCore/TrinityCore/commit/2ff855054f52bf2dcf81aa7a7da7bab7f8a99686#diff-ea612aafadff90005e88b243eb000369be9e5cb6f8dc85a008d31e42b156e0ec Co-authored-by: ariel- <ariel-@users.noreply.github.com> * spell_warlock aura:spell_warl_demonic_pact_aura * fixup! spell_warlock aura:spell_warl_demonic_pact_aura * remove not needed spell correction, flag is already set * subtract current proc bonus before calculating new bonus * also increase healing done * remove Demonic Pact handling in Unit * refactor indent, remove bonus from spell group effects e.g. totem of wrath * Revert "refactor indent, remove bonus from spell group effects e.g. totem of wrath" This reverts commit 104041172d34f542cc934e9f468407c36912cc7f. * refactor indent * manually set proc cooldown --------- Co-authored-by: ariel- <ariel-@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id` IN (53646, 54909);
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||||
|
(53646, 'spell_warl_demonic_pact_aura'),
|
||||||
|
(54909, 'spell_warl_demonic_pact_aura');
|
||||||
@@ -9692,30 +9692,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
|||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Demonic Pact
|
|
||||||
case 48090:
|
|
||||||
{
|
|
||||||
// Get talent aura from owner
|
|
||||||
if (IsPet())
|
|
||||||
if (Unit* owner = GetOwner())
|
|
||||||
{
|
|
||||||
if (HasSpellCooldown(trigger_spell_id))
|
|
||||||
return false;
|
|
||||||
AddSpellCooldown(trigger_spell_id, 0, cooldown);
|
|
||||||
|
|
||||||
if (AuraEffect* aurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 3220, 0))
|
|
||||||
{
|
|
||||||
int32 spellPower = owner->SpellBaseDamageBonusDone(SpellSchoolMask(SPELL_SCHOOL_MASK_MAGIC));
|
|
||||||
if (AuraEffect const* demonicAuraEffect = GetAuraEffect(trigger_spell_id, EFFECT_0))
|
|
||||||
spellPower -= demonicAuraEffect->GetAmount();
|
|
||||||
|
|
||||||
basepoints0 = int32((aurEff->GetAmount() * spellPower + 100.0f) / 100.0f);
|
|
||||||
CastCustomSpell(this, trigger_spell_id, &basepoints0, &basepoints0, nullptr, true, castItem, triggeredByAura);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 46916: // Slam! (Bloodsurge proc)
|
case 46916: // Slam! (Bloodsurge proc)
|
||||||
case 52437: // Sudden Death
|
case 52437: // Sudden Death
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4699,12 +4699,6 @@ void SpellMgr::LoadSpellInfoCorrections()
|
|||||||
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
|
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Demonic Pact
|
|
||||||
ApplySpellFix({ 48090 }, [](SpellInfo* spellInfo)
|
|
||||||
{
|
|
||||||
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Ancestral Awakening
|
// Ancestral Awakening
|
||||||
ApplySpellFix({ 52759 }, [](SpellInfo* spellInfo)
|
ApplySpellFix({ 52759 }, [](SpellInfo* spellInfo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,12 +65,14 @@ enum WarlockSpells
|
|||||||
SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC = 18371,
|
SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC = 18371,
|
||||||
SPELL_WARLOCK_EYE_OF_KILROGG_FLY = 58083,
|
SPELL_WARLOCK_EYE_OF_KILROGG_FLY = 58083,
|
||||||
SPELL_WARLOCK_PET_VOID_STAR_TALISMAN = 37386, // Void Star Talisman
|
SPELL_WARLOCK_PET_VOID_STAR_TALISMAN = 37386, // Void Star Talisman
|
||||||
|
SPELL_WARLOCK_DEMONIC_PACT_PROC = 48090,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum WarlockSpellIcons
|
enum WarlockSpellIcons
|
||||||
{
|
{
|
||||||
WARLOCK_ICON_ID_IMPROVED_LIFE_TAP = 208,
|
WARLOCK_ICON_ID_IMPROVED_LIFE_TAP = 208,
|
||||||
WARLOCK_ICON_ID_MANA_FEED = 1982
|
WARLOCK_ICON_ID_MANA_FEED = 1982,
|
||||||
|
WARLOCK_ICON_ID_DEMONIC_PACT = 3220
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_warl_eye_of_kilrogg : public AuraScript
|
class spell_warl_eye_of_kilrogg : public AuraScript
|
||||||
@@ -1321,6 +1323,54 @@ class spell_warl_glyph_of_voidwalker : public AuraScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 54909, 53646 - Demonic Pact
|
||||||
|
class spell_warl_demonic_pact_aura : public AuraScript
|
||||||
|
{
|
||||||
|
PrepareAuraScript(spell_warl_demonic_pact_aura);
|
||||||
|
|
||||||
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||||
|
{
|
||||||
|
return ValidateSpellInfo({ SPELL_WARLOCK_DEMONIC_PACT_PROC });
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AfterCheckProc(ProcEventInfo& eventInfo, bool isTriggeredAtSpellProcEvent)
|
||||||
|
{
|
||||||
|
return isTriggeredAtSpellProcEvent && eventInfo.GetActor() && eventInfo.GetActor()->IsPet();
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||||
|
{
|
||||||
|
PreventDefaultAction();
|
||||||
|
|
||||||
|
if (eventInfo.GetActor()->HasSpellCooldown(aurEff->GetId()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (Unit* owner = eventInfo.GetActor()->GetOwner())
|
||||||
|
{
|
||||||
|
int32 currentBonus = 0;
|
||||||
|
if (AuraEffect* demonicAurEff = owner->GetAuraEffect(SPELL_WARLOCK_DEMONIC_PACT_PROC, EFFECT_0))
|
||||||
|
{
|
||||||
|
currentBonus = demonicAurEff->GetAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AuraEffect* talentAurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_DEMONIC_PACT, EFFECT_0))
|
||||||
|
{
|
||||||
|
int32 spellDamageMinusBonus = owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_MAGIC) - currentBonus;
|
||||||
|
if (spellDamageMinusBonus < 0)
|
||||||
|
return;
|
||||||
|
int32 bp = int32((talentAurEff->GetAmount() / 100.0f) * spellDamageMinusBonus);
|
||||||
|
owner->CastCustomSpell((Unit*)nullptr, SPELL_WARLOCK_DEMONIC_PACT_PROC, &bp, &bp, 0, true, nullptr, talentAurEff);
|
||||||
|
eventInfo.GetActor()->AddSpellCooldown(aurEff->GetId(), 0, eventInfo.GetProcCooldown());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
OnEffectProc += AuraEffectProcFn(spell_warl_demonic_pact_aura::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void AddSC_warlock_spell_scripts()
|
void AddSC_warlock_spell_scripts()
|
||||||
{
|
{
|
||||||
RegisterSpellScript(spell_warl_eye_of_kilrogg);
|
RegisterSpellScript(spell_warl_eye_of_kilrogg);
|
||||||
@@ -1354,5 +1404,6 @@ void AddSC_warlock_spell_scripts()
|
|||||||
RegisterSpellScript(spell_warl_shadowburn);
|
RegisterSpellScript(spell_warl_shadowburn);
|
||||||
RegisterSpellScript(spell_warl_glyph_of_felguard);
|
RegisterSpellScript(spell_warl_glyph_of_felguard);
|
||||||
RegisterSpellScript(spell_warl_glyph_of_voidwalker);
|
RegisterSpellScript(spell_warl_glyph_of_voidwalker);
|
||||||
|
RegisterSpellScript(spell_warl_demonic_pact_aura);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user