aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp56
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp31
2 files changed, 87 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 1f23d0a4d7a..b54cc3cdf55 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3335,6 +3335,61 @@ class spell_gen_increase_stats_buff : public SpellScriptLoader
}
};
+enum Replenishment
+{
+ SPELL_REPLENISHMENT = 57669,
+ SPELL_INFINITE_REPLENISHMENT = 61782
+};
+
+class spell_gen_replenishment : public SpellScriptLoader
+{
+ public:
+ spell_gen_replenishment() : SpellScriptLoader("spell_gen_replenishment") { }
+
+ class spell_gen_replenishment_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_replenishment_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_REPLENISHMENT) ||
+ !sSpellMgr->GetSpellInfo(SPELL_INFINITE_REPLENISHMENT))
+ return false;
+ return true;
+ }
+
+ bool Load()
+ {
+ return GetUnitOwner()->GetPower(POWER_MANA);
+ }
+
+ void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ switch (GetSpellInfo()->Id)
+ {
+ case SPELL_REPLENISHMENT:
+ amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f;
+ break;
+ case SPELL_INFINITE_REPLENISHMENT:
+ amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f;
+ break;
+ default:
+ break;
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_replenishment_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_ENERGIZE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_replenishment_AuraScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -3418,4 +3473,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_increase_stats_buff("spell_pri_shadow_protection");
new spell_gen_increase_stats_buff("spell_mage_arcane_brilliance");
new spell_gen_increase_stats_buff("spell_mage_dalaran_brilliance");
+ new spell_gen_replenishment();
}
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index a73af6892ca..e52034ed2d9 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -706,6 +706,36 @@ class spell_hun_tame_beast : public SpellScriptLoader
}
};
+class spell_hun_furious_howl : public SpellScriptLoader
+{
+ public:
+ spell_hun_furious_howl() : SpellScriptLoader("spell_hun_furious_howl") { }
+
+ class spell_hun_furious_howl_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_hun_furious_howl_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ targets.clear();
+ targets.push_back(GetCaster());
+ if (Unit* owner = GetCaster()->GetOwner())
+ targets.push_back(owner);
+ }
+
+ void Register()
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hun_furious_howl_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hun_furious_howl_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_PARTY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_hun_furious_howl_SpellScript();
+ }
+};
+
void AddSC_hunter_spell_scripts()
{
new spell_hun_aspect_of_the_beast();
@@ -722,4 +752,5 @@ void AddSC_hunter_spell_scripts()
new spell_hun_misdirection_proc();
new spell_hun_disengage();
new spell_hun_tame_beast();
+ new spell_hun_furious_howl();
}