fix(Scripts/SSC): some Vashj fixes (#18276)

* initial

* script tainted elemental

* sql

* codestyle
This commit is contained in:
Dan
2024-02-06 17:47:37 +01:00
committed by GitHub
parent 401c0e045a
commit c513da85c8
2 changed files with 46 additions and 2 deletions

View File

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

View File

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