diff --git a/data/sql/updates/pending_db_world/tainted_ele.sql b/data/sql/updates/pending_db_world/tainted_ele.sql new file mode 100644 index 000000000..fb023e085 --- /dev/null +++ b/data/sql/updates/pending_db_world/tainted_ele.sql @@ -0,0 +1,4 @@ +-- +UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'npc_tainted_elemental' WHERE `entry` = 22009; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 22009 AND `source_type` = 0; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index fb0061340..2f48c1338 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -57,7 +57,9 @@ enum Spells SPELL_SUMMON_SPOREBAT2 = 38490, SPELL_SUMMON_SPOREBAT3 = 38492, SPELL_SUMMON_SPOREBAT4 = 38493, - SPELL_TOXIC_SPORES = 38574 + SPELL_TOXIC_SPORES = 38574, + + SPELL_POISON_BOLT = 38253 }; enum Misc @@ -91,6 +93,8 @@ struct boss_lady_vashj : public BossAI ScheduleHealthCheckEvent(70, [&]{ Talk(SAY_PHASE2); + scheduler.CancelAll(); + me->CastStop(); me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), true, true); }); @@ -178,7 +182,6 @@ struct boss_lady_vashj : public BossAI me->AddUnitState(UNIT_STATE_ROOT); me->SetFacingTo(me->GetHomePosition().GetOrientation()); instance->SetData(DATA_ACTIVATE_SHIELD, 0); - scheduler.CancelAll(); scheduler.Schedule(2400ms, [this](TaskContext context) { if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) @@ -271,6 +274,42 @@ private: std::chrono::seconds _batTimer; }; +struct npc_tainted_elemental : public ScriptedAI +{ + npc_tainted_elemental(Creature* creature) : ScriptedAI(creature) { } + + void Reset() override + { + scheduler.CancelAll(); + me->SetInCombatWithZone(); + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + { + me->AddThreat(target, 1000.0f); + } + } + + void JustEngagedWith(Unit* /*who*/) override + { + scheduler.Schedule(100ms, 500ms, [this](TaskContext context) + { + DoCastVictim(SPELL_POISON_BOLT); + context.Repeat(2350ms, 2650ms); + }).Schedule(15s, [this](TaskContext) + { + me->DespawnOrUnsummon(); + }); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + scheduler.Update(diff); + } + +}; + class spell_lady_vashj_magic_barrier : public AuraScript { PrepareAuraScript(spell_lady_vashj_magic_barrier); @@ -410,6 +449,7 @@ class spell_lady_vashj_summons : public SpellScript void AddSC_boss_lady_vashj() { RegisterSerpentShrineAI(boss_lady_vashj); + RegisterSerpentShrineAI(npc_tainted_elemental); RegisterSpellScript(spell_lady_vashj_magic_barrier); RegisterSpellScript(spell_lady_vashj_remove_tainted_cores); RegisterSpellScript(spell_lady_vashj_summon_sporebat);