diff --git a/data/sql/updates/pending_db_world/rev_1744421404317179000.sql b/data/sql/updates/pending_db_world/rev_1744421404317179000.sql new file mode 100644 index 000000000..18f266fbe --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1744421404317179000.sql @@ -0,0 +1,11 @@ +-- +UPDATE `creature_template` SET +`ScriptName` = 'npc_sunblade_arch_mage', +`AIName` = '' +WHERE `entry` = 25367; + +DELETE FROM `creature_template_spell` WHERE `CreatureID` = 25367 AND `Index` IN (0, 1, 2); +INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES +(25367, 0, 46553, 0), -- Arcane Explosion +(25367, 1, 28401, 0), -- Blink +(25367, 2, 46555, 0); -- Frost Nova diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp index cf8910dee..4d2154fab 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -282,10 +282,65 @@ private: uint32 _triggeredSpellId; }; +enum SunbladeArchMageSpells +{ + SPELL_ARCANE_EXPLOSION = 46553, + SPELL_BLINK = 28401, + SPELL_FROST_NOVA = 46555 +}; + +struct npc_sunblade_arch_mage : public ScriptedAI +{ + npc_sunblade_arch_mage(Creature* creature) : ScriptedAI(creature) + { + scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); + } + + void Reset() override + { + scheduler.CancelAll(); + } + + void JustEngagedWith(Unit* /*who*/) override + { + scheduler.Schedule(6s, 12s, [this](TaskContext context) + { + DoCastAOE(SPELL_ARCANE_EXPLOSION); + context.Repeat(12s, 18s); + }); + + scheduler.Schedule(8s, 15s, [this](TaskContext context) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true)) + { + DoCast(target, SPELL_BLINK, true); + DoCastAOE(SPELL_FROST_NOVA, true); + } + context.Repeat(20s, 25s); + }); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + scheduler.Update(diff); + DoMeleeAttackIfReady(); + } + +private: + TaskScheduler scheduler; +}; + void AddSC_instance_sunwell_plateau() { new instance_sunwell_plateau(); RegisterSpellScript(spell_cataclysm_breath); + RegisterSunwellPlateauCreatureAI(npc_sunblade_arch_mage); RegisterSunwellPlateauCreatureAI(npc_sunblade_scout); RegisterSpellScriptWithArgs(spell_sunwell_teleport, "spell_teleport_to_apex_point", SPELL_TELEPORT_TO_APEX_POINT); RegisterSpellScriptWithArgs(spell_sunwell_teleport, "spell_teleport_to_witchs_sanctum", SPELL_TELEPORT_TO_WITCHS_SANCTUM);