diff options
author | aquadeus <95978183+aquadeus@users.noreply.github.com> | 2021-12-26 20:13:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-26 20:13:41 +0100 |
commit | fed9d73f667c0deed6ee201093ffe43746a178f0 (patch) | |
tree | f5044e2ab49f91cf906b06a7603390b4480b1ff9 | |
parent | b821a729733db0d3742b4aefe05e5a8305724f66 (diff) |
Scripts/Spells Fix shaman talent Aftershock (#27469)
-rw-r--r-- | sql/updates/world/master/2021_12_26_01_world_shaman_aftershock.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 37 |
2 files changed, 40 insertions, 0 deletions
diff --git a/sql/updates/world/master/2021_12_26_01_world_shaman_aftershock.sql b/sql/updates/world/master/2021_12_26_01_world_shaman_aftershock.sql new file mode 100644 index 00000000000..119d1b0e52f --- /dev/null +++ b/sql/updates/world/master/2021_12_26_01_world_shaman_aftershock.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sha_aftershock'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(273221, 'spell_sha_aftershock'); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 2f3b7a143d4..7be24d5aea3 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -36,6 +36,7 @@ enum ShamanSpells { + SPELL_SHAMAN_AFTERSHOCK_ENERGIZE = 210712, SPELL_SHAMAN_ANCESTRAL_GUIDANCE = 108281, SPELL_SHAMAN_ANCESTRAL_GUIDANCE_HEAL = 114911, SPELL_SHAMAN_CHAIN_LIGHTNING_ENERGIZE = 195897, @@ -99,6 +100,41 @@ enum MiscNpcs NPC_HEALING_RAIN_INVISIBLE_STALKER = 73400, }; +// 273221 - Aftershock +class spell_sha_aftershock : public AuraScript +{ + PrepareAuraScript(spell_sha_aftershock); + + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo({ SPELL_SHAMAN_AFTERSHOCK_ENERGIZE }); + } + + bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + if (Spell const* procSpell = eventInfo.GetProcSpell()) + if (Optional<int32> cost = procSpell->GetPowerTypeCostAmount(POWER_MAELSTROM)) + return cost > 0 && roll_chance_i(aurEff->GetAmount()); + + return false; + } + + void HandleEffectProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo) + { + Spell const* procSpell = eventInfo.GetProcSpell(); + int32 energize = *procSpell->GetPowerTypeCostAmount(POWER_MAELSTROM); + + eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_SHAMAN_AFTERSHOCK_ENERGIZE, CastSpellExtraArgs(energize) + .AddSpellMod(SPELLVALUE_BASE_POINT0, energize)); + } + + void Register() override + { + DoCheckEffectProc += AuraCheckEffectProcFn(spell_sha_aftershock::CheckProc, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectProc += AuraEffectProcFn(spell_sha_aftershock::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } +}; + // 108281 - Ancestral Guidance class spell_sha_ancestral_guidance : public AuraScript { @@ -1284,6 +1320,7 @@ private: void AddSC_shaman_spell_scripts() { + RegisterAuraScript(spell_sha_aftershock); RegisterAuraScript(spell_sha_ancestral_guidance); RegisterSpellScript(spell_sha_ancestral_guidance_heal); RegisterSpellScript(spell_sha_bloodlust); |