diff --git a/data/sql/updates/pending_db_world/rev_1662201901115078700.sql b/data/sql/updates/pending_db_world/rev_1662201901115078700.sql new file mode 100644 index 000000000..1ffa54b4b --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1662201901115078700.sql @@ -0,0 +1,3 @@ +-- +UPDATE `creature_template` SET `AiName`='', `ScriptName`='npc_anubisath_warder' WHERE `entry`=15311; +DELETE FROM `smart_scripts` WHERE `entryorguid`=15311 AND `source_type`=0; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp index bdabb840b..c11802783 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp @@ -38,6 +38,12 @@ enum Spells SPELL_SUMMON_WARRIOR = 17431, SPELL_SUMMON_SWARMGUARD = 17430, + SPELL_FEAR = 26070, + SPELL_ENTAGLING_ROOTS = 26071, + SPELL_SILENCE = 26069, + SPELL_DUST_CLOUD = 26072, + SPELL_FIRE_NOVA = 26073, + SPELL_SUMMON_LARGE_OBSIDIAN_CHUNK = 27630, // Server-side SPELL_SHOCK_BLAST = 26458, @@ -274,10 +280,80 @@ class spell_drain_mana : public SpellScript } }; +struct npc_anubisath_warder : public ScriptedAI +{ + npc_anubisath_warder(Creature* creature) : ScriptedAI(creature) + { + } + + void Reset() override + { + _scheduler.CancelAll(); + } + + void EnterCombat(Unit* /*who*/) override + { + if (urand(0, 1)) + { + _scheduler.Schedule(5s, 5s, [this](TaskContext context) + { + DoCastAOE(SPELL_FEAR, true); + context.Repeat(20s, 20s); + }); + } + else + { + _scheduler.Schedule(5s, 5s, [this](TaskContext context) + { + DoCastAOE(SPELL_ENTAGLING_ROOTS, true); + context.Repeat(20s, 20s); + }); + } + + if (urand(0, 1)) + { + _scheduler.Schedule(4s, 4s, [this](TaskContext context) + { + DoCastAOE(SPELL_SILENCE, true); + context.Repeat(15s, 15s); + }); + } + else + { + _scheduler.Schedule(4s, 4s, [this](TaskContext context) + { + DoCastAOE(SPELL_DUST_CLOUD, true); + context.Repeat(15s, 15s); + }); + } + + _scheduler.Schedule(2s, 2s, [this](TaskContext context) + { + DoCastAOE(SPELL_FIRE_NOVA, true); + context.Repeat(8s, 15s); + }); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + { + return; + } + + _scheduler.Update(diff, + std::bind(&ScriptedAI::DoMeleeAttackIfReady, this)); + } + +private: + TaskScheduler _scheduler; +}; + void AddSC_temple_of_ahnqiraj() { RegisterTempleOfAhnQirajCreatureAI(npc_anubisath_defender); RegisterSpellScript(spell_aggro_drones); RegisterTempleOfAhnQirajCreatureAI(npc_obsidian_eradicator); RegisterSpellScript(spell_drain_mana); + RegisterTempleOfAhnQirajCreatureAI(npc_anubisath_warder); }