Scripts/Spells: Implement priest talent Light's Wrath

This commit is contained in:
Nyr
2023-08-04 15:24:19 +02:00
committed by Shauren
parent f5c65c3551
commit 07a03dd730
2 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_pri_lights_wrath');
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(373178, 'spell_pri_lights_wrath');

View File

@@ -106,6 +106,7 @@ enum PriestSpells
SPELL_PRIEST_LEAP_OF_FAITH_EFFECT = 92832,
SPELL_PRIEST_LEVITATE_EFFECT = 111759,
SPELL_PRIEST_LIGHT_ERUPTION = 196812,
SPELL_PRIEST_LIGHTS_WRATH_VISUAL = 215795,
SPELL_PRIEST_MASOCHISM_TALENT = 193063,
SPELL_PRIEST_MASOCHISM_PERIODIC_HEAL = 193065,
SPELL_PRIEST_MASTERY_GRACE = 271534,
@@ -387,6 +388,11 @@ public:
UpdateSinsOfTheManyValue();
}
std::vector<ObjectGuid> const& GetAtonementTargets() const
{
return _appliedAtonements;
}
void TriggerAtonementHealOnTargets(AuraEffect const* atonementEffect, ProcEventInfo const& eventInfo)
{
Unit* priest = GetUnitOwner();
@@ -1267,6 +1273,50 @@ class spell_pri_levitate : public SpellScript
}
};
// 373178 - Light's Wrath
class spell_pri_lights_wrath : public SpellScript
{
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
}
void OnPrecast() override
{
Aura const* atonement = GetCaster()->GetAura(SPELL_PRIEST_ATONEMENT);
if (!atonement)
return;
spell_pri_atonement const* script = atonement->GetScript<spell_pri_atonement>();
if (!script)
return;
for (ObjectGuid const& atonementTarget : script->GetAtonementTargets())
{
if (Unit* target = ObjectAccessor::GetUnit(*GetCaster(), atonementTarget))
{
target->CastSpell(GetCaster(), SPELL_PRIEST_LIGHTS_WRATH_VISUAL, TRIGGERED_IGNORE_CAST_IN_PROGRESS);
}
}
}
void CalculateDamageBonus(Unit const* /*victim*/, int32 const& /*damage*/, int32 const& /*flatMod*/, float& pctMod) const
{
Aura const* atonement = GetCaster()->GetAura(SPELL_PRIEST_ATONEMENT);
if (!atonement)
return;
// Atonement size may have changed when missile hits, we need to take an updated count of Atonement applications.
if (spell_pri_atonement const* script = atonement->GetScript<spell_pri_atonement>())
AddPct(pctMod, GetEffectInfo(EFFECT_1).CalcValue(GetCaster()) * script->GetAtonementTargets().size());
}
void Register() override
{
CalcDamage += SpellCalcDamageFn(spell_pri_lights_wrath::CalculateDamageBonus);
}
};
// 205369 - Mind Bomb
class spell_pri_mind_bomb : public AuraScript
{
@@ -2592,6 +2642,7 @@ void AddSC_priest_spell_scripts()
RegisterSpellScript(spell_pri_item_t6_trinket);
RegisterSpellScript(spell_pri_leap_of_faith_effect_trigger);
RegisterSpellScript(spell_pri_levitate);
RegisterSpellScript(spell_pri_lights_wrath);
RegisterSpellScript(spell_pri_mind_bomb);
RegisterSpellScript(spell_pri_painful_punishment);
RegisterSpellScriptWithArgs(spell_pri_penance, "spell_pri_penance", SPELL_PRIEST_PENANCE_CHANNEL_DAMAGE, SPELL_PRIEST_PENANCE_CHANNEL_HEALING);