mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Scripts/Spells: Implement evoker talent "Ruby Embers" (#30581)
This commit is contained in:
4
sql/updates/world/master/2025_01_13_04_world.sql
Normal file
4
sql/updates/world/master/2025_01_13_04_world.sql
Normal file
@@ -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');
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user