Scripts/Spells: Implement mage talent Flame Patch (#31096)

This commit is contained in:
Aqua Deus
2025-07-12 14:30:01 +02:00
committed by GitHub
parent d6882ce951
commit 601bcc35b2
3 changed files with 74 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
DELETE FROM `areatrigger_create_properties` WHERE (`IsCustom`=0 AND `Id` = 6122);
INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Flags`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `SpellForVisuals`, `TimeToTargetScale`, `Speed`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES
(6122, 0, 10801, 0, 0, 0, 0, 0, 0, -1, 0, 0, NULL, 8000, 0, 4, 8, 8, 4, 4, 0.300000011920928955, 0.300000011920928955, 0, 0, 'at_mage_flame_patch', 61559); -- Spell: 205470 (Flame Patch)
UPDATE `areatrigger_template` SET `VerifiedBuild`=61559 WHERE (`Id`=10801 AND `IsCustom`=0);
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_mage_flame_patch';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(2120, 'spell_mage_flame_patch');

View File

@@ -5414,6 +5414,12 @@ void SpellMgr::LoadSpellInfoTargetCaps()
spellInfo->_LoadSqrtTargetLimit(5, 0, 385059, EFFECT_5, {}, {});
});
// Flame Patch
ApplySpellFix({ 205472 }, [](SpellInfo* spellInfo)
{
spellInfo->_LoadSqrtTargetLimit(8, 0, {}, EFFECT_1, {}, {});
}
// Flamestrike
ApplySpellFix({ 2120 }, [](SpellInfo* spellInfo)
{

View File

@@ -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);