diff options
author | aquadeus <95978183+aquadeus@users.noreply.github.com> | 2021-12-25 22:15:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-25 22:15:11 +0100 |
commit | 47d8b17e9f6766ade424027d4cdaf46eb0beb488 (patch) | |
tree | 7040a5e1edba98ecd4b7df6e7817704dca3ee2c5 /src | |
parent | c95b1784dfb164b2844658c7a80a34586a7cb8fc (diff) |
Scripts/Spells: Fix chain lightning energize (elemental) (#27468)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 3b680dec910..1dca1e9e0fa 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -38,6 +38,7 @@ enum ShamanSpells { SPELL_SHAMAN_ANCESTRAL_GUIDANCE = 108281, SPELL_SHAMAN_ANCESTRAL_GUIDANCE_HEAL = 114911, + SPELL_SHAMAN_CHAIN_LIGHTNING_ENERGIZE = 195897, SPELL_SHAMAN_CHAINED_HEAL = 70809, SPELL_SHAMAN_CRASH_LIGHTNING_CLEAVE = 187878, SPELL_SHAMAN_EARTH_SHIELD_HEAL = 204290, @@ -186,6 +187,30 @@ class spell_sha_bloodlust : public SpellScript } }; +// 188443 - Chain lightning +class spell_sha_chain_lightning : public SpellScript +{ + PrepareSpellScript(spell_sha_chain_lightning); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SHAMAN_CHAIN_LIGHTNING_ENERGIZE, SPELL_SHAMAN_MAELSTROM_CONTROLLER }) + && sSpellMgr->AssertSpellInfo(SPELL_SHAMAN_MAELSTROM_CONTROLLER, DIFFICULTY_NONE)->GetEffects().size() > EFFECT_4; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (AuraEffect const* energizeAmount = GetCaster()->GetAuraEffect(SPELL_SHAMAN_MAELSTROM_CONTROLLER, EFFECT_4)) + GetCaster()->CastSpell(GetCaster(), SPELL_SHAMAN_CHAIN_LIGHTNING_ENERGIZE, CastSpellExtraArgs(energizeAmount) + .AddSpellMod(SPELLVALUE_BASE_POINT0, energizeAmount->GetAmount() * GetUnitTargetCountForEffect(EFFECT_0))); + } + + void Register() override + { + OnEffectLaunch += SpellEffectFn(spell_sha_chain_lightning::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } +}; + // 187874 - Crash Lightning class spell_sha_crash_lightning : public SpellScript { @@ -1194,6 +1219,7 @@ void AddSC_shaman_spell_scripts() RegisterAuraScript(spell_sha_ancestral_guidance); RegisterSpellScript(spell_sha_ancestral_guidance_heal); RegisterSpellScript(spell_sha_bloodlust); + RegisterSpellScript(spell_sha_chain_lightning); RegisterSpellScript(spell_sha_crash_lightning); RegisterAuraScript(spell_sha_earth_shield); RegisterAuraScript(spell_sha_earthen_rage_passive); |