Skip to content

Commit 61ab759

Browse files
authored
Update Majordomo Pre-Ragnaros Sequence (vmangos#2974)
1 parent 56e4534 commit 61ab759

2 files changed

Lines changed: 57 additions & 21 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
DROP PROCEDURE IF EXISTS add_migration;
2+
DELIMITER ??
3+
CREATE PROCEDURE `add_migration`()
4+
BEGIN
5+
DECLARE v INT DEFAULT 1;
6+
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20250320074027');
7+
IF v = 0 THEN
8+
INSERT INTO `migrations` VALUES ('20250320074027');
9+
-- Add your query below.
10+
11+
INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`, `build_min`, `build_max`) VALUES (19527, 409, 847.103, -816.153, -229.775, 4.344, 0, 5875);
12+
13+
14+
-- End of migration.
15+
END IF;
16+
END??
17+
DELIMITER ;
18+
CALL add_migration();
19+
DROP PROCEDURE IF EXISTS add_migration;

src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_majordomo_executus.cpp

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ enum
5353
SPELL_SEPARATION_ANXIETY = 21094, // Cast onto all adds at start by Majordomo Executus, if adds move out of range, they will cast spell 21095 on themselves
5454

5555
SPELL_VISUAL_TELEPORT = 19484, // Visual used after fight ending dialogue to teleport to Ragnaros
56+
SPELL_MAJORDOMO_TELEPORT = 19527, // Spell cast to facilitate teleporting of Majordomo to Ragnaros
5657
SPELL_ELEMENTAL_FIRE = 19773, // Spell used by Ragnaros to kill Majordomo Executus
5758
SPELL_SUMMON_RAGNAROS = 19774, // Spell used by Majordomo Executus to summon Ragnaros
5859

@@ -102,6 +103,8 @@ struct boss_majordomoAI : public ScriptedAI
102103
bool DialogueDefeatStart1 = false;
103104
bool DialogueDefeatStart2 = false;
104105
bool DialogueDefeatStart3 = false;
106+
bool DialogueTeleportStart = false;
107+
bool DialogueTeleportFinished = false;
105108

106109
// Ragnaros Event
107110
uint32 DialogueRagnaros_M;
@@ -287,24 +290,6 @@ struct boss_majordomoAI : public ScriptedAI
287290
}
288291
}
289292

290-
// Teleport to Ragnaros after dialogue sequence has concluded
291-
void DomoTP()
292-
{
293-
// Summon new copy of Majordomo at Ragnaros Event position
294-
if (Creature* Domo = m_creature->SummonCreature(m_creature->GetEntry(), 847.103f, -816.153f, -229.775f, 4.344f, TEMPSUMMON_TIMED_DESPAWN, (2 * 60 * 60 * 1000)))
295-
{
296-
Domo->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
297-
Domo->SetFactionTemplateId(FACTION_FRIENDLY);
298-
Domo->SetHealth(35);
299-
Domo->SetMaxHealth(35);
300-
}
301-
302-
// Reset Ragnaros timer, cast teleport to Ragnaros visual, and despawn
303-
DialogueRagnarosTimer = 0;
304-
m_creature->CastSpell(m_creature, SPELL_VISUAL_TELEPORT, false);
305-
m_creature->ForcedDespawn(1000);
306-
}
307-
308293
// Ragnaros Event sequence
309294
void DomoEvent()
310295
{
@@ -391,11 +376,12 @@ struct boss_majordomoAI : public ScriptedAI
391376
DialogueDefeatTimer += diff;
392377
if (DialogueDefeatTimer > 2400)
393378
{
394-
m_creature->SetFactionTemplateId(FACTION_FRIENDLY);
395-
m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PLAYER | UNIT_FLAG_IN_COMBAT);
396379
DialogueDefeatStart0 = false;
397380
DialogueDefeatStart1 = true;
398381
DialogueDefeatTimer = 0;
382+
383+
m_creature->SetFactionTemplateId(FACTION_FRIENDLY);
384+
m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PLAYER | UNIT_FLAG_IN_COMBAT);
399385
DoScriptText(SAY_DEFEAT1, m_creature);
400386
}
401387
}
@@ -413,6 +399,7 @@ struct boss_majordomoAI : public ScriptedAI
413399
DialogueDefeatStart1 = false;
414400
DialogueDefeatStart2 = true;
415401
DialogueDefeatTimer = 0;
402+
416403
DoScriptText(SAY_DEFEAT2, m_creature);
417404
}
418405
}
@@ -426,6 +413,7 @@ struct boss_majordomoAI : public ScriptedAI
426413
DialogueDefeatStart2 = false;
427414
DialogueDefeatStart3 = true;
428415
DialogueDefeatTimer = 0;
416+
429417
DoScriptText(SAY_DEFEAT3, m_creature);
430418
}
431419
}
@@ -439,12 +427,41 @@ struct boss_majordomoAI : public ScriptedAI
439427
if (DialogueDefeatTimer > 17600)
440428
{
441429
DialogueDefeatStart3 = false;
430+
DialogueTeleportStart = true;
442431
DialogueDefeatTimer = 0;
443-
DomoTP();
432+
433+
DoCastSpellIfCan(m_creature, SPELL_VISUAL_TELEPORT, CF_FORCE_CAST);
444434
}
445435
}
446436
}
447437

438+
// Majordomo Teleport sequence start
439+
if (DialogueTeleportStart)
440+
{
441+
DialogueDefeatTimer += diff;
442+
if (DialogueDefeatTimer > 1510)
443+
{
444+
DialogueTeleportStart = false;
445+
DialogueTeleportFinished = true;
446+
DialogueDefeatTimer = 0;
447+
448+
DoCastSpellIfCan(m_creature, SPELL_MAJORDOMO_TELEPORT, CF_FORCE_CAST);
449+
}
450+
}
451+
452+
// Majordomo Teleport sequence end
453+
if (DialogueTeleportFinished)
454+
{
455+
DialogueDefeatTimer += diff;
456+
if (DialogueDefeatTimer > 100)
457+
{
458+
DialogueTeleportFinished = false;
459+
DialogueDefeatTimer = 0;
460+
461+
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
462+
}
463+
}
464+
448465
// Start the Ragnaros summoning event
449466
if (RagnarosEventStart && m_creature->GetFactionTemplateId() == FACTION_FRIENDLY)
450467
{

0 commit comments

Comments
 (0)