Scripts/Spells: Implement Astral Communion talent with Celestial Alignment (#30135)

This commit is contained in:
Aqua Deus
2024-08-31 13:09:51 +02:00
committed by GitHub
parent cd10553da1
commit 5e2eb66f1e
2 changed files with 60 additions and 5 deletions

View File

@@ -0,0 +1,10 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_dru_astral_communion_celestial_alignment','spell_dru_celestial_alignment');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(102560, 'spell_dru_astral_communion_celestial_alignment'),
(194223, 'spell_dru_astral_communion_celestial_alignment'),
(383410, 'spell_dru_astral_communion_celestial_alignment'),
(390414, 'spell_dru_astral_communion_celestial_alignment'),
(102560, 'spell_dru_celestial_alignment'),
(194223, 'spell_dru_celestial_alignment'),
(383410, 'spell_dru_celestial_alignment'),
(390414, 'spell_dru_celestial_alignment');

View File

@@ -38,6 +38,8 @@ enum DruidSpells
{
SPELL_DRUID_ABUNDANCE = 207383,
SPELL_DRUID_ABUNDANCE_EFFECT = 207640,
SPELL_DRUID_ASTRAL_COMMUNION_ENERGIZE = 450599,
SPELL_DRUID_ASTRAL_COMMUNION_TALENT = 450598,
SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE = 394061,
SPELL_DRUID_BALANCE_T10_BONUS = 70718,
SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721,
@@ -172,6 +174,35 @@ class spell_dru_abundance : public AuraScript
}
};
// 102560 - Incarnation: Chosen of Elune
// 194223 - Celestial Alignment
// 383410 - Celestial Alignment
// 390414 - Incarnation: Chosen of Elune
class spell_dru_astral_communion_celestial_alignment : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_ASTRAL_COMMUNION_TALENT, SPELL_DRUID_ASTRAL_COMMUNION_ENERGIZE });
}
bool Load() override
{
return GetCaster()->HasAura(SPELL_DRUID_ASTRAL_COMMUNION_TALENT);
}
void Energize() const
{
GetCaster()->CastSpell(GetCaster(), SPELL_DRUID_ASTRAL_COMMUNION_ENERGIZE, CastSpellExtraArgs()
.SetTriggeringSpell(GetSpell())
.SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR));
}
void Register() override
{
AfterCast += SpellCastFn(spell_dru_astral_communion_celestial_alignment::Energize);
}
};
// 394058 - Astral Smolder
class spell_dru_astral_smolder : public AuraScript
{
@@ -356,7 +387,10 @@ class spell_dru_cat_form : public AuraScript
}
};
// 102560 - Incarnation: Chosen of Elune
// 194223 - Celestial Alignment
// 383410 - Celestial Alignment
// 390414 - Incarnation: Chosen of Elune
class spell_dru_celestial_alignment : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
@@ -366,11 +400,11 @@ class spell_dru_celestial_alignment : public SpellScript
SPELL_DRUID_ECLIPSE_SOLAR_AURA,
SPELL_DRUID_ECLIPSE_LUNAR_AURA,
SPELL_DRUID_ECLIPSE_VISUAL_SOLAR,
SPELL_DRUID_ECLIPSE_VISUAL_LUNAR
SPELL_DRUID_ECLIPSE_VISUAL_LUNAR,
});
}
void TriggerEclipses(SpellEffIndex /*effIndex*/) const
void TriggerEclipses() const
{
Unit* caster = GetCaster();
CastSpellExtraArgs args;
@@ -385,7 +419,7 @@ class spell_dru_celestial_alignment : public SpellScript
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_dru_celestial_alignment::TriggerEclipses, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
AfterCast += SpellCastFn(spell_dru_celestial_alignment::TriggerEclipses);
}
};
@@ -512,8 +546,15 @@ class spell_dru_eclipse_dummy : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_ECLIPSE_SOLAR_SPELL_CNT, SPELL_DRUID_ECLIPSE_LUNAR_SPELL_CNT,
SPELL_DRUID_ECLIPSE_SOLAR_AURA, SPELL_DRUID_ECLIPSE_LUNAR_AURA });
return ValidateSpellInfo(
{
SPELL_DRUID_ECLIPSE_SOLAR_SPELL_CNT,
SPELL_DRUID_ECLIPSE_LUNAR_SPELL_CNT,
SPELL_DRUID_ECLIPSE_SOLAR_AURA,
SPELL_DRUID_ECLIPSE_LUNAR_AURA,
SPELL_DRUID_ASTRAL_COMMUNION_TALENT,
SPELL_DRUID_ASTRAL_COMMUNION_ENERGIZE
});
}
void HandleProc(ProcEventInfo& eventInfo)
@@ -570,6 +611,9 @@ private:
// cast eclipse
target->CastSpell(target, eclipseAuraSpellId, TRIGGERED_FULL_MASK);
if (target->HasAura(SPELL_DRUID_ASTRAL_COMMUNION_TALENT))
target->CastSpell(target, SPELL_DRUID_ASTRAL_COMMUNION_ENERGIZE, true);
// Remove stacks from other one as well
// reset remaining power on other spellId
target->RemoveAura(cntSpellId);
@@ -2221,6 +2265,7 @@ class spell_dru_yseras_gift_group_heal : public SpellScript
void AddSC_druid_spell_scripts()
{
RegisterSpellScript(spell_dru_abundance);
RegisterSpellScript(spell_dru_astral_communion_celestial_alignment);
RegisterSpellScript(spell_dru_astral_smolder);
RegisterSpellScript(spell_dru_barkskin);
RegisterSpellScript(spell_dru_berserk);