From 99485195d2e1c97dc61e3d4aa6bac405ac4ad44b Mon Sep 17 00:00:00 2001 From: patou01 <2592673+patou01@users.noreply.github.com> Date: Fri, 5 Nov 2021 11:18:53 +0100 Subject: [PATCH] fix(script/LBRS): Urok Doomhowl improvements (#7960) --- .../rev_1631974777295481100.sql | 49 ++++++++++++++ .../BlackrockSpire/blackrock_spire.h | 4 ++ .../BlackrockSpire/boss_urok_doomhowl.cpp | 8 ++- .../instance_blackrock_spire.cpp | 64 ++++++++++++++++--- 4 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1631974777295481100.sql diff --git a/data/sql/updates/pending_db_world/rev_1631974777295481100.sql b/data/sql/updates/pending_db_world/rev_1631974777295481100.sql new file mode 100644 index 000000000..14ccef8c7 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1631974777295481100.sql @@ -0,0 +1,49 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1631974777295481100'); +UPDATE `creature_template` SET `flags_extra` = 0, `faction` = 40 WHERE (`entry` IN (10601, 10602)); + +-- extend duration of mobs alive, without increasing Urok. spawn all circles at once +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 17558400); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(17558400, 9, 0, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 50, 175571, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -14.36, -389.37, 48.78, 0, 'Script9 - Summon GO'), +(17558400, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 50, 175571, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -27.43, -372.86, 49.36, 0, 'Script9 - Summon GO'), +(17558400, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 50, 175571, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -19.78, -372.75, 49.25, 0, 'Script9 - Summon GO'), +(17558400, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 50, 175571, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -31.67, -385.91, 48.65, 0, 'Script9 - Summon GO'), +(17558400, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 50, 175571, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -37.13, -369.65, 50.63, 0, 'Script9 - Summon GO'), +(17558400, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 50, 175571, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, -46.26, -376.98, 50.51, 0, 'Script9 - Summon GO'), +(17558400, 9, 6, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 12, 10601, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -19.78, -372.75, 49.25, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 12, 10601, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -31.67, -385.91, 48.65, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 12, 10602, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -37.13, -369.65, 50.63, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 9, 0, 0, 0, 100, 0, 15000, 15000, 0, 0, 0, 12, 10601, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -14.36, -389.37, 48.78, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 12, 10602, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -27.43, -372.86, 49.36, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 11, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 0, 12, 10602, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -31.67, -385.91, 48.65, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 12, 0, 0, 0, 100, 0, 15000, 15000, 0, 0, 0, 12, 10601, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -46.26, -376.98, 50.51, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 13, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 12, 10602, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -37.13, -369.65, 50.63, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 14, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 0, 12, 10601, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -27.43, -372.86, 49.36, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 15, 0, 0, 0, 100, 0, 15000, 15000, 0, 0, 0, 12, 10602, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -46.26, -376.98, 50.51, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 16, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 12, 10601, 4, 120000, 0, 0, 0, 8, 0, 0, 0, 0, -14.36, -389.37, 48.78, 0, 'Script9 - Summon Creature ogre'), +(17558400, 9, 17, 0, 0, 0, 100, 0, 15000, 15000, 0, 0, 0, 12, 10584, 4, 30000, 0, 0, 0, 8, 0, 0, 0, 0, -28.57, -395.78, 48.78, 1.41, 'Script9 - Summon Creature Urok'), +(17558400, 9, 18, 0, 0, 0, 100, 0, 60000, 60000, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Script9 - Delete Self'); + +-- add urok data fail + despawn to urok enforcer and ogre magus +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 10601; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 10601) AND (`source_type` = 0) AND (`id` IN (1, 2, 20)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(10601, 0, 1, 2, 1, 0, 100, 0, 30000, 30000, 0, 0, 0, 34, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'OOC update - Set Urok fail after timer'), +(10601, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Link - despawn self after fail'), +(10601, 0, 20, 21, 54, 0, 100, 1, 0, 0, 0, 0, 0, 11, 12980, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'On Update - Cast Spell'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 10602; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 10602) AND (`source_type` = 0) AND (`id` IN (4, 3, 20)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(10602, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Link - self despawn'), +(10602, 0, 3, 4, 1, 0, 100, 0, 30000, 30000, 0, 0, 0, 34, 4, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'OOC update - set Urok to fail'), +(10602, 0, 20, 21, 54, 0, 100, 1, 0, 0, 0, 0, 0, 11, 12980, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'On spawn - Cast Spell'); + +-- despawn circles after 2 minutes +UPDATE `gameobject_template` SET `AIName` = 'SmartGameObjectAI' WHERE `entry` = 175571; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 175571) AND (`source_type` = 1) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(175571, 1, 0, 0, 1, 0, 100, 0, 0, 0, 0, 0, 0, 41, 120000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, ''); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h index 2fc63e865..335cda813 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h @@ -73,6 +73,8 @@ enum CreaturesIds NPC_BLACKHAND_VETERAN = 9819, NPC_BLACKHAND_INCARCERATOR = 10316, NPC_LORD_VICTOR_NEFARIUS = 10162, + NPC_UROK_MAGUS = 10602, + NPC_UROK_ENFORCER = 10601, NPC_FINKLE_EINHORN = 10776 }; @@ -121,6 +123,8 @@ enum GameObjectsIds GO_PORTCULLIS_TOBOSSROOMS = 175186, // Urok Doomhowl GO_UROK_PILE = 175621, + GO_UROK_CHALLENGE = 175584, + GO_UROK_CIRCLE = 175571 }; enum npcspells diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp index 96a212f27..23417f553 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp @@ -58,6 +58,8 @@ public: { me->CastSpell(me, SPELL_UROK_SPAWN, true); BossAI::InitializeAI(); + Talk(SAY_SUMMON); + DoZoneInCombat(nullptr, 100.0f); } void EnterCombat(Unit* /*who*/) override @@ -65,7 +67,7 @@ public: _EnterCombat(); events.ScheduleEvent(SPELL_REND, urand(17000, 20000)); events.ScheduleEvent(SPELL_STRIKE, urand(10000, 12000)); - Talk(SAY_AGGRO); + events.ScheduleEvent(SPELL_INTIMIDATING_ROAR, urand(25000, 30000)); } void JustDied(Unit* /*killer*/) override @@ -95,6 +97,10 @@ public: DoCastVictim(SPELL_STRIKE); events.ScheduleEvent(SPELL_STRIKE, urand(8000, 10000)); break; + case SPELL_INTIMIDATING_ROAR: + DoCastVictim(SPELL_INTIMIDATING_ROAR); + events.ScheduleEvent(SPELL_INTIMIDATING_ROAR, urand(40000, 45000)); + break; default: break; } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp index 6ce09c80f..844788307 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp @@ -33,13 +33,7 @@ uint32 const DragonspireMobs[3] = { NPC_BLACKHAND_DREADWEAVER, NPC_BLACKHAND_SUM enum EventIds { EVENT_DARGONSPIRE_ROOM_STORE = 1, - EVENT_DARGONSPIRE_ROOM_CHECK = 2, - EVENT_UROK_DOOMHOWL_SPAWNS_1 = 3, - EVENT_UROK_DOOMHOWL_SPAWNS_2 = 4, - EVENT_UROK_DOOMHOWL_SPAWNS_3 = 5, - EVENT_UROK_DOOMHOWL_SPAWNS_4 = 6, - EVENT_UROK_DOOMHOWL_SPAWNS_5 = 7, - EVENT_UROK_DOOMHOWL_SPAWN_IN = 8 + EVENT_DARGONSPIRE_ROOM_CHECK = 2 }; enum Texts @@ -76,6 +70,11 @@ public: { switch (creature->GetEntry()) { + case NPC_UROK_MAGUS: + [[fallthrough]]; + case NPC_UROK_ENFORCER: + UrokMobs.push_back(creature->GetGUID()); + break; case NPC_HIGHLORD_OMOKK: HighlordOmokk = creature->GetGUID(); break; @@ -239,7 +238,13 @@ public: HandleGameObject(ObjectGuid::Empty, true, go); break; case GO_UROK_PILE: - go_urok_pile = go->GetGUID(); + go_urokPile = go->GetGUID(); + break; + case GO_UROK_CIRCLE: + go_urokOgreCirles.push_back(go->GetGUID()); + break; + case GO_UROK_CHALLENGE: + go_urokChallenge = go->GetGUID(); break; default: break; @@ -303,8 +308,11 @@ public: case EVENT_UROK_DOOMHOWL: if (GetBossState(DATA_UROK_DOOMHOWL) == NOT_STARTED) { - if (GameObject* pile = instance->GetGameObject(go_urok_pile)) + SetBossState(DATA_UROK_DOOMHOWL, IN_PROGRESS); + if (GameObject* pile = instance->GetGameObject(go_urokPile)) + { pile->SetLootState(GO_JUST_DEACTIVATED); + } } break; default: @@ -322,6 +330,39 @@ public: if (GetBossState(DATA_DRAGONSPIRE_ROOM) != DONE) Events.ScheduleEvent(EVENT_DARGONSPIRE_ROOM_STORE, 1000); } + break; + case DATA_UROK_DOOMHOWL: + if (data == FAIL) + { + if (!(GetBossState(DATA_UROK_DOOMHOWL) == NOT_STARTED)) + { + SetBossState(DATA_UROK_DOOMHOWL, NOT_STARTED); + if (GameObject* challenge = instance->GetGameObject(go_urokChallenge)) + { + challenge->Delete(); + } + if (GameObject* pile = instance->GetGameObject(go_urokPile)) + { + pile->SetLootState(GO_READY); + pile->Respawn(); + } + for (const auto& circleGUID : go_urokOgreCirles) + { + if (GameObject* circle = instance->GetGameObject(circleGUID)) + { + circle->Delete(); + } + } + for (const auto& mobGUID: UrokMobs) + { + if (Creature* mob = instance->GetCreature(mobGUID)) + { + mob->DespawnOrUnsummon(); + } + } + } + } + break; default: break; } @@ -592,7 +633,10 @@ public: GuidVector runecreaturelist[7]; ObjectGuid go_portcullis_active; ObjectGuid go_portcullis_tobossrooms; - ObjectGuid go_urok_pile; + ObjectGuid go_urokPile; + ObjectGuid go_urokChallenge; + std::vector go_urokOgreCirles; + std::vector UrokMobs; }; InstanceScript* GetInstanceScript(InstanceMap* map) const override