fix(Scripts/Steamvault): Despawn Thespia's adds on death (#15898)

* fix(Scripts/Steamvault): Despawn Thespia's adds on death

* stuff
This commit is contained in:
Skjalf
2023-04-09 17:37:12 -03:00
committed by GitHub
parent 450d87fd86
commit 9c6a561404
3 changed files with 22 additions and 32 deletions
@@ -29,11 +29,7 @@ enum HydromancerThespia
SPELL_LIGHTNING_CLOUD = 25033, SPELL_LIGHTNING_CLOUD = 25033,
SPELL_LUNG_BURST = 31481, SPELL_LUNG_BURST = 31481,
SPELL_ENVELOPING_WINDS = 31718, SPELL_ENVELOPING_WINDS = 31718
EVENT_SPELL_LIGHTNING = 1,
EVENT_SPELL_LUNG = 2,
EVENT_SPELL_ENVELOPING = 3
}; };
struct boss_hydromancer_thespia : public BossAI struct boss_hydromancer_thespia : public BossAI
@@ -44,47 +40,39 @@ struct boss_hydromancer_thespia : public BossAI
{ {
_JustDied(); _JustDied();
Talk(SAY_DEAD); Talk(SAY_DEAD);
instance->DoForAllMinions(DATA_HYDROMANCER_THESPIA, [&](Creature* creature) {
creature->DespawnOrUnsummon();
});
} }
void KilledUnit(Unit* victim) override void KilledUnit(Unit* victim) override
{ {
if (victim->IsPlayer()) if (victim->IsPlayer())
{
Talk(SAY_SLAY); Talk(SAY_SLAY);
}
} }
void JustEngagedWith(Unit* /*who*/) override void JustEngagedWith(Unit* /*who*/) override
{ {
Talk(SAY_AGGRO); Talk(SAY_AGGRO);
_JustEngagedWith(); _JustEngagedWith();
events.ScheduleEvent(EVENT_SPELL_LIGHTNING, 9800);
events.ScheduleEvent(EVENT_SPELL_LUNG, 13300);
events.ScheduleEvent(EVENT_SPELL_ENVELOPING, 14500);
}
void UpdateAI(uint32 diff) override scheduler.Schedule(9800ms, [this](TaskContext context)
{
if (!UpdateVictim())
return;
events.Update(diff);
switch (events.ExecuteEvent())
{ {
case EVENT_SPELL_LIGHTNING:
Talk(SAY_SPELL); Talk(SAY_SPELL);
DoCastRandomTarget(SPELL_LIGHTNING_CLOUD); DoCastRandomTarget(SPELL_LIGHTNING_CLOUD);
events.RepeatEvent(urand(12100, 14500)); context.Repeat(12100ms, 14500ms);
break; }).Schedule(13300ms, [this](TaskContext context)
case EVENT_SPELL_LUNG: {
DoCastRandomTarget(SPELL_LUNG_BURST); DoCastRandomTarget(SPELL_LUNG_BURST);
events.RepeatEvent(urand(21800, 25400)); context.Repeat(21800ms, 25400ms);
break; }).Schedule(14500ms, [this](TaskContext context)
case EVENT_SPELL_ENVELOPING: {
DoCastRandomTarget(SPELL_ENVELOPING_WINDS); DoCastRandomTarget(SPELL_ENVELOPING_WINDS);
events.RepeatEvent(urand(30000, 40000)); context.Repeat(30s, 40s);
break; });
}
DoMeleeAttackIfReady();
} }
}; };
@@ -27,8 +27,9 @@ enum MainChambersAccessPanelSays
MinionData const minionData[] = MinionData const minionData[] =
{ {
{ NPC_NAGA_DISTILLER, DATA_WARLORD_KALITHRESH }, { NPC_NAGA_DISTILLER, DATA_WARLORD_KALITHRESH },
{ 0, 0 } { NPC_THESPIA_WATER_ELEMENTAL, DATA_HYDROMANCER_THESPIA },
{ 0, 0 }
}; };
class go_main_chambers_access_panel : public GameObjectScript class go_main_chambers_access_panel : public GameObjectScript
@@ -51,9 +51,10 @@ enum steamVaultNPCGO
NPC_DOOR_CONTROLLER = 20926 NPC_DOOR_CONTROLLER = 20926
}; };
enum NagaDistiller enum Creatures
{ {
NPC_NAGA_DISTILLER = 17954 NPC_NAGA_DISTILLER = 17954,
NPC_THESPIA_WATER_ELEMENTAL = 17917
}; };
template <class AI, class T> template <class AI, class T>