From d4cdb05ab19045ea76f45fef09bbc32734cfec2d Mon Sep 17 00:00:00 2001 From: NickTyrer Date: Fri, 10 Dec 2021 21:39:49 +0000 Subject: [PATCH] Update GUIDs For Lunar Festival Conditions (#1418) --- sql/migrations/20211210213106_world.sql | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sql/migrations/20211210213106_world.sql diff --git a/sql/migrations/20211210213106_world.sql b/sql/migrations/20211210213106_world.sql new file mode 100644 index 000000000..dbf64551d --- /dev/null +++ b/sql/migrations/20211210213106_world.sql @@ -0,0 +1,28 @@ +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`='20211210213106'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20211210213106'); +-- Add your query below. + + +-- Update Conditions For Lunar Festival Questgivers +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 (1589202, 15892, 262, 1, 0, 100, 0, 0, 0, 0, 0, 1589202, 0, 0, 'Lunar Festival Emissary - Modify Flags on Spawn'); +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 (1589202, 0, 4, 147, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lunar Festival Emissary - Modify Flags'); +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (260, 52, 12469, 12460, 12526, 12496, 1); +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (261, 52, 12478, 12487, 0, 0, 1); +INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (262, -1, 260, 261, 0, 0, 0); + +-- Remove Unneeded Script +DELETE FROM `creature_movement_scripts` WHERE `id` = 848001; + + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration;