diff --git a/data/sql/updates/pending_db_world/rev_1729968739299017200.sql b/data/sql/updates/pending_db_world/rev_1729968739299017200.sql new file mode 100644 index 000000000..1f5a9398a --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1729968739299017200.sql @@ -0,0 +1,49 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=51000; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (51000, 'spell_hos_dark_matter_size'); + +DELETE FROM `spell_script_names` WHERE `spell_id`=51001; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (51001, 'spell_hos_dark_matter'); + +DELETE FROM `script_waypoint` WHERE `entry` IN (28070); +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) +VALUES +(28070, 1, 1064.12, 474.883, 207.721, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 2, 1045.25, 471.345, 208.611, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 3, 1022.27, 458.81, 207.72, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 4, 995.493, 432.994, 207.413, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 5, 982.247, 421.768, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 6, 977.403, 420.578, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 7, 968.479, 421.992, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 8, 959.337, 420.403, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 9, 949.226, 413.964, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 10, 944.901, 401.561, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 11, 943.739, 394.289, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 12, 943.949, 383.505, 206.696, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 13, 942.623, 378.852, 207.423, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 14, 937.271, 373.627, 207.422, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 15, 926.094, 362.071, 203.706, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 16, 897.082, 332.612, 203.706, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 17, 916.701, 352.318, 203.706, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 18, 946.597, 383.533, 205.994, 2000, 'Brann Bronzebeard - Halls of Stone'), +(28070, 19, 973.525, 379.987, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 20, 982.317, 390.587, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 21, 984.925, 406.454, 205.994, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 22, 999.096, 433.512, 207.412, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 23, 1023.27, 457.194, 207.719, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 24, 1046.27, 479.728, 207.748, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 25, 1064.12, 474.883, 207.721, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 26, 1047.91, 521.103, 207.719, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 27, 1048.57, 622.492, 207.719, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 28, 1048.86, 662.867, 201.672, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 29, 1105.7, 662.475, 202.871, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 30, 1121.44, 662.366, 196.235, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 31, 1138.58, 632.499, 196.235, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 32, 1164.78, 637.113, 196.294, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 33, 1199.88, 667.139, 196.242, 2000, 'Brann Bronzebeard - Halls of Stone'), +(28070, 34, 1202.49, 667.226, 196.243, 2000, 'Brann Bronzebeard - Halls of Stone'), +(28070, 35, 1230.13, 666.967, 189.607, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 36, 1256.34, 666.921, 189.611, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 37, 1282.12, 666.744, 189.607, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 38, 1307.56, 666.938, 189.607, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 39, 1306.05, 666.85, 189.607, 0, 'Brann Bronzebeard - Halls of Stone'), +(28070, 40, 1307.56, 666.938, 189.607, 0, 'Brann Bronzebeard - Halls of Stone'); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index da0e324ca..d51461f6a 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -145,8 +145,6 @@ public: if (pInstance->GetData(BOSS_TRIBUNAL_OF_AGES) == DONE) { me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - if (GameObject* doors = me->GetMap()->GetGameObject(pInstance->GetGuidData(GO_SJONNIR_DOOR))) - doors->SetGoState(GO_STATE_ACTIVE); if (GameObject* console = me->GetMap()->GetGameObject( pInstance->GetGuidData(GO_SJONNIR_CONSOLE))) console->SetGoState(GO_STATE_READY); @@ -155,7 +153,7 @@ public: { brann->setDeathState(DeathState::JustDied); brann->Respawn(); - brann->AI()->DoAction(5); + brann->AI()->DoAction(ACTION_SJONNIR_WIPE_START); } } } @@ -183,7 +181,7 @@ public: if (pInstance->GetData(BOSS_TRIBUNAL_OF_AGES) == DONE) if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) - brann->AI()->DoAction(3); + brann->AI()->DoAction(ACTION_START_SJONNIR_FIGHT); } } @@ -220,8 +218,7 @@ public: if (pInstance) if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) { - brann->Yell("What in the name o' Madoran did THAT do? Oh! Wait: I just about got it...", LANG_UNIVERSAL); - brann->PlayDirectSound(14276); + brann->AI()->Talk(SAY_BRANN_SPAWN_OOZE); } } @@ -229,8 +226,7 @@ public: { if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) { - brann->Yell("Ha, that did it! Help's a-comin'! Take this, ya glowin' iron brute!", LANG_UNIVERSAL); - brann->PlayDirectSound(14277); + brann->AI()->Talk(SAY_BRANN_SPAWN_EARTHEN); } SummonPhase = PHASE_SUMMON_FRIENDLY_DWARFES; me->CastSpell(me, SPELL_FRENZY, false); @@ -276,8 +272,7 @@ public: { if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) { - brann->Yell("This is a wee bit trickier that before... Oh, bloody--incomin'!", LANG_UNIVERSAL); - brann->PlayDirectSound(14275); + brann->AI()->Talk(SAY_BRANN_SPAWN_TROGG); } break; @@ -331,7 +326,7 @@ public: sd->SetGoState(GO_STATE_ACTIVE); if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) - brann->AI()->DoAction(4); + brann->AI()->DoAction(ACTION_SJONNIR_DEAD); } } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp index 83da96853..8202f673a 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp @@ -28,14 +28,19 @@ #define GOSSIP_ITEM_2 "Let's move Brann, enough of the history lessons!" #define GOSSIP_ITEM_3 "There will be plenty of time for this later Brann, we need to get moving!" #define GOSSIP_ITEM_4 "We're with you Brann! Open it!" -#define TEXT_ID_START 13100 +#define TEXT_ID_START 13100 +#define TEXT_ID_TRIBUNAL_START 13101 +#define TEXT_ID_TRIBUNAL_END 14176 +#define TEXT_ID_SJONNIR_DOOR 13883 +#define TEXT_ID_SJONNIR_END 13308 enum NPCs { NPC_DARK_RUNE_PROTECTOR = 27983, NPC_DARK_RUNE_STORMCALLER = 27984, NPC_IRON_GOLEM_CUSTODIAN = 27985, - NPC_DARK_MATTER_TRIGGER = 28237, + NPC_DARK_MATTER = 28235, + NPC_DARK_MATTER_TARGET = 28237, NPC_SEARING_GAZE_TRIGGER = 28265, }; @@ -44,7 +49,8 @@ enum Misc // BRANN EVENT SPELL_GLARE_OF_THE_TRIBUNAL = 50988, SPELL_GLARE_OF_THE_TRIBUNAL_H = 59870, - SPELL_DARK_MATTER_VISUAL = 51001, + SPELL_DARK_MATTER_VISUAL = 51000, + SPELL_DARK_MATTER_VISUAL_CHANNEL= 51001, SPELL_DARK_MATTER = 51012, SPELL_DARK_MATTER_H = 59868, SPELL_SEARING_GAZE = 51136, @@ -65,46 +71,49 @@ enum Misc SPELL_IGC_GROUND_SMASH = 12734, SPELL_IGC_GROUND_SMASH_H = 59865, - // ACTIONS - ACTION_START_EVENT = 0, - ACTION_START_TRIBUNAL = 1, - ACTION_GO_TO_SJONNIR = 2, - ACTION_START_SJONNIR_FIGHT = 3, - ACTION_SJONNIR_DEAD = 4, - ACTION_ENTEREVADEMODE = 5, - ACTION_WIPE_START = 6, - ACTION_OPEN_DOOR = 7, - // QUESTS QUEST_HALLS_OF_STONE = 13207, }; enum events { - // BRANN - EVENT_KADDRAK_HEAD = 1, - EVENT_MARNAK_HEAD = 2, - EVENT_ABEDNEUM_HEAD = 3, - EVENT_SUMMON_MONSTERS = 4, - EVENT_TRIBUNAL_END = 5, - EVENT_GO_TO_SJONNIR = 6, - EVENT_END = 7, - EVENT_KADDRAK_VISUAL = 8, - EVENT_MARNAK_VISUAL = 9, - EVENT_ABEDNEUM_VISUAL = 10, - EVENT_KADDRAK_SWITCH_EYE = 11, + // BRANN AND TRIBUNAL + EVENT_ABEDNEUM_VISUAL = 1, + EVENT_KADDRAK_VISUAL = 2, + EVENT_MARNAK_VISUAL = 3, + EVENT_ABEDNEUM_HEAD = 4, + EVENT_KADDRAK_HEAD = 5, + EVENT_MARNAK_HEAD = 6, + EVENT_KADDRAK_SWITCH_EYE = 7, + EVENT_SUMMON_MONSTERS = 8, + EVENT_SUMMON_STORMCALLER = 9, + EVENT_SUMMON_CUSTODIAN = 10, + EVENT_DARK_MATTER_START = 11, + EVENT_DARK_MATTER_END = 12, // DARK RUNE PROTECTOR - EVENT_DRP_CHARGE = 15, - EVENT_DRP_CLEAVE = 16, + EVENT_DRP_CHARGE = 13, + EVENT_DRP_CLEAVE = 14, // DARK RUNE STORMCALLER - EVENT_DRS_LIGHTNING_BOLD = 20, - EVENT_DRS_SHADOW_WORD_PAIN = 21, + EVENT_DRS_LIGHTNING_BOLD = 15, + EVENT_DRS_SHADOW_WORD_PAIN = 16, // IRON GOLEM CUSTODIAN - EVENT_IGC_CRUSH = 30, - EVENT_IGC_GROUND_SMASH = 31, + EVENT_IGC_CRUSH = 17, + EVENT_IGC_GROUND_SMASH = 18, + + EVENT_TRIBUNAL_END = 19, + EVENT_BREEN_WAITING = 20, + EVENT_TALK_FACE_CHANGE = 21, + EVENT_SKY_ROOM_FLOOR_CHANGE = 22, + + //BRANN AND SJONNIR + EVENT_GO_TO_SJONNIR = 23, + EVENT_DOOR_OPEN = 24, + EVENT_RESUME_ESCORT = 25, + EVENT_SJONNIR_END_BRANN_YELL = 26, + EVENT_SJONNIR_END_BRANN_LAST_YELL = 27, }; struct Yells @@ -116,46 +125,45 @@ struct Yells static Yells Conversation[] = { - {14259, "Time to get some answers! Let's get this show on the road!", NPC_BRANN, 0}, - {14247, "Take a moment and relish this with me. Soon... all will be revealed. Okay then, let's do this!", NPC_BRANN, 5000}, - {14248, "Now keep an eye out! I'll have this licked in two shakes of a--", NPC_BRANN, 17000}, - {13765, "Warning: life form pattern not recognized. Archival processing terminated. Continued interference will result in targeted response.", NPC_ABEDNEUM, 20500}, - {14249, "Oh, that doesn't sound good. We might have a complication or two...", NPC_BRANN, 32000}, - {13756, "Security breach in progress. Analysis of historical archives transferred to lower-priority queue. Countermeasures engaged.", NPC_KADDRAK, 37000}, - {14250, "Ah, you want to play hardball, eh? That's just my game!", NPC_BRANN, 49000}, - {14251, "Couple more minutes and I'll--", NPC_BRANN, 100000}, + {14248, "Now keep an eye out! I'll have this licked in two shakes of a--", NPC_BRANN, 8000}, + {13765, "Warning: life form pattern not recognized. Archival processing terminated. Continued interference will result in targeted response.", NPC_ABEDNEUM, 13000}, + {14249, "Oh, that doesn't sound good. We might have a complication or two...", NPC_BRANN, 24000}, + {13756, "Security breach in progress. Analysis of historical archives transferred to lower-priority queue. Countermeasures engaged.", NPC_KADDRAK, 30500}, + {14250, "Ah, you want to play hardball, eh? That's just my game!", NPC_BRANN, 42000}, + {14251, "Couple more minutes and I'll--", NPC_BRANN, 102000}, {13761, "Threat index threshold exceeded. Celestial archive aborted. Security level heightened.", NPC_MARNAK, 105000}, - {14252, "Heightened? What's the good news?", NPC_BRANN, 116000}, - {14253, "So that was the problem? Now I'm makin' progress...", NPC_BRANN, 195000}, - {13767, "Critical threat index. Void analysis diverted. Initiating sanitization protocol.", NPC_ABEDNEUM, 205000}, - {14254, "Hang on! Nobody's gonna' be sanitized as long as I have a say in it!", NPC_BRANN, 215000}, - {14255, "Ha! The old magic fingers finally won through! Now let's get down to--", NPC_BRANN, 295000}, - {13768, "Alert: security fail-safes deactivated. Beginning memory purge and... ", NPC_ABEDNEUM, 303000}, - //The fight is completed at this point. - {14256, "Purge? No no no no no.. where did I-- Aha, this should do the trick...", NPC_BRANN, 310000}, - {13769, "System online. Life form pattern recognized. Welcome, Branbronzan. Query?", NPC_ABEDNEUM, 321000}, - {14263, "Query? What do you think I'm here for, tea and biscuits? Spill the beans already!", NPC_BRANN, 329000}, + {14252, "Heightened? What's the good news?", NPC_BRANN, 113000}, + {14253, "So that was the problem? Now I'm makin' progress...", NPC_BRANN, 201000}, + {13767, "Critical threat index. Void analysis diverted. Initiating sanitization protocol.", NPC_ABEDNEUM, 207500 }, + {14254, "Hang on! Nobody's gonna' be sanitized as long as I have a say in it!", NPC_BRANN, 214000}, + {14255, "Ha! The old magic fingers finally won through! Now let's get down to--", NPC_BRANN, 305000}, + {13768, "Alert: security fail-safes deactivated. Beginning memory purge and... ", NPC_ABEDNEUM, 310000}, + //The fight is completed at this point.d + {14256, "Purge? No no no no no.. where did I-- Aha, this should do the trick...", NPC_BRANN, 316000}, + {13769, "System online. Life form pattern recognized. Welcome, Branbronzan. Query?", NPC_ABEDNEUM, 322000}, + {14263, "Query? What do you think I'm here for, tea and biscuits? Spill the beans already!", NPC_BRANN, 330000}, {14264, "Tell me how the dwarves came to be, and start at the beginning!", NPC_BRANN, 336000}, - {13770, "Accessing prehistoric data... retrieved. In the beginning the earthen were created to--", NPC_ABEDNEUM, 342000}, + {13770, "Accessing prehistoric data... retrieved. In the beginning the earthen were created to--", NPC_ABEDNEUM, 341000}, {14265, "Right, right... I know the earthen were made from stone to shape the deep regions o' the world. But what about the anomalies? Matrix non-stabilizin' and what-not?", NPC_BRANN, 348000}, {13771, "Accessing... In the early stages of it's development cycle, Azeroth suffered infection by parasitic necrophotic symbiotes.", NPC_ABEDNEUM, 360000}, - {14266, "Necrowhatinthe-- Speak bloody Common, will ye?", NPC_BRANN, 373500}, - {13772, "Designation: Old Gods. Old Gods rendered all systems, including earthen, defenseless in order to facilitate assimilation. This matrix destabilization has been termed the Curse of Flesh. Effects of destabilization increased over time.", NPC_ABEDNEUM, 380000}, - {14267, "Old Gods, huh? So they zapped the earthen with this Curse of Flesh... and then what?", NPC_BRANN, 399500}, - {13757, "Accessing... Creators arrived to extirpate symbiotic infection. Assessment revealed that Old God infestation had grown malignant. Excising parasites would result in loss of host--", NPC_KADDRAK, 406000}, + {14266, "Necrowhatinthe-- Speak bloody Common, will ye?", NPC_BRANN, 372000}, + {13772, "Designation: Old Gods. Old Gods rendered all systems, including earthen, defenseless in order to facilitate assimilation. This matrix destabilization has been termed the Curse of Flesh. Effects of destabilization increased over time.", NPC_ABEDNEUM, 377000}, + {14267, "Old Gods, huh? So they zapped the earthen with this Curse of Flesh... and then what?", NPC_BRANN, 400000}, + {13757, "Accessing... Creators arrived to extirpate symbiotic infection. Assessment revealed that Old God infestation had grown malignant. Excising parasites would result in loss of host--", NPC_KADDRAK, 407500}, {14268, "If they killed the Old Gods, Azeroth would've been destroyed...", NPC_BRANN, 424000}, - {13758, "Correct. Creators neutralized parasitic threat and contained it within the host. Forge of Wills and other systems were instituted to create new earthen. Safeguards were implemented, and protectors were appointed.", NPC_KADDRAK, 429000}, - {14269, "What protectors?", NPC_BRANN, 449000}, - {13759, "Designations: Aesir and Vanir. Or in the common nomenclature, storm and earth giants. Sentinel Loken designated supreme. Dragon Aspects appointed to monitor evolution on Azeroth.", NPC_KADDRAK, 452000}, - {14270, "Aesir and Vanir... Okay, so the Forge o' Wills started makin' new earthen... but what happened to the old ones?", NPC_BRANN, 471000}, - {13762, "Additional background is relevant to your query: following global combat between Aesir and Vanir--", NPC_MARNAK, 482000}, + {13758, "Correct. Creators neutralized parasitic threat and contained it within the host. Forge of Wills and other systems were instituted to create new earthen. Safeguards were implemented, and protectors were appointed.", NPC_KADDRAK, 431000}, + {14269, "What protectors?", NPC_BRANN, 450000}, + {13759, "Designations: Aesir and Vanir. Or in the common nomenclature, storm and earth giants. Sentinel Loken designated supreme. Dragon Aspects appointed to monitor evolution on Azeroth.", NPC_KADDRAK, 453000}, + {14270, "Aesir and Vanir... Okay, so the Forge o' Wills started makin' new earthen... but what happened to the old ones?", NPC_BRANN, 472000}, + {13762, "Additional background is relevant to your query: following global combat between Aesir and Vanir--", NPC_MARNAK, 483000}, {14271, "Hold everything! The Aesir and Vanir went to war? Why?", NPC_BRANN, 489000}, - {13763, "Unknown. Data suggests that impetus for global combat originated with prime designate Loken, who neutralized all remaining Aesir and Vanir, affecting termination of conflict. Prime designate Loken then initiated stasis of several seed races, including earthen, giants and vrykul, at designated holding facilities.", NPC_MARNAK, 494000}, + {13763, "Unknown. Data suggests that impetus for global combat originated with prime designate Loken, who neutralized all remaining Aesir and Vanir, affecting termination of conflict. Prime designate Loken then initiated stasis of several seed races, including earthen, giants and vrykul, at designated holding facilities.", NPC_MARNAK, 495000}, {14272, "This Loken sounds like a nasty character. Glad we don't have to worry about the likes o' him anymore. So... if I'm understandin' ye right, the original earthen eventually woke up from this stasis, and by that time the destabili-whatever had turned 'em into proper dwarves. Or at least... dwarf ancestors.", NPC_BRANN, 519000}, {13764, "Essentially that is correct.", NPC_MARNAK, 543000}, - {14273, "Well, now... that's a lot to digest. I'm gonna need some time to take all this in. Thank ye.", NPC_BRANN, 549000}, - {13773, "Acknowledged, Branbronzan. Session terminated.", NPC_ABEDNEUM, 559000}, - {0, "I think it's time to see what's behind the door near the entrance. I'm going to sneak over there, nice and quiet. Meet me at the door and I'll get us in.", NPC_BRANN, 574000}, + {14273, "Well, now... that's a lot to digest. I'm gonna need some time to take all this in. Thank ye.", NPC_BRANN, 546000}, + {13773, "Acknowledged, Branbronzan. Session terminated.", NPC_ABEDNEUM, 554000}, + //Go to Sjonnir's door + {0, "I think it's time to see what's behind the door near the entrance. I'm going to sneak over there, nice and quiet. Meet me at the door and I'll get us in.", NPC_BRANN, 561000}, }; class brann_bronzebeard : public CreatureScript @@ -176,24 +184,27 @@ public: { case 1: AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + SendGossipMenuFor(player, TEXT_ID_START, creature->GetGUID()); break; case 2: AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + SendGossipMenuFor(player, TEXT_ID_TRIBUNAL_START, creature->GetGUID()); break; case 3: AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + SendGossipMenuFor(player, TEXT_ID_TRIBUNAL_END, creature->GetGUID()); break; case 4: - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + SendGossipMenuFor(player, TEXT_ID_SJONNIR_DOOR, creature->GetGUID()); break; case 5: - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + SendGossipMenuFor(player, TEXT_ID_SJONNIR_END, creature->GetGUID()); break; default: break; } } - SendGossipMenuFor(player, TEXT_ID_START, creature->GetGUID()); return true; } @@ -204,7 +215,7 @@ public: switch (action) { case GOSSIP_ACTION_INFO_DEF+1: - creature->AI()->DoAction(ACTION_START_EVENT); + creature->AI()->DoAction(ACTION_START_ESCORT_EVENT); CloseGossipMenuFor(player); break; case GOSSIP_ACTION_INFO_DEF+2: @@ -216,10 +227,6 @@ public: CloseGossipMenuFor(player); break; case GOSSIP_ACTION_INFO_DEF+4: - creature->AI()->DoAction(ACTION_WIPE_START); - CloseGossipMenuFor(player); - break; - case GOSSIP_ACTION_INFO_DEF+5: creature->AI()->DoAction(ACTION_OPEN_DOOR); CloseGossipMenuFor(player); break; @@ -246,10 +253,13 @@ public: ObjectGuid AbedneumGUID; ObjectGuid MarnakGUID; ObjectGuid KaddrakGUID; + ObjectGuid darkMatterTargetGUID; + uint8 WaveNum; bool TalkEvent; uint32 SpeechCount, SpeechPause; + bool canExecuteEvents = true; void DespawnHeads() { @@ -257,6 +267,7 @@ public: if ((cr = GetAbedneum())) cr->DespawnOrUnsummon(); if ((cr = GetMarnak())) cr->DespawnOrUnsummon(); if ((cr = GetKaddrak())) cr->DespawnOrUnsummon(); + SwitchHeadVisaul(0x7, false); } @@ -268,15 +279,46 @@ public: GameObject* go = nullptr; if (headMask & 0x1) // Kaddrak if ((go = me->GetMap()->GetGameObject(pInstance->GetGuidData(GO_KADDRAK)))) - activate ? go->SendCustomAnim(0) : go->SetGoState(GO_STATE_READY); - + { + if (activate) + { + go->SendCustomAnim(0); + } + else + { + go->SendCustomAnim(1); + if (go->GetGoState() == GO_STATE_ACTIVE) + go->SetGoState(GO_STATE_READY); + } + } if (headMask & 0x2) // Marnak if ((go = me->GetMap()->GetGameObject(pInstance->GetGuidData(GO_MARNAK)))) - activate ? go->SendCustomAnim(0) : go->SetGoState(GO_STATE_READY); - + { + if (activate) + { + go->SendCustomAnim(0); + } + else + { + go->SendCustomAnim(1); + if (go->GetGoState() == GO_STATE_ACTIVE) + go->SetGoState(GO_STATE_READY); + } + } if (headMask & 0x4) // Abedneum if ((go = me->GetMap()->GetGameObject(pInstance->GetGuidData(GO_ABEDNEUM)))) - activate ? go->SendCustomAnim(0) : go->SetGoState(GO_STATE_READY); + { + if (activate) + { + go->SendCustomAnim(0); + } + else + { + go->SendCustomAnim(1); + if (go->GetGoState() == GO_STATE_ACTIVE) + go->SetGoState(GO_STATE_READY); + } + } } void ResetEvent() @@ -284,6 +326,9 @@ public: if (GameObject* tribunal = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_TRIBUNAL_CONSOLE))) tribunal->SetGoState(GO_STATE_READY); + if (GameObject* tribunalSkyFloor = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_SKY_FLOOR))) + tribunalSkyFloor->SetGoState(GO_STATE_READY); + events.Reset(); summons.DespawnAll(); DespawnHeads(); @@ -301,7 +346,8 @@ public: Creature* GetMarnak() { return ObjectAccessor::GetCreature(*me, MarnakGUID); } Creature* GetKaddrak() { return ObjectAccessor::GetCreature(*me, KaddrakGUID); } - void MoveInLineOfSight(Unit* /*pWho*/) override { } + bool leftEye = true; + void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override { if (damage && pInstance) @@ -325,7 +371,18 @@ public: pInstance->SetData(DATA_BRANN_ACHIEVEMENT, true); if (pInstance->GetData(BOSS_TRIBUNAL_OF_AGES) == DONE) - pInstance->SetData(BRANN_BRONZEBEARD, (pInstance->GetData(BOSS_SJONNIR) == DONE) ? 5 : 4); + { + pInstance->SetData(BRANN_BRONZEBEARD, 4); + if (GameObject* door = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_TRIBUNAL_ACCESS_DOOR))) + door->SetGoState(GO_STATE_ACTIVE); + } + + if (pInstance->GetData(BOSS_SJONNIR) == DONE) + { + pInstance->SetData(BRANN_BRONZEBEARD, 5); + if (GameObject* door = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_SJONNIR_DOOR))) + door->SetGoState(GO_STATE_ACTIVE); + } } } @@ -333,58 +390,79 @@ public: { switch (action) { - case ACTION_START_EVENT: + case ACTION_START_ESCORT_EVENT: Start(false, true, ObjectGuid::Empty, 0, true, false); + Talk(SAY_BRANN_ESCORT_START); + me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); + me->SetReactState(REACT_AGGRESSIVE); + me->SetRegeneratingHealth(false); break; case ACTION_START_TRIBUNAL: - { - Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers(); - if (!PlayerList.IsEmpty()) - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - me->SetFaction(i->GetSource()->GetFaction()); - break; - } + { + me->SetReactState(REACT_PASSIVE); + Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers(); + if (!PlayerList.IsEmpty()) + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + me->SetFaction(i->GetSource()->GetFaction()); + break; + } - SetEscortPaused(false); - InitializeEvent(); - me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); - break; - } - case ACTION_GO_TO_SJONNIR: + SetEscortPaused(false); + InitializeEvent(); + me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); + break; + } + case ACTION_TRIBUNAL_WIPE_START: + SetNextWaypoint(1, false); SetEscortPaused(false); ResetEvent(); me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); break; + case ACTION_GO_TO_SJONNIR: + Talk(SAY_BRANN_ENTRANCE_MEET); + me->SetFaction(FACTION_FRIENDLY); + me->SetReactState(REACT_PASSIVE); + me->SetRegeneratingHealth(true); + SetEscortPaused(false); + ResetEvent(); + me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); + DoCast(me, 58506, false); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY_UNARMED); + me->SendMovementFlagUpdate(); + break; case ACTION_START_SJONNIR_FIGHT: me->SetFaction(FACTION_FRIENDLY); - me->Yell("Don't worry! Ol' Brann's got yer back! Keep that metal monstrosity busy, and I'll see if I can't sweet talk this machine into helping ye!", LANG_UNIVERSAL); - me->PlayDirectSound(14274); SetEscortPaused(false); break; case ACTION_SJONNIR_DEAD: - me->Yell("Loken? That's downright bothersome... We might've neutralized the iron dwarves, but I'd lay odds there's another machine somewhere else churnin' out a whole mess o' these iron vrykul!", LANG_UNIVERSAL); - me->PlayDirectSound(14278); - events.ScheduleEvent(EVENT_END, 14000); + if (pInstance) + pInstance->SetData(BRANN_BRONZEBEARD, 5); + SetEscortPaused(false); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND); + me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); + me->SetOrientation(3.132660f); + me->SendMovementFlagUpdate(); + events.ScheduleEvent(EVENT_SJONNIR_END_BRANN_YELL, 10000ms); + events.ScheduleEvent(EVENT_SJONNIR_END_BRANN_LAST_YELL, 22000ms); break; - case ACTION_ENTEREVADEMODE: - RemoveEscortState(0x7); // all states - me->SetHomePosition(1077.41f, 474.16f, 207.8f, 2.70526f); - me->UpdatePosition(1077.41f, 474.16f, 207.9f, 2.70526f, true); - me->StopMovingOnCurrentPos(); + case ACTION_SJONNIR_WIPE_START: Reset(); - break; - case ACTION_WIPE_START: - Start(false, true, ObjectGuid::Empty, 0, true, false); - SetNextWaypoint(20, false); - ResetEvent(); - me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); + SetNextWaypoint(33, true); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY_UNARMED); + me->StopMovingOnCurrentPos(); + DoCast(me, 58506, false); + if (GameObject* door = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_SJONNIR_DOOR))) + door->SetGoState(GO_STATE_READY); break; case ACTION_OPEN_DOOR: - if (GameObject* door = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_SJONNIR_DOOR))) - door->SetGoState(GO_STATE_ACTIVE); + Start(false, true, ObjectGuid::Empty, 0, true, false); + SetNextWaypoint(34, false); SetEscortPaused(false); me->RemoveAura(58506); + me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); + me->SetWalk(true); + me->SetSpeed(MOVE_WALK, 1.0f); break; } } @@ -400,68 +478,130 @@ public: void UpdateEscortAI(uint32 diff) override { events.Update(diff); - switch (events.ExecuteEvent()) + + if (uint32 eventId = events.ExecuteEvent()) { - case EVENT_KADDRAK_VISUAL: + switch (eventId) + { + case EVENT_KADDRAK_VISUAL: { SwitchHeadVisaul(0x1, true); break; } - case EVENT_MARNAK_VISUAL: + case EVENT_MARNAK_VISUAL: { SwitchHeadVisaul(0x2, true); break; } - case EVENT_ABEDNEUM_VISUAL: + case EVENT_ABEDNEUM_VISUAL: { SwitchHeadVisaul(0x4, true); break; } - case EVENT_KADDRAK_HEAD: // First + case EVENT_KADDRAK_HEAD: // Phase 1 { + if (!canExecuteEvents) + return; if (Creature* kaddrak = GetKaddrak()) { if (Player* plr = SelectTargetFromPlayerList(100.0f)) kaddrak->CastSpell(plr, DUNGEON_MODE(SPELL_GLARE_OF_THE_TRIBUNAL, SPELL_GLARE_OF_THE_TRIBUNAL_H), true); } - events.RescheduleEvent(EVENT_KADDRAK_SWITCH_EYE, 1500ms); - events.Repeat(2s, 4s); + events.RescheduleEvent(EVENT_KADDRAK_SWITCH_EYE, 1000ms); + events.Repeat(1500ms); break; } - case EVENT_KADDRAK_SWITCH_EYE: + case EVENT_KADDRAK_SWITCH_EYE: { + if (!canExecuteEvents) + return; if (Creature* kaddrak = GetKaddrak()) { - if (urand(0, 1)) + if (leftEye) kaddrak->UpdatePosition(927.9f, 330.9f, 219.4f, 2.4f, true); else kaddrak->UpdatePosition(923.7f, 326.9f, 219.5f, 2.1f, true); + leftEye = !leftEye; kaddrak->StopMovingOnCurrentPos(); } break; } - case EVENT_MARNAK_HEAD: // Second + case EVENT_MARNAK_HEAD: // Phase 2 { + if (!canExecuteEvents) + return; + if (Creature* marnak = GetMarnak()) { - if (Creature* cr = me->SummonCreature(NPC_DARK_MATTER_TRIGGER, marnak->GetPositionX(), marnak->GetPositionY(), marnak->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 7000)) + if (Creature* cr = me->SummonCreature(NPC_DARK_MATTER_TARGET, 899.843f, 355.271f, 214.301f, 0, TEMPSUMMON_TIMED_DESPAWN, 10000)) { - cr->CastSpell(cr, SPELL_DARK_MATTER_VISUAL, true); - if (Player* plr = SelectTargetFromPlayerList(100.0f)) + cr->SetCanFly(true); + + //right eye + if (Creature* cra = me->SummonCreature(NPC_DARK_MATTER, marnak->GetPositionX(), marnak->GetPositionY(), marnak->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000)) + cra->CastSpell(cra, SPELL_DARK_MATTER_VISUAL_CHANNEL, false); + + //left eye + if (Creature* crb = me->SummonCreature(NPC_DARK_MATTER, 891.543f, 359.5252f, 219.338f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000)) + crb->CastSpell(crb, SPELL_DARK_MATTER_VISUAL_CHANNEL, false); + + darkMatterTargetGUID = cr->GetGUID(); + + events.RescheduleEvent(EVENT_DARK_MATTER_START, 5000ms); + } + } + events.Repeat(30s); + break; + } + case EVENT_DARK_MATTER_START: + { + if (Creature* darkMatterTarget = ObjectAccessor::GetCreature(*me, darkMatterTargetGUID)) + { + darkMatterTarget->CastSpell(darkMatterTarget, SPELL_DARK_MATTER_VISUAL, false); + if (Player* plr = SelectTargetFromPlayerList(100.0f)) + { + if (!plr) + return; //no target + + float speed = 10.0f; + float tooFarAwaySpeed = me->GetDistance(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ()) / (5000.0f * 0.001f); + if (speed < tooFarAwaySpeed) + speed = tooFarAwaySpeed; + + darkMatterTarget->MonsterMoveWithSpeed(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), speed); + + if (darkMatterTarget->GetDistance(plr) < 15.0f) { - float speed = me->GetDistance(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ()) / (4000.0f * 0.001f); - cr->MonsterMoveWithSpeed(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), speed); + events.RescheduleEvent(EVENT_DARK_MATTER_END, 3000ms); + } + else if (darkMatterTarget->GetDistance(plr) < 30.0f) + { + events.RescheduleEvent(EVENT_DARK_MATTER_END, 3500ms); + } + else + { + events.RescheduleEvent(EVENT_DARK_MATTER_END, 4500ms); } } } - events.Repeat(20s); break; } - case EVENT_ABEDNEUM_HEAD: // Third + case EVENT_DARK_MATTER_END: { + if (Creature* darkMatterTarget = ObjectAccessor::GetCreature(*me, darkMatterTargetGUID)) + { + darkMatterTarget->CastSpell(darkMatterTarget, darkMatterTarget->GetMap()->IsHeroic() ? SPELL_DARK_MATTER_H : SPELL_DARK_MATTER, true); + darkMatterTarget->DespawnOrUnsummon(500); + } + break; + } + case EVENT_ABEDNEUM_HEAD: // Phase 3 + { + if (!canExecuteEvents) + return; if (GetAbedneum()) { Player* plr = SelectTargetFromPlayerList(100.0f); @@ -475,38 +615,50 @@ public: cr->CastSpell(cr, DUNGEON_MODE(SPELL_SEARING_GAZE, SPELL_SEARING_GAZE_H), true); } } - events.Repeat(30s); + events.Repeat(15s); break; } - case EVENT_SUMMON_MONSTERS: + case EVENT_SUMMON_MONSTERS: { - uint32 Time = 45000 - (2500 * WaveNum); - SummonCreatures(NPC_DARK_RUNE_PROTECTOR, 3); + if (!canExecuteEvents) + return; + uint32 Time = 40000 - (2500 * WaveNum); + SummonCreatures(NPC_DARK_RUNE_PROTECTOR, 3, 0); if (WaveNum > 2) - SummonCreatures(NPC_DARK_RUNE_STORMCALLER, 2); + events.ScheduleEvent(EVENT_SUMMON_STORMCALLER, urand(10 - WaveNum, 15 - WaveNum) * 1000); if (WaveNum > 5) - SummonCreatures(NPC_IRON_GOLEM_CUSTODIAN, 1); + events.ScheduleEvent(EVENT_SUMMON_CUSTODIAN, urand(10 - WaveNum, 15 - WaveNum) * 1000); WaveNum++; events.RepeatEvent(Time); break; } - case EVENT_TRIBUNAL_END: + case EVENT_SUMMON_STORMCALLER: { + if (!canExecuteEvents) + return; + + SummonCreatures(NPC_DARK_RUNE_STORMCALLER, 2, 1); + + break; + } + case EVENT_SUMMON_CUSTODIAN: + { + if (!canExecuteEvents) + return; + + SummonCreatures(NPC_IRON_GOLEM_CUSTODIAN, 1, 1); + + break; + } + case EVENT_TRIBUNAL_END: + { + canExecuteEvents = false; // Has to be here! events.Reset(); //DespawnHeads(); summons.DespawnAll(); - if (pInstance) - { - pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, DONE); - pInstance->SetData(BRANN_BRONZEBEARD, 3); - me->CastSpell(me, 59046, true); // credit - } - - me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); - // Spawn Chest and quest credit if (Player* plr = SelectTargetFromPlayerList(200.0f)) { @@ -520,31 +672,89 @@ public: plr->GroupEventHappens(QUEST_HALLS_OF_STONE, me); } - events.ScheduleEvent(EVENT_GO_TO_SJONNIR, 279s); + events.ScheduleEvent(EVENT_BREEN_WAITING, 11s); + events.ScheduleEvent(EVENT_SKY_ROOM_FLOOR_CHANGE, 92s); + events.ScheduleEvent(EVENT_TALK_FACE_CHANGE, 97s); //kaddrak speaks + events.ScheduleEvent(EVENT_SKY_ROOM_FLOOR_CHANGE, 168s); + events.ScheduleEvent(EVENT_TALK_FACE_CHANGE, 173s); //marnak speaks + events.ScheduleEvent(EVENT_SKY_ROOM_FLOOR_CHANGE, 239s); + events.ScheduleEvent(EVENT_TALK_FACE_CHANGE, 244s); //abedneum speaks + events.ScheduleEvent(EVENT_GO_TO_SJONNIR, 251s); + events.ScheduleEvent(EVENT_SKY_ROOM_FLOOR_CHANGE, 253s); break; } - case EVENT_GO_TO_SJONNIR: + case EVENT_BREEN_WAITING: { - if (GameObject* door = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_SJONNIR_DOOR))) - door->SetGoState(GO_STATE_ACTIVE); SetEscortPaused(false); - ResetEvent(); - me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); - break; - } - case EVENT_END: - { - events.Reset(); if (pInstance) - pInstance->SetData(BRANN_BRONZEBEARD, 6); + { + pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, DONE); + pInstance->SetData(BRANN_BRONZEBEARD, 3); + me->CastSpell(me, 59046, true); // credit + } me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); - me->Yell("I'll use the forge to make batches o' earthen to stand guard... But our greatest challenge still remains: find and stop Loken!", LANG_UNIVERSAL); - me->PlayDirectSound(14279); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND); + me->SendMovementFlagUpdate(); + break; } + case EVENT_TALK_FACE_CHANGE: + { + if (pInstance) + pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, DONE); + break; + } + case EVENT_SKY_ROOM_FLOOR_CHANGE: + { + if (pInstance) + pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, SPECIAL); + break; + } + case EVENT_GO_TO_SJONNIR: + { + me->AI()->DoAction(ACTION_GO_TO_SJONNIR); + break; + } + case EVENT_DOOR_OPEN: + { + me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); + me->AddUnitMovementFlag(MOVEMENTFLAG_NONE); + + if (pInstance) + { + if (GameObject* door = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_SJONNIR_DOOR))) + { + door->SetGoState(GO_STATE_ACTIVE); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY_UNARMED); + me->SendMovementFlagUpdate(); + } + } + + break; + } + case EVENT_RESUME_ESCORT: + { + SetEscortPaused(false); + break; + } + case EVENT_SJONNIR_END_BRANN_YELL: + { + Talk(SAY_BRANN_VICTORY_SJONNIR_1); + break; + } + case EVENT_SJONNIR_END_BRANN_LAST_YELL: + { + events.Reset(); + SetEscortPaused(false); + Talk(SAY_BRANN_VICTORY_SJONNIR_2); + break; + } + } } + npc_escortAI::UpdateEscortAI(diff); + if (TalkEvent) { SpeechPause += diff; @@ -581,11 +791,16 @@ public: } } - void SummonCreatures(uint32 entry, uint8 count) + void SummonCreatures(uint32 entry, uint8 count, uint8 pos) { + Creature* cr; for (int i = 0; i < count; ++i) { - Creature* cr = me->SummonCreature(entry, 946.5971f + urand(0, 6), 383.5330f + urand(0, 6), 205.9943f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + if (pos == 0) + cr = me->SummonCreature(entry, 943.088f + urand(0, 5), 401.378f + urand(0, 5), 206.078f, 3.8f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); //left + else + cr = me->SummonCreature(entry, 964.302f + urand(0, 4), 378.942f + urand(0, 4), 206.078f, 3.85f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); //right + if (cr) { cr->AI()->AttackStart(me); @@ -602,9 +817,18 @@ public: { if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) { + brann->HandleEmoteCommand(EMOTE_STATE_DEAD); brann->setDeathState(DeathState::JustDied); brann->Respawn(); - brann->AI()->DoAction(5); + if (pInstance->GetData(BOSS_TRIBUNAL_OF_AGES) != DONE) + { + brann->AI()->DoAction(ACTION_TRIBUNAL_WIPE_START); + pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, FAIL); + } + if (pInstance->GetData(BOSS_TRIBUNAL_OF_AGES) == DONE) + { + brann->AI()->DoAction(ACTION_SJONNIR_WIPE_START); + } } if (pInstance->GetData(BOSS_TRIBUNAL_OF_AGES) != DONE) pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, NOT_STARTED); @@ -635,16 +859,18 @@ void brann_bronzebeard::brann_bronzebeardAI::InitializeEvent() TalkEvent = true; events.Reset(); - events.ScheduleEvent(EVENT_SUMMON_MONSTERS, 21s); - events.ScheduleEvent(EVENT_KADDRAK_HEAD, 20s); - events.ScheduleEvent(EVENT_MARNAK_HEAD, 105s); - events.ScheduleEvent(EVENT_ABEDNEUM_HEAD, 205s); - events.ScheduleEvent(EVENT_TRIBUNAL_END, 315s); // Viusals - events.ScheduleEvent(EVENT_KADDRAK_VISUAL, 20s); + events.ScheduleEvent(EVENT_KADDRAK_VISUAL, 30s); events.ScheduleEvent(EVENT_MARNAK_VISUAL, 105s); - events.ScheduleEvent(EVENT_ABEDNEUM_VISUAL, 205s); + events.ScheduleEvent(EVENT_ABEDNEUM_VISUAL, 207s); + + // Fight + events.ScheduleEvent(EVENT_SUMMON_MONSTERS, 47s); + events.ScheduleEvent(EVENT_KADDRAK_HEAD, 47s); + events.ScheduleEvent(EVENT_MARNAK_HEAD, 115s); + events.ScheduleEvent(EVENT_ABEDNEUM_HEAD, 217s); + events.ScheduleEvent(EVENT_TRIBUNAL_END, 310s); } void brann_bronzebeard::brann_bronzebeardAI::WaypointReached(uint32 id) @@ -652,46 +878,89 @@ void brann_bronzebeard::brann_bronzebeardAI::WaypointReached(uint32 id) switch (id) { // Stop before stairs and ask to start - case 9: + case 14: SetEscortPaused(true); - me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); if (pInstance) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER); + Talk(SAY_BRANN_EVENT_INTRO_1); + me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); pInstance->SetData(BRANN_BRONZEBEARD, 2); - + } break; // In front of Console - case 11: + case 16: SetEscortPaused(true); if (pInstance) { pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, IN_PROGRESS); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); if (GameObject* tribunal = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_TRIBUNAL_CONSOLE))) tribunal->SetGoState(GO_STATE_ACTIVE); } break; - // Before Sjonnir's door - case 27: + //Tribunal end, stand in the middle of the sky room + case 17: SetEscortPaused(true); + me->SetOrientation(3.91672f); + me->SendMovementFlagUpdate(); + break; + //Run to the skyroom door and then teleport before Sjonnir's door + case 18: + SetEscortPaused(true); + SetNextWaypoint(33, false); if (pInstance) { - pInstance->SetData(BRANN_BRONZEBEARD, 5); + pInstance->SetData(BRANN_BRONZEBEARD, 4); me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); if (Creature* cr = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_SJONNIR))) cr->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->SetOrientation(3.132660f); DoCast(me, 58506, false); + me->SendMovementFlagUpdate(); + me->SetHomePosition(1199.8f, 667.138f, 196.242f, 3.12967f); + me->Relocate(1199.8f, 667.138f, 196.242f, 3.12967f); } break; - case 28: + // Before Sjonnir's door + case 33: SetEscortPaused(true); break; - case 29: + //Walk to the door, run after opening it + case 34: + SetEscortPaused(true); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); + me->SendMovementFlagUpdate(); + events.ScheduleEvent(EVENT_DOOR_OPEN, 1500); + me->SetWalk(false); + me->SetSpeed(MOVE_RUN, 1.0f, false); + events.ScheduleEvent(EVENT_RESUME_ESCORT, 3500); + break; + //Brann stops in front of Sjonnir and awaits the start of the battle. + case 36: + SetEscortPaused(true); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY_UNARMED); + me->SendMovementFlagUpdate(); + Talk(SAY_BRANN_FRONT_OF_SJONNIR); + break; + //Brann steps back and uses the Sjonnir console. + case 38: SetEscortPaused(true); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); if (pInstance) + { if (GameObject* console = ObjectAccessor::GetGameObject(*me, pInstance->GetGuidData(GO_SJONNIR_CONSOLE))) console->SetGoState(GO_STATE_ACTIVE); - + } + break; + //After Sjonnir's death, Brann steps away from the console and talk. + case 39: + SetEscortPaused(true); + break; + //Brann steps back and uses the Sjonnir console. + case 40: + SetEscortPaused(true); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); break; } } @@ -864,9 +1133,9 @@ public: }; }; -class spell_hos_dark_matter_aura : public AuraScript +class spell_hos_dark_matter : public AuraScript { - PrepareAuraScript(spell_hos_dark_matter_aura); + PrepareAuraScript(spell_hos_dark_matter); bool Validate(SpellInfo const* /*spellInfo*/) override { @@ -881,7 +1150,23 @@ class spell_hos_dark_matter_aura : public AuraScript void Register() override { - OnEffectRemove += AuraEffectRemoveFn(spell_hos_dark_matter_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_hos_dark_matter::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + +class spell_hos_dark_matter_size : public SpellScript +{ + PrepareSpellScript(spell_hos_dark_matter_size); + + void HandleApplyTouch() + { + if (Unit* target = GetHitUnit()) + target->SetObjectScale(0.35f); + } + + void Register() override + { + AfterHit += SpellHitFn(spell_hos_dark_matter_size::HandleApplyTouch); } }; @@ -891,5 +1176,6 @@ void AddSC_brann_bronzebeard() new dark_rune_protectors(); new dark_rune_stormcaller(); new iron_golem_custodian(); - RegisterSpellScript(spell_hos_dark_matter_aura); + RegisterSpellScript(spell_hos_dark_matter); + RegisterSpellScript(spell_hos_dark_matter_size); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h index f027fa014..c9188b35e 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.h @@ -24,6 +24,23 @@ #define HallsOfStoneScriptName "instance_halls_of_stone" +enum Texts +{ + SAY_BRANN_KILL = 0, + SAY_BRANN_LOW_HEALTH = 1, + SAY_BRANN_DEATH = 2, + SAY_BRANN_PLAYER_DEATH = 3, + SAY_BRANN_ESCORT_START = 4, + SAY_BRANN_FRONT_OF_SJONNIR = 5, + SAY_BRANN_SPAWN_TROGG = 6, + SAY_BRANN_SPAWN_OOZE = 7, + SAY_BRANN_SPAWN_EARTHEN = 8, + SAY_BRANN_EVENT_INTRO_1 = 9, + SAY_BRANN_VICTORY_SJONNIR_1 = 30, + SAY_BRANN_VICTORY_SJONNIR_2 = 31, + SAY_BRANN_ENTRANCE_MEET = 32, +}; + enum Encounter { BOSS_KRYSTALLUS = 0, @@ -61,6 +78,15 @@ enum npcs NPC_ABEDNEUM = 30899, NPC_SJONNIR = 27978, NPC_BRANN = 28070, + + ACTION_START_ESCORT_EVENT = 0, + ACTION_START_TRIBUNAL = 1, + ACTION_TRIBUNAL_WIPE_START = 2, + ACTION_GO_TO_SJONNIR = 3, + ACTION_OPEN_DOOR = 4, + ACTION_START_SJONNIR_FIGHT = 5, + ACTION_SJONNIR_DEAD = 6, + ACTION_SJONNIR_WIPE_START = 7, }; template diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp index 619d5e724..968d95126 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp @@ -157,6 +157,8 @@ public: return goMarnakGUID; case GO_ABEDNEUM: return goAbedneumGUID; + case GO_SKY_FLOOR: + return goSkyRoomFloorGUID; case NPC_SJONNIR: return SjonnirGUID; @@ -210,23 +212,91 @@ public: if (GameObject* tribunalDoor = instance->GetGameObject(goTribunalDoorGUID)) tribunalDoor->SetGoState(GO_STATE_ACTIVE); + if (type == BOSS_TRIBUNAL_OF_AGES && data == SPECIAL) + { + if (GameObject* pSkyRoomFloor = instance->GetGameObject(goSkyRoomFloorGUID)) + pSkyRoomFloor->SetGoState(GO_STATE_READY); + } + if (type == BOSS_TRIBUNAL_OF_AGES && data == DONE) { - if (GameObject* pA = instance->GetGameObject(goAbedneumGUID)) - pA->SetGoState(GO_STATE_ACTIVE); - if (GameObject* pF = instance->GetGameObject(goSkyRoomFloorGUID)) - pF->SetGoState(GO_STATE_ACTIVE); + GameObject* pAbedneum = instance->GetGameObject(goAbedneumGUID); + GameObject* pKaddrak = instance->GetGameObject(goKaddrakGUID); + GameObject* pMarnak = instance->GetGameObject(goMarnakGUID); + + GameObject* pSkyRoomFloor = instance->GetGameObject(goSkyRoomFloorGUID); + bool skyRoomDown = false; + + if (pAbedneum && pKaddrak && pMarnak && pSkyRoomFloor) + { + if (pAbedneum->GetGoState() != GO_STATE_ACTIVE) + { + if (pKaddrak->GetGoState() != GO_STATE_ACTIVE && pMarnak->GetGoState() != GO_STATE_ACTIVE) + { + //Abedneum first talk + pAbedneum->SetGoState(GO_STATE_ACTIVE); + } + else if (pMarnak->GetGoState() == GO_STATE_ACTIVE) + { + //Abedneum second talk + pAbedneum->SetGoState(GO_STATE_ACTIVE); + pMarnak->SetGoState(GO_STATE_READY); + pSkyRoomFloor->SetGoState(GO_STATE_READY); + skyRoomDown = true; + } + else + { + //Marnak talk + if (pKaddrak->GetGoState() == GO_STATE_ACTIVE) + { + pMarnak->SetGoState(GO_STATE_ACTIVE); + pKaddrak->SetGoState(GO_STATE_READY); + pSkyRoomFloor->SetGoState(GO_STATE_READY); + } + } + } + else + { + //Kaddrak talk + if (pKaddrak->GetGoState() != GO_STATE_ACTIVE) + { + pAbedneum->SetGoState(GO_STATE_READY); + pKaddrak->SetGoState(GO_STATE_ACTIVE); + pSkyRoomFloor->SetGoState(GO_STATE_READY); + } + } + + if (!skyRoomDown) + pSkyRoomFloor->SetGoState(GO_STATE_ACTIVE); + } // Make sjonnir attackable - if (Creature* cr = instance->GetCreature(SjonnirGUID)) - cr->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + if (Creature* cSjonnir = instance->GetCreature(SjonnirGUID)) + cSjonnir->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); } + if (type == BOSS_TRIBUNAL_OF_AGES && data == NOT_STARTED) { - if (GameObject* pA = instance->GetGameObject(goAbedneumGUID)) - pA->SetGoState(GO_STATE_READY); - if (GameObject* pF = instance->GetGameObject(goSkyRoomFloorGUID)) - pF->SetGoState(GO_STATE_READY); + if (GameObject* pAbedneum = instance->GetGameObject(goAbedneumGUID)) + pAbedneum->SetGoState(GO_STATE_READY); + if (GameObject* pKaddrak = instance->GetGameObject(goKaddrakGUID)) + pKaddrak->SetGoState(GO_STATE_READY); + if (GameObject* pMarnak = instance->GetGameObject(goMarnakGUID)) + pMarnak->SetGoState(GO_STATE_READY); + if (GameObject* pSkyRoomFloor = instance->GetGameObject(goSkyRoomFloorGUID)) + pSkyRoomFloor->SetGoState(GO_STATE_READY); + } + + if (type == BOSS_TRIBUNAL_OF_AGES && data == FAIL) + { + if (GameObject* pAbedneum = instance->GetGameObject(goAbedneumGUID)) + pAbedneum->SetGoState(GO_STATE_ACTIVE); + if (GameObject* pKaddrak = instance->GetGameObject(goKaddrakGUID)) + pKaddrak->SetGoState(GO_STATE_ACTIVE); + if (GameObject* pMarnak = instance->GetGameObject(goMarnakGUID)) + pMarnak->SetGoState(GO_STATE_ACTIVE); + if (GameObject* pSkyRoomFloor = instance->GetGameObject(goSkyRoomFloorGUID)) + pSkyRoomFloor->SetGoState(GO_STATE_READY); } if (type == DATA_BRANN_ACHIEVEMENT)