aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2025-01-13 20:47:24 +0100
committerGitHub <noreply@github.com>2025-01-13 20:47:24 +0100
commit55dda32225a653d1ecdd44d88e8566f8dd2f4121 (patch)
tree27a98c336baca6e60d1ca4a9c187c878ed6b3204
parent7062aed40c61fcfe514dcb35e589f4be4b891cb1 (diff)
Scripts/Spells: Implement evoker talent "Firestorm" (#30579)
-rw-r--r--sql/updates/world/master/2025_01_13_05_world.sql7
-rw-r--r--src/server/scripts/Spells/spell_evoker.cpp34
2 files changed, 41 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_01_13_05_world.sql b/sql/updates/world/master/2025_01_13_05_world.sql
new file mode 100644
index 00000000000..9ed972b31e8
--- /dev/null
+++ b/sql/updates/world/master/2025_01_13_05_world.sql
@@ -0,0 +1,7 @@
+DELETE FROM `areatrigger_template` WHERE (`Id`=28714 AND `IsCustom`=0);
+INSERT INTO `areatrigger_template` (`Id`, `IsCustom`, `Flags`, `VerifiedBuild`) VALUES
+(28714, 0, 0, 58187);
+
+DELETE FROM `areatrigger_create_properties` WHERE (`Id`=24713 AND `IsCustom`=0);
+INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Flags`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `SpellForVisuals`, `TimeToTargetScale`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES
+(24713, 0, 28714, 0, 0, 0, 0, 0, 0, -1, 0, 0, NULL, 10000, 0, 10, 10, 0, 0, 0, 0, 0, 0, 'at_evo_firestorm', 58187); -- Spell: 369372 (Firestorm)
diff --git a/src/server/scripts/Spells/spell_evoker.cpp b/src/server/scripts/Spells/spell_evoker.cpp
index d13c551b88b..cd79566aa81 100644
--- a/src/server/scripts/Spells/spell_evoker.cpp
+++ b/src/server/scripts/Spells/spell_evoker.cpp
@@ -21,6 +21,8 @@
* Scriptnames of files in this file should be prefixed with "spell_evo_".
*/
+#include "AreaTrigger.h"
+#include "AreaTriggerAI.h"
#include "Containers.h"
#include "DB2Stores.h"
#include "Player.h"
@@ -30,6 +32,7 @@
#include "SpellHistory.h"
#include "SpellMgr.h"
#include "SpellScript.h"
+#include "TaskScheduler.h"
enum EvokerSpells
{
@@ -48,6 +51,7 @@ enum EvokerSpells
SPELL_EVOKER_BLESSING_OF_THE_BRONZE_WARLOCK = 381757,
SPELL_EVOKER_BLESSING_OF_THE_BRONZE_WARRIOR = 381758,
SPELL_EVOKER_ENERGIZING_FLAME = 400006,
+ SPELL_EVOKER_FIRESTORM_DAMAGE = 369374,
SPELL_EVOKER_FIRE_BREATH_DAMAGE = 357209,
SPELL_EVOKER_GLIDE_KNOCKBACK = 358736,
SPELL_EVOKER_HOVER = 358267,
@@ -220,6 +224,35 @@ class spell_evo_fire_breath_damage : public SpellScript
}
};
+// 369372 - Firestorm (Red)
+struct at_evo_firestorm : AreaTriggerAI
+{
+ using AreaTriggerAI::AreaTriggerAI;
+
+ void OnCreate(Spell const* /*creatingSpell*/) override
+ {
+ _scheduler.Schedule(0ms, [this](TaskContext task)
+ {
+ std::chrono::duration<float> period = 2s; // 2s, affected by haste
+ if (Unit* caster = at->GetCaster())
+ {
+ period *= *caster->m_unitData->ModCastingSpeed;
+ caster->CastSpell(at->GetPosition(), SPELL_EVOKER_FIRESTORM_DAMAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
+ }
+
+ task.Repeat(duration_cast<Milliseconds>(period));
+ });
+ }
+
+ void OnUpdate(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+ }
+
+private:
+ TaskScheduler _scheduler;
+};
+
// 358733 - Glide (Racial)
class spell_evo_glide : public SpellScript
{
@@ -460,6 +493,7 @@ void AddSC_evoker_spell_scripts()
RegisterSpellScript(spell_evo_azure_strike);
RegisterSpellScript(spell_evo_blessing_of_the_bronze);
RegisterSpellScript(spell_evo_charged_blast);
+ RegisterAreaTriggerAI(at_evo_firestorm);
RegisterSpellScript(spell_evo_fire_breath);
RegisterSpellScript(spell_evo_fire_breath_damage);
RegisterSpellScript(spell_evo_glide);