From 1b7ecdd3b8dad4531ef54537093fa1952eddc3d3 Mon Sep 17 00:00:00 2001 From: ratkosrb Date: Fri, 15 Jan 2021 22:51:08 +0200 Subject: [PATCH] New script for Darkmaster Gandling. --- sql/migrations/20210115202724_world.sql | 166 +++++++++ src/game/ScriptMgr.cpp | 8 +- src/game/ScriptMgr.h | 4 + src/game/Spells/SpellEffects.cpp | 11 +- src/scripts/CMakeLists.txt | 1 - src/scripts/ScriptLoader.cpp | 2 - .../scholomance/boss_darkmaster_gandling.cpp | 324 ------------------ .../scholomance/instance_scholomance.cpp | 124 +------ .../scholomance/scholomance.h | 6 - 9 files changed, 183 insertions(+), 463 deletions(-) create mode 100644 sql/migrations/20210115202724_world.sql delete mode 100644 src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_darkmaster_gandling.cpp diff --git a/sql/migrations/20210115202724_world.sql b/sql/migrations/20210115202724_world.sql new file mode 100644 index 000000000..26085fe66 --- /dev/null +++ b/sql/migrations/20210115202724_world.sql @@ -0,0 +1,166 @@ +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`='20210115202724'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20210115202724'); +-- Add your query below. + +-- Delete texts from custom table. +DELETE FROM `script_texts` WHERE `entry` IN (-1289000, -1289001); + +-- Text yelled on spawn. +UPDATE `broadcast_text` SET `chat_type`=1 WHERE `entry`=7145; + +-- Source health above 3 percent. +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (17950, 41, 3, 1, 0, 0, 2); + +-- Delete custom creatures. +DELETE FROM `creature_ai_scripts` WHERE `id` IN (3000001, 3000101, 3000201, 3000301, 3000401, 3000501); +DELETE FROM `creature_ai_events` WHERE `creature_id` IN (30000, 30001, 30002, 30003, 30004, 30005); +DELETE FROM `creature_template` WHERE `entry` IN (30000, 30001, 30002, 30003, 30004, 30005); + +-- Events list for Darkmaster Gandling +DELETE FROM `creature_ai_events` WHERE `creature_id`=1853; +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 (185301, 1853, 0, 11, 0, 100, 0, 0, 0, 0, 0, 185301, 0, 0, 'Darkmaster Gandling - Yell 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 (185302, 1853, 0, 21, 0, 100, 0, 0, 0, 0, 0, 185302, 0, 0, 'Darkmaster Gandling - Set Data on Reached Home'); +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 (185303, 1853, 0, 6, 0, 100, 0, 0, 0, 0, 0, 185303, 0, 0, 'Darkmaster Gandling - Set Data on Death'); +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 (185304, 1853, 17950, 0, 0, 100, 1, 16000, 16000, 20000, 35000, 185304, 0, 0, 'Darkmaster Gandling - Cast Shadow Portal in Combat'); +DELETE FROM `creature_ai_scripts` WHERE `id`=185301; +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 (185301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7145, 0, 0, 0, 0, 0, 0, 0, 0, 'Darkmaster Gandling - 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 (185301, 0, 15, 26200, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 110, 'Darkmaster Gandling - Cast Spell Christmas Darkmaster Gandling'); +DELETE FROM `creature_ai_scripts` WHERE `id`=185302; +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 (185302, 0, 37, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Darkmaster Gandling - Set Data Gandling to Fail'); +DELETE FROM `creature_ai_scripts` WHERE `id`=185303; +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 (185303, 0, 37, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Darkmaster Gandling - Set Data Gandling to Done'); +DELETE FROM `creature_ai_scripts` WHERE `id`=185304; +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 (185304, 0, 15, 17950, 2, 0, 0, 0, 259, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Darkmaster Gandling - Cast Shadow Portal'); +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 (18530, 'Scholomance - Darkmaster Gandling', 15790, 100, 1, 0, 0, 0, 4, 5, 6, 20, 0, 12040, 100, 0, 0, 0, 0, 12, 20, 14, 28, 0, 18702, 100, 1, 0, 0, 0, 15, 27, 15, 27, 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 `spell_list_id`=18530, `ai_name`='EventAI', `script_name`='' WHERE `entry`=1853; + +-- Positions for Shadow Portal spells. +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES (17863, 289, 274.877, 1.33366, 85.3117, 3.22886); +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES (17939, 289, 182.246, -95.4371, 85.3117, 1.5694); +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES (17943, 289, 86.6634, -1.96039, 85.3117, 0.017453); +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES (17944, 289, 265.956, 0.903429, 75.3334, 3.07178); +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES (17946, 289, 178.724, -91.0232, 70.8568, 1.64061); +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES (17948, 289, 103.305, -1.67752, 75.2183, 6.17846); + +-- Shadow Portal 17863 +-- Lorekeeper Polkelt +-- event 5618 +-- door guid 43196 + +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (5608, 47, 5618, 121, 0, 0, 0); +DELETE FROM `event_scripts` WHERE `id`=5618; +INSERT INTO `event_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 (5618, 0, 61, 5618, 300, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Polkelt: Start Scripted Map Event'); +INSERT INTO `event_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 (5618, 1, 80, 1, 0, 0, 0, 43196, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Polkelt: Door - Close'); +INSERT INTO `event_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 (5618, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5618, -1, 1, 256.289, 0.652, 84.924, 4.765, 0, 'Shadow Portal Polkelt: Summon Risen Guardian'); +INSERT INTO `event_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 (5618, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5618, -1, 1, 241.345, 4.231, 84.924, 5.062, 0, 'Shadow Portal Polkelt: Summon Risen Guardian'); +INSERT INTO `event_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 (5618, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5618, -1, 1, 249.715, -5.978, 85.106, 3.177, 0, 'Shadow Portal Polkelt: Summon Risen Guardian'); +INSERT INTO `event_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 (5618, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5618, -1, 1, 230.05, -9.946, 85.317, 5.847, 0, 'Shadow Portal Polkelt: Summon Risen Guardian'); +INSERT INTO `event_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 (5618, 3, 69, 5618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5608, 5608, 0, 0, 0, 0, 0, 'Shadow Portal Polkelt: Edit Map Event'); +DELETE FROM `generic_scripts` WHERE `id`=5608; +INSERT INTO `generic_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 (5608, 0, 80, 0, 0, 0, 0, 43196, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Polkelt: Door - Open'); +DELETE FROM `generic_scripts` WHERE `id`=5618; +INSERT INTO `generic_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 (5618, 0, 63, 5618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Polkelt: Risen Guardian - Add to Map Event'); + +-- Shadow Portal 17939 +-- Doctor Theolen Krastinov +-- event 5619 +-- door guid 43203 + +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (5609, 47, 5619, 121, 0, 0, 0); +DELETE FROM `event_scripts` WHERE `id`=5619; +INSERT INTO `event_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 (5619, 0, 61, 5619, 300, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Krastinov: Start Scripted Map Event'); +INSERT INTO `event_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 (5619, 1, 80, 1, 0, 0, 0, 43203, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Krastinov: Door - Close'); +INSERT INTO `event_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 (5619, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5619, -1, 1, 180.707, -75.818, 84.925, 1.396, 0, 'Shadow Portal Krastinov: Summon Risen Guardian'); +INSERT INTO `event_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 (5619, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5619, -1, 1, 185.689, -64.627, 84.925, 5.55, 0, 'Shadow Portal Krastinov: Summon Risen Guardian'); +INSERT INTO `event_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 (5619, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5619, -1, 1, 175.7, -55.238, 85.229, 4.772, 0, 'Shadow Portal Krastinov: Summon Risen Guardian'); +INSERT INTO `event_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 (5619, 3, 69, 5619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5609, 5609, 0, 0, 0, 0, 0, 'Shadow Portal Krastinov: Edit Map Event'); +DELETE FROM `generic_scripts` WHERE `id`=5609; +INSERT INTO `generic_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 (5609, 0, 80, 0, 0, 0, 0, 43203, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Krastinov: Door - Open'); +DELETE FROM `generic_scripts` WHERE `id`=5619; +INSERT INTO `generic_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 (5619, 0, 63, 5619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Krastinov: Risen Guardian - Add to Map Event'); + +-- Shadow Portal 17943 +-- Instructor Malicia +-- event 5620 +-- door guid 43184 + +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (5610, 47, 5620, 121, 0, 0, 0); +DELETE FROM `event_scripts` WHERE `id`=5620; +INSERT INTO `event_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 (5620, 0, 61, 5620, 300, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Malicia: Start Scripted Map Event'); +INSERT INTO `event_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 (5620, 1, 80, 1, 0, 0, 0, 43184, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Malicia: Door - Close'); +INSERT INTO `event_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 (5620, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5620, -1, 1, 123.306, 3.933, 85.312, 6.056, 0, 'Shadow Portal Malicia: Summon Risen Guardian'); +INSERT INTO `event_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 (5620, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5620, -1, 1, 110.892, -6.463, 85.312, 0.436, 0, 'Shadow Portal Malicia: Summon Risen Guardian'); +INSERT INTO `event_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 (5620, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5620, -1, 1, 102.454, 4.374, 85.312, 2.182, 0, 'Shadow Portal Malicia: Summon Risen Guardian'); +INSERT INTO `event_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 (5620, 3, 69, 5620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5610, 5610, 0, 0, 0, 0, 0, 'Shadow Portal Malicia: Edit Map Event'); +DELETE FROM `generic_scripts` WHERE `id`=5610; +INSERT INTO `generic_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 (5610, 0, 80, 0, 0, 0, 0, 43184, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Malicia: Door - Open'); +DELETE FROM `generic_scripts` WHERE `id`=5620; +INSERT INTO `generic_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 (5620, 0, 63, 5620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Malicia: Risen Guardian - Add to Map Event'); + +-- Shadow Portal 17944 +-- Lady Illucia Barov +-- event 5621 +-- door guid 35798 + +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (5611, 47, 5621, 121, 0, 0, 0); +DELETE FROM `event_scripts` WHERE `id`=5621; +INSERT INTO `event_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 (5621, 0, 61, 5621, 300, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Illucia: Start Scripted Map Event'); +INSERT INTO `event_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 (5621, 1, 80, 1, 0, 0, 0, 35798, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Illucia: Door - Close'); +INSERT INTO `event_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 (5621, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5621, -1, 1, 239.556, -4.945, 72.674, 1.4525, 0, 'Shadow Portal Illucia: Summon Risen Guardian'); +INSERT INTO `event_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 (5621, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5621, -1, 1, 226.854, 0.262, 72.673, 3.161, 0, 'Shadow Portal Illucia: Summon Risen Guardian'); +INSERT INTO `event_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 (5621, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5621, -1, 1, 248.115, 2.809, 72.669, 4.668, 0, 'Shadow Portal Illucia: Summon Risen Guardian'); +INSERT INTO `event_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 (5621, 3, 69, 5621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5611, 5611, 0, 0, 0, 0, 0, 'Shadow Portal Illucia: Edit Map Event'); +DELETE FROM `generic_scripts` WHERE `id`=5611; +INSERT INTO `generic_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 (5611, 0, 80, 0, 0, 0, 0, 35798, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Illucia: Door - Open'); +DELETE FROM `generic_scripts` WHERE `id`=5621; +INSERT INTO `generic_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 (5621, 0, 63, 5621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Illucia: Risen Guardian - Add to Map Event'); + +-- Shadow Portal 17946 +-- Lord Alexei Barov +-- event 5622 +-- door guid 43188 + +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (5612, 47, 5622, 121, 0, 0, 0); +DELETE FROM `event_scripts` WHERE `id`=5622; +INSERT INTO `event_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 (5622, 0, 61, 5622, 300, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Alexei: Start Scripted Map Event'); +INSERT INTO `event_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 (5622, 1, 80, 1, 0, 0, 0, 43188, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Alexei: Door - Close'); +INSERT INTO `event_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 (5622, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5622, -1, 1, 185.616, -42.912, 75.4812, 4.45059, 0, 'Shadow Portal Alexei: Summon Risen Guardian'); +INSERT INTO `event_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 (5622, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5622, -1, 1, 177.746, -42.7475, 75.4812, 4.88692, 0, 'Shadow Portal Alexei: Summon Risen Guardian'); +INSERT INTO `event_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 (5622, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5622, -1, 1, 181.825, -42.5812, 75.4812, 4.66003, 0, 'Shadow Portal Alexei: Summon Risen Guardian'); +INSERT INTO `event_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 (5622, 3, 69, 5622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5612, 5612, 0, 0, 0, 0, 0, 'Shadow Portal Alexei: Edit Map Event'); +DELETE FROM `generic_scripts` WHERE `id`=5612; +INSERT INTO `generic_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 (5612, 0, 80, 0, 0, 0, 0, 43188, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Alexei: Door - Open'); +DELETE FROM `generic_scripts` WHERE `id`=5622; +INSERT INTO `generic_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 (5622, 0, 63, 5622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Alexei: Risen Guardian - Add to Map Event'); + +-- Shadow Portal 17948 +-- The Ravenian +-- event 5623 +-- door guid 43187 + +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (5613, 47, 5623, 121, 0, 0, 0); +DELETE FROM `event_scripts` WHERE `id`=5623; +INSERT INTO `event_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 (5623, 0, 61, 5623, 300, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Ravenian: Start Scripted Map Event'); +INSERT INTO `event_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 (5623, 1, 80, 1, 0, 0, 0, 43187, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Ravenian: Door - Close'); +INSERT INTO `event_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 (5623, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5623, -1, 1, 128.806, -7.874, 75.482, 5.62, 0, 'Shadow Portal Ravenian: Summon Risen Guardian'); +INSERT INTO `event_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 (5623, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5623, -1, 1, 130.415, -1.113, 75.482, 2.688, 0, 'Shadow Portal Ravenian: Summon Risen Guardian'); +INSERT INTO `event_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 (5623, 2, 10, 11598, 300000, 0, 0, 0, 0, 0, 0, 0, 5623, -1, 1, 124.162, 5.816, 75.482, 5.061, 0, 'Shadow Portal Ravenian: Summon Risen Guardian'); +INSERT INTO `event_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 (5623, 3, 69, 5623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5613, 5613, 0, 0, 0, 0, 0, 'Shadow Portal Ravenian: Edit Map Event'); +DELETE FROM `generic_scripts` WHERE `id`=5613; +INSERT INTO `generic_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 (5613, 0, 80, 0, 0, 0, 0, 43187, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Ravenian: Door - Open'); +DELETE FROM `generic_scripts` WHERE `id`=5623; +INSERT INTO `generic_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 (5623, 0, 63, 5623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadow Portal Ravenian: Risen Guardian - Add to Map Event'); + + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index f92bd7b53..e22ffe5df 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -2649,19 +2649,19 @@ WorldObject* GetTargetByType(WorldObject* pSource, WorldObject* pTarget, uint8 T break; case TARGET_T_HOSTILE_SECOND_AGGRO: if (Creature* pCreatureSource = ToCreature(pSource)) - return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1); + return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1, Param2 ? Param2 : SELECT_FLAG_NO_TOTEM); break; case TARGET_T_HOSTILE_LAST_AGGRO: if (Creature* pCreatureSource = ToCreature(pSource)) - return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_BOTTOMAGGRO, 0); + return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_BOTTOMAGGRO, 0, Param2 ? Param2 : SELECT_FLAG_NO_TOTEM); break; case TARGET_T_HOSTILE_RANDOM: if (Creature* pCreatureSource = ToCreature(pSource)) - return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, Param2 ? Param2 : SELECT_FLAG_NO_TOTEM); break; case TARGET_T_HOSTILE_RANDOM_NOT_TOP: if (Creature* pCreatureSource = ToCreature(pSource)) - return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + return pCreatureSource->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1, nullptr, Param2 ? Param2 : SELECT_FLAG_NO_TOTEM); break; case TARGET_T_OWNER_OR_SELF: if (Unit* pUnitSource = ToUnit(pSource)) diff --git a/src/game/ScriptMgr.h b/src/game/ScriptMgr.h index 2adae3dbd..6163b11a9 100644 --- a/src/game/ScriptMgr.h +++ b/src/game/ScriptMgr.h @@ -1134,9 +1134,13 @@ enum ScriptTarget TARGET_T_HOSTILE = 1, //Our current target (ie: highest aggro). TARGET_T_HOSTILE_SECOND_AGGRO = 2, //Second highest aggro (generaly used for cleaves and some special attacks). + //Param2 = select_flags TARGET_T_HOSTILE_LAST_AGGRO = 3, //Dead last on aggro (no idea what this could be used for). + //Param2 = select_flags TARGET_T_HOSTILE_RANDOM = 4, //Just any random target on our threat list. + //Param2 = select_flags TARGET_T_HOSTILE_RANDOM_NOT_TOP = 5, //Any random target except top threat. + //Param2 = select_flags TARGET_T_OWNER_OR_SELF = 6, //Either self or owner if pet or controlled. TARGET_T_OWNER = 7, //The owner of the source. diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index d34c19d7f..b641f8806 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -1076,14 +1076,19 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) m_casterUnit->CastSpell(m_casterUnit, 29940, true, nullptr); return; } - case 17950: + case 17950: // Shadow Portal { if (!unitTarget) return; - // Shadow Portal + if (!m_casterUnit) + return; + + if (m_casterUnit->GetThreatManager().getThreat(unitTarget)) + m_casterUnit->GetThreatManager().modifyThreatPercent(unitTarget, -100); + uint32 spellId = PickRandomValue(17863, 17939, 17943, 17944, 17946, 17948); - m_caster->CastSpell(unitTarget, spellId, true); + m_casterUnit->CastSpell(unitTarget, spellId, true); return; } case 18350: // Dummy Trigger diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 99be20288..0bd1cff57 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -175,7 +175,6 @@ set (SCRIPTS_SRCS eastern_kingdoms/uldaman/uldaman.cpp eastern_kingdoms/undercity/undercity.cpp eastern_kingdoms/western_plaguelands/western_plaguelands.cpp - eastern_kingdoms/western_plaguelands/scholomance/boss_darkmaster_gandling.cpp eastern_kingdoms/western_plaguelands/scholomance/boss_doctor_theolen_krastinov.cpp eastern_kingdoms/western_plaguelands/scholomance/boss_illucia_barov.cpp eastern_kingdoms/western_plaguelands/scholomance/boss_instructor_malicia.cpp diff --git a/src/scripts/ScriptLoader.cpp b/src/scripts/ScriptLoader.cpp index 36e71198b..505ab34ca 100644 --- a/src/scripts/ScriptLoader.cpp +++ b/src/scripts/ScriptLoader.cpp @@ -122,7 +122,6 @@ void AddSC_boss_houndmaster_loksey(); void AddSC_boss_interrogator_vishas(); void AddSC_boss_mograine_and_whitemane(); void AddSC_instance_scarlet_monastery(); -void AddSC_boss_darkmaster_gandling(); //scholomance void AddSC_boss_theolenkrastinov(); void AddSC_boss_illuciabarov(); void AddSC_boss_instructormalicia(); @@ -374,7 +373,6 @@ void AddScripts() AddSC_boss_interrogator_vishas(); AddSC_boss_mograine_and_whitemane(); AddSC_instance_scarlet_monastery(); - AddSC_boss_darkmaster_gandling(); //scholomance AddSC_boss_theolenkrastinov(); AddSC_boss_illuciabarov(); AddSC_boss_instructormalicia(); diff --git a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_darkmaster_gandling.cpp b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_darkmaster_gandling.cpp deleted file mode 100644 index 43a7a7b96..000000000 --- a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/boss_darkmaster_gandling.cpp +++ /dev/null @@ -1,324 +0,0 @@ -/* Copyright (C) 2006 - 2009 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_Darkmaster_Gandling -SD%Complete: 75 -SDComment: Doors missing -SDCategory: Scholomance -EndScriptData */ - -#include "scriptPCH.h" -#include "scholomance.h" - -#define SAY_GANDLING_SPAWN -1289000 -#define SAY_GANDLING_DEATH -1289001 - -#define SPELL_ARCANEMISSILES 15790 -#define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either. -#define SPELL_CURSE 18702 - -#define ADD_1X 170.205 -#define ADD_1Y 99.413 -#define ADD_1Z 104.733 -#define ADD_1O 3.16 - -#define ADD_2X 170.813 -#define ADD_2Y 97.857 -#define ADD_2Z 104.713 -#define ADD_2O 3.16 - -#define ADD_3X 170.720 -#define ADD_3Y 100.900 -#define ADD_3Z 104.739 -#define ADD_3O 3.16 - -#define ADD_4X 171.866 -#define ADD_4Y 99.373 -#define ADD_4Z 104.732 -#define ADD_4O 3.16 - -struct boss_darkmaster_gandlingAI : public ScriptedAI -{ - boss_darkmaster_gandlingAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - Reset(); - DoScriptText(SAY_GANDLING_SPAWN, m_creature); - // display Christmas Hat Gandling during Feast of Winter Veil - if (sGameEventMgr.IsActiveEvent(2)) - m_creature->SetDisplayId(15732); - } - - ScriptedInstance* m_pInstance; - - uint32 ArcaneMissiles_Timer; - uint32 ShadowShield_Timer; - uint32 Curse_Timer; - uint32 Teleport_Timer; - bool bShadowPortalCasted; - uint64 ShadowPortalTargetGUID; - - void Reset() override - { - ArcaneMissiles_Timer = 4500; - ShadowShield_Timer = 12000; - Curse_Timer = 2000; - Teleport_Timer = 16000; - bShadowPortalCasted = false; - ShadowPortalTargetGUID = 0; - } - - void JustDied(Unit *killer) override - { - if (m_pInstance) - m_pInstance->SetData(TYPE_GANDLING, DONE); - - DoScriptText(SAY_GANDLING_DEATH, m_creature); - } - - void JustReachedHome() override - { - if (m_pInstance) - m_pInstance->SetData(TYPE_GANDLING, FAIL); - } - - void UpdateAI(uint32 const diff) override - { - if (!m_creature->SelectHostileTarget() || !m_creature->GetVictim()) - return; - - //ArcaneMissiles_Timer - if (ArcaneMissiles_Timer < diff) - { - if (DoCastSpellIfCan(m_creature->GetVictim(), SPELL_ARCANEMISSILES) == CAST_OK) - ArcaneMissiles_Timer = urand(10000, 16000); - } - else ArcaneMissiles_Timer -= diff; - - //ShadowShield_Timer - if (ShadowShield_Timer < diff) - { - if (DoCastSpellIfCan(m_creature, SPELL_SHADOWSHIELD) == CAST_OK) - ShadowShield_Timer = urand(10000, 12000); - } - else ShadowShield_Timer -= diff; - - //Curse_Timer - if (Curse_Timer < diff) - { - if (DoCastSpellIfCan(m_creature->GetVictim(), SPELL_CURSE) == CAST_OK) - Curse_Timer = urand(15000, 27000); - } - else Curse_Timer -= diff; - - //Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer. - //We will only telport if gandling has more than 3% of hp so teleported gamers can always loot. - if (m_creature->GetHealthPercent() > 3.0f) - { - if (Teleport_Timer < diff) - { - if (!bShadowPortalCasted) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) - { - if (pTarget->GetTypeId() == TYPEID_PLAYER) - { - ShadowPortalTargetGUID = pTarget->GetGUID(); - m_creature->CastSpell(pTarget, 17950, false); //Shadow Portal (visual) - bShadowPortalCasted = true; - Teleport_Timer = 2000; - } - } - } - else if (Unit* target = m_creature->GetMap()->GetUnit(ShadowPortalTargetGUID)) - { - m_creature->GetThreatManager().modifyThreatPercent(target, -100); - ShadowPortalTargetGUID = 0; - bShadowPortalCasted = false; - - if (target->IsAlive()) - { - switch (urand(0, 5)) - { - case 0: // Pokelt - DoTeleportPlayer(target, 250.0696f, 0.3921f, 84.8408f, 3.149f); - m_pInstance->SetData(TYPE_BONEMINION0, IN_PROGRESS); - if (Creature* Summoned = m_creature->SummonCreature(30000, 229.229f, 5.39118f, 85.2283f, 0.0961165f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30000, 229.503f, 0.00814369f, 85.2283f, 0.0961165f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30000, 229.727f, -4.39616f, 85.2283f, 0.0961165f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - break; - case 1: // Theolen - DoTeleportPlayer(target, 181.4220f, -91.9481f, 84.8410f, 1.608f); - m_pInstance->SetData(TYPE_BONEMINION1, IN_PROGRESS); - if (Creature* Summoned = m_creature->SummonCreature(30001, 186.217f, -50.0985f, 85.2283f, 4.75432f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30001, 181.568f, -56.2009f, 84.841f, 4.75432f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30001, 188.325f, -55.6766f, 85.2283f, 4.75432f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30001, 173.013f, -56.4198f, 85.2283f, 4.75432f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - break; - case 2: // Malicia - DoTeleportPlayer(target, 95.1547f, -1.8173f, 85.2289f, 0.043f); - m_pInstance->SetData(TYPE_BONEMINION2, IN_PROGRESS); - if (Creature* Summoned = m_creature->SummonCreature(30002, 128.205f, 5.00569f, 85.2283f, 3.09949f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30002, 128.06f, -6.1269f, 85.2283f, 3.09949f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30002, 128.124f, -1.71736f, 85.3764f, 3.09949f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - break; - case 3: // Illucia - DoTeleportPlayer(target, 250.0696f, 0.3921f, 72.6722f, 3.149f); - m_pInstance->SetData(TYPE_BONEMINION3, IN_PROGRESS); - if (Creature* Summoned = m_creature->SummonCreature(30003, 235.598f, 0.588147f, 72.6727f, 2.92513f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30003, 235.51f, -5.92126f, 72.6727f, 0.331743f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30003, 229.127f, -3.10989f, 72.6727f, 3.17017f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - break; - case 4: // Alexei - DoTeleportPlayer(target, 181.4220f, -91.9481f, 70.7734f, 1.608f); - m_pInstance->SetData(TYPE_BONEMINION4, IN_PROGRESS); - if (Creature* Summoned = m_creature->SummonCreature(30004, 170.96f, -56.9603f, 75.3971f, 3.75058f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30004, 182.708f, -55.8739f, 75.3971f, 1.88447f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30004, 175.353f, -55.9977f, 75.3971f, 0.461331f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30004, 191.41f, -55.4289f, 75.3971f, 3.75058f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - break; - case 5: // Voracien - DoTeleportPlayer(target, 106.1541f, -1.8994f, 75.3663f, 0.043f); - m_pInstance->SetData(TYPE_BONEMINION5, IN_PROGRESS); - if (Creature* Summoned = m_creature->SummonCreature(30005, 138.599f, 4.62909f, 75.397f, 0.065487f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30005, 136.525f, -1.6351f, 75.397f, 0.065487f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - if (Creature* Summoned = m_creature->SummonCreature(30005, 139.392f, -7.35632f, 75.397f, 0.039568f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000)) - { - Summoned->SetInCombatWith(target); - Summoned->GetThreatManager().addThreatDirectly(target, 100000.0f); - Summoned->GetMotionMaster()->MoveChase(target); - } - break; - } - } - Teleport_Timer = urand(20000, 35000); - } - } - else Teleport_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_darkmaster_gandling(Creature* pCreature) -{ - return new boss_darkmaster_gandlingAI(pCreature); -} - -void AddSC_boss_darkmaster_gandling() -{ - Script* newscript; - newscript = new Script; - newscript->Name = "boss_darkmaster_gandling"; - newscript->GetAI = &GetAI_boss_darkmaster_gandling; - newscript->RegisterSelf(); -} diff --git a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/instance_scholomance.cpp b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/instance_scholomance.cpp index 1ddf7af88..5633888dd 100644 --- a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/instance_scholomance.cpp +++ b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/instance_scholomance.cpp @@ -47,13 +47,6 @@ struct instance_scholomance : public ScriptedInstance uint64 m_uiGateIlluciaGUID; uint64 m_uiBrazierKirtonosGUID; - uint32 m_uiBoneMinionCount0; - uint32 m_uiBoneMinionCount1; - uint32 m_uiBoneMinionCount2; - uint32 m_uiBoneMinionCount3; - uint32 m_uiBoneMinionCount4; - uint32 m_uiBoneMinionCount5; - void Initialize() override { memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); @@ -68,13 +61,6 @@ struct instance_scholomance : public ScriptedInstance m_uiGateIlluciaGUID = 0; m_uiBrazierKirtonosGUID = 0; - m_uiBoneMinionCount0 = 0; - m_uiBoneMinionCount1 = 0; - m_uiBoneMinionCount2 = 0; - m_uiBoneMinionCount3 = 0; - m_uiBoneMinionCount4 = 0; - m_uiBoneMinionCount5 = 0; - } void OnCreatureCreate(Creature* pCreature) override { @@ -216,114 +202,6 @@ struct instance_scholomance : public ScriptedInstance case TYPE_VIEWING_ROOM_DOOR: m_auiEncounter[uiType] = uiData; break; - case TYPE_BONEMINION0: - m_auiEncounter[TYPE_BONEMINION0] = uiData; // eventAI a changer : virer le onplayer kill et mettre on evade ou reached home ? - if (uiData == IN_PROGRESS) - { - m_uiBoneMinionCount0 = 0; - if (GameObject* pGo = instance->GetGameObject(m_uiGatePolkeltGUID)) - if (pGo->GetGoState() == GO_STATE_ACTIVE) // ouverte - DoUseDoorOrButton(m_uiGatePolkeltGUID); - } - else if (uiData == DONE) - { - ++m_uiBoneMinionCount0; - if (m_uiBoneMinionCount0 > 2) - if (GameObject* pGo = instance->GetGameObject(m_uiGatePolkeltGUID)) - if (pGo->GetGoState() != GO_STATE_ACTIVE) // fermée - DoUseDoorOrButton(m_uiGatePolkeltGUID); - } - break; - case TYPE_BONEMINION1: - m_auiEncounter[TYPE_BONEMINION1] = uiData; - if (uiData == IN_PROGRESS) - { - m_uiBoneMinionCount1 = 0; - if (GameObject* pGo = instance->GetGameObject(m_uiGateTheolenGUID)) - if (pGo->GetGoState() == GO_STATE_ACTIVE) // ouverte - DoUseDoorOrButton(m_uiGateTheolenGUID); - } - else if (uiData == DONE) - { - ++m_uiBoneMinionCount1; - if (m_uiBoneMinionCount1 > 3) - if (GameObject* pGo = instance->GetGameObject(m_uiGateTheolenGUID)) - if (pGo->GetGoState() != GO_STATE_ACTIVE) // fermée - DoUseDoorOrButton(m_uiGateTheolenGUID); - } - break; - case TYPE_BONEMINION2: - m_auiEncounter[TYPE_BONEMINION2] = uiData; - if (uiData == IN_PROGRESS) - { - m_uiBoneMinionCount2 = 0; - if (GameObject* pGo = instance->GetGameObject(m_uiGateMiliciaGUID)) - if (pGo->GetGoState() == GO_STATE_ACTIVE) // ouverte - DoUseDoorOrButton(m_uiGateMiliciaGUID); - } - else if (uiData == DONE) - { - ++m_uiBoneMinionCount2; - if (m_uiBoneMinionCount2 > 2) - if (GameObject* pGo = instance->GetGameObject(m_uiGateMiliciaGUID)) - if (pGo->GetGoState() != GO_STATE_ACTIVE) // fermée - DoUseDoorOrButton(m_uiGateMiliciaGUID); - } - break; - case TYPE_BONEMINION3: - m_auiEncounter[TYPE_BONEMINION3] = uiData; - if (uiData == IN_PROGRESS) - { - m_uiBoneMinionCount3 = 0; - if (GameObject* pGo = instance->GetGameObject(m_uiGateIlluciaGUID)) - if (pGo->GetGoState() == GO_STATE_ACTIVE) // ouverte - DoUseDoorOrButton(m_uiGateIlluciaGUID); - } - else if (uiData == DONE) - { - ++m_uiBoneMinionCount3; - if (m_uiBoneMinionCount3 > 2) - if (GameObject* pGo = instance->GetGameObject(m_uiGateIlluciaGUID)) - if (pGo->GetGoState() != GO_STATE_ACTIVE) // fermée - DoUseDoorOrButton(m_uiGateIlluciaGUID); - } - break; - case TYPE_BONEMINION4: - m_auiEncounter[TYPE_BONEMINION4] = uiData; - if (uiData == IN_PROGRESS) - { - m_uiBoneMinionCount4 = 0; - if (GameObject* pGo = instance->GetGameObject(m_uiGateBarovGUID)) - if (pGo->GetGoState() == GO_STATE_ACTIVE) // ouverte - DoUseDoorOrButton(m_uiGateBarovGUID); - } - else if (uiData == DONE) - { - ++m_uiBoneMinionCount4; - if (m_uiBoneMinionCount4 > 3) - if (GameObject* pGo = instance->GetGameObject(m_uiGateBarovGUID)) - if (pGo->GetGoState() != GO_STATE_ACTIVE) // fermée - DoUseDoorOrButton(m_uiGateBarovGUID); - } - break; - case TYPE_BONEMINION5: - m_auiEncounter[TYPE_BONEMINION5] = uiData; - if (uiData == IN_PROGRESS) - { - m_uiBoneMinionCount5 = 0; - if (GameObject* pGo = instance->GetGameObject(m_uiGateRavenianGUID)) - if (pGo->GetGoState() == GO_STATE_ACTIVE) // ouverte - DoUseDoorOrButton(m_uiGateRavenianGUID); - } - else if (uiData == DONE) - { - ++m_uiBoneMinionCount5; - if (m_uiBoneMinionCount5 > 2) - if (GameObject* pGo = instance->GetGameObject(m_uiGateRavenianGUID)) - if (pGo->GetGoState() != GO_STATE_ACTIVE) // fermée - DoUseDoorOrButton(m_uiGateRavenianGUID); - } - break; default: break; } @@ -365,7 +243,7 @@ struct instance_scholomance : public ScriptedInstance { if (GetData(TYPE_GANDLING) == SPECIAL) { - instance->SummonCreature(NPC_GANDLING, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SummonCreature(NPC_GANDLING, 180.771f, -5.4286f, 75.5702f, 1.29154f, TEMPSUMMON_DEAD_DESPAWN, 0); SetData(TYPE_GANDLING, IN_PROGRESS); } } diff --git a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/scholomance.h b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/scholomance.h index 7b1de680c..a17a5aacf 100644 --- a/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/scholomance.h +++ b/src/scripts/eastern_kingdoms/western_plaguelands/scholomance/scholomance.h @@ -38,12 +38,6 @@ enum TYPE_POLKELT = 5, TYPE_RAVENIAN = 6, TYPE_KIRTONOS = 7, - TYPE_BONEMINION0 = 8, - TYPE_BONEMINION1 = 9, - TYPE_BONEMINION2 = 10, - TYPE_BONEMINION3 = 11, - TYPE_BONEMINION4 = 12, - TYPE_BONEMINION5 = 13, TYPE_VIEWING_ROOM_DOOR = 14, INSTANCE_SCHOLOMANCE_MAX_ENCOUNTER =15,