fix(Scripts/Ulduar): Mimiron proximity mines now despawn on wipe (#26874)

Co-authored-by: sogladev <[email protected]>
This commit is contained in:
EricksOliveira
2026-08-03 19:38:01 -03:00
committed by GitHub
co-authored by sogladev
parent 4eba00c5ab
commit 72059cab34
@@ -230,6 +230,7 @@ enum Actions
{
DO_DISABLE_AERIAL = 1,
DO_ENABLE_AERIAL,
DO_DESPAWN_SUMMONS,
};
enum Texts
@@ -734,7 +735,7 @@ struct boss_mimiron : public BossAI
me->_ExitVehicle(&exitPos);
me->AttackStop();
me->GetMotionMaster()->Clear();
summons.DoAction(1337); // despawn summons of summons
summons.DoAction(DO_DESPAWN_SUMMONS);
summons.DespawnEntry(NPC_FLAMES_INITIAL);
summons.DespawnEntry(33576);
@@ -820,7 +821,7 @@ struct boss_mimiron : public BossAI
c->DespawnOrUnsummon();
}
summons.DoAction(1337); // despawn summons of summons
summons.DoAction(DO_DESPAWN_SUMMONS); // despawn summons of summons
me->RemoveAllAuras();
me->ExitVehicle();
@@ -943,7 +944,7 @@ private:
struct npc_ulduar_leviathan_mkii : public ScriptedAI
{
npc_ulduar_leviathan_mkii(Creature* creature) : ScriptedAI(creature)
npc_ulduar_leviathan_mkii(Creature* creature) : ScriptedAI(creature), _summons(me)
{
instance = me->GetInstanceScript();
_isEvading = false;
@@ -952,6 +953,7 @@ struct npc_ulduar_leviathan_mkii : public ScriptedAI
void Reset() override
{
_phase = 0;
_summons.DespawnAll();
if (Unit* c = GetS3())
c->ExitVehicle(); // this should never happen!
if (Creature* c = me->SummonCreature(NPC_LEVIATHAN_MKII_CANNON, *me, TEMPSUMMON_MANUAL_DESPAWN))
@@ -975,6 +977,18 @@ struct npc_ulduar_leviathan_mkii : public ScriptedAI
}
}
// Mines are summoned by the MK II, not by Mimiron, so they are not in his SummonList.
void JustSummoned(Creature* summon) override
{
if (summon->GetEntry() == NPC_PROXIMITY_MINE)
_summons.Summon(summon);
}
void SummonedCreatureDespawn(Creature* summon) override
{
_summons.Despawn(summon);
}
void SetData(uint32 id, uint32 value) override
{
if (id == 1) // setting phase to start fighting
@@ -1201,6 +1215,7 @@ struct npc_ulduar_leviathan_mkii : public ScriptedAI
private:
InstanceScript* instance;
EventMap _events;
SummonList _summons;
bool _isEvading;
uint8 _phase;
};
@@ -1288,7 +1303,7 @@ struct npc_ulduar_vx001 : public ScriptedAI
void DoAction(int32 action) override
{
if (action == 1337)
if (action == DO_DESPAWN_SUMMONS)
if (Vehicle* vk = me->GetVehicleKit())
for (uint8 i = 0; i < 2; ++i)
if (Unit* r = vk->GetPassenger(5 + i))
@@ -1586,7 +1601,7 @@ struct npc_ulduar_aerial_command_unit : public ScriptedAI
me->SetReactState(REACT_AGGRESSIVE);
}, 2s);
break;
case 1337:
case DO_DESPAWN_SUMMONS:
_summons.DespawnAll();
break;
}
@@ -1778,6 +1793,7 @@ struct npc_ulduar_proximity_mine : public ScriptedAI
{
_exploded = true;
me->CastSpell(me, SPELL_MINE_EXPLOSION, false);
me->DespawnOrUnsummon(2s);
}
}
else
@@ -1790,6 +1806,7 @@ struct npc_ulduar_proximity_mine : public ScriptedAI
{
_exploded = true;
me->CastSpell(me, SPELL_MINE_EXPLOSION, false);
me->DespawnOrUnsummon(2s);
}
}
else
@@ -2211,7 +2228,7 @@ struct npc_ulduar_flames_initial : public NullCreatureAI
void DoAction(int32 action) override
{
if (action == 1337)
if (action == DO_DESPAWN_SUMMONS)
RemoveAll();
}