diff options
author | Kito <kito@vortexirc.com> | 2016-10-22 12:11:42 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2016-10-22 12:11:42 +0200 |
commit | c4a54c639b7cf657094f034de3d7d9c96bec7cc7 (patch) | |
tree | d8ead338963deda751a28668b1f2b4d1584159bb /src | |
parent | 3fedeb1c9d6b2b218f46774991bd8e841477ad1a (diff) |
Core/Spells: Fix Shaman talent Ancestral Guidance and Path of Flames
Closes #17695
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 181 |
1 files changed, 181 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 470272d5da5..3b900cd66de 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -32,6 +32,8 @@ enum ShamanSpells { + SPELL_SHAMAN_ANCESTRAL_GUIDANCE = 108281, + SPELL_SHAMAN_ANCESTRAL_GUIDANCE_HEAL = 114911, SPELL_SHAMAN_EARTH_SHIELD_HEAL = 379, SPELL_SHAMAN_EARTH_SHOCK = 8042, SPELL_SHAMAN_EARTHEN_RAGE_PASSIVE = 170374, @@ -47,6 +49,7 @@ enum ShamanSpells SPELL_SHAMAN_EXHAUSTION = 57723, SPELL_SHAMAN_FIRE_NOVA_TRIGGERED = 8349, SPELL_SHAMAN_FLAME_SHOCK = 8050, + SPELL_SHAMAN_FLAME_SHOCK_MAELSTROM = 188389, SPELL_SHAMAN_FLAMETONGUE_ATTACK = 10444, SPELL_SHAMAN_FULMINATION = 88767, SPELL_SHAMAN_FULMINATION_UI_INDICATOR = 95774, @@ -70,6 +73,8 @@ enum ShamanSpells SPELL_SHAMAN_LAVA_SURGE = 77762, SPELL_SHAMAN_LIGHTNING_SHIELD = 324, SPELL_SHAMAN_NATURE_GUARDIAN = 31616, + SPELL_SHAMAN_PATH_OF_FLAMES_SPREAD = 210621, + SPELL_SHAMAN_PATH_OF_FLAMES_TALENT = 201909, SPELL_SHAMAN_RIPTIDE = 61295, SPELL_SHAMAN_RUSHING_STREAMS = 147074, SPELL_SHAMAN_SATED = 57724, @@ -85,6 +90,85 @@ enum MiscSpells SPELL_PET_NETHERWINDS_FATIGUED = 160455 }; +// 108281 - Ancestral Guidance +class spell_sha_ancestral_guidance : public SpellScriptLoader +{ +public: + spell_sha_ancestral_guidance() : SpellScriptLoader("spell_sha_ancestral_guidance") { } + + class spell_sha_ancestral_guidance_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_ancestral_guidance_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ANCESTRAL_GUIDANCE_HEAL)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetHealInfo()->GetSpellInfo()->Id == SPELL_SHAMAN_ANCESTRAL_GUIDANCE_HEAL) + return false; + return true; + } + + void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 bp0 = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); + if (bp0) + eventInfo.GetActor()->CastCustomSpell(SPELL_SHAMAN_ANCESTRAL_GUIDANCE_HEAL, SPELLVALUE_BASE_POINT0, bp0, eventInfo.GetActor(), true, NULL, aurEff); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_sha_ancestral_guidance_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_sha_ancestral_guidance_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_ancestral_guidance_AuraScript(); + } +}; + +// 114911 - Ancestral Guidance Heal +class spell_sha_ancestral_guidance_heal : public SpellScriptLoader +{ +public: + spell_sha_ancestral_guidance_heal() : SpellScriptLoader("spell_sha_ancestral_guidance_heal") { } + + class spell_sha_ancestral_guidance_heal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_ancestral_guidance_heal_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ANCESTRAL_GUIDANCE)) + return false; + return true; + } + + void ResizeTargets(std::list<WorldObject*>& targets) + { + Trinity::Containers::RandomResizeList(targets, 3); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_ancestral_guidance_heal_SpellScript::ResizeTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_sha_ancestral_guidance_heal_SpellScript(); + } +}; + // 2825 - Bloodlust class spell_sha_bloodlust : public SpellScriptLoader { @@ -947,6 +1031,45 @@ public: } }; +// 51505 - Lava burst +class spell_sha_lava_burst : public SpellScriptLoader +{ +public: + spell_sha_lava_burst() : SpellScriptLoader("spell_sha_lava_burst") { } + + class spell_sha_lava_burst_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_lava_burst_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_PATH_OF_FLAMES_TALENT)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_PATH_OF_FLAMES_SPREAD)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (Unit* target = GetExplTargetUnit()) + if (caster->HasAura(SPELL_SHAMAN_PATH_OF_FLAMES_TALENT)) + caster->CastSpell(target, SPELL_SHAMAN_PATH_OF_FLAMES_SPREAD, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_sha_lava_burst_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_sha_lava_burst_SpellScript(); + } +}; + // 60103 - Lava Lash class spell_sha_lava_lash : public SpellScriptLoader { @@ -1185,6 +1308,60 @@ class spell_sha_nature_guardian : public SpellScriptLoader } }; +// 210621 - Path of Flames Spread +class spell_sha_path_of_flames_spread : public SpellScriptLoader +{ +public: + spell_sha_path_of_flames_spread() : SpellScriptLoader("spell_sha_path_of_flames_spread") { } + + class spell_sha_path_of_flames_spread_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_path_of_flames_spread_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FLAME_SHOCK_MAELSTROM)) + return false; + return true; + } + + void FilterTargets(std::list<WorldObject*>& targets) + { + targets.remove(GetExplTargetUnit()); + Trinity::Containers::RandomResizeList(targets, [this](WorldObject* target) + { + return target->GetTypeId() == TYPEID_UNIT && !target->ToUnit()->HasAura(SPELL_SHAMAN_FLAME_SHOCK_MAELSTROM, GetCaster()->GetGUID()); + }, 1); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* mainTarget = GetExplTargetUnit()) + { + if (Aura* flameShock = mainTarget->GetAura(SPELL_SHAMAN_FLAME_SHOCK_MAELSTROM, GetCaster()->GetGUID())) + { + if (Aura* newAura = GetCaster()->AddAura(SPELL_SHAMAN_FLAME_SHOCK_MAELSTROM, GetHitUnit())) + { + newAura->SetDuration(flameShock->GetDuration()); + newAura->SetMaxDuration(flameShock->GetDuration()); + } + } + } + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_path_of_flames_spread_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_sha_path_of_flames_spread_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_sha_path_of_flames_spread_SpellScript(); + } +}; + // 51490 - Thunderstorm class spell_sha_thunderstorm : public SpellScriptLoader { @@ -1291,6 +1468,8 @@ public: void AddSC_shaman_spell_scripts() { + new spell_sha_ancestral_guidance(); + new spell_sha_ancestral_guidance_heal(); new spell_sha_bloodlust(); new spell_sha_chain_heal(); new spell_sha_earth_shield(); @@ -1309,12 +1488,14 @@ void AddSC_shaman_spell_scripts() new spell_sha_item_mana_surge(); new spell_sha_item_t10_elemental_2p_bonus(); new spell_sha_item_t18_elemental_4p_bonus(); + new spell_sha_lava_burst(); new spell_sha_lava_lash(); new spell_sha_lava_lash_spread_flame_shock(); new spell_sha_lava_surge(); new spell_sha_lava_surge_proc(); new spell_sha_lightning_shield(); new spell_sha_nature_guardian(); + new spell_sha_path_of_flames_spread(); new spell_sha_thunderstorm(); new spell_sha_tidal_waves(); new spell_sha_windfury(); |