diff --git a/sql/migrations/20200616192801_world.sql b/sql/migrations/20200616192801_world.sql new file mode 100644 index 000000000..7580296d7 --- /dev/null +++ b/sql/migrations/20200616192801_world.sql @@ -0,0 +1,142 @@ +DROP PROCEDURE IF EXISTS add_migration; +delimiter ?? +CREATE PROCEDURE `add_migration`() +BEGIN +DECLARE v INT DEFAULT 1; +SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20200616192801'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20200616192801'); +-- Add your query below. + + +-- Remove static spawn for Gyth in UBRS. +DELETE FROM `creature` WHERE `id`=10339; + +-- Correct spawns of Nefarian and Rend in UBRS. +UPDATE `creature` SET `position_x`=163.168, `position_y`=-444.165, `position_z`=122.059, `orientation`=3.12414, `spawntimesecsmin`=1000000, `spawntimesecsmax`=1000000 WHERE `guid`=41877; +INSERT INTO `creature` (`guid`, `id`, `id2`, `id3`, `id4`, `map`, `display_id`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecsmin`, `spawntimesecsmax`, `wander_distance`, `health_percent`, `mana_percent`, `movement_type`, `spawn_flags`, `visibility_mod`, `patch_min`, `patch_max`) VALUES (41809, 10429, 0, 0, 0, 229, 0, 0, 159.276, -443.619, 122.059, 6.26573, 1000000, 1000000, 0, 100, 0, 0, 0, 0, 0, 10); + +-- Change default movement type to idle. +UPDATE `creature_template` SET `movement_type`=0 WHERE `entry` IN (10442, 10447, 10742, 10339, 10429, 10162, 9819, 10317); + +-- Increase aggro radius for stadium event mobs. +UPDATE `creature_template` SET `detection_range`=25 WHERE `entry` IN (10442, 10447, 10742); + +-- Add waypoints for mobs summoned during stadium event. +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`) VALUES +(10442, 1, 177.85, -421.282, 110.472, 100), +(10442, 2, 175.62, -413.621, 110.863, 100), +(10442, 3, 168.71, -409.398, 110.863, 100), +(10442, 4, 161.046, -403.908, 110.863, 100), +(10442, 5, 152.812, -402.17, 110.863, 100), +(10442, 6, 141.017, -403.946, 110.863, 100), +(10442, 7, 131.584, -405.95, 110.863, 100), +(10442, 8, 122.644, -411, 110.863, 100), +(10442, 9, 122.206, -417.566, 110.488, 100), +(10442, 10, 124.851, -431.84, 110.863, 100), +(10442, 11, 132.464, -435.998, 110.863, 100), +(10442, 12, 145.458, -435.786, 110.863, 100), +(10442, 13, 151.911, -436.3, 110.863, 100), +(10442, 14, 166.307, -436.156, 110.863, 100), +(10442, 15, 175.394, -431.882, 110.863, 100); + +-- Add waypoints for Lord Victor Nefarius. +INSERT INTO `creature_movement_template` (`entry`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `waittime`) VALUES (10162, 1, 169.33, -444.8, 121.98, 6.27848, 0); +INSERT INTO `creature_movement_template` (`entry`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `waittime`) VALUES (10162, 2, 161.91, -444.92, 121.98, 3.28768, 0); + +-- Add waypoints for Gyth. +INSERT INTO `creature_movement_template` (`entry`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `waittime`, `script_id`) VALUES +(10339, 1, 211.762, -397.589, 111.182, 100, 0, 0), +(10339, 2, 209.232, -409.57, 110.939, 100, 0, 0), +(10339, 3, 190.982, -420.506, 110.89, 100, 0, 0), +(10339, 4, 163.62, -420.33, 110.47, 100, 60000, 1033904), +(10339, 5, 163.62, -420.33, 110.47, 100, 0, 0); +DELETE FROM `creature_movement_scripts` WHERE `id`=1033904; +INSERT INTO `creature_movement_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033904, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gyth - Move Idle'); + +-- Events list for Gyth +DELETE FROM `creature_ai_events` WHERE `creature_id`=10339; +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1033901, 10339, 0, 2, 0, 100, 0, 50, 1, 0, 0, 1033901, 0, 0, 'Gyth - Cast Chromatic Power below 50% HP'); +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1033902, 10339, 0, 2, 0, 100, 0, 20, 0, 0, 0, 1033902, 0, 0, 'Gyth - Summon Rend below 20% HP'); +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1033903, 10339, 0, 11, 0, 100, 0, 0, 0, 0, 0, 1033903, 0, 0, 'Gyth - Enable Death Prevention on Spawn'); +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1033904, 10339, 0, 17, 0, 100, 0, 10429, 0, 0, 0, 1033904, 0, 0, 'Gyth - Say Emoted Text on Summoning Rend'); +DELETE FROM `creature_ai_scripts` WHERE `id`=1033901; +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033901, 0, 0, 0, 0, 0, 0, 10162, 0, 10, 2, 5726, 0, 0, 0, 0, 0, 0, 0, 0, 'Lord VIctor Nefarius - Say Text'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033901, 0, 15, 16337, 2, 0, 0, 10162, 0, 10, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lord VIctor Nefarius - Cast Spell Chromatic Chaos'); +DELETE FROM `creature_ai_scripts` WHERE `id`=1033902; +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033902, 0, 14, 16167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gyth - Remove Aura Rend Blackhand Mounts'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033902, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gyth - Disable Death Prevention'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033902, 0, 15, 16328, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gyth - Cast Spell Summon Rend Blackhand'); +DELETE FROM `creature_ai_scripts` WHERE `id`=1033903; +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033903, 0, 52, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gyth - Enable Death Prevention'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033903, 0, 15, 16167, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Gyth - Cast Spell Rend Blackhand Mounts'); +DELETE FROM `creature_ai_scripts` WHERE `id`=1033904; +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5711, 0, 0, 0, 0, 0, 0, 0, 0, 'Warchief Rend Blackhand - Say Text'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033904, 0, 4, 46, 768, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Warchief Rend Blackhand - Remove Immune to Player Flag'); +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1033904, 0, 15, 13360, 2, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Warchief Rend Blackhand - Cast Spell Knockdown'); +REPLACE INTO `creature_spells` (`entry`, `name`, `spellId_1`, `probability_1`, `castTarget_1`, `targetParam1_1`, `targetParam2_1`, `castFlags_1`, `delayInitialMin_1`, `delayInitialMax_1`, `delayRepeatMin_1`, `delayRepeatMax_1`, `scriptId_1`, `spellId_2`, `probability_2`, `castTarget_2`, `targetParam1_2`, `targetParam2_2`, `castFlags_2`, `delayInitialMin_2`, `delayInitialMax_2`, `delayRepeatMin_2`, `delayRepeatMax_2`, `scriptId_2`, `spellId_3`, `probability_3`, `castTarget_3`, `targetParam1_3`, `targetParam2_3`, `castFlags_3`, `delayInitialMin_3`, `delayInitialMax_3`, `delayRepeatMin_3`, `delayRepeatMax_3`, `scriptId_3`, `spellId_4`, `probability_4`, `castTarget_4`, `targetParam1_4`, `targetParam2_4`, `castFlags_4`, `delayInitialMin_4`, `delayInitialMax_4`, `delayRepeatMin_4`, `delayRepeatMax_4`, `scriptId_4`, `spellId_5`, `probability_5`, `castTarget_5`, `targetParam1_5`, `targetParam2_5`, `castFlags_5`, `delayInitialMin_5`, `delayInitialMax_5`, `delayRepeatMin_5`, `delayRepeatMax_5`, `scriptId_5`, `spellId_6`, `probability_6`, `castTarget_6`, `targetParam1_6`, `targetParam2_6`, `castFlags_6`, `delayInitialMin_6`, `delayInitialMax_6`, `delayRepeatMin_6`, `delayRepeatMax_6`, `scriptId_6`, `spellId_7`, `probability_7`, `castTarget_7`, `targetParam1_7`, `targetParam2_7`, `castFlags_7`, `delayInitialMin_7`, `delayInitialMax_7`, `delayRepeatMin_7`, `delayRepeatMax_7`, `scriptId_7`, `spellId_8`, `probability_8`, `castTarget_8`, `targetParam1_8`, `targetParam2_8`, `castFlags_8`, `delayInitialMin_8`, `delayInitialMax_8`, `delayRepeatMin_8`, `delayRepeatMax_8`, `scriptId_8`) VALUES (103390, 'Blackrock Spire - Gyth', 16359, 100, 1, 0, 0, 0, 8, 8, 7, 7, 0, 16350, 100, 1, 0, 0, 0, 11, 11, 16, 16, 0, 16390, 100, 1, 0, 0, 0, 4, 4, 10, 10, 0, 10101, 100, 1, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +UPDATE `creature_template` SET `spell_list_id`=103390, `ai_name`='EventAI', `script_name`='' WHERE `entry`=10339; + +-- Events list for Warchief Rend Blackhand +DELETE FROM `creature_ai_events` WHERE `creature_id`=10429; +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1042901, 10429, 0, 2, 0, 100, 0, 20, 1, 0, 0, 1042901, 0, 0, 'Warchief Rend Blackhand - Cast Enrage at 20% HP'); +INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1042902, 10429, 110, 11, 0, 100, 0, 0, 0, 0, 0, 1042902, 0, 0, 'Warchief Rend Blackhand - Morph on Spawn during Winter Veil'); +DELETE FROM `creature_ai_scripts` WHERE `id`=1042901; +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1042901, 0, 15, 8269, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Warchief Rend Blackhand - Cast Enrage'); +DELETE FROM `creature_ai_scripts` WHERE `id`=1042902; +INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1042902, 0, 23, 15736, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Warchief Rend Blackhand - Morph'); +REPLACE INTO `creature_spells` (`entry`, `name`, `spellId_1`, `probability_1`, `castTarget_1`, `targetParam1_1`, `targetParam2_1`, `castFlags_1`, `delayInitialMin_1`, `delayInitialMax_1`, `delayRepeatMin_1`, `delayRepeatMax_1`, `scriptId_1`, `spellId_2`, `probability_2`, `castTarget_2`, `targetParam1_2`, `targetParam2_2`, `castFlags_2`, `delayInitialMin_2`, `delayInitialMax_2`, `delayRepeatMin_2`, `delayRepeatMax_2`, `scriptId_2`, `spellId_3`, `probability_3`, `castTarget_3`, `targetParam1_3`, `targetParam2_3`, `castFlags_3`, `delayInitialMin_3`, `delayInitialMax_3`, `delayRepeatMin_3`, `delayRepeatMax_3`, `scriptId_3`, `spellId_4`, `probability_4`, `castTarget_4`, `targetParam1_4`, `targetParam2_4`, `castFlags_4`, `delayInitialMin_4`, `delayInitialMax_4`, `delayRepeatMin_4`, `delayRepeatMax_4`, `scriptId_4`, `spellId_5`, `probability_5`, `castTarget_5`, `targetParam1_5`, `targetParam2_5`, `castFlags_5`, `delayInitialMin_5`, `delayInitialMax_5`, `delayRepeatMin_5`, `delayRepeatMax_5`, `scriptId_5`, `spellId_6`, `probability_6`, `castTarget_6`, `targetParam1_6`, `targetParam2_6`, `castFlags_6`, `delayInitialMin_6`, `delayInitialMax_6`, `delayRepeatMin_6`, `delayRepeatMax_6`, `scriptId_6`, `spellId_7`, `probability_7`, `castTarget_7`, `targetParam1_7`, `targetParam2_7`, `castFlags_7`, `delayInitialMin_7`, `delayInitialMax_7`, `delayRepeatMin_7`, `delayRepeatMax_7`, `scriptId_7`, `spellId_8`, `probability_8`, `castTarget_8`, `targetParam1_8`, `targetParam2_8`, `castFlags_8`, `delayInitialMin_8`, `delayInitialMax_8`, `delayRepeatMin_8`, `delayRepeatMax_8`, `scriptId_8`) VALUES (104290, 'Blackrock Spire - Warchief Rend Blackhand', 13736, 100, 1, 0, 0, 64, 20, 20, 18, 18, 0, 15708, 100, 1, 0, 0, 0, 9, 9, 16, 16, 0, 15754, 100, 1, 0, 0, 0, 5, 5, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +UPDATE `creature_template` SET `unit_flags`=832, `spell_list_id`=104290, `ai_name`='EventAI', `script_name`='' WHERE `entry`=10429; + +-- Add slight delay before Chromatic Whelp starts casting. +REPLACE INTO `creature_spells` (`entry`, `name`, `spellId_1`, `probability_1`, `castTarget_1`, `targetParam1_1`, `targetParam2_1`, `castFlags_1`, `delayInitialMin_1`, `delayInitialMax_1`, `delayRepeatMin_1`, `delayRepeatMax_1`, `scriptId_1`, `spellId_2`, `probability_2`, `castTarget_2`, `targetParam1_2`, `targetParam2_2`, `castFlags_2`, `delayInitialMin_2`, `delayInitialMax_2`, `delayRepeatMin_2`, `delayRepeatMax_2`, `scriptId_2`, `spellId_3`, `probability_3`, `castTarget_3`, `targetParam1_3`, `targetParam2_3`, `castFlags_3`, `delayInitialMin_3`, `delayInitialMax_3`, `delayRepeatMin_3`, `delayRepeatMax_3`, `scriptId_3`, `spellId_4`, `probability_4`, `castTarget_4`, `targetParam1_4`, `targetParam2_4`, `castFlags_4`, `delayInitialMin_4`, `delayInitialMax_4`, `delayRepeatMin_4`, `delayRepeatMax_4`, `scriptId_4`, `spellId_5`, `probability_5`, `castTarget_5`, `targetParam1_5`, `targetParam2_5`, `castFlags_5`, `delayInitialMin_5`, `delayInitialMax_5`, `delayRepeatMin_5`, `delayRepeatMax_5`, `scriptId_5`, `spellId_6`, `probability_6`, `castTarget_6`, `targetParam1_6`, `targetParam2_6`, `castFlags_6`, `delayInitialMin_6`, `delayInitialMax_6`, `delayRepeatMin_6`, `delayRepeatMax_6`, `scriptId_6`, `spellId_7`, `probability_7`, `castTarget_7`, `targetParam1_7`, `targetParam2_7`, `castFlags_7`, `delayInitialMin_7`, `delayInitialMax_7`, `delayRepeatMin_7`, `delayRepeatMax_7`, `scriptId_7`, `spellId_8`, `probability_8`, `castTarget_8`, `targetParam1_8`, `targetParam2_8`, `castFlags_8`, `delayInitialMin_8`, `delayInitialMax_8`, `delayRepeatMin_8`, `delayRepeatMax_8`, `scriptId_8`) VALUES (104420, 'Blackrock Spire - Chromatic Whelp', 16249, 100, 4, 0, 0, 0, 2, 2, 4, 6, 0, 16250, 100, 4, 0, 0, 0, 6, 10, 12, 20, 0, 12167, 100, 1, 0, 0, 8, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + +-- Correct Cleave spell id used by Chromatic Dragonspawn. +REPLACE INTO `creature_spells` (`entry`, `name`, `spellId_1`, `probability_1`, `castTarget_1`, `targetParam1_1`, `targetParam2_1`, `castFlags_1`, `delayInitialMin_1`, `delayInitialMax_1`, `delayRepeatMin_1`, `delayRepeatMax_1`, `scriptId_1`, `spellId_2`, `probability_2`, `castTarget_2`, `targetParam1_2`, `targetParam2_2`, `castFlags_2`, `delayInitialMin_2`, `delayInitialMax_2`, `delayRepeatMin_2`, `delayRepeatMax_2`, `scriptId_2`, `spellId_3`, `probability_3`, `castTarget_3`, `targetParam1_3`, `targetParam2_3`, `castFlags_3`, `delayInitialMin_3`, `delayInitialMax_3`, `delayRepeatMin_3`, `delayRepeatMax_3`, `scriptId_3`, `spellId_4`, `probability_4`, `castTarget_4`, `targetParam1_4`, `targetParam2_4`, `castFlags_4`, `delayInitialMin_4`, `delayInitialMax_4`, `delayRepeatMin_4`, `delayRepeatMax_4`, `scriptId_4`, `spellId_5`, `probability_5`, `castTarget_5`, `targetParam1_5`, `targetParam2_5`, `castFlags_5`, `delayInitialMin_5`, `delayInitialMax_5`, `delayRepeatMin_5`, `delayRepeatMax_5`, `scriptId_5`, `spellId_6`, `probability_6`, `castTarget_6`, `targetParam1_6`, `targetParam2_6`, `castFlags_6`, `delayInitialMin_6`, `delayInitialMax_6`, `delayRepeatMin_6`, `delayRepeatMax_6`, `scriptId_6`, `spellId_7`, `probability_7`, `castTarget_7`, `targetParam1_7`, `targetParam2_7`, `castFlags_7`, `delayInitialMin_7`, `delayInitialMax_7`, `delayRepeatMin_7`, `delayRepeatMax_7`, `scriptId_7`, `spellId_8`, `probability_8`, `castTarget_8`, `targetParam1_8`, `targetParam2_8`, `castFlags_8`, `delayInitialMin_8`, `delayInitialMax_8`, `delayRepeatMin_8`, `delayRepeatMax_8`, `scriptId_8`) VALUES (104470, 'Blackrock Spire - Chromatic Dragonspawn', 15580, 100, 1, 0, 0, 0, 5, 8, 6, 9, 0, 15663, 100, 1, 0, 0, 0, 4, 9, 7, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + +-- nefarius SAY_INTRO_1 +UPDATE `broadcast_text` SET `chat_type`=1, `emote_id1`=1 WHERE `entry`=5635; +-- nefarius SAY_INTRO_2 +UPDATE `broadcast_text` SET `chat_type`=1, `emote_id1`=1 WHERE `entry`=5640; +-- nefarius SAY_NEFARIUS_LOSE1 +UPDATE `broadcast_text` SET `chat_type`=1, `emote_id1`=1 WHERE `entry`=5709; +-- rend SAY_REND_ATTACK +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5722; +-- nefarius SAY_WARCHIEF +UPDATE `broadcast_text` SET `chat_type`=1, `emote_id1`=25 WHERE `entry`=5720; +-- nefarius SAY_VICTORY +UPDATE `broadcast_text` SET `chat_type`=1, `emote_id1`=1 WHERE `entry`=5824; +-- nefarius SAY_NEFARIUS_TAUNT1 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5665; +-- nefarius SAY_NEFARIUS_TAUNT2 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5671; +-- nefarius SAY_NEFARIUS_TAUNT3 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5666; +-- nefarius SAY_NEFARIUS_TAUNT4 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5667; +-- nefarius SAY_NEFARIUS_TAUNT5 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5668; +-- nefarius SAY_NEFARIUS_TAUNT6 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5669; +-- nefarius SAY_NEFARIUS_TAUNT7 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5664; +-- nefarius SAY_NEFARIUS_TAUNT8 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5719; +-- nefarius SAY_NEFARIUS_BUFF_GYTH +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5726; +-- rend SAY_REND_TAUNT1 +UPDATE `broadcast_text` SET `chat_type`=1, `emote_id1`=1 WHERE `entry`=5672; +-- rend SAY_REND_TAUNT2 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5678; +-- rend SAY_REND_TAUNT3 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5673; +-- rend SAY_REND_TAUNT4 +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=5674; + + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/game/AI/ScriptedInstance.cpp b/src/game/AI/ScriptedInstance.cpp index a0d9ea3b6..830d4f705 100644 --- a/src/game/AI/ScriptedInstance.cpp +++ b/src/game/AI/ScriptedInstance.cpp @@ -303,7 +303,7 @@ void DialogueHelper::DoNextDialogueStep() } // Simulate Case - if (uiSpeakerEntry && iTextEntry < 0) + if (uiSpeakerEntry && iTextEntry) { // Use Speaker if directly provided Creature* pSpeaker = GetSpeakerByEntry(uiSpeakerEntry); diff --git a/src/game/Objects/Creature.h b/src/game/Objects/Creature.h index aa9b0b6c9..ce021c500 100644 --- a/src/game/Objects/Creature.h +++ b/src/game/Objects/Creature.h @@ -34,7 +34,6 @@ #include "Cell.h" #include "Util.h" -#include #include class SpellEntry; diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 8addfc13d..208b67296 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -62,14 +62,12 @@ set (SCRIPTS_SRCS eastern_kingdoms/burning_steppes/blackrock_depths/boss_tomb_of_seven.cpp eastern_kingdoms/burning_steppes/blackrock_depths/instance_blackrock_depths.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_drakkisath.cpp - eastern_kingdoms/burning_steppes/blackrock_spire/boss_gyth.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_halycon.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_highlord_omokk.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_mother_smolderweb.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_overlord_wyrmthalak.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_pyroguard_emberseer.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_quartermaster_zigris.cpp - eastern_kingdoms/burning_steppes/blackrock_spire/boss_rend_blackhand.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_shadow_hunter_voshgajin.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_the_beast.cpp eastern_kingdoms/burning_steppes/blackrock_spire/boss_urok.cpp diff --git a/src/scripts/ScriptLoader.cpp b/src/scripts/ScriptLoader.cpp index e316cdd78..4983ca012 100644 --- a/src/scripts/ScriptLoader.cpp +++ b/src/scripts/ScriptLoader.cpp @@ -68,8 +68,6 @@ void AddSC_boss_thebeast(); void AddSC_boss_warmastervoone(); void AddSC_boss_quatermasterzigris(); void AddSC_boss_pyroguard_emberseer(); -void AddSC_boss_gyth(); -void AddSC_boss_rend_blackhand(); void AddSC_boss_razorgore(); //blackwing_lair void AddSC_boss_vael(); void AddSC_boss_broodlord(); @@ -330,8 +328,6 @@ void AddScripts() AddSC_instance_blackrock_spire(); AddSC_boss_pyroguard_emberseer(); - AddSC_boss_gyth(); - AddSC_boss_rend_blackhand(); AddSC_boss_razorgore(); //blackwing_lair AddSC_boss_vael(); AddSC_boss_broodlord(); diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/blackrock_spire.h b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/blackrock_spire.h index 832624aae..928ffca72 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/blackrock_spire.h +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/blackrock_spire.h @@ -8,11 +8,13 @@ enum { MAX_ROOMS = 7, + MAX_STADIUM_WAVES = 7, + MAX_STADIUM_MOBS_PER_WAVE = 5, TYPE_ROOM_EVENT = 0, TYPE_EMBERSEER = 1, TYPE_FLAMEWREATH = 2, // Only summon once per instance - TYPE_GYTH = 3, + TYPE_STADIUM = 3, TYPE_VALTHALAK = 4, // Only summon once per instance TYPE_EVENT_DOOR_UBRS = 5, // Pour Event Porte de UBRS TYPE_SOLAKAR = 6, // Pour Event Rookery @@ -23,7 +25,9 @@ enum NPC_BLACKHAND_VETERAN = 9819, NPC_PYROGUARD_EMBERSEER = 9816, NPC_BLACKHAND_INCANCERATOR = 10316, + NPC_BLACKHAND_ELITE = 10317, NPC_LORD_VICTOR_NEFARIUS = 10162, + NPC_REND_BLACKHAND = 10429, NPC_GYTH = 10339, NPC_SOLAKAR = 10264, NPC_ROOKERY_GUARDIAN = 10258, @@ -31,6 +35,9 @@ enum NPC_SOLAKAR_TRIGGER = 160014, NPC_DRAKKISATH = 10363, NPC_THE_BEAST = 10430, + NPC_CHROMATIC_WHELP = 10442, // related to Gyth arena event + NPC_CHROMATIC_DRAGON = 10447, + NPC_BLACKHAND_HANDLER = 10742, NPC_FIREBRAND_GRUNT = 9259, NPC_BANNOK_GRIMAXE = 9596, @@ -72,11 +79,10 @@ enum GO_EMBERSEER_RUNE04 = 175269, GO_EMBERSEER_RUNE05 = 175270, GO_EMBERSEER_RUNE06 = 175271, - GO_EMBERSEER_RUNE07 = 175272 - + GO_EMBERSEER_RUNE07 = 175272, }; -class instance_blackrock_spire : public ScriptedInstance +class instance_blackrock_spire : public ScriptedInstance, private DialogueHelper { public: instance_blackrock_spire(Map* pMap); @@ -86,6 +92,8 @@ class instance_blackrock_spire : public ScriptedInstance void OnObjectCreate(GameObject* pGo) override; void OnCreatureCreate(Creature* pCreature) override; + void OnCreatureDeath(Creature* pCreature) override; + void OnCreatureEvade(Creature* pCreature) override; void SetData(uint32 uiType, uint32 uiData) override; void SetData64(uint32 uiType, uint64 uiData) override; @@ -102,6 +110,11 @@ class instance_blackrock_spire : public ScriptedInstance void Update(uint32 uiDiff) override; protected: + void JustDidDialogueStep(int32 iEntry) override; + Creature* GetSpeakerByEntry(uint32 uiEntry) override; + void DoSendNextStadiumWave(); + void DespawnStadiumSpectators(); + uint32 m_auiEncounter[INSTANCE_BRS_MAX_ENCOUNTER]; std::string strInstData; @@ -111,6 +124,7 @@ class instance_blackrock_spire : public ScriptedInstance uint64 m_uiInfiltratorGUID; uint64 m_uiDrakkisathGUID; uint64 m_uiBeastGUID; + uint64 m_uiRendGUID; uint64 m_uiEmberseerInDoorGUID; uint64 m_uiEmberseerCombatDoorGUID; @@ -145,11 +159,16 @@ class instance_blackrock_spire : public ScriptedInstance uint32 m_uiUBRSDoor_Timer; uint32 m_uiUBRSDoor_Step; + uint32 m_uiStadiumEventTimer; + uint8 m_uiStadiumWaves; + uint8 m_uiStadiumMobsAlive; + uint64 m_auiRoomRuneGUID[MAX_ROOMS]; std::list m_alRoomEventMobGUIDSorted[MAX_ROOMS]; std::list m_lRoomEventMobGUIDList; std::list m_lIncanceratorGUIDList; std::list m_lRookeryEggGUIDList; + GuidList m_lStadiumSpectatorsGUIDList; bool m_bBannokSpawned; }; diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_gyth.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_gyth.cpp deleted file mode 100644 index 4210140e1..000000000 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_gyth.cpp +++ /dev/null @@ -1,499 +0,0 @@ -/* Copyright (C) 2006 - 2010 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gyth -SD%Complete: 100 -SDComment: Whole Event needs some rewrite -SDCategory: Blackrock Spire -EndScriptData */ - -#include "scriptPCH.h" -#include "blackrock_spire.h" -// INSERT INTO nostalrius_string(entry, content_default, content_loc2) VALUES -// (156,"Foolsss... Kill the one in the dress!","Imbeciles ... Tuez celui qui porte une robe !"), -// (157,"Concentrate your attacks upon the healer!","Concentrez vos attaques sur le Guerisseur !"), -// (158,"Inconceivable!","Inconcevable !"); -// INSERT INTO nostalrius_string(entry, content_default) VALUES -// (159,"Do not force my hand, children! I shall use your hides to line my boots."); -// INSERT INTO nostalrius_string(entry, content_default, content_loc2) VALUES -// (160,"Defilers!","Profanateurs !"), -// (161,"Impossible!","Impossible ..."), -// (162,"Your efforts will prove fruitless. None shall stand in our way!","Vos efforts seront vains. Personne ne nous arretera."), -// (163,"THIS CANNOT BE!!! Rend, deal with these insects.","CELA NE PEUT PAS ETRE !!! Rend, occupe toi de ces insectes."), -// (164,"With pleasure...","Avec plaisir, Sire."), -// (165,"Your victory shall be short lived. The days of both the Alliance and Horde are coming to an end. The next time we meet shall be the last.","Votre victoire sera de courte duree. Les jours de l'Alliance et la Horde sont comptes : la prochaine fois que nous rencontrons sera la derniere."), -// (166,"The Warchief shall make quick work of you, mortals. Prepare yourselves!","Le Chef de Guerre ne devrait faire qu'une bouchee de vous. Preparez vous !"), -// (167,"Let not even a drop of their blood remain upon the arena floor, my children. Feast on their souls!","Ne laissez pas meme une goutte de leur sang sur le sol de l'arene, mes enfants. Régalez vous de leur ame !"), -// (168,"Sire, let me join the fray! I shall tear their spines out with my bare hands!!","Sire, permettez moi de rejoindre le combat. Je dechirerai leurs épines de mes propres mains !"), -// (169,"Excellent... it would appear as if the meddlesome insects have arrived just in time to feed my legion. Welcome, mortals!","Excellent ... Il semblerait que ces insectes fouineurs soient arrives juste a temps pour nourir ma Legion. Bienvenu, mortels !"); - -enum -{ - SPELL_CORROSIVEACID = 20667, - SPELL_FREEZE = 16350, // ID was wrong! - SPELL_FLAMEBREATH = 20712, - SPELL_KNOCKAWAY = 10101, - SPELL_CHROMATICCHAOS = 16337, -// Spell BC !! -// SPELL_ROOT_SELF = 33356, - - MODEL_ID_INVISIBLE = 11686, - MODEL_ID_GYTH_MOUNTED = 9723, - MODEL_ID_GYTH = 9806, - - NPC_FIRE_TONGUE = 10372, - NPC_CHROMATIC_WHELP = 10442, - NPC_CHROMATIC_DRAGON = 10447, - NPC_BLACKHAND_ELITE = 10317, - NPC_REND_BLACKHAND = 10429 -}; - -// NOSTALRIUS -//#define DEBUG_ON -enum -{ -#ifdef DEBUG_ON - WAVE_TIMER = 10000, -#else - WAVE_TIMER = 60000, -#endif - NEFARIAN_ENTRY = 10162, -}; -#define SPAWN_X 210.0f -#define SPAWN_Y -420.0f -#define SPAWN_Z 110.94f -#define SPAWN_O 3.14f - -struct boss_gythAI : public ScriptedAI -{ - boss_gythAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = (instance_blackrock_spire*) pCreature->GetInstanceData(); - nefarianGUID = 0; - m_bInitialized = false; - Reset(); - } - - instance_blackrock_spire* m_pInstance; - uint64 m_uiCombatDoorGUID; - uint32 uiAggroTimer; - uint32 uiDragonsTimer; - uint32 uiOrcTimer; - uint32 uiCorrosiveAcidTimer; - uint32 uiFreezeTimer; - uint32 uiFlamebreathTimer; - uint32 uiKnockAwayTimer; - uint32 uiLine1Count; - uint32 uiLine2Count; - - bool m_bSummonedRend; - bool m_bAggro; - bool m_bRootSelf; - - // NOSTALRIUS - uint64 nefarianGUID; - uint32 mobCount; - uint32 uiWaveNum; - uint32 waveRemainingCount; - bool m_bInitialized; - std::list m_lSummonedGuids; - bool bChromaticChaosCasted; - - void Reset() override - { - uiDragonsTimer = 3000; - uiOrcTimer = WAVE_TIMER; - uiAggroTimer = WAVE_TIMER; - uiCorrosiveAcidTimer = 8000; - uiFreezeTimer = 11000; - uiFlamebreathTimer = 4000; - uiKnockAwayTimer = urand(5000, 10000); - m_bSummonedRend = false; - m_bAggro = false; - m_bRootSelf = false; - bChromaticChaosCasted = false; - - // how many times should the two lines of summoned creatures be spawned - // min 2 x 2, max 7 lines of attack in total -#ifdef DEBUG_ON - uiLine1Count = urand(2, 5); - uiLine2Count = urand(2, 7 - uiLine1Count); -#else - uiLine1Count = urand(2, 5); - uiLine2Count = urand(2, 7 - uiLine1Count); -#endif - - // Invisible for event start -#ifndef DEBUG_ON - m_creature->SetDisplayId(MODEL_ID_INVISIBLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); -#endif - - // NOSTALRIUS - uiWaveNum = 0; - waveRemainingCount = 0; - DespawnAdds(); -#ifdef DEBUG_ON - sLog.outString("Boss GYTH RESET"); -#endif - } - - // NOSTALRIUS - void Initialize() - { - Creature* nefarian = GetClosestCreatureWithEntry(m_creature, NEFARIAN_ENTRY, 150.0f); - if (nefarian) - nefarianGUID = nefarian->GetGUID(); - else - nefarianGUID = 0; -#ifdef DEBUG_ON - sLog.outString("Nefarian trouve : %u", nefarianGUID); -#endif - } - - void NefarianSay(int32 what) - { - if (Unit* nefarian = Unit::GetUnit(*m_creature, nefarianGUID)) - nefarian->MonsterSay(what, LANG_UNIVERSAL, 0); - else - sLog.outString("Nefarian introuvable."); -#ifdef DEBUG_ON - sLog.outString("[Nefarian] : %s", what); -#endif - } - void RendSay(int32 what) - { - m_creature->MonsterSay(what, LANG_UNIVERSAL, 0); -#ifdef DEBUG_ON - sLog.outString("[Rend] : %s", what); -#endif - } - void SummonedCreatureJustDied(Creature* summ) override - { - // Rend - invoque par Gyth - peut mourir apres Gyth. - if (m_creature->IsAlive()) - m_creature->SetInCombatWithZone(); - - // Ne doit pas etre negatif - if (waveRemainingCount > 0) - --waveRemainingCount; - - if (uiWaveNum == 1 && waveRemainingCount == 2) - NefarianSay(5665); - else if (uiWaveNum == 3 && waveRemainingCount == 3) - NefarianSay(5671); - else if (uiWaveNum == 3 && waveRemainingCount == 2) - NefarianSay(5666); - else if (uiWaveNum == 3 && waveRemainingCount == 1) - NefarianSay(5667); - else if (uiWaveNum == 4 && waveRemainingCount == 2) - RendSay(5678); - else if (uiWaveNum == 4 && waveRemainingCount == 1) - RendSay(5673); - else if (uiWaveNum == 5 && waveRemainingCount == 1) - NefarianSay(5668); - else if (uiWaveNum == 6 && waveRemainingCount == 2) - NefarianSay(5709); - else if (uiWaveNum == 6 && waveRemainingCount == 1) - RendSay(5722); - else if (summ && summ->GetEntry() == NPC_REND_BLACKHAND) - NefarianSay(5824); -#ifdef DEBUG_ON - sLog.outString("Creature %u morte. Vague %u / reste %u", summ->GetEntry(), uiWaveNum, waveRemainingCount); -#endif - //summ->AddObjectToRemoveList(); - } - - void DespawnAdds() - { -#ifdef DEBUG_ON - sLog.outString("Despawn %u Adds", m_lSummonedGuids.size()); -#endif - while (!m_lSummonedGuids.empty()) - { - uint64 guid = m_lSummonedGuids.front(); - m_lSummonedGuids.pop_front(); - if (Unit* invoc = Unit::GetUnit(*m_creature, guid)) - { - invoc->AddObjectToRemoveList(); -#ifdef DEBUG_ON - sLog.outString("Despawn de %u (entry %u)", invoc->GetGUIDLow(), invoc->GetEntry()); -#endif - } - } - } - - // NOSTALRIUS END - void Aggro(Unit* pWho) override - { - if (m_pInstance) - { - m_pInstance->SetData(TYPE_GYTH, IN_PROGRESS); - m_uiCombatDoorGUID = m_pInstance->GetData64(GO_GYTH_COMBAT_DOOR); - } - } - void AttackStart(Unit *target) override - { - // $target commence a nous attaquer. - if (!m_bAggro) - { - m_creature->Attack(target, false); - m_creature->AddThreat(target); - m_creature->SetInCombatWith(target); - target->SetInCombatWith(m_creature); - } - // Sinon, go attaquer. - else if (m_creature->Attack(target, true)) - { - m_creature->AddThreat(target); - m_creature->SetInCombatWith(target); - target->SetInCombatWith(m_creature); - - m_creature->GetMotionMaster()->MoveChase(target); - } - } - - void JustDied(Unit* pKiller) override - { -#ifdef DEBUG_ON - sLog.outString("Boss GYTH JustDied"); -#endif - if (m_pInstance) - m_pInstance->SetData(TYPE_GYTH, DONE); - } - - void EnterEvadeMode() override - { -#ifdef DEBUG_ON - sLog.outString("Boss GYTH EnterEvadeMode"); -#endif - if (m_pInstance) - m_pInstance->SetData(TYPE_GYTH, FAIL); - DespawnAdds(); - - if (m_creature->IsAlive()) - { - m_creature->SetDeathState(JUST_DIED); - m_creature->Respawn(); - } - Reset(); - } - void JustReachedHome() override - { -#ifdef DEBUG_ON - sLog.outString("Boss GYTH JustReachedHome"); -#endif - if (m_pInstance) - m_pInstance->SetData(TYPE_GYTH, FAIL); - DespawnAdds(); - - if (m_creature->IsAlive()) - { - m_creature->SetDeathState(JUST_DIED); - m_creature->Respawn(); - } - Reset(); - } - - void SummonCreatureWithRandomTarget(uint32 uiCreatureId) - { - float fX, fY, fZ; - m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 2 * INTERACTION_DISTANCE, fX, fY, fZ); - fX = std::min(m_creature->GetPositionX(), fX); // Halfcircle - suits better the rectangular form - if (Creature* pSummoned = m_creature->SummonCreature(uiCreatureId, SPAWN_X + irand(-10, 10), SPAWN_Y + irand(-10, 10), SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000)) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - pSummoned->AI()->AttackStart(pTarget); - m_lSummonedGuids.push_back(pSummoned->GetGUID()); - } - ++waveRemainingCount; - } - - void UpdateAI(uint32 const uiDiff) override - { - if (!m_bInitialized) - { - Initialize(); - m_bInitialized = true; - } - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->GetVictim()) - return; - - if (!m_bRootSelf) - { - //DoCastSpellIfCan(m_creature, SPELL_ROOT_SELF); - m_creature->AddUnitState(UNIT_STAT_ROOT); - m_bRootSelf = true; - } - - bool bWaveSummoned = false; - if (!m_bAggro && uiLine1Count == 0 && uiLine2Count == 0) - { - if (uiAggroTimer < uiDiff) - { - m_bAggro = true; - NefarianSay(5720); - // Visible now! - //m_creature->Relocate(SPAWN_X, SPAWN_Y, SPAWN_Z, SPAWN_O); - m_creature->GetMap()->CreatureRelocation(m_creature, SPAWN_X, SPAWN_Y, SPAWN_Z, SPAWN_O); - //m_creature->GetMotionMaster()->Initialize(); - - m_creature->SetDisplayId(MODEL_ID_GYTH_MOUNTED); - m_creature->SetFactionTemplateId(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //m_creature->RemoveAurasDueToSpell(SPELL_ROOT_SELF); - m_creature->ClearUnitState(UNIT_STAT_ROOT); - - DoResetThreat(); - - if (m_pInstance) - m_pInstance->DoUseDoorOrButton(m_uiCombatDoorGUID); - } - else - uiAggroTimer -= uiDiff; - } - - // Summon Dragon pack. 2 Dragons and 3 Whelps - if (!m_bAggro && !m_bSummonedRend && uiLine1Count > 0) - { - if (uiDragonsTimer < uiDiff) - { - waveRemainingCount = 0; - SummonCreatureWithRandomTarget(NPC_FIRE_TONGUE); - SummonCreatureWithRandomTarget(NPC_FIRE_TONGUE); - SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); - SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); - SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); - --uiLine1Count; - if (m_pInstance) - m_pInstance->DoUseDoorOrButton(m_uiCombatDoorGUID); - uiDragonsTimer = WAVE_TIMER; - bWaveSummoned = true; - } - else - uiDragonsTimer -= uiDiff; - } - - //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps - if (!m_bAggro && !m_bSummonedRend && uiLine1Count == 0 && uiLine2Count > 0) - { - if (uiOrcTimer < uiDiff) - { - waveRemainingCount = 0; - SummonCreatureWithRandomTarget(NPC_CHROMATIC_DRAGON); - SummonCreatureWithRandomTarget(NPC_BLACKHAND_ELITE); - SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); - SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); - SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); - if (m_pInstance) - m_pInstance->DoUseDoorOrButton(m_uiCombatDoorGUID); - --uiLine2Count; - uiOrcTimer = WAVE_TIMER; - bWaveSummoned = true; - } - else - uiOrcTimer -= uiDiff; - } - if (bWaveSummoned) - { - ++uiWaveNum; - if (uiWaveNum == 1) - NefarianSay(5640); - else if (uiWaveNum == 3) - RendSay(5672); - } - - // we take part in the fight - if (m_bAggro) - { - // CorrosiveAcid_Timer - if (uiCorrosiveAcidTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_CORROSIVEACID) == CAST_OK) - uiCorrosiveAcidTimer = 7000; - } - else - uiCorrosiveAcidTimer -= uiDiff; - - // Freeze_Timer - if (uiFreezeTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_FREEZE) == CAST_OK) - uiFreezeTimer = 16000; - } - else - uiFreezeTimer -= uiDiff; - - // Flamebreath_Timer - if (uiFlamebreathTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_FLAMEBREATH) == CAST_OK) - uiFlamebreathTimer = 10500; - } - else - uiFlamebreathTimer -= uiDiff; - - if (uiKnockAwayTimer < uiDiff) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - { - if (pTarget->GetDistance(m_creature) < 10.0f) - { - if (DoCastSpellIfCan(pTarget, SPELL_KNOCKAWAY) == CAST_OK) - uiKnockAwayTimer = urand(8000, 12000); - } - } - } - else - uiKnockAwayTimer -= uiDiff; - - if (!bChromaticChaosCasted && m_creature->GetHealthPercent() < 50.0f) - { - if (DoCastSpellIfCan(m_creature, SPELL_CHROMATICCHAOS) == CAST_OK) - bChromaticChaosCasted = true; - } - //Summon Rend - if (!m_bSummonedRend && m_creature->GetHealthPercent() < 20.0f) - { - // summon Rend and Change model to normal Gyth - // Inturrupt any spell casting - m_creature->InterruptNonMeleeSpells(false); - // Gyth model - m_creature->SetDisplayId(MODEL_ID_GYTH); - m_creature->SummonCreature(NPC_REND_BLACKHAND, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000); - m_bSummonedRend = true; - } - - DoMeleeAttackIfReady(); - } // end if Aggro - } -}; - -CreatureAI* GetAI_boss_gyth(Creature* pCreature) -{ - return new boss_gythAI(pCreature); -} - -void AddSC_boss_gyth() -{ - Script* pNewScript; - pNewScript = new Script; - pNewScript->Name = "boss_gyth"; - pNewScript->GetAI = &GetAI_boss_gyth; - pNewScript->RegisterSelf(); -} diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_rend_blackhand.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_rend_blackhand.cpp deleted file mode 100644 index 4a347ef07..000000000 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_rend_blackhand.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* Copyright (C) 2006 - 2010 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Rend_Blackhand -SD%Complete: 100 -SDComment: Intro event NYI -SDCategory: Blackrock Spire -EndScriptData */ - -#include "scriptPCH.h" - -/* -In DB : change creature_template et creature_equip_template -*/ -enum -{ - NPC_RENDBLACKHAND = 10429, - SPELL_MORTALSTRIKE = 16856, - SPELL_CLEAVE = 15284, - SPELL_WHIRLWIND = 13736, - SPELL_FRENZY = 8269 -}; - -struct boss_rend_blackhandAI : public ScriptedAI -{ - boss_rend_blackhandAI(Creature* pCreature) : ScriptedAI(pCreature) - { - Reset(); - } - - uint32 m_uiMortalStrikeTimer; - uint32 m_uiCleaveTimer; - uint32 m_uiFrenzyTimer; - uint32 m_uiCloseCombatCheckTimer; - uint32 m_uiCloseCombatCount; - uint32 m_uiWhirlWindTimer; - - void Reset() override - { - m_uiMortalStrikeTimer = 1000; - m_uiCleaveTimer = 4000; - m_uiFrenzyTimer = 0; - m_uiCloseCombatCheckTimer = 1000; - m_uiCloseCombatCount = 0; - m_uiWhirlWindTimer = 0; - } - - void UpdateAI(uint32 const uiDiff) override - { - // Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->GetVictim()) - return; - - // WhirlWind Check - if (m_uiCloseCombatCheckTimer < uiDiff) - { - m_uiCloseCombatCount = 0; - ThreatList const& tList = m_creature->GetThreatManager().getThreatList(); - for (const auto i : tList) - { - Unit* pUnit = m_creature->GetMap()->GetUnit(i->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER) && (pUnit->GetDistance2d(m_creature) < 7.0f)) - m_uiCloseCombatCount++; - } - m_uiCloseCombatCheckTimer = 2000; - } - else - m_uiCloseCombatCheckTimer -= uiDiff; - - if (m_uiCloseCombatCount > 3) - { - if (m_uiWhirlWindTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_WHIRLWIND) == CAST_OK) - m_uiWhirlWindTimer = 1500; - } - else - m_uiWhirlWindTimer -= uiDiff; - } - else - { - // Mortal Strike - if (m_uiMortalStrikeTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature->GetVictim(), SPELL_MORTALSTRIKE) == CAST_OK) - m_uiMortalStrikeTimer = urand(6000, 10000); - } - else - m_uiMortalStrikeTimer -= uiDiff; - - // Cleave - if (m_uiCleaveTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature->GetVictim(), SPELL_CLEAVE) == CAST_OK) - m_uiCleaveTimer = urand(4000, 6000); - } - else - m_uiCleaveTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } - - // Frenzy - if (m_creature->GetHealthPercent() <= 25.0f) - { - if (m_uiFrenzyTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_FRENZY) == CAST_OK) - m_uiFrenzyTimer = 110000; - } - else - m_uiFrenzyTimer -= uiDiff; - } - } -}; - -CreatureAI* GetAI_boss_rend_blackhand(Creature* pCreature) -{ - return new boss_rend_blackhandAI(pCreature); -} - -void AddSC_boss_rend_blackhand() -{ - Script* newscript; - newscript = new Script; - newscript->Name = "boss_rend_blackhand"; - newscript->GetAI = &GetAI_boss_rend_blackhand; - newscript->RegisterSelf(); -} diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/instance_blackrock_spire.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/instance_blackrock_spire.cpp index a051eec54..1958ef2b6 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/instance_blackrock_spire.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/instance_blackrock_spire.cpp @@ -23,13 +23,39 @@ EndScriptData */ #include "scriptPCH.h" #include "blackrock_spire.h" +#include "WaypointManager.h" //#define DEBUG_ON enum { AREATRIGGER_ENTER_UBRS = 2046, - AREATRIGGER_STADIUM = 2026 + AREATRIGGER_STADIUM = 2026, + + // Arena event dialogue intro and outro - handled by instance + SAY_NEFARIUS_INTRO_1 = 5635, + SAY_NEFARIUS_INTRO_2 = 5640, + SAY_NEFARIUS_LOSE1 = 5709, + SAY_REND_ATTACK = 5722, + SAY_NEFARIUS_WARCHIEF = 5720, + SAY_NEFARIUS_PACING = 5721, + SAY_NEFARIUS_VICTORY = 5824, + + // Arena event random taunt - handled on creature death + SAY_NEFARIUS_TAUNT1 = 5665, + SAY_NEFARIUS_TAUNT2 = 5671, + SAY_NEFARIUS_TAUNT3 = 5666, + SAY_NEFARIUS_TAUNT4 = 5667, + SAY_NEFARIUS_TAUNT5 = 5668, + SAY_NEFARIUS_TAUNT6 = 5669, + SAY_NEFARIUS_TAUNT7 = 5664, + SAY_NEFARIUS_TAUNT8 = 5719, + SAY_REND_TAUNT1 = 5672, + SAY_REND_TAUNT2 = 5678, + SAY_REND_TAUNT3 = 5673, + SAY_REND_TAUNT4 = 5674, + + WAYPOINT_ID_STADIUM = 10442, }; /* Areatrigger @@ -46,9 +72,86 @@ enum 3726 UBRS, entrance to BWL */ -instance_blackrock_spire::instance_blackrock_spire(Map* pMap) : ScriptedInstance(pMap), +static const uint32 aStadiumSpectators[12] = +{ + NPC_BLACKHAND_VETERAN, NPC_BLACKHAND_VETERAN, NPC_BLACKHAND_VETERAN, NPC_BLACKHAND_ELITE, NPC_BLACKHAND_VETERAN, NPC_BLACKHAND_VETERAN, + NPC_BLACKHAND_VETERAN, NPC_BLACKHAND_VETERAN, NPC_BLACKHAND_VETERAN, NPC_BLACKHAND_ELITE, NPC_BLACKHAND_VETERAN, NPC_BLACKHAND_VETERAN +}; + +static const Position aSpectatorsSpawnLocs[12] = +{ + { 163.3209f, -340.9818f, 111.0216f, 4.818223f }, + { 164.2471f, -339.0313f, 111.0368f, 1.413717f }, + { 161.124f, -339.5178f, 111.0381f, 3.001966f }, + { 162.5045f, -337.8101f, 111.0367f, 4.13643f }, + { 160.9896f, -337.7715f, 111.0368f, 1.117011f }, + { 161.8347f, -335.7923f, 111.0352f, 2.286381f }, + { 113.9726f, -366.0805f, 116.9195f, 6.252025f }, + { 112.7245f, -368.9635f, 116.9307f, 4.677482f }, + { 110.5757f, -368.2123f, 116.9278f, 4.310963f }, + { 109.3343f, -366.4785f, 116.9261f, 2.740167f }, + { 110.1331f, -363.9824f, 116.9272f, 0.5235988f }, + { 111.9971f, -363.0948f, 116.929f, 5.951573f }, +}; + +static const Position aSpectatorsTargetLocs[12] = +{ + { 160.619f, -395.826f, 121.9752f, -1.502597f }, + { 162.1428f, -395.1175f, 121.9751f, -1.67753f }, + { 158.6822f, -395.7097f, 121.9753f, -1.787977f }, + { 164.384f, -395.3787f, 121.9751f, -1.502597f }, + { 156.9669f, -395.2188f, 121.9752f, -1.678662f }, + { 166.2515f, -395.0366f, 121.975f, -1.791467f }, + { 143.814f, -396.7092f, 121.9753f, -1.40136f }, + { 145.3893f, -396.1959f, 121.9752f, -1.419479f }, + { 142.1598f, -396.0284f, 121.9752f, -1.661444f }, + { 147.7274f, -396.3042f, 121.9753f, -1.40136f }, + { 139.9446f, -396.7277f, 121.9753f, -1.428414f }, + { 149.3754f, -395.7497f, 121.9753f, -1.714769f }, +}; + +static const Position aStadiumLocs[7] = +{ + {210.00f, -420.30f, 110.94f, 3.14f}, // dragons summon location + {211.762f,-397.58f, 111.18f, 4.74f}, // Gyth summon location + {163.62f, -420.33f, 110.47f, 0.0f}, // center of the stadium location (for movement) + {164.63f, -444.04f, 121.97f, 3.22f}, // Lord Nefarius summon position + {161.01f, -443.73f, 121.97f, 6.26f}, // Rend summon position + {164.64f, -443.30f, 121.97f, 1.61f}, // Nefarius move position + {165.74f, -466.46f, 116.80f, 0.0f}, // Rend move position +}; + +// Stadium event description +static const uint32 aStadiumEventNpcs[MAX_STADIUM_WAVES][MAX_STADIUM_MOBS_PER_WAVE] = +{ + {NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_DRAGON, 0}, + {NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_DRAGON, 0}, + {NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_DRAGON, NPC_BLACKHAND_HANDLER, 0}, + {NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_DRAGON, NPC_BLACKHAND_HANDLER, 0}, + {NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_DRAGON, NPC_BLACKHAND_HANDLER}, + {NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_DRAGON, NPC_CHROMATIC_DRAGON, NPC_BLACKHAND_HANDLER}, + {NPC_CHROMATIC_WHELP, NPC_CHROMATIC_WHELP, NPC_CHROMATIC_DRAGON, NPC_CHROMATIC_DRAGON, NPC_BLACKHAND_HANDLER}, +}; + +static const SIDialogueEntry aStadiumDialogue[] = +{ + {NPC_LORD_VICTOR_NEFARIUS, 0, 1000}, + {SAY_NEFARIUS_INTRO_1, NPC_LORD_VICTOR_NEFARIUS, 7000}, + {SAY_NEFARIUS_INTRO_2, NPC_LORD_VICTOR_NEFARIUS, 5000}, + {NPC_BLACKHAND_HANDLER, 0, 0}, + {SAY_NEFARIUS_LOSE1, NPC_LORD_VICTOR_NEFARIUS, 3000}, + {SAY_REND_ATTACK, NPC_REND_BLACKHAND, 2000}, + {SAY_NEFARIUS_WARCHIEF, NPC_LORD_VICTOR_NEFARIUS, 3000}, + {SAY_NEFARIUS_PACING, NPC_LORD_VICTOR_NEFARIUS, 0}, + {SAY_NEFARIUS_VICTORY, NPC_LORD_VICTOR_NEFARIUS, 5000}, + {NPC_REND_BLACKHAND, 0, 0}, + {0, 0, 0}, +}; + +instance_blackrock_spire::instance_blackrock_spire(Map* pMap) : ScriptedInstance(pMap), DialogueHelper(aStadiumDialogue), m_uiEmberseerGUID(0), m_uiNefariusGUID(0), + m_uiRendGUID(0), m_uiGythGUID(0), m_uiInfiltratorGUID(0), m_uiDrakkisathGUID(0), @@ -87,6 +190,10 @@ instance_blackrock_spire::instance_blackrock_spire(Map* pMap) : ScriptedInstance m_uiUBRSDoor_Timer(0), m_uiUBRSDoor_Step(0), + m_uiStadiumEventTimer(0), + m_uiStadiumWaves(0), + m_uiStadiumMobsAlive(0), + m_bBannokSpawned(false) { @@ -130,7 +237,7 @@ void instance_blackrock_spire::OnObjectCreate(GameObject* pGo) break; case GO_GYTH_EXIT_DOOR: m_uiGythExitDoorGUID = pGo->GetGUID(); - if (GetData(TYPE_GYTH) == DONE) + if (GetData(TYPE_STADIUM) == DONE) pGo->SetGoState(GO_STATE_ACTIVE); break; @@ -235,6 +342,10 @@ void instance_blackrock_spire::OnCreatureCreate(Creature* pCreature) case NPC_LORD_VICTOR_NEFARIUS: m_uiNefariusGUID = pCreature->GetGUID(); break; + case NPC_REND_BLACKHAND: + if (!m_uiRendGUID) // only save the original Rend + m_uiRendGUID = pCreature->GetGUID(); + break; case NPC_GYTH: m_uiGythGUID = pCreature->GetGUID(); break; @@ -304,15 +415,37 @@ void instance_blackrock_spire::SetData(uint32 uiType, uint32 uiData) case TYPE_FLAMEWREATH: m_auiEncounter[TYPE_FLAMEWREATH] = uiData; break; - case TYPE_GYTH: - if (uiData == IN_PROGRESS || uiData == FAIL) - DoUseDoorOrButton(m_uiGythEntryDoorGUID); + case TYPE_STADIUM: + // Don't set the same data twice + if (m_auiEncounter[uiType] == uiData) + break; + // Combat door + DoUseDoorOrButton(m_uiGythEntryDoorGUID); + // Start event + if (uiData == IN_PROGRESS) + StartNextDialogueText(SAY_NEFARIUS_INTRO_1); else if (uiData == DONE) { - DoUseDoorOrButton(m_uiGythEntryDoorGUID); + // Event complete: remove the summoned spectators + DespawnStadiumSpectators(); DoUseDoorOrButton(m_uiGythExitDoorGUID); } - m_auiEncounter[TYPE_GYTH] = uiData; + else if (uiData == FAIL) + { + // Despawn Nefarius, Rend and the spectators on fail (the others are despawned OnCreatureEvade()) + if (Creature* pNefarius = GetCreature(m_uiNefariusGUID)) + pNefarius->DespawnOrUnsummon(); + if (Creature* pRend = GetCreature(m_uiRendGUID)) + pRend->DespawnOrUnsummon(); + if (Creature* pGyth = GetCreature(m_uiGythGUID)) + pGyth->DespawnOrUnsummon(); + DespawnStadiumSpectators(); + + m_uiStadiumEventTimer = 0; + m_uiStadiumMobsAlive = 0; + m_uiStadiumWaves = 0; + } + m_auiEncounter[uiType] = uiData; break; case TYPE_VALTHALAK: m_auiEncounter[TYPE_VALTHALAK] = uiData; @@ -350,6 +483,214 @@ void instance_blackrock_spire::SetData(uint32 uiType, uint32 uiData) } } +void instance_blackrock_spire::OnCreatureDeath(Creature* pCreature) +{ + switch (pCreature->GetEntry()) + { + case NPC_CHROMATIC_WHELP: + case NPC_CHROMATIC_DRAGON: + case NPC_BLACKHAND_HANDLER: + // check if it's summoned - some npcs with the same entry are already spawned in the instance + if (!pCreature->IsTemporarySummon()) + break; + + // 5% chance for Rend or Lord Victor Nefarius to taunt players when one of the creature is killed (% is guesswork) + // Lord Victor Nefarius + if (urand(0, 100) < 5) + { + if (Creature* pNefarius = GetCreature(m_uiNefariusGUID)) + { + uint32 const textId = PickRandomValue(SAY_NEFARIUS_TAUNT1, SAY_NEFARIUS_TAUNT2, SAY_NEFARIUS_TAUNT3, + SAY_NEFARIUS_TAUNT4, SAY_NEFARIUS_TAUNT5, SAY_NEFARIUS_TAUNT6, + SAY_NEFARIUS_TAUNT7, SAY_NEFARIUS_TAUNT8); + DoScriptText(textId, pNefarius); + } + } + // Warchief Rend Blackhand + if (urand(0, 100) < 5) + { + if (Creature* pRend = GetCreature(m_uiRendGUID)) + { + uint32 const textId = PickRandomValue(SAY_REND_TAUNT1, SAY_REND_TAUNT2, SAY_REND_TAUNT3, SAY_REND_TAUNT4); + DoScriptText(textId, pRend); + } + } + --m_uiStadiumMobsAlive; + if (!m_uiStadiumMobsAlive && (m_uiStadiumWaves == MAX_STADIUM_WAVES)) + DoSendNextStadiumWave(); + break; + case NPC_GYTH: + case NPC_REND_BLACKHAND: + --m_uiStadiumMobsAlive; + if (m_uiStadiumMobsAlive == 0) + StartNextDialogueText(SAY_NEFARIUS_VICTORY); + break; + } +} + +void instance_blackrock_spire::OnCreatureEvade(Creature* pCreature) +{ + switch (pCreature->GetEntry()) + { + case NPC_CHROMATIC_WHELP: + case NPC_CHROMATIC_DRAGON: + case NPC_BLACKHAND_HANDLER: + case NPC_GYTH: + case NPC_REND_BLACKHAND: + // check if it's summoned - some npcs with the same entry are already spawned in the instance + if (!pCreature->IsTemporarySummon()) + break; + SetData(TYPE_STADIUM, FAIL); + pCreature->DespawnOrUnsummon(); + break; + } +} + +Creature* instance_blackrock_spire::GetSpeakerByEntry(uint32 uiEntry) +{ + switch (uiEntry) + { + case NPC_LORD_VICTOR_NEFARIUS: + return GetCreature(m_uiNefariusGUID); + case NPC_REND_BLACKHAND: + return GetCreature(m_uiRendGUID); + } + + return nullptr; +} + +void instance_blackrock_spire::JustDidDialogueStep(int32 iEntry) +{ + switch (iEntry) + { + case NPC_BLACKHAND_HANDLER: + m_uiStadiumEventTimer = 1000; + // Move the two near the balcony + if (Creature* pRend = GetCreature(m_uiRendGUID)) + pRend->SetFacingTo(aStadiumLocs[5].o); + if (Creature* pNefarius = GetCreature(m_uiNefariusGUID)) + { + pNefarius->GetMotionMaster()->MovePoint(0, aStadiumLocs[5].x, aStadiumLocs[5].y, aStadiumLocs[5].z, 0, 0.0f, aStadiumLocs[5].o); + // Summon the spectators and move them to the western balcony + for (uint8 i = 0; i < 12; i++) + { + if (Creature* pSpectator = pNefarius->SummonCreature(aStadiumSpectators[i], aSpectatorsSpawnLocs[i].x, aSpectatorsSpawnLocs[i].y, aSpectatorsSpawnLocs[i].z, aSpectatorsSpawnLocs[i].o, TEMPSUMMON_DEAD_DESPAWN, 0)) + { + pSpectator->SetDetectionDistance(1.0f); + pSpectator->SetNoCallAssistance(true); + pSpectator->SetWalk(false); + pSpectator->SetHomePosition(aSpectatorsTargetLocs[i].x, aSpectatorsTargetLocs[i].y, aSpectatorsTargetLocs[i].z, aSpectatorsTargetLocs[i].o); + pSpectator->GetMotionMaster()->MovePoint(0, aSpectatorsTargetLocs[i].x, aSpectatorsTargetLocs[i].y, aSpectatorsTargetLocs[i].z, 0, 0.0f, aSpectatorsTargetLocs[i].o); + m_lStadiumSpectatorsGUIDList.push_back(pSpectator->GetObjectGuid()); + } + } + } + break; + case SAY_NEFARIUS_WARCHIEF: + // Prepare for Gyth + if (Creature* pRend = GetCreature(m_uiRendGUID)) + { + pRend->ForcedDespawn(5000); + pRend->SetWalk(false); + pRend->GetMotionMaster()->MovePoint(0, aStadiumLocs[6].x, aStadiumLocs[6].y, aStadiumLocs[6].z); + } + m_uiStadiumEventTimer = 30000; + break; + case SAY_NEFARIUS_PACING: + // Make Lord Nefarius walk back and forth while Rend is preparing Glyth + if (Creature* pNefarius = GetCreature(m_uiNefariusGUID)) + pNefarius->GetMotionMaster()->MoveWaypoint(); + break; + case SAY_NEFARIUS_VICTORY: + SetData(TYPE_STADIUM, DONE); + break; + case NPC_REND_BLACKHAND: + // Despawn Nefarius + if (Creature* pNefarius = GetCreature(m_uiNefariusGUID)) + { + pNefarius->ForcedDespawn(5000); + pNefarius->GetMotionMaster()->MovePoint(0, aStadiumLocs[6].x, aStadiumLocs[6].y, aStadiumLocs[6].z); + } + break; + } +} + +void instance_blackrock_spire::DespawnStadiumSpectators() +{ + for (const auto& itr : m_lStadiumSpectatorsGUIDList) + { + if (Creature* pSpectator = instance->GetCreature(itr)) + pSpectator->DespawnOrUnsummon(); + } + m_lStadiumSpectatorsGUIDList.clear(); +} + +void instance_blackrock_spire::DoSendNextStadiumWave() +{ + if (m_uiStadiumWaves < MAX_STADIUM_WAVES) + { + // Send current wave mobs + if (Creature* pNefarius = GetCreature(m_uiNefariusGUID)) + { + float fX, fY, fZ; + Creature* pFirstMob = nullptr; + for (uint8 i = 0; i < MAX_STADIUM_MOBS_PER_WAVE; ++i) + { + if (aStadiumEventNpcs[m_uiStadiumWaves][i] == 0) + continue; + + pNefarius->GetRandomPoint(aStadiumLocs[0].x, aStadiumLocs[0].y, aStadiumLocs[0].z, 7.0f, fX, fY, fZ); + fX = std::min(aStadiumLocs[0].x, fX); // Halfcircle - suits better the rectangular form + if (Creature* pTemp = pNefarius->SummonCreature(aStadiumEventNpcs[m_uiStadiumWaves][i], fX, fY, fZ, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0)) + { + if (!pFirstMob) + pFirstMob = pTemp; + else + pTemp->JoinCreatureGroup(pFirstMob, frand(3.0f, 5.0f), i, OPTION_FORMATION_MOVE | OPTION_AGGRO_TOGETHER); + ++m_uiStadiumMobsAlive; + } + } + + if (pFirstMob) + pFirstMob->GetMotionMaster()->MoveWaypoint(0, 0, PATH_FROM_SPECIAL, 0, WAYPOINT_ID_STADIUM, true); + } + + DoUseDoorOrButton(m_uiGythCombatDoorGUID); + } + // All waves are cleared - start Gyth intro + else if (m_uiStadiumWaves == MAX_STADIUM_WAVES) + StartNextDialogueText(SAY_NEFARIUS_LOSE1); + else + { + // Send Gyth + if (Creature* pNefarius = GetCreature(m_uiNefariusGUID)) + { + // Stop Lord Nefarius from moving and put him back in place + pNefarius->GetMotionMaster()->MoveIdle(); + pNefarius->GetMotionMaster()->MovePoint(0, aStadiumLocs[5].x, aStadiumLocs[5].y, aStadiumLocs[5].z, 0, 0.0f, aStadiumLocs[5].o); + + if (Creature* pGyth = pNefarius->SummonCreature(NPC_GYTH, aStadiumLocs[1].x, aStadiumLocs[1].y, aStadiumLocs[1].z, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0)) + { + pGyth->SetWalk(false); + pGyth->GetMotionMaster()->MoveWaypoint(); + } + } + + // Set this to 2, because Rend will be summoned later during the fight + m_uiStadiumMobsAlive = 2; + + DoUseDoorOrButton(m_uiGythCombatDoorGUID); + } + + ++m_uiStadiumWaves; + + // Stop the timer when all the waves have been sent + if (m_uiStadiumWaves >= MAX_STADIUM_WAVES) + m_uiStadiumEventTimer = 0; + else + m_uiStadiumEventTimer = 60000; +} + enum { SAY_ROOKERY_EVENT_START = -1229020 @@ -357,6 +698,16 @@ enum void instance_blackrock_spire::Update(uint32 uiDiff) { + DialogueUpdate(uiDiff); + + if (m_uiStadiumEventTimer) + { + if (m_uiStadiumEventTimer <= uiDiff) + DoSendNextStadiumWave(); + else + m_uiStadiumEventTimer -= uiDiff; + } + if (m_uiUBRSDoor_Timer) { if (m_uiUBRSDoor_Timer <= uiDiff) @@ -499,7 +850,7 @@ uint32 instance_blackrock_spire::GetData(uint32 uiType) case TYPE_ROOM_EVENT: case TYPE_EMBERSEER: case TYPE_FLAMEWREATH: - case TYPE_GYTH: + case TYPE_STADIUM: case TYPE_VALTHALAK: case TYPE_EVENT_DOOR_UBRS: case TYPE_SOLAKAR: @@ -518,6 +869,8 @@ uint64 instance_blackrock_spire::GetData64(uint32 uiType) return m_uiEmberseerGUID; case NPC_LORD_VICTOR_NEFARIUS: return m_uiNefariusGUID; + case NPC_REND_BLACKHAND: + return m_uiRendGUID; case NPC_GYTH: return m_uiGythGUID; case NPC_SCARSHIELD_INFILTRATOR: @@ -567,7 +920,7 @@ InstanceData* GetInstanceData_instance_blackrock_spire(Map* pMap) bool AreaTrigger_at_blackrock_spire(Player* pPlayer, AreaTriggerEntry const* pAt) { - if (pPlayer->IsDead()) + if (pPlayer->IsDead() || pPlayer->IsGameMaster()) return false; switch (pAt->id) @@ -582,16 +935,26 @@ bool AreaTrigger_at_blackrock_spire(Player* pPlayer, AreaTriggerEntry const* pAt } break; case AREATRIGGER_STADIUM: - if (instance_blackrock_spire* pInstance = (instance_blackrock_spire*) pPlayer->GetInstanceData()) - if (Creature* pGyth = pInstance->instance->GetCreature(pInstance->GetData64(NPC_GYTH))) - if (pGyth->IsAlive() && !pGyth->IsInCombat()) - pGyth->AI()->AttackStart(pPlayer); + if (instance_blackrock_spire* pInstance = (instance_blackrock_spire*)pPlayer->GetInstanceData()) + { + if (pInstance->GetData(TYPE_STADIUM) == IN_PROGRESS || pInstance->GetData(TYPE_STADIUM) == DONE) + return false; + + // Respawn Nefarius and Rend for the dialogue event if they are not spawned already. + if (Creature* pNefarius = pInstance->GetCreature(pInstance->GetData64(NPC_LORD_VICTOR_NEFARIUS))) + if (!pNefarius->IsAlive()) + pNefarius->Respawn(); + if (Creature* pRend = pInstance->GetCreature(pInstance->GetData64(NPC_REND_BLACKHAND))) + if (!pRend->IsAlive()) + pRend->Respawn(); + + pInstance->SetData(TYPE_STADIUM, IN_PROGRESS); + } break; } return false; } - struct go_father_flameAI: public GameObjectAI { go_father_flameAI(GameObject* pGo) : GameObjectAI(pGo) {} @@ -701,7 +1064,6 @@ struct npc_rookery_hatcherAI : public ScriptedAI m_creature->ForcedDespawn(); } - void MoveInLineOfSight(Unit* pWho) override { // Do not aggro players in the Hall of Binding. diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_victor_nefarius.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_victor_nefarius.cpp index 455c290e0..c97aecf87 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_victor_nefarius.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackwing_lair/boss_victor_nefarius.cpp @@ -631,7 +631,7 @@ CreatureAI* GetAI_boss_victor_nefarius(Creature* creature) return new boss_victor_nefariusAI(creature); // UBRS - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PLAYER); return new NullCreatureAI(creature); }