aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 23de0fdfab1..9efc0eb2591 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -58,6 +58,7 @@ enum DruidSpells
SPELL_DRUID_CULTIVATION = 200390,
SPELL_DRUID_CULTIVATION_HEAL = 200389,
SPELL_DRUID_CURIOUS_BRAMBLEPATCH = 330670,
+ SPELL_DRUID_DREAMSTATE = 450346,
SPELL_DRUID_EARTHWARDEN_AURA = 203975,
SPELL_DRUID_ECLIPSE_DUMMY = 79577,
SPELL_DRUID_ECLIPSE_LUNAR_AURA = 48518,
@@ -107,6 +108,7 @@ enum DruidSpells
SPELL_DRUID_MANGLE = 33917,
SPELL_DRUID_MASS_ENTANGLEMENT = 102359,
SPELL_DRUID_MOONFIRE_DAMAGE = 164812,
+ SPELL_DRUID_NATURES_GRACE_TALENT = 450347,
SPELL_DRUID_NEW_MOON = 274281,
SPELL_DRUID_NEW_MOON_OVERRIDE = 274295,
SPELL_DRUID_POWER_OF_THE_ARCHDRUID = 392302,
@@ -1341,6 +1343,61 @@ class spell_dru_moonfire : public SpellScript
}
};
+// 450347 - Nature's Grace
+class spell_dru_natures_grace : public AuraScript
+{
+public:
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ SPELL_DRUID_NATURES_GRACE_TALENT, SPELL_DRUID_DREAMSTATE })
+ && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
+ }
+
+ static void Trigger(Unit* caster, AuraEffect const* naturesGraceEffect)
+ {
+ caster->CastSpell(caster, SPELL_DRUID_DREAMSTATE, CastSpellExtraArgsInit{
+ .SpellValueOverrides = { { SPELLVALUE_AURA_STACK, naturesGraceEffect->GetAmount() } }
+ });
+
+ }
+
+ void OnOwnerInCombat(bool isNowInCombat) const
+ {
+ if (isNowInCombat)
+ Trigger(GetTarget(), GetEffect(EFFECT_2));
+ }
+
+ void Register() override
+ {
+ OnEnterLeaveCombat += AuraEnterLeaveCombatFn(spell_dru_natures_grace::OnOwnerInCombat);
+ }
+};
+
+// 48517 Eclipse (Solar) + 48518 Eclipse (Lunar)
+class spell_dru_natures_grace_eclipse : public AuraScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_DRUID_DREAMSTATE })
+ && ValidateSpellEffect({ { SPELL_DRUID_NATURES_GRACE_TALENT, EFFECT_2 } });
+ }
+
+ bool Load() override
+ {
+ return GetCaster()->HasAuraEffect(SPELL_DRUID_NATURES_GRACE_TALENT, EFFECT_2);
+ }
+
+ void HandleRemoved(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
+ {
+ spell_dru_natures_grace::Trigger(GetTarget(), GetTarget()->GetAuraEffect(SPELL_DRUID_NATURES_GRACE_TALENT, EFFECT_2));
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_natures_grace_eclipse::HandleRemoved, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
// 274283 - Full Moon
// 274282 - Half Moon
// 274281 - New Moon
@@ -2301,6 +2358,8 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_lunar_inspiration);
RegisterSpellScript(spell_dru_luxuriant_soil);
RegisterSpellScript(spell_dru_moonfire);
+ RegisterSpellScript(spell_dru_natures_grace);
+ RegisterSpellScript(spell_dru_natures_grace_eclipse);
RegisterSpellScriptWithArgs(spell_dru_new_moon, "spell_dru_full_moon", Optional<DruidSpells>(), Optional<DruidSpells>(SPELL_DRUID_HALF_MOON_OVERRIDE));
RegisterSpellScriptWithArgs(spell_dru_new_moon, "spell_dru_half_moon", Optional<DruidSpells>(SPELL_DRUID_HALF_MOON_OVERRIDE), Optional<DruidSpells>(SPELL_DRUID_NEW_MOON_OVERRIDE));
RegisterSpellScriptWithArgs(spell_dru_new_moon, "spell_dru_new_moon", Optional<DruidSpells>(SPELL_DRUID_NEW_MOON_OVERRIDE), Optional<DruidSpells>());