fix(Scripts/SSC): some Vashj fixes (#18276)
* initial * script tainted elemental * sql * codestyle
This commit is contained in:
@@ -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;
|
||||||
@@ -57,7 +57,9 @@ enum Spells
|
|||||||
SPELL_SUMMON_SPOREBAT2 = 38490,
|
SPELL_SUMMON_SPOREBAT2 = 38490,
|
||||||
SPELL_SUMMON_SPOREBAT3 = 38492,
|
SPELL_SUMMON_SPOREBAT3 = 38492,
|
||||||
SPELL_SUMMON_SPOREBAT4 = 38493,
|
SPELL_SUMMON_SPOREBAT4 = 38493,
|
||||||
SPELL_TOXIC_SPORES = 38574
|
SPELL_TOXIC_SPORES = 38574,
|
||||||
|
|
||||||
|
SPELL_POISON_BOLT = 38253
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Misc
|
enum Misc
|
||||||
@@ -91,6 +93,8 @@ struct boss_lady_vashj : public BossAI
|
|||||||
|
|
||||||
ScheduleHealthCheckEvent(70, [&]{
|
ScheduleHealthCheckEvent(70, [&]{
|
||||||
Talk(SAY_PHASE2);
|
Talk(SAY_PHASE2);
|
||||||
|
scheduler.CancelAll();
|
||||||
|
me->CastStop();
|
||||||
me->SetReactState(REACT_PASSIVE);
|
me->SetReactState(REACT_PASSIVE);
|
||||||
me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), true, true);
|
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->AddUnitState(UNIT_STATE_ROOT);
|
||||||
me->SetFacingTo(me->GetHomePosition().GetOrientation());
|
me->SetFacingTo(me->GetHomePosition().GetOrientation());
|
||||||
instance->SetData(DATA_ACTIVATE_SHIELD, 0);
|
instance->SetData(DATA_ACTIVATE_SHIELD, 0);
|
||||||
scheduler.CancelAll();
|
|
||||||
scheduler.Schedule(2400ms, [this](TaskContext context)
|
scheduler.Schedule(2400ms, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||||
@@ -271,6 +274,42 @@ private:
|
|||||||
std::chrono::seconds _batTimer;
|
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
|
class spell_lady_vashj_magic_barrier : public AuraScript
|
||||||
{
|
{
|
||||||
PrepareAuraScript(spell_lady_vashj_magic_barrier);
|
PrepareAuraScript(spell_lady_vashj_magic_barrier);
|
||||||
@@ -410,6 +449,7 @@ class spell_lady_vashj_summons : public SpellScript
|
|||||||
void AddSC_boss_lady_vashj()
|
void AddSC_boss_lady_vashj()
|
||||||
{
|
{
|
||||||
RegisterSerpentShrineAI(boss_lady_vashj);
|
RegisterSerpentShrineAI(boss_lady_vashj);
|
||||||
|
RegisterSerpentShrineAI(npc_tainted_elemental);
|
||||||
RegisterSpellScript(spell_lady_vashj_magic_barrier);
|
RegisterSpellScript(spell_lady_vashj_magic_barrier);
|
||||||
RegisterSpellScript(spell_lady_vashj_remove_tainted_cores);
|
RegisterSpellScript(spell_lady_vashj_remove_tainted_cores);
|
||||||
RegisterSpellScript(spell_lady_vashj_summon_sporebat);
|
RegisterSpellScript(spell_lady_vashj_summon_sporebat);
|
||||||
|
|||||||
Reference in New Issue
Block a user