diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-07-12 14:30:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-12 14:30:01 +0200 |
commit | 601bcc35b20143d1ae368ff2e7126d5320c1b3d5 (patch) | |
tree | de87a60cf17eac071c82b6a175c16b44249b5e7c /src/server/scripts | |
parent | d6882ce9515a83925d1c71fa606e3d8c62e0e088 (diff) |
Scripts/Spells: Implement mage talent Flame Patch (#31096)
Diffstat (limited to 'src/server/scripts')
-rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index c61bab59c8f..4540717fb28 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -32,6 +32,7 @@ #include "SpellHistory.h" #include "SpellMgr.h" #include "SpellScript.h" +#include "TaskScheduler.h" #include "TemporarySummon.h" enum MageSpells @@ -62,8 +63,11 @@ enum MageSpells SPELL_MAGE_FEEL_THE_BURN = 383391, SPELL_MAGE_FINGERS_OF_FROST = 44544, SPELL_MAGE_FIRE_BLAST = 108853, - SPELL_MAGE_FLURRY_DAMAGE = 228596, SPELL_MAGE_FIRESTARTER = 205026, + SPELL_MAGE_FLAME_PATCH_AREATRIGGER = 205470, + SPELL_MAGE_FLAME_PATCH_DAMAGE = 205472, + SPELL_MAGE_FLAME_PATCH_TALENT = 205037, + SPELL_MAGE_FLURRY_DAMAGE = 228596, SPELL_MAGE_FROST_NOVA = 122, SPELL_MAGE_GIRAFFE_FORM = 32816, SPELL_MAGE_ICE_BARRIER = 11426, @@ -778,6 +782,58 @@ class spell_mage_flame_on : public AuraScript } }; +// 205037 - Flame Patch (attached to 2120 - Flamestrike) +class spell_mage_flame_patch : public SpellScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MAGE_FLAME_PATCH_TALENT, SPELL_MAGE_FLAME_PATCH_AREATRIGGER }); + } + + bool Load() override + { + return GetCaster()->HasAura(SPELL_MAGE_FLAME_PATCH_TALENT); + } + + void HandleFlamePatch() const + { + GetCaster()->CastSpell(GetExplTargetDest()->GetPosition(), SPELL_MAGE_FLAME_PATCH_AREATRIGGER, CastSpellExtraArgsInit{ + .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR, + .TriggeringSpell = GetSpell() + }); + } + + void Register() override + { + AfterCast += SpellCastFn(spell_mage_flame_patch::HandleFlamePatch); + } +}; + +// 205470 - Flame Patch +// Id - 6122 +struct at_mage_flame_patch : public AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnCreate(Spell const* /*creatingSpell*/) override + { + _scheduler.Schedule(1s, [this](TaskContext task) + { + if (Unit* caster = at->GetCaster()) + caster->CastSpell(at->GetPosition(), SPELL_MAGE_FLAME_PATCH_DAMAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + task.Repeat(1s); + }); + } + + void OnUpdate(uint32 diff) override + { + _scheduler.Update(diff); + } + +private: + TaskScheduler _scheduler; +}; + // 44614 - Flurry class spell_mage_flurry : public SpellScript { @@ -1621,6 +1677,8 @@ void AddSC_mage_spell_scripts() RegisterSpellScript(spell_mage_firestarter); RegisterSpellScript(spell_mage_firestarter_dots); RegisterSpellScript(spell_mage_flame_on); + RegisterSpellScript(spell_mage_flame_patch); + RegisterAreaTriggerAI(at_mage_flame_patch); RegisterSpellScript(spell_mage_flurry); RegisterSpellScript(spell_mage_flurry_damage); RegisterSpellScript(spell_mage_frostbolt); |