Skip to content

Commit aef3aa4

Browse files
committed
Yetis should flee at low health before 1.3.
1 parent eb21246 commit aef3aa4

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
DROP PROCEDURE IF EXISTS add_migration;
2+
DELIMITER ??
3+
CREATE PROCEDURE `add_migration`()
4+
BEGIN
5+
DECLARE v INT DEFAULT 1;
6+
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20251204140338');
7+
IF v = 0 THEN
8+
INSERT INTO `migrations` VALUES ('20251204140338');
9+
-- Add your query below.
10+
11+
12+
/*
13+
World of Warcraft Client Patch 1.3.0 (2005-03-22)
14+
- Yeti will no longer flee when at low health.
15+
*/
16+
17+
-- 4020: Content Patch Is Equal Or Less Than 1.2
18+
INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (4020, 24, 0, 2, 0, 0, 0);
19+
20+
-- Events list for Cave Yeti
21+
DELETE FROM `creature_ai_events` WHERE `creature_id`=2248;
22+
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
23+
(224801, 2248, 4020, 2, 0, 100, 0, 15, 0, 0, 0, 224801, 0, 0, 'Cave Yeti - Flee at 15% HP (Before 1.3)');
24+
DELETE FROM `creature_ai_scripts` WHERE `id`=224801;
25+
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `priority`, `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
26+
(224801, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Cave Yeti - Flee');
27+
UPDATE `creature_template` SET `ai_name`='EventAI' WHERE `entry`=2248;
28+
29+
-- Events list for Mountain Yeti
30+
DELETE FROM `creature_ai_events` WHERE `creature_id`=2250;
31+
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
32+
(225001, 2250, 4020, 2, 0, 100, 0, 15, 0, 0, 0, 225001, 0, 0, 'Mountain Yeti - Flee at 15% HP (Before 1.3)');
33+
DELETE FROM `creature_ai_scripts` WHERE `id`=225001;
34+
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `priority`, `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
35+
(225001, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mountain Yeti - Flee');
36+
UPDATE `creature_template` SET `ai_name`='EventAI' WHERE `entry`=2250;
37+
38+
-- Events list for Giant Yeti
39+
DELETE FROM `creature_ai_events` WHERE `creature_id`=2251;
40+
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
41+
(225101, 2251, 4020, 2, 0, 100, 0, 15, 0, 0, 0, 225101, 0, 0, 'Giant Yeti - Flee at 15% HP (Before 1.3)');
42+
DELETE FROM `creature_ai_scripts` WHERE `id`=225101;
43+
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `priority`, `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
44+
(225101, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Giant Yeti - Flee');
45+
UPDATE `creature_template` SET `ai_name`='EventAI' WHERE `entry`=2251;
46+
47+
-- Events list for Feral Scar Yeti
48+
DELETE FROM `creature_ai_events` WHERE `creature_id`=5292;
49+
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
50+
(529201, 5292, 4020, 2, 0, 100, 0, 15, 0, 0, 0, 529201, 0, 0, 'Feral Scar Yeti - Flee at 15% HP (Before 1.3)');
51+
DELETE FROM `creature_ai_scripts` WHERE `id`=529201;
52+
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `priority`, `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
53+
(529201, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Feral Scar Yeti - Flee');
54+
UPDATE `creature_template` SET `ai_name`='EventAI' WHERE `entry`=5292;
55+
56+
-- Events list for Ice Thistle Yeti
57+
DELETE FROM `creature_ai_events` WHERE `creature_id`=7458;
58+
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
59+
(745801, 7458, 4020, 2, 0, 100, 0, 15, 0, 0, 0, 745801, 0, 0, 'Ice Thistle Yeti - Flee at 15% HP (Before 1.3)');
60+
DELETE FROM `creature_ai_scripts` WHERE `id`=745801;
61+
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `priority`, `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
62+
(745801, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Ice Thistle Yeti - Flee');
63+
UPDATE `creature_template` SET `ai_name`='EventAI' WHERE `entry`=7458;
64+
65+
66+
-- End of migration.
67+
END IF;
68+
END??
69+
DELIMITER ;
70+
CALL add_migration();
71+
DROP PROCEDURE IF EXISTS add_migration;

0 commit comments

Comments
 (0)