diff --git a/sql/migrations/20180613180009_world.sql b/sql/migrations/20180613180009_world.sql new file mode 100644 index 000000000..256a7ec5f --- /dev/null +++ b/sql/migrations/20180613180009_world.sql @@ -0,0 +1,239 @@ +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`='20180613180009'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20180613180009'); +-- Add your query below. + + +-- Conditions. +INSERT INTO `conditions` VALUES (3704, 34, 2, 3, 0, 0, 0); -- Rethilgore DONE +INSERT INTO `conditions` VALUES (3705, 34, 5, 3, 0, 0, 1); -- Intro Event NOT DONE +INSERT INTO `conditions` VALUES (3706, 1, 7587, 1, 0, 0, 1); -- Not Have Aura 7587 +INSERT INTO `conditions` VALUES (3707, 1, 7586, 1, 0, 0, 1); -- Not Have Aura 7586 +INSERT INTO `conditions` VALUES (3708, 1, 7136, 1, 0, 0, 1); -- Not Have Aura 7136 +INSERT INTO `conditions` VALUES (3709, -1, 3706, 3707, 0, 0, 0); -- Not Have Aura 7587 and 7586 +INSERT INTO `conditions` VALUES (3710, -1, 3708, 3709, 0, 0, 2); -- Source Not Have Aura 7587 and 7586 and 7136 + +-- Texts. +UPDATE `broadcast_text` SET `EmoteId0`=4 WHERE `ID`=1320; +UPDATE `broadcast_text` SET `EmoteId0`=1 WHERE `ID`=1331; + +-- Assign condition to Intro Event. +UPDATE `creature_ai_events` SET `condition_id`=3705 WHERE `id`=1000000; +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 (10000, 0, 37, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'SFK Intro - Set Instance Data'); + +-- Deathstalker Vincent. +DELETE FROM `creature_ai_events` WHERE `creature_id`=4444; +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 (444401, 4444, 0, 4, 2, 100, 0, 0, 0, 0, 0, 444401, 0, 0, 'Deathstalker Vincent - Stand Up on Aggro (Phase 0)'); +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 (444402, 4444, 0, 2, 2, 100, 0, 1, 0, 0, 0, 444402, 0, 0, 'Deathstalker Vincent - Play Dead at 1% HP (Phase 0)'); +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 (444403, 4444, 0, 21, 2, 100, 0, 0, 0, 0, 0, 444403, 0, 0, 'Deathstalker Vincent - Play Dead on Reached Home (Phase 0)'); +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 (444404, 4444, 0, 7, 1, 100, 0, 0, 0, 0, 0, 444404, 0, 0, 'Deathstalker Vincent - Disable Attack and Combat Movement on Evade (Phase 1)'); +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 (444405, 4444, 0, 0, 1, 100, 0, 60000, 60000, 0, 0, 444405, 0, 0, 'Deathstalker Vincent - Leave Combat after 1 Minute (Phase 1)'); +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 (444406, 4444, 0, 4, 1, 100, 0, 0, 0, 0, 0, 444403, 0, 0, 'Deathstalker Vincent - Play Dead on Aggro (Phase 1)'); +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 (444407, 4444, 0, 29, 0, 100, 0, 8, 1, 0, 0, 444403, 0, 0, 'Deathstalker Vincent - Play Dead on Reaching Home Position'); +DELETE FROM `creature_ai_scripts` WHERE `id`=444401; +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 (444401, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Stand Up'); +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 (444401, 0, 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Enable Melee Attack'); +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 (444401, 0, 43, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Enable Combat Movement'); +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 (444401, 0, 52, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Make Unkillable'); +DELETE FROM `creature_ai_scripts` WHERE `id`=444402; +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 (444402, 0, 44, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Set Phase to 1'); +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 (444402, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Disable Melee Attack'); +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 (444402, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Disable Combat Movement'); +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 (444402, 0, 3, 0, 0, 68, 3, 0, 0, 0, 0, 1, 0, 0, 0, -219.311, 2147.68, 80.9921, 3.63082, 0, 'Deathstalker Vincent - Move to Home Position'); +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 (444402, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1458, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Say Text'); +DELETE FROM `creature_ai_scripts` WHERE `id`=444403; +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 (444403, 0, 28, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Set Stand State to Dead'); +DELETE FROM `creature_ai_scripts` WHERE `id`=444404; +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 (444404, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Disable Melee Attack'); +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 (444404, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Disable Combat Movement'); +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 (444404, 0, 28, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Set Stand State to Dead'); +DELETE FROM `creature_ai_scripts` WHERE `id`=444405; +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 (444405, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Vincent - Enter Evade Mode'); +UPDATE `creature_template` SET `AIName`='EventAI', `ScriptName`='', `RegenHealth`=0 WHERE `entry`=4444; + +-- Script when Rethilgore dies. +DELETE FROM `creature_ai_scripts` WHERE `id`=391403; +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 (391403, 0, 37, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Rethilgore - Set Instance Data'); +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 (391403, 0, 39, 391403, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 'Rethilgore - Start Event Script'); +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 (391403, 0, 0, 0, 0, 0, 0, 3849, 50, 8, 2, 1328, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Say Text'); +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 (391403, 4, 0, 0, 0, 0, 0, 3850, 50, 8, 2, 1329, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Say Text'); + +-- Sorcerer Ashcrombe. +INSERT INTO `gossip_menu` VALUES (21213, 798, 0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`, `condition_id`) VALUES (21213, 0, 0, 'Please unlock the courtyard door.', 2802, 1, 1, -1, 0, 21213, 0, 0, NULL, 0, 3704); +DELETE FROM `gossip_scripts` WHERE `id`=21214; +INSERT INTO `gossip_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 (21213, 0, 4, 147, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Remove Gossip Flag'); +INSERT INTO `gossip_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 (21213, 0, 60, 3, 0, 4000, 0, 0, 0, 0, 0, 1, 3850, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Start Waypoints'); +INSERT INTO `gossip_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 (21213, 0, 4, 46, 512, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Add Passive Flag'); +INSERT INTO `gossip_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 (21213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1331, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Say Text'); +UPDATE `creature_template` SET `ScriptName`='', `gossip_menu_id`=21213 WHERE `entry`=3850; +DELETE FROM `script_waypoint` WHERE `entry`=3850; +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 1, -241.817, 2122.9, 81.179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 2, -247.139, 2124.89, 81.179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 3, -253.179, 2127.41, 81.179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 4, -253.898, 2130.87, 81.179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 5, -249.889, 2142.31, 86.972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 6, -248.205, 2144.02, 87.013, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 7, -240.553, 2140.55, 87.012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 8, -237.514, 2142.07, 87.012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 9, -235.638, 2149.23, 90.587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 10, -234.186, 2152.72, 90.624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 11, -241.162, 2153.65, 90.624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3850, 12, -241.13, 2154.56, 90.624, 0, 385012, 0, 0, 0, 0, 0, 0, 0, 1.25, 0, 0); +DELETE FROM `creature_movement_scripts` WHERE `id`=385012; +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 (385012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1332, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Say Text 1'); +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 (385012, 0, 15, 6421, 5, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Cast Spell Ashcrombe\'s Unlock'); +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 (385012, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1334, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Say Text 2'); +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 (385012, 5, 37, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Set Instance Data'); +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 (385012, 10, 15, 6422, 5, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Cast Spell Ashcrombe\'s Teleport'); +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 (385012, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1343, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Say Text 3 (Emoted)'); +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 (385012, 12, 18, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Sorcerer Ashcrombe - Despawn'); + +-- Deathstalker Adamant. +INSERT INTO `gossip_menu` VALUES (21214, 799, 0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `action_script_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`, `condition_id`) VALUES (21214, 0, 0, 'Please unlock the courtyard door.', 2802, 1, 1, -1, 0, 21214, 0, 0, NULL, 0, 3704); +DELETE FROM `gossip_scripts` WHERE `id`=21214; +INSERT INTO `gossip_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 (21214, 0, 4, 147, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Remove Gossip Flag'); +INSERT INTO `gossip_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 (21214, 0, 60, 3, 0, 4000, 0, 0, 0, 0, 0, 1, 3849, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Start Waypoints'); +INSERT INTO `gossip_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 (21214, 0, 4, 46, 512, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Add Passive Flag'); +INSERT INTO `gossip_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 (21214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1320, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Say Text'); +UPDATE `creature_template` SET `ScriptName`='', `gossip_menu_id`=21214 WHERE `entry`=3849; +DELETE FROM `script_waypoint` WHERE `entry`=3849; +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 1, -250.923, 2116.26, 81.179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 2, -255.049, 2119.39, 81.179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 3, -254.129, 2123.45, 81.179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 4, -253.898, 2130.87, 81.179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 5, -249.889, 2142.31, 86.972, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 6, -248.205, 2144.02, 87.013, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 7, -240.553, 2140.55, 87.012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 8, -237.514, 2142.07, 87.012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 9, -235.638, 2149.23, 90.587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 10, -237.188, 2151.95, 90.624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 11, -239.651, 2155.98, 90.624, 12000, 384911, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 12, -208.764, 2141.6, 90.6257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 13, -206.441, 2143.51, 90.4287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 14, -203.715, 2145.85, 88.7052, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 15, -199.199, 2144.88, 86.501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 16, -195.798, 2143.58, 86.501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 17, -190.029, 2141.38, 83.2712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 18, -189.353, 2138.65, 83.1102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 19, -190.304, 2135.73, 81.5288, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 20, -207.325, 2112.43, 81.0548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 21, -208.754, 2109.9, 81.0527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 22, -206.248, 2108.62, 81.0555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 23, -202.017, 2106.64, 78.6836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 24, -200.928, 2104.49, 78.5569, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 25, -201.845, 2101.17, 76.9256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 26, -202.844, 2100.11, 76.8911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 27, -213.326, 2105.83, 76.8925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 28, -226.993, 2111.47, 76.8892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 29, -227.955, 2112.34, 76.8895, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `waittime`, `script_id`, `textid1`, `textid2`, `textid3`, `textid4`, `textid5`, `emote`, `spell`, `orientation`, `model1`, `model2`) VALUES (3849, 30, -230.05, 2106.64, 76.8895, 0, 384930, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0); +DELETE FROM `creature_movement_scripts` WHERE `id`=384911; +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 (384911, 0, 1, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Emote Crafting'); +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 (384911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1321, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Say Text 1'); +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 (384911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1322, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Say Text 2 (Emoted)'); +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 (384911, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Stop Emoting'); +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 (384911, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1323, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Say Text 3'); +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 (384911, 6, 37, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Set Instance Data'); +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 (384911, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1324, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Say Text 4'); +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 (384911, 10, 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Set Run'); +DELETE FROM `creature_movement_scripts` WHERE `id`=384930; +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 (384930, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Deathstalker Adamant - Despawn'); + +-- Script when Fenrus dies. +DELETE FROM `spell_mod` WHERE `id`=33019; +DELETE FROM `spell_effect_mod` WHERE `id`=33019; +DELETE FROM `creature_ai_scripts` WHERE `id`=427403; +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 (427403, 0, 37, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Fenrus the Devourer - Set Instance Data'); +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 (427403, 0, 10, 4275, 14000, 0, 0, 0, 0, 0, 0, 0, 427403, 6, 3, -137.29, 2169.59, 136.57, 2.81, 0, 'Fenrus the Devourer - Summon Archmage Arugal'); +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 (427403, 0, 39, 9536, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 'Fenrus the Devourer - Start Script to Summon Voidwalkers'); +DELETE FROM `event_scripts` WHERE `id`=427403; +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 (427403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1435, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Say Text'); +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 (427403, 0, 4, 46, 898, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Make Unattackable'); +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 (427403, 2, 15, 6422, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Cast Spell Ashcrombe\'s Teleport'); +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 (427403, 8, 13, 0, 0, 0, 0, 32447, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Activate Object Arugal\'s Focus'); +DELETE FROM `event_scripts` WHERE `id`=9536; +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 (9536, 14, 10, 4627, 9000000, 0, 0, 0, 0, 0, 0, 0, 0, 6, 1, -147.059, 2163.19, 128.696, 0.128, 0, 'Fenrus the Devourer - Summon Voidwalker 1'); +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 (9536, 14, 10, 4627, 9000000, 0, 0, 0, 0, 0, 0, 0, 0, 6, 1, -155.352, 2172.78, 128.448, 4.679, 0, 'Fenrus the Devourer - Summon Voidwalker 2'); +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 (9536, 14, 10, 4627, 9000000, 0, 0, 0, 0, 0, 0, 0, 0, 6, 1, -148.869, 2180.86, 128.448, 1.814, 0, 'Fenrus the Devourer - Summon Voidwalker 3'); +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 (9536, 14, 10, 4627, 9000000, 0, 0, 0, 0, 0, 0, 0, 0, 6, 1, -140.203, 2175.26, 128.448, 0.373, 0, 'Fenrus the Devourer - Summon Voidwalker 4'); + +-- Wolf Master Nandos - Script when his dogs die. +UPDATE `creature_template` SET `flags_extra`=`flags_extra`+65536 WHERE `entry`=3927; +UPDATE `creature` SET `spawntimesecsmin`=7200, `spawntimesecsmax`=7200 WHERE `guid` iN (16240, 16241, 16239, 16238); +DELETE FROM `creature_groups` WHERE `leaderGUID`=16238; +INSERT INTO `creature_groups` VALUES (16237, 16237, 0, 0, 64); +INSERT INTO `creature_groups` VALUES (16237, 16238, 0, 0, 64); +INSERT INTO `creature_groups` VALUES (16237, 16239, 0, 0, 64); +INSERT INTO `creature_groups` VALUES (16237, 16240, 0, 0, 64); +INSERT INTO `creature_groups` VALUES (16237, 16241, 0, 0, 64); +INSERT INTO `creature_linking` VALUES (16239, 16238, 3); +INSERT INTO `creature_linking` VALUES (16240, 16238, 3); +INSERT INTO `creature_linking` VALUES (16241, 16238, 3); +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 (392707, 3927, 0, 32, 0, 100, 1, 0, 0, 0, 0, 392707, 0, 0, 'Wolf Master Nandos - Increment Phase on Group Member Died'); +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 (392708, 3927, 0, 1, 15, 100, 0, 0, 0, 0, 0, 392708, 0, 0, 'Wolf Master Nandos - Say Text on Group All Dead'); +DELETE FROM `creature_ai_scripts` WHERE `id`=392706; +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 (392706, 0, 37, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Wolf Master Nandos - Set Instance Data'); +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 (392706, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Wolf Master Nandos - Set Phase to 0'); +DELETE FROM `creature_ai_scripts` WHERE `id`=392707; +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 (392707, 0, 44, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Wolf Master Nandos - Increment Phase'); +DELETE FROM `creature_ai_scripts` WHERE `id`=392708; +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 (392708, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Wolf Master Nandos - Set Phase to 0'); +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 (392708, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2086, 0, 0, 0, 0, 0, 0, 0, 0, 'Wolf Master Nandos - 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 (392708, 0, 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Wolf Master Nandos - Set Run'); +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 (392708, 0, 3, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, -171, 2182.22, 151.9, 0, 0, 'Wolf Master Nandos - Move to Door'); + +-- Archmage Arugal. +DELETE FROM `creature_ai_events` WHERE `creature_id`=4275; +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 (427501, 4275, 0, 4, 0, 100, 0, 0, 0, 0, 0, 427501, 0, 0, 'Archmage Arugal - Yell on Aggro'); +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 (427502, 4275, 0, 5, 0, 100, 0, 0, 0, 0, 0, 427502, 0, 0, 'Archmage Arugal - Yell on Player Kill'); +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 (427503, 4275, 0, 9, 0, 100, 1, 0, 10, 500, 500, 427503, 0, 0, 'Archmage Arugal - Enable Melee Attack below 10 yards'); +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 (427504, 4275, 0, 9, 0, 100, 1, 10, 60, 500, 500, 427504, 0, 0, 'Archmage Arugal - Disable Melee Attack above 10 yards'); +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 (427505, 4275, 3710, 0, 4, 100, 1, 48000, 48000, 40000, 40000, 427505, 0, 0, 'Archmage Arugal - Cast Shadow Port 1'); +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 (427506, 4275, 3710, 0, 4, 100, 1, 22000, 22000, 40000, 40000, 427506, 0, 0, 'Archmage Arugal - Cast Shadow Port 2'); +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 (427507, 4275, 3710, 0, 4, 100, 1, 34000, 34000, 40000, 40000, 427507, 0, 0, 'Archmage Arugal - Cast Shadow Port 3'); +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 (427508, 4275, 0, 27, 5, 100, 1, 7587, 1, 5000, 5000, 427508, 0, 0, 'Archmage Arugal - Cast Shadow Port when Root Expires'); +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 (427509, 4275, 0, 3, 6, 100, 0, 20, 0, 0, 0, 427509, 0, 0, 'Archmage Arugal - Set Phase when Mana below 10%'); +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 (427510, 4275, 0, 7, 0, 100, 0, 0, 0, 0, 0, 427510, 0, 0, 'Archmage Arugal - Set Phase on Evade'); +DELETE FROM `creature_ai_scripts` WHERE `id`=427503; +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 (427503, 0, 42, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Enable Melee Attack'); +DELETE FROM `creature_ai_scripts` WHERE `id`=427504; +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 (427504, 0, 42, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Disable Melee Attack'); +DELETE FROM `creature_ai_scripts` WHERE `id`=427505; +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 (427505, 0, 15, 7136, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Cast Shadow Port'); +DELETE FROM `creature_ai_scripts` WHERE `id`=427506; +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 (427506, 0, 15, 7586, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Cast Shadow Port'); +DELETE FROM `creature_ai_scripts` WHERE `id`=427507; +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 (427507, 0, 15, 7587, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Cast Shadow Port'); +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 (427507, 0, 44, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Set Phase to 1'); +DELETE FROM `creature_ai_scripts` WHERE `id`=427508; +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 (427508, 0, 15, 7586, 3, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Cast Shadow Port'); +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 (427508, 0, 44, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Set Phase to 0'); +DELETE FROM `creature_ai_scripts` WHERE `id`=427509; +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 (427509, 0, 44, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Set Phase to 2'); +DELETE FROM `creature_ai_scripts` WHERE `id`=427510; +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 (427510, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Archmage Arugal - Set Phase to 0'); +DELETE FROM `creature_spells_scripts` WHERE `id`=7587; +DELETE FROM `creature_spells_scripts` WHERE `id`=7586; +DELETE FROM `creature_spells_scripts` WHERE `id`=7136; +DELETE FROM `creature_spells_scripts` WHERE `id`=7803; +INSERT INTO `creature_spells_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 (7803, 1, 3, 2, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 'Archmage Arugal - Thundershock - Move Away from Target'); +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 (42750, 'Shadowfang Keep - Archmage Arugal', 7621, 100, 4, 0, 0, 0, 10, 15, 15, 20, 7621, 7803, 80, 1, 0, 0, 0, 15, 15, 15, 15, 7803, 7588, 100, 1, 0, 0, 64, 0, 0, 5, 7, 0, 7588, 100, 1, 0, 0, 128, 0, 0, 1, 1, 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); + +-- Unrelated fix for Scarlet Subterfuge. +DELETE FROM `conditions` WHERE `condition_entry` IN (6300, 6302); +UPDATE `quest_end_scripts` SET `dataint3`=6301 WHERE `id`=5862 && `command`=69 && `dataint3`=6302; + + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/game/AI/CreatureAI.cpp b/src/game/AI/CreatureAI.cpp index 119607aac..9e5d4582e 100644 --- a/src/game/AI/CreatureAI.cpp +++ b/src/game/AI/CreatureAI.cpp @@ -329,11 +329,6 @@ void CreatureAI::DoCast(Unit* victim, uint32 spellId, bool triggered) m_creature->CastSpell(victim, spellId, triggered); } -void CreatureAI::DoCastVictim(uint32 spellId, bool triggered) -{ - m_creature->CastSpell(m_creature->getVictim(), spellId, triggered); -} - void CreatureAI::DoCastAOE(uint32 spellId, bool triggered) { if (!triggered && m_creature->IsNonMeleeSpellCasted(false)) diff --git a/src/game/AI/CreatureAI.h b/src/game/AI/CreatureAI.h index 147b5459a..6d3fb3e35 100644 --- a/src/game/AI/CreatureAI.h +++ b/src/game/AI/CreatureAI.h @@ -120,6 +120,9 @@ class MANGOS_DLL_SPEC CreatureAI // Called when the creature summon is killed virtual void SummonedCreatureJustDied(Creature* /*unit*/) {} + // Called when a member of the creature's group is killed + virtual void GroupMemberJustDied(Creature* /*unit*/, bool /*isLeader*/) {} + // Called when the creature kills a unit virtual void KilledUnit(Unit *) {} @@ -207,7 +210,6 @@ class MANGOS_DLL_SPEC CreatureAI // TrinityCore void DoCast(Unit* victim, uint32 spellId, bool triggered = false); - void DoCastVictim(uint32 spellId, bool triggered = false); void DoCastAOE(uint32 spellId, bool triggered = false); bool UpdateVictim(); bool UpdateVictimWithGaze(); diff --git a/src/game/AI/CreatureEventAI.cpp b/src/game/AI/CreatureEventAI.cpp index d3fbea16b..6d8b91b3f 100644 --- a/src/game/AI/CreatureEventAI.cpp +++ b/src/game/AI/CreatureEventAI.cpp @@ -359,6 +359,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction break; } case EVENT_T_MAP_SCRIPT_EVENT: + case EVENT_T_GROUP_MEMBER_DIED: break; default: sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type); @@ -859,4 +860,22 @@ void CreatureEventAI::MapScriptEventHappened(ScriptedEvent* pEvent, uint32 uiDat if (((*i).Event.map_event.eventId == pEvent->m_uiEventId) && ((*i).Event.map_event.data == uiData)) ProcessEvent(*i); } +} + +void CreatureEventAI::GroupMemberJustDied(Creature* pUnit, bool isLeader) +{ + if (m_bEmptyList) + return; + + for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) + { + if ((*i).Event.event_type == EVENT_T_GROUP_MEMBER_DIED) + { + if ((*i).Event.group_member_died.creatureId && ((*i).Event.group_member_died.creatureId != pUnit->GetEntry())) + continue; + + if (((bool)(*i).Event.group_member_died.isLeader) == isLeader) + ProcessEvent(*i); + } + } } \ No newline at end of file diff --git a/src/game/AI/CreatureEventAI.h b/src/game/AI/CreatureEventAI.h index 7ef0214fc..facd204d6 100644 --- a/src/game/AI/CreatureEventAI.h +++ b/src/game/AI/CreatureEventAI.h @@ -69,6 +69,7 @@ enum EventAI_Type EVENT_T_MOVEMENT_INFORM = 29, // Param1 = motion type, Param2 = point ID, RepeatMin, RepeatMax EVENT_T_LEAVE_COMBAT = 30, // NONE EVENT_T_MAP_SCRIPT_EVENT = 31, // Param1 = EventID, Param2 = Data + EVENT_T_GROUP_MEMBER_DIED = 32, // Param1 = CreatureId, Param2 = IsLeader EVENT_T_END, }; @@ -229,6 +230,12 @@ struct CreatureEventAI_Event uint32 eventId; uint32 data; } map_event; + // EVENT_T_GROUP_MEMBER_DIED = 32 + struct + { + uint32 creatureId; + uint32 isLeader; + } group_member_died; // RAW struct { @@ -285,6 +292,7 @@ class MANGOS_DLL_SPEC CreatureEventAI : public CreatureAI void DamageTaken(Unit* done_by, uint32& damage) override; void UpdateAI(const uint32 diff) override; void ReceiveEmote(Player* pPlayer, uint32 text_emote) override; + void GroupMemberJustDied(Creature* unit, bool isLeader) override; void SummonedCreatureJustDied(Creature* unit) override; void SummonedCreatureDespawn(Creature* unit) override; void MapScriptEventHappened(ScriptedEvent* pEvent, uint32 uiData) override; diff --git a/src/game/AI/CreatureEventAIMgr.cpp b/src/game/AI/CreatureEventAIMgr.cpp index fbe3dc612..785d453af 100644 --- a/src/game/AI/CreatureEventAIMgr.cpp +++ b/src/game/AI/CreatureEventAIMgr.cpp @@ -204,17 +204,18 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Events() case EVENT_T_SUMMONED_JUST_DIED: case EVENT_T_SUMMONED_JUST_DESPAWN: if (!sCreatureStorage.LookupEntry(temp.summoned.creatureId)) - sLog.outErrorDb("CreatureEventAI: Creature %u are using event(%u) with nonexistent creature template id (%u) in param1, skipped.", temp.creature_id, i, temp.summoned.creatureId); + { + if (!sObjectMgr.IsExistingCreatureId(temp.group_member_died.creatureId)) + sLog.outErrorDb("CreatureEventAI: Creature %u are using event(%u) with nonexistent creature template id (%u) in param1, skipped.", temp.creature_id, i, temp.summoned.creatureId); + continue; + } if (temp.summoned.repeatMax < temp.summoned.repeatMin) sLog.outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); break; case EVENT_T_QUEST_ACCEPT: case EVENT_T_QUEST_COMPLETE: - if (!sObjectMgr.GetQuestTemplate(temp.quest.questId)) - sLog.outErrorDb("CreatureEventAI: Creature %u are using event(%u) with nonexistent quest id (%u) in param1, skipped.", temp.creature_id, i, temp.quest.questId); sLog.outErrorDb("CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i); continue; - case EVENT_T_AGGRO: case EVENT_T_DEATH: case EVENT_T_EVADE: @@ -277,6 +278,19 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Events() } case EVENT_T_MAP_SCRIPT_EVENT: break; + case EVENT_T_GROUP_MEMBER_DIED: + { + if (temp.group_member_died.creatureId) + { + if (!sCreatureStorage.LookupEntry(temp.group_member_died.creatureId)) + { + if (!sObjectMgr.IsExistingCreatureId(temp.group_member_died.creatureId)) + sLog.outErrorDb("CreatureEventAI: Creature %u are using event(%u) with nonexistent creature template id (%u) in param1, skipped.", temp.creature_id, i, temp.group_member_died.creatureId); + continue; + } + } + break; + } default: sLog.outErrorDb("CreatureEventAI: Creature %u using not checked at load event (%u) in event %u. Need check code update?", temp.creature_id, temp.event_id, i); break; diff --git a/src/game/CreatureGroups.cpp b/src/game/CreatureGroups.cpp index 3cd060640..a5dd7b373 100644 --- a/src/game/CreatureGroups.cpp +++ b/src/game/CreatureGroups.cpp @@ -43,22 +43,41 @@ void CreatureGroup::OnMemberAttackStart(Creature* member, Unit *target) if (!(_options & OPTION_AGGRO_TOGETHER)) return; - for (std::map::iterator itr = _members.begin(); itr != _members.end(); ++itr) - if (itr->first != member->GetObjectGuid()) - MemberAssist(member->GetMap()->GetCreature(itr->first), target); + for (const auto& itr : _members) + if (itr.first != member->GetObjectGuid()) + MemberAssist(member->GetMap()->GetCreature(itr.first), target); if (member->GetObjectGuid() != GetLeaderGuid()) MemberAssist(member->GetMap()->GetCreature(GetLeaderGuid()), target); } +void CreatureGroup::OnMemberDied(Creature* member) +{ + if (_options & OPTION_INFORM_LEADER_ON_MEMBER_DIED) + { + if (member->GetObjectGuid() != GetLeaderGuid()) + if (Creature* groupLeader = member->GetMap()->GetCreature(GetLeaderGuid())) + if (groupLeader->IsInWorld() && groupLeader->isAlive() && groupLeader->AI()) + groupLeader->AI()->GroupMemberJustDied(member, false); + } + if (_options & OPTION_INFORM_MEMBERS_ON_ANY_DIED) + { + for (const auto& itr : _members) + if (itr.first != member->GetObjectGuid()) + if (Creature* otherMember = member->GetMap()->GetCreature(itr.first)) + if (otherMember->IsInWorld() && otherMember->isAlive() && otherMember->AI()) + otherMember->AI()->GroupMemberJustDied(member, member->GetObjectGuid() == GetLeaderGuid()); + } +} + void CreatureGroup::OnLeaveCombat(Creature* member) { bool masterEvade = member->GetObjectGuid() == GetLeaderGuid(); if (_options & OPTION_EVADE_TOGETHER) { - for (std::map::iterator itr = _members.begin(); itr != _members.end(); ++itr) - if (itr->first != member->GetObjectGuid()) - if (Creature* otherMember = member->GetMap()->GetCreature(itr->first)) + for (const auto& itr : _members) + if (itr.first != member->GetObjectGuid()) + if (Creature* otherMember = member->GetMap()->GetCreature(itr.first)) if (otherMember->IsInWorld() && otherMember->isAlive() && otherMember->AI()) otherMember->AI()->EnterEvadeMode(); @@ -85,14 +104,14 @@ void CreatureGroup::OnRespawn(Creature* member) void CreatureGroup::RespawnAll(Creature* except) { - for (std::map::iterator itr = _members.begin(); itr != _members.end(); ++itr) - if (itr->first != except->GetObjectGuid()) - if (Creature* otherMember = except->GetMap()->GetCreature(itr->first)) - Respawn(otherMember, itr->second); + for (const auto& itr : _members) + if (itr.first != except->GetObjectGuid()) + if (Creature* otherMember = except->GetMap()->GetCreature(itr.first)) + Respawn(otherMember, itr.second); if (except->GetObjectGuid() != GetLeaderGuid()) if (Creature* otherMember = except->GetMap()->GetCreature(GetLeaderGuid())) - Respawn(otherMember, NULL); + Respawn(otherMember, nullptr); } void CreatureGroup::Respawn(Creature* member, CreatureGroupMember const* memberEntry /* = NULL for leader */) @@ -102,7 +121,7 @@ void CreatureGroup::Respawn(Creature* member, CreatureGroupMember const* memberE return; _respawnGuard = true; - if (member->IsInWorld() && member->GetRespawnTime() > time(NULL)) + if (member->IsInWorld() && member->GetRespawnTime() > time(nullptr)) { if (memberEntry && memberEntry->memberFlags & OPTION_FORMATION_MOVE) { @@ -159,15 +178,15 @@ void CreatureGroup::DeleteFromDb() void CreatureGroup::SaveToDb() { DeleteFromDb(); - for (std::map::iterator it = _members.begin(); it != _members.end(); ++it) + for (const auto& itr : _members) WorldDatabase.PExecute("INSERT INTO creature_groups SET leaderGUID=%u, memberGUID=%u, dist='%f', angle='%f', flags=%u", - _leaderGuid.GetCounter(), it->first.GetCounter(), it->second->followDistance, it->second->followAngle, it->second->memberFlags); + _leaderGuid.GetCounter(), itr.first.GetCounter(), itr.second->followDistance, itr.second->followAngle, itr.second->memberFlags); } uint32 CreatureGroup::GetWaitTime(Creature* moving) { - for (std::map::iterator it = _members.begin(); it != _members.end(); ++it) - if (Creature* curr = moving->GetMap()->GetCreature(it->first)) + for (const auto& itr : _members) + if (Creature* curr = moving->GetMap()->GetCreature(itr.first)) if (!curr->movespline->Finalized()) return 1; return 0; @@ -205,7 +224,7 @@ void CreatureGroupsManager::Load() uint32 count = 0; Field *fields; - CreatureGroup *currentGroup = NULL; + CreatureGroup *currentGroup = nullptr; do { @@ -231,7 +250,7 @@ void CreatureGroupsManager::Load() currentGroup = new CreatureGroup(leaderGuid); RegisterNewGroup(currentGroup); } - currentGroup->AddMember(memberGuid, fields[2].GetFloat(), fields[3].GetFloat(), fields[4].GetUInt8()); + currentGroup->AddMember(memberGuid, fields[2].GetFloat(), fields[3].GetFloat(), fields[4].GetUInt32()); ++count; } } @@ -244,14 +263,14 @@ void CreatureGroupsManager::Load() void CreatureGroupsManager::LoadCreatureGroup(Creature* creature, CreatureGroup*& group) { - group = NULL; + group = nullptr; if (!creature->HasStaticDBSpawnData()) return; - for (std::map::iterator it = _groups.begin(); it != _groups.end(); ++it) + for (const auto& itr : _groups) { - if (it->first == creature->GetObjectGuid() || it->second->ContainsGuid(creature->GetObjectGuid())) + if (itr.first == creature->GetObjectGuid() || itr.second->ContainsGuid(creature->GetObjectGuid())) { - group = it->second; + group = itr.second; break; } } diff --git a/src/game/CreatureGroups.h b/src/game/CreatureGroups.h index 2c71bf7dc..7ee1d0771 100644 --- a/src/game/CreatureGroups.h +++ b/src/game/CreatureGroups.h @@ -32,6 +32,8 @@ enum OptionFlags OPTION_RESPAWN_TOGETHER = 0x008, OPTION_RESPAWN_ALL_ON_MASTER_EVADE = 0x010, OPTION_RESPAWN_ALL_ON_ANY_EVADE = 0x020, + OPTION_INFORM_LEADER_ON_MEMBER_DIED = 0x040, + OPTION_INFORM_MEMBERS_ON_ANY_DIED = 0x080, }; struct CreatureGroupMember @@ -62,6 +64,8 @@ class CreatureGroup void OnMemberAttackStart(Creature* member, Unit* target); void MemberAssist(Creature* member, Unit* target); + void OnMemberDied(Creature* member); + void OnLeaveCombat(Creature* creature); void OnRespawn(Creature* member); void RespawnAll(Creature* except); diff --git a/src/game/Objects/Creature.cpp b/src/game/Objects/Creature.cpp index 226f1d107..450f0a2c6 100644 --- a/src/game/Objects/Creature.cpp +++ b/src/game/Objects/Creature.cpp @@ -2215,11 +2215,12 @@ void Creature::CallForHelp(float fRadius) bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /*= true*/) const { - // we don't need help from zombies :) if (!isAlive()) return false; - // we don't need help from non-combatant ;) + if (GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_ASSIST) + return false; + if (GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_AGGRO) return false; diff --git a/src/game/Objects/Creature.h b/src/game/Objects/Creature.h index 039a5f400..0bef1f42d 100644 --- a/src/game/Objects/Creature.h +++ b/src/game/Objects/Creature.h @@ -65,6 +65,7 @@ enum CreatureFlagsExtra CREATURE_FLAG_EXTRA_ALWAYS_CRUSH = 0x00002000, // creature always roll a crushing melee outcome when not miss/crit/dodge/parry/block CREATURE_FLAG_EXTRA_IMMUNE_AOE = 0x00004000, // creature is immune to AoE CREATURE_FLAG_EXTRA_CHASE_GEN_NO_BACKING = 0x00008000, // creature does not move back when target is within bounding radius + CREATURE_FLAG_EXTRA_NO_ASSIST = 0x00010000, // creature does not aggro when nearby creatures aggro }; // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index c7f5630ac..d15a6ca7f 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -1251,10 +1251,12 @@ void Unit::Kill(Unit* pVictim, SpellEntry const *spellProto, bool durabilityLoss creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } - // Call creature just died function if (creature->AI()) creature->AI()->JustDied(this); + if (CreatureGroup* group = creature->GetCreatureGroup()) + group->OnMemberDied(creature); + if (creature->IsTemporarySummon()) { TemporarySummon* pSummon = (TemporarySummon*)creature; diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 37f18ed6d..3da736179 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -13,7 +13,6 @@ set (SCRIPTS_SRCS eastern_kingdoms/dun_morogh/gnomeregan/gnomeregan.h eastern_kingdoms/eastern_plaguelands/naxxramas/naxxramas.h eastern_kingdoms/eastern_plaguelands/stratholme/stratholme.h - eastern_kingdoms/silverpine_forest/shadowfang_keep/shadowfang_keep.h eastern_kingdoms/stormwind_city/quest_stormwind_rendezvous.h eastern_kingdoms/stranglethorn_vale/zulgurub/zulgurub.h eastern_kingdoms/swamp_of_sorrows/sunken_temple/sunken_temple.h @@ -145,7 +144,6 @@ set (SCRIPTS_SRCS eastern_kingdoms/searing_gorge/searing_gorge.cpp eastern_kingdoms/silverpine_forest/silverpine_forest.cpp eastern_kingdoms/silverpine_forest/shadowfang_keep/instance_shadowfang_keep.cpp - eastern_kingdoms/silverpine_forest/shadowfang_keep/shadowfang_keep.cpp eastern_kingdoms/stormwind_city/quest_stormwind_rendezvous.cpp eastern_kingdoms/stormwind_city/stormwind_city.cpp eastern_kingdoms/stranglethorn_vale/stranglethorn_vale.cpp diff --git a/src/scripts/ScriptLoader.cpp b/src/scripts/ScriptLoader.cpp index 46d2316f8..6dc89635e 100644 --- a/src/scripts/ScriptLoader.cpp +++ b/src/scripts/ScriptLoader.cpp @@ -145,7 +145,6 @@ void AddSC_boss_vectus(); //void AddSC_boss_lordblackwood(); void AddSC_scholo_trash(); void AddSC_instance_scholomance(); -void AddSC_shadowfang_keep(); //shadowfang_keep void AddSC_instance_shadowfang_keep(); void AddSC_boss_magistrate_barthilas(); //stratholme void AddSC_boss_maleki_the_pallid(); @@ -416,7 +415,6 @@ void AddScripts() //AddSC_boss_lordblackwood(); AddSC_scholo_trash(); AddSC_instance_scholomance(); - AddSC_shadowfang_keep(); //shadowfang_keep AddSC_instance_shadowfang_keep(); AddSC_boss_magistrate_barthilas(); //stratholme AddSC_boss_maleki_the_pallid(); diff --git a/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/instance_shadowfang_keep.cpp b/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/instance_shadowfang_keep.cpp index 4c45c38f4..0f613ac62 100644 --- a/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/instance_shadowfang_keep.cpp +++ b/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/instance_shadowfang_keep.cpp @@ -22,17 +22,17 @@ SDCategory: Shadowfang Keep EndScriptData */ #include "scriptPCH.h" -#include "shadowfang_keep.h" enum { + TYPE_FREE_NPC = 1, + TYPE_RETHILGORE = 2, + TYPE_FENRUS = 3, + TYPE_NANDOS = 4, + TYPE_INTRO = 5, + TYPE_VOIDWALKER = 6, MAX_ENCOUNTER = 6, - SAY_BOSS_DIE_AD = 1328, - SAY_BOSS_DIE_AS = 1329, - SAY_FENRUS_DEAD = 1435, - SAY_WOLVES_DEAD = 2086, - NPC_BARON_SILVERLAINE = 3887, NPC_CMD_SPRINGVALE = 4278, NPC_ASH = 3850, @@ -47,9 +47,6 @@ enum GO_SORCERER_DOOR = 18972, //door to open when Fenrus the Devourer dies GO_ARUGAL_DOOR = 18971, //door to open when Wolf Master Nandos dies GO_ARUGAL_FOCUS = 18973, //this generates the lightning visual in the Fenrus event - - SPELL_ARUGAL_SPAWN = 6422, - SPELL_VOID_EVENT = 33019, }; struct instance_shadowfang_keep : public ScriptedInstance @@ -75,29 +72,21 @@ struct instance_shadowfang_keep : public ScriptedInstance uint64 m_uiVincentGUID; uint64 m_uiNandosGUID; - uint64 m_uiArugalFocusGUID; - uint32 m_uiVoidWalkerCount; uint32 m_uiSpawnPatrolOnBaronDeath; uint32 m_uiSpawnPatrolOnCmdDeath; - uint32 m_uiCountDeadWolf; - uint32 m_bNandosYelled; - bool isBaronDead; bool isCmdDead; - void Initialize() + void Initialize() override { memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); m_uiAshGUID = 0; m_uiAdaGUID = 0; - m_uiCountDeadWolf = 0; - m_bNandosYelled = false; - m_uiDoorCourtyardGUID = 0; m_uiDoorSorcererGUID = 0; m_uiDoorArugalGUID = 0; @@ -112,12 +101,11 @@ struct instance_shadowfang_keep : public ScriptedInstance m_uiSpawnPatrolOnCmdDeath = 6000; m_uiBaronSilverlaineGUID = 0; - m_uiArugalFocusGUID = 0; //Nostalrius m_uiVoidWalkerCount = 0; } - void OnCreatureCreate(Creature* pCreature) + void OnCreatureCreate(Creature* pCreature) override { switch (pCreature->GetEntry()) { @@ -166,7 +154,7 @@ struct instance_shadowfang_keep : public ScriptedInstance } } - void OnCreatureDeath(Creature* pCreature) + void OnCreatureDeath(Creature* pCreature) override { switch (pCreature->GetEntry()) { @@ -177,38 +165,10 @@ struct instance_shadowfang_keep : public ScriptedInstance isCmdDead = true; break; } - - if (pCreature->GetRespawnDelay() == 7205) - m_uiCountDeadWolf++; - if (m_uiCountDeadWolf == 4) - { - Creature* pNandos = instance->GetCreature(m_uiNandosGUID); - { - if (pNandos->isAlive()) - { - if (!m_bNandosYelled) - { - DoScriptText(SAY_WOLVES_DEAD, pNandos); - pNandos->SetWalk(false); - pNandos->GetMotionMaster()->MovePoint(0, -171.0f, 2182.22f, 151.9f, MOVE_PATHFINDING); - m_bNandosYelled = true; - } - else if (Unit* victim = pNandos->getVictim()) - { - // Once MovePoint has been used the movement generator type becomes idle. - // If he has a target make him chase it. - pNandos->SendMeleeAttackStart(victim); - pNandos->GetMotionMaster()->Clear(false); - pNandos->GetMotionMaster()->MoveChase(victim); - } - - } - } - } } - void OnObjectCreate(GameObject* pGo) + void OnObjectCreate(GameObject* pGo) override { switch (pGo->GetEntry()) { @@ -229,25 +189,10 @@ struct instance_shadowfang_keep : public ScriptedInstance if (m_auiEncounter[3] == DONE) pGo->SetGoState(GO_STATE_ACTIVE); break; - case GO_ARUGAL_FOCUS: - m_uiArugalFocusGUID = pGo->GetGUID(); - break; } } - void DoSpeech() - { - Creature* pAda = instance->GetCreature(m_uiAdaGUID); - Creature* pAsh = instance->GetCreature(m_uiAshGUID); - - if (pAda && pAda->isAlive() && pAsh && pAsh->isAlive()) - { - DoScriptText(SAY_BOSS_DIE_AD, pAda); - DoScriptText(SAY_BOSS_DIE_AS, pAsh); - } - } - - void Update(uint32 uiDiff) + void Update(uint32 uiDiff) override { if (isBaronDead) { @@ -296,7 +241,7 @@ struct instance_shadowfang_keep : public ScriptedInstance } - void SetData(uint32 uiType, uint32 uiData) + void SetData(uint32 uiType, uint32 uiData) override { switch (uiType) { @@ -306,35 +251,9 @@ struct instance_shadowfang_keep : public ScriptedInstance m_auiEncounter[0] = uiData; break; case TYPE_RETHILGORE: - if (uiData == DONE) - DoSpeech(); m_auiEncounter[1] = uiData; break; case TYPE_FENRUS: - if (uiData == DONE) - if (Creature* pFenrus = instance->GetCreature(m_uiFenrusGUID)) - if (Creature* pArugal = pFenrus->SummonCreature(NPC_ARCHMAGE_ARUGAL, -137.29f, 2169.588f, 136.57f, 2.810f, TEMPSUMMON_TIMED_DESPAWN, 12000)) - { - // Say text and cast event spell when fenrus is killed. - pArugal->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoScriptText(SAY_FENRUS_DEAD, pArugal); - pArugal->CastSpell(pArugal, SPELL_VOID_EVENT, true); - - // After 2 seconds cast fire spell. - static ScriptInfo si; - si.command = SCRIPT_COMMAND_CAST_SPELL; - si.castSpell.spellId = SPELL_ARUGAL_SPAWN; - si.castSpell.flags = 0x1; - pArugal->GetMap()->ScriptCommandStart(si, 2, pArugal, pArugal); - - // After 8 seconds create lightning. - if (GameObject* pLightning = instance->GetGameObject(GetData64(DATA_LIGHTNING))) - { - static ScriptInfo si2; - si2.command = SCRIPT_COMMAND_ACTIVATE_OBJECT; - pArugal->GetMap()->ScriptCommandStart(si2, 8, pArugal, pLightning); - } - } m_auiEncounter[2] = uiData; break; case TYPE_NANDOS: @@ -370,7 +289,7 @@ struct instance_shadowfang_keep : public ScriptedInstance } } - uint32 GetData(uint32 uiType) + uint32 GetData(uint32 uiType) override { switch (uiType) { @@ -384,30 +303,18 @@ struct instance_shadowfang_keep : public ScriptedInstance return m_auiEncounter[3]; case TYPE_INTRO: return m_auiEncounter[4]; - case DEAD_WOLF: - return m_uiCountDeadWolf; default: break; } return 0; } - uint64 GetData64(uint32 uiType) - { - switch (uiType) - { - case DATA_LIGHTNING: - return m_uiArugalFocusGUID; - } - return 0; - } - - const char* Save() + const char* Save() override { return strInstData.c_str(); } - void Load(const char* chrIn) + void Load(const char* chrIn) override { if (!chrIn) { diff --git a/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/shadowfang_keep.cpp b/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/shadowfang_keep.cpp deleted file mode 100644 index 9bd7bdf01..000000000 --- a/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/shadowfang_keep.cpp +++ /dev/null @@ -1,257 +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: Shadowfang_Keep -SD%Complete: 100 -SDComment: npc_shadowfang_prisoner using escortAI for movement to door. -SDCategory: Shadowfang Keep -EndScriptData */ - -/* ContentData -npc_shadowfang_prisoner -npc_deathstalker_vincent -EndContentData */ - -#include "scriptPCH.h" -#include "shadowfang_keep.h" - -/*###### -## npc_shadowfang_prisoner -######*/ - -enum -{ - SAY_FREE_AS = 1331, - SAY_OPEN_DOOR_AS = 1332, - SAY_POST_DOOR_AS = 1334, - EMOTE_VANISH_AS = 1343, - SAY_FREE_AD = 1320, - SAY_OPEN_DOOR_AD = 1321, - SAY_POST1_DOOR_AD = 1323, - SAY_POST2_DOOR_AD = 1324, - EMOTE_UNLOCK_DOOR_AD = 1322, - - SPELL_UNLOCK = 6421, - SPELL_FIRE = 6422, - NPC_ASH = 3850, - NPC_ADA = 3849, - - GOSSIP_ITEM_DOOR = 2802 -}; - -struct npc_shadowfang_prisonerAI : public npc_escortAI -{ - npc_shadowfang_prisonerAI(Creature* pCreature) : npc_escortAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - m_uiNpcEntry = pCreature->GetEntry(); - Reset(); - } - - ScriptedInstance* m_pInstance; - uint32 m_uiNpcEntry; - - void WaypointReached(uint32 uiPoint) - { - switch (uiPoint) - { - case 0: - if (m_uiNpcEntry == NPC_ASH) - DoScriptText(SAY_FREE_AS, m_creature); - else - DoScriptText(SAY_FREE_AD, m_creature); - break; - case 10: - if (m_uiNpcEntry == NPC_ASH) - DoScriptText(SAY_OPEN_DOOR_AS, m_creature); - else - DoScriptText(SAY_OPEN_DOOR_AD, m_creature); - break; - case 11: - if (m_uiNpcEntry == NPC_ASH) - DoCastSpellIfCan(m_creature, SPELL_UNLOCK); - else - { - DoScriptText(EMOTE_UNLOCK_DOOR_AD, m_creature); - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING); - } - break; - case 12: - if (m_uiNpcEntry != NPC_ASH) - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_NONE); - break; - case 13: - if (m_uiNpcEntry == NPC_ASH) - DoScriptText(SAY_POST_DOOR_AS, m_creature); - else - DoScriptText(SAY_POST1_DOOR_AD, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_FREE_NPC, DONE); - break; - case 14: - if (m_uiNpcEntry == NPC_ASH) - DoCastSpellIfCan(m_creature, SPELL_FIRE); - else - { - DoScriptText(SAY_POST2_DOOR_AD, m_creature); - SetRun(); - } - break; - case 15: - if (m_uiNpcEntry == NPC_ASH) - DoScriptText(EMOTE_VANISH_AS, m_creature); - break; - } - } - - void Reset() {} - - //let's prevent Adamant from charging into Ashcrombe's cell - //and beating the crap out of him and vice versa XD - void AttackStart(Unit* pWho) - { - if (pWho) - { - if (pWho->GetEntry() == NPC_ASH || pWho->GetEntry() == NPC_ADA) - return; - else - ScriptedAI::AttackStart(pWho); - } - } -}; - -CreatureAI* GetAI_npc_shadowfang_prisoner(Creature* pCreature) -{ - return new npc_shadowfang_prisonerAI(pCreature); -} - -bool GossipHello_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance* pInstance = ((ScriptedInstance*)pCreature->GetInstanceData()); - - if (pInstance && pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - - if (npc_shadowfang_prisonerAI* pEscortAI = dynamic_cast(pCreature->AI())) - pEscortAI->Start(); - } - return true; -} - -/*###### -## npc_deathstalker_vincent -######*/ - -enum -{ - SAY_VINCENT_DIE = 1458, - - FACTION_FRIENDLY = 35 -}; - -struct npc_deathstalker_vincentAI : public ScriptedAI -{ - npc_deathstalker_vincentAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - void Reset() - { - if (!m_pInstance) - return; - - if (m_pInstance->GetData(TYPE_INTRO) == DONE && !m_creature->GetByteValue(UNIT_FIELD_BYTES_1, 0)) - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - } - - void DamageTaken(Unit* pDoneBy, uint32& uiDamage) - { - if (pDoneBy) - { - m_creature->SetInCombatWith(pDoneBy); - pDoneBy->SetInCombatWith(m_creature); - } - - if (m_creature->getStandState()) - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - - if (uiDamage >= m_creature->GetHealth()) - { - m_creature->GetHealth() > 1 ? uiDamage = m_creature->GetHealth() - 1 : uiDamage = 0; - m_creature->setFaction(FACTION_FRIENDLY); - EnterEvadeMode(); - DoScriptText(SAY_VINCENT_DIE, m_creature); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_creature->isInCombat() && m_creature->getFaction() == FACTION_FRIENDLY) - EnterEvadeMode(); - - ScriptedAI::UpdateAI(uiDiff); - } - - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->LoadCreatureAddon(true); - - m_creature->SetLootRecipient(NULL); - - Reset(); - } -}; - -CreatureAI* GetAI_npc_deathstalker_vincent(Creature* pCreature) -{ - return new npc_deathstalker_vincentAI(pCreature); -} - -void AddSC_shadowfang_keep() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_shadowfang_prisoner"; - newscript->pGossipHello = &GossipHello_npc_shadowfang_prisoner; - newscript->pGossipSelect = &GossipSelect_npc_shadowfang_prisoner; - newscript->GetAI = &GetAI_npc_shadowfang_prisoner; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_deathstalker_vincent"; - newscript->GetAI = &GetAI_npc_deathstalker_vincent; - newscript->RegisterSelf(); -} diff --git a/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/shadowfang_keep.h b/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/shadowfang_keep.h deleted file mode 100644 index 59b97e059..000000000 --- a/src/scripts/eastern_kingdoms/silverpine_forest/shadowfang_keep/shadowfang_keep.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHADOWFANG_H -#define DEF_SHADOWFANG_H - -enum -{ - TYPE_FREE_NPC = 1, - TYPE_RETHILGORE = 2, - TYPE_FENRUS = 3, - TYPE_NANDOS = 4, - TYPE_INTRO = 5, - TYPE_VOIDWALKER = 6, - DATA_LIGHTNING = 7, - DEAD_WOLF = 8 -}; - -#endif