aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2025-01-13 19:09:51 +0100
committerGitHub <noreply@github.com>2025-01-13 19:09:51 +0100
commit7062aed40c61fcfe514dcb35e589f4be4b891cb1 (patch)
treef202fdffe0a20d4493c1932a826aa78715ba65ab
parent4f63d34021dfcaabb69f008800e250357e898869 (diff)
Scripts/Spells: Implement evoker talent "Ruby Embers" (#30581)
-rw-r--r--sql/updates/world/master/2025_01_13_04_world.sql4
-rw-r--r--src/server/scripts/Spells/spell_evoker.cpp35
2 files changed, 37 insertions, 2 deletions
diff --git a/sql/updates/world/master/2025_01_13_04_world.sql b/sql/updates/world/master/2025_01_13_04_world.sql
new file mode 100644
index 00000000000..511996b2de3
--- /dev/null
+++ b/sql/updates/world/master/2025_01_13_04_world.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_evo_ruby_embers';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(361500, 'spell_evo_ruby_embers'),
+(361509, 'spell_evo_ruby_embers');
diff --git a/src/server/scripts/Spells/spell_evoker.cpp b/src/server/scripts/Spells/spell_evoker.cpp
index cdd15b85dad..d13c551b88b 100644
--- a/src/server/scripts/Spells/spell_evoker.cpp
+++ b/src/server/scripts/Spells/spell_evoker.cpp
@@ -56,6 +56,7 @@ enum EvokerSpells
SPELL_EVOKER_LIVING_FLAME_HEAL = 361509,
SPELL_EVOKER_PERMEATING_CHILL_TALENT = 370897,
SPELL_EVOKER_PYRE_DAMAGE = 357212,
+ SPELL_EVOKER_RUBY_EMBERS = 365937,
SPELL_EVOKER_SCOURING_FLAME = 378438,
SPELL_EVOKER_SOAR_RACIAL = 369536,
SPELL_EVOKER_VERDANT_EMBRACE_HEAL = 361195,
@@ -268,7 +269,7 @@ class spell_evo_living_flame : public SpellScript
{
Unit* caster = GetCaster();
Unit* hitUnit = GetHitUnit();
- if (caster->IsFriendlyTo(hitUnit))
+ if (caster->IsValidAssistTarget(hitUnit))
caster->CastSpell(hitUnit, SPELL_EVOKER_LIVING_FLAME_HEAL, true);
else
caster->CastSpell(hitUnit, SPELL_EVOKER_LIVING_FLAME_DAMAGE, true);
@@ -277,7 +278,7 @@ class spell_evo_living_flame : public SpellScript
void HandleLaunchTarget(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
- if (caster->IsFriendlyTo(GetHitUnit()))
+ if (caster->IsValidAssistTarget(GetHitUnit()))
return;
if (AuraEffect* auraEffect = caster->GetAuraEffect(SPELL_EVOKER_ENERGIZING_FLAME, EFFECT_0))
@@ -344,6 +345,35 @@ class spell_evo_pyre : public SpellScript
}
};
+// 361500 Living Flame (Red)
+// 361509 Living Flame (Red)
+class spell_evo_ruby_embers : public SpellScript
+{
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ SPELL_EVOKER_RUBY_EMBERS })
+ && ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } })
+ && spellInfo->GetEffect(EFFECT_1).IsEffect(SPELL_EFFECT_APPLY_AURA)
+ && spellInfo->GetEffect(EFFECT_1).ApplyAuraPeriod != 0;
+ }
+
+ bool Load() override
+ {
+ return !GetCaster()->HasAura(SPELL_EVOKER_RUBY_EMBERS);
+ }
+
+ static void PreventPeriodic(WorldObject*& target)
+ {
+ target = nullptr;
+ }
+
+ void Register() override
+ {
+ OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_evo_ruby_embers::PreventPeriodic, EFFECT_1,
+ m_scriptSpellId == SPELL_EVOKER_LIVING_FLAME_DAMAGE ? TARGET_UNIT_TARGET_ENEMY : TARGET_UNIT_TARGET_ALLY);
+ }
+};
+
// 357209 Fire Breath (Red)
class spell_evo_scouring_flame : public SpellScript
{
@@ -436,6 +466,7 @@ void AddSC_evoker_spell_scripts()
RegisterSpellScript(spell_evo_living_flame);
RegisterSpellScript(spell_evo_permeating_chill);
RegisterSpellScript(spell_evo_pyre);
+ RegisterSpellScript(spell_evo_ruby_embers);
RegisterSpellScript(spell_evo_scouring_flame);
RegisterSpellScript(spell_evo_verdant_embrace);
RegisterSpellScript(spell_evo_verdant_embrace_trigger_heal);