From 96f90381e3ed696861354ea4ddf4ac0c495031c5 Mon Sep 17 00:00:00 2001 From: treeston Date: Fri, 5 Aug 2016 11:04:26 +0200 Subject: Scripts/SmartScripts: Fix charmed behavior for SmartAI. For real this time. - Core AI logic will no longer issue attack/movement commands while under player control. - Add new SMART_EVENT_FLAG_WHILE_CHARMED (0x200). Any event without this flag won't run while charmed. - Add SMART_EVENT_FLAG_WHILE_CHARMED to existing actions, except a select subset (movement, talking, and nontriggered casts, pretty much). --- .../world/3.3.5/9999_99_99_99_SMART_CHARMAI.sql | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sql/updates/world/3.3.5/9999_99_99_99_SMART_CHARMAI.sql (limited to 'sql') diff --git a/sql/updates/world/3.3.5/9999_99_99_99_SMART_CHARMAI.sql b/sql/updates/world/3.3.5/9999_99_99_99_SMART_CHARMAI.sql new file mode 100644 index 00000000000..435919c5071 --- /dev/null +++ b/sql/updates/world/3.3.5/9999_99_99_99_SMART_CHARMAI.sql @@ -0,0 +1,27 @@ +-- set "execute event while charmed" flag on all events except: +-- -) movement actions +-- -) nontriggered cast actions +-- -) talk/emote/sound actions +-- -) ally summon actions +ALTER TABLE `smart_scripts` MODIFY COLUMN `event_flags` SMALLINT(3) UNSIGNED NOT NULL DEFAULT '0'; +UPDATE `smart_scripts` SET `event_flags`=(`event_flags`|0x200) WHERE `source_type`=0 AND + (`action_type` not in (1,4,5,10,11,12,17,25,27,38,39,40,49,62,69,84,85,86,89,92,97,103,107,114) OR + (`action_type` in (11,86) AND (`action_param2`&2)=2)); + + +-- assorted quest fixes (no claim to completeness) +-- Seeds of Chaos (13172) +UPDATE `smart_scripts` SET `event_flags`=(`event_flags`|0x200) WHERE `source_type`=0 AND `entryorguid`=31157; +UPDATE `smart_scripts` SET `event_type`=29, `comment`="Skeletal Assault Gryphon - On Charmed - Start Waypoint" WHERE `source_type`=0 AND `entryorguid`=31157 AND `id`=0; +-- Generosity Abounds (13146) +UPDATE `smart_scripts` SET `event_flags`=(`event_flags`|0x200) WHERE `source_type`=0 AND `entryorguid`=30894; +-- Battling the Elements (12967) +UPDATE `smart_scripts` SET `event_flags`=(`event_flags`|0x200) WHERE `source_type`=0 AND `entryorguid`=30124; +-- Krolmir, Hammer of Storms (13010) +UPDATE `smart_scripts` SET `event_flags`=(`event_flags`|0x200) WHERE `source_type`=0 AND `entryorguid`=30331; +UPDATE `smart_scripts` SET `event_type`=29 WHERE `source_type`=0 AND `entryorguid`=30331 AND `id`=0; +UPDATE `smart_scripts` SET `target_type`=23 WHERE `source_type`=0 AND `entryorguid`=30331 AND `id`=1; +UPDATE `smart_scripts` SET `event_flags`=(`event_flags`|0x200) WHERE `source_type`=9 AND `entryorguid`=3033100; +-- Spy Hunter (12994) +UPDATE `smart_scripts` SET `event_flags`=(`event_flags`|0x200) WHERE `source_type`=0 AND `entryorguid`=30219; +UPDATE `smart_scripts` SET `event_flags`=(`event_flags`|0x200) WHERE `source_type`=9 AND `entryorguid` IN (3021900,3021901,3021902); -- cgit v1.2.3