mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Spells: Implement mage talent Flame Patch (#31096)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user