diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-10-22 11:57:47 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-10-22 11:57:47 +0200 |
| commit | 3fedeb1c9d6b2b218f46774991bd8e841477ad1a (patch) | |
| tree | d5c140fd87ec38773ac2a13d22ad0b2c7d45ea2f /src/server/scripts/Spells | |
| parent | 189455d2fbfd6583bb08996b3f4b14eb3c928472 (diff) | |
Core/Spells: Fixed Shaman talent Path of Flames
Closes #17705
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index ad43ed92d3e..470272d5da5 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -34,6 +34,9 @@ enum ShamanSpells { SPELL_SHAMAN_EARTH_SHIELD_HEAL = 379, SPELL_SHAMAN_EARTH_SHOCK = 8042, + SPELL_SHAMAN_EARTHEN_RAGE_PASSIVE = 170374, + SPELL_SHAMAN_EARTHEN_RAGE_PERIODIC = 170377, + SPELL_SHAMAN_EARTHEN_RAGE_DAMAGE = 170379, SPELL_SHAMAN_ELEMENTAL_BLAST_CRIT = 118522, SPELL_SHAMAN_ELEMENTAL_BLAST_HASTE = 173183, SPELL_SHAMAN_ELEMENTAL_BLAST_MASTERY = 173184, @@ -266,6 +269,84 @@ class spell_sha_earth_shield : public SpellScriptLoader } }; +// 170374 - Earthen Rage (Passive) +class spell_sha_earthen_rage_passive : public SpellScriptLoader +{ +public: + spell_sha_earthen_rage_passive() : SpellScriptLoader("spell_sha_earthen_rage_passive") { } + + class spell_sha_earthen_rage_passive_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_earthen_rage_passive_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EARTHEN_RAGE_PERIODIC)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EARTHEN_RAGE_DAMAGE)) + return false; + return true; + } + + void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetAura()->SetCastExtraParam("procTargetGUID", eventInfo.GetProcTarget()->GetGUID()); + eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_SHAMAN_EARTHEN_RAGE_PERIODIC, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_sha_earthen_rage_passive_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_earthen_rage_passive_AuraScript(); + } +}; + +// 170377 - Earthen Rage (Proc Aura) +class spell_sha_earthen_rage_proc_aura : public SpellScriptLoader +{ +public: + spell_sha_earthen_rage_proc_aura() : SpellScriptLoader("spell_sha_earthen_rage_proc_aura") { } + + class spell_sha_earthen_rage_proc_aura_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_earthen_rage_proc_aura_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EARTHEN_RAGE_PASSIVE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EARTHEN_RAGE_DAMAGE)) + return false; + return true; + } + + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + if (Aura const* aura = GetCaster()->GetAura(SPELL_SHAMAN_EARTHEN_RAGE_PASSIVE)) + if (ObjectGuid const* procTargetGUID = aura->GetCastExtraParam<ObjectGuid>("procTargetGUID")) + if (Unit* procTarget = ObjectAccessor::GetUnit(*GetCaster(), *procTargetGUID)) + GetTarget()->CastSpell(procTarget, SPELL_SHAMAN_EARTHEN_RAGE_DAMAGE, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthen_rage_proc_aura_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_earthen_rage_proc_aura_AuraScript(); + } +}; + // 117014 - Elemental Blast class spell_sha_elemental_blast : public SpellScriptLoader { @@ -1213,6 +1294,8 @@ void AddSC_shaman_spell_scripts() new spell_sha_bloodlust(); new spell_sha_chain_heal(); new spell_sha_earth_shield(); + new spell_sha_earthen_rage_passive(); + new spell_sha_earthen_rage_proc_aura(); new spell_sha_elemental_blast(); new spell_sha_fire_nova(); new spell_sha_flametongue(); |
