Skip to content

Commit aedb477

Browse files
Merge AzerothCore 3.3.5 to ElunaAzerothcore [skip ci]
2 parents 7a4eaac + 0f2841d commit aedb477

13 files changed

Lines changed: 230 additions & 130 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
-- DB update 2026_04_22_03 -> 2026_04_23_00
2+
--
3+
-- Fix quest "The Deadliest Trap Ever Laid" (11097 Scryer / 11101 Aldor):
4+
-- the AC-specific SCRIPTED_SPAWN (state=0 on AI_INIT -> despawn self)
5+
-- pattern loops forever under the ported dynamic spawn system because
6+
-- each respawn creates a new creature whose AI_INIT fires the despawn
7+
-- again. Migrate to MANUAL_SPAWN spawn groups and SPAWN_SPAWNGROUP /
8+
-- DESPAWN_SPAWNGROUP, which is what the spawn system port was built for.
9+
--
10+
11+
-- Four manual-spawn groups: two per quest (defenders, skybreakers)
12+
DELETE FROM `spawn_group_template` WHERE `groupId` IN (100, 101, 102, 103);
13+
INSERT INTO `spawn_group_template` (`groupId`, `groupName`, `groupFlags`) VALUES
14+
(100, 'Sanctum of the Stars - Defenders', 0x04),
15+
(101, 'Sanctum of the Stars - Skybreakers', 0x04),
16+
(102, 'Altar of Sha''tar - Defenders', 0x04),
17+
(103, 'Altar of Sha''tar - Skybreakers', 0x04);
18+
19+
-- Assign existing creature spawns to their groups
20+
DELETE FROM `spawn_group` WHERE `groupId` = 100;
21+
INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) SELECT 100, 0, `guid` FROM `creature` WHERE `id1` = 23435;
22+
DELETE FROM `spawn_group` WHERE `groupId` = 101;
23+
INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) SELECT 101, 0, `guid` FROM `creature` WHERE `id1` = 23440;
24+
DELETE FROM `spawn_group` WHERE `groupId` = 102;
25+
INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) SELECT 102, 0, `guid` FROM `creature` WHERE `id1` = 23453;
26+
DELETE FROM `spawn_group` WHERE `groupId` = 103;
27+
INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) SELECT 103, 0, `guid` FROM `creature` WHERE `id1` = 23441;
28+
29+
-- Skybreakers respawn mid-event (wave mechanic)
30+
UPDATE `creature` SET `spawntimesecs` = 5 WHERE `id1` IN (23440, 23441);
31+
32+
-- Drop the creatures' AI_INIT self-despawn events (dormancy now handled by MANUAL_SPAWN)
33+
DELETE FROM `smart_scripts` WHERE `source_type` = 0 AND `event_type` = 37 AND `action_type` = 226 AND `entryorguid` IN (23435, 23440, 23441, 23453);
34+
35+
-- Commander Hobb: On Just Died cleanup -> DESPAWN_SPAWNGROUP
36+
UPDATE `smart_scripts` SET `action_type` = 132, `action_param1` = 100, `action_param2` = 0, `action_param3` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Hobb - On Just Died - Despawn Defenders Group' WHERE `entryorguid` = 23434 AND `source_type` = 0 AND `id` = 7;
37+
UPDATE `smart_scripts` SET `action_type` = 132, `action_param1` = 101, `action_param2` = 0, `action_param3` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Hobb - On Just Died - Despawn Skybreakers Group' WHERE `entryorguid` = 23434 AND `source_type` = 0 AND `id` = 8;
38+
39+
-- Commander Arcus (Aldor): same cleanup
40+
UPDATE `smart_scripts` SET `action_type` = 132, `action_param1` = 102, `action_param2` = 0, `action_param3` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Arcus - On Just Died - Despawn Defenders Group' WHERE `entryorguid` = 23452 AND `source_type` = 0 AND `id` = 7;
41+
UPDATE `smart_scripts` SET `action_type` = 132, `action_param1` = 103, `action_param2` = 0, `action_param3` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Arcus - On Just Died - Despawn Skybreakers Group' WHERE `entryorguid` = 23452 AND `source_type` = 0 AND `id` = 8;
42+
43+
-- Hobb start actionlist: SPAWN_SPAWNGROUP
44+
UPDATE `smart_scripts` SET `action_type` = 131, `action_param1` = 100, `action_param2` = 0, `action_param3` = 0, `action_param4` = 0, `action_param5` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Hobb - Actionlist - Spawn Sanctum Defenders Group' WHERE `entryorguid` = 2343400 AND `source_type` = 9 AND `id` = 3;
45+
UPDATE `smart_scripts` SET `action_type` = 131, `action_param1` = 101, `action_param2` = 0, `action_param3` = 0, `action_param4` = 0, `action_param5` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Hobb - Actionlist - Spawn Dragonmaw Skybreakers Group' WHERE `entryorguid` = 2343400 AND `source_type` = 9 AND `id` = 10;
46+
47+
-- Hobb complete actionlist: DESPAWN_SPAWNGROUP
48+
UPDATE `smart_scripts` SET `action_type` = 132, `action_param1` = 100, `action_param2` = 0, `action_param3` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Hobb - Actionlist - Despawn Defenders Group' WHERE `entryorguid` = 2343402 AND `source_type` = 9 AND `id` = 0;
49+
UPDATE `smart_scripts` SET `action_type` = 132, `action_param1` = 101, `action_param2` = 0, `action_param3` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Hobb - Actionlist - Despawn Skybreakers Group' WHERE `entryorguid` = 2343402 AND `source_type` = 9 AND `id` = 1;
50+
51+
-- Arcus start actionlist
52+
UPDATE `smart_scripts` SET `action_type` = 131, `action_param1` = 102, `action_param2` = 0, `action_param3` = 0, `action_param4` = 0, `action_param5` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Arcus - Actionlist - Spawn Altar Defenders Group' WHERE `entryorguid` = 2345200 AND `source_type` = 9 AND `id` = 5;
53+
UPDATE `smart_scripts` SET `action_type` = 131, `action_param1` = 103, `action_param2` = 0, `action_param3` = 0, `action_param4` = 0, `action_param5` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Arcus - Actionlist - Spawn Dragonmaw Skybreakers Group' WHERE `entryorguid` = 2345200 AND `source_type` = 9 AND `id` = 9;
54+
55+
-- Arcus complete actionlist
56+
UPDATE `smart_scripts` SET `action_type` = 132, `action_param1` = 102, `action_param2` = 0, `action_param3` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Arcus - Actionlist - Despawn Defenders Group' WHERE `entryorguid` = 2345202 AND `source_type` = 9 AND `id` = 0;
57+
UPDATE `smart_scripts` SET `action_type` = 132, `action_param1` = 103, `action_param2` = 0, `action_param3` = 0, `target_type` = 1, `target_param1` = 0, `target_param3` = 0, `comment` = 'Commander Arcus - Actionlist - Despawn Skybreakers Group' WHERE `entryorguid` = 2345202 AND `source_type` = 9 AND `id` = 1;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-- DB update 2026_04_23_00 -> 2026_04_23_01
2+
3+
-- Update targets
4+
UPDATE `smart_scripts` SET `target_param1` = 65915, `target_param2` = 191577 WHERE (`entryorguid` IN (-128571)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
5+
UPDATE `smart_scripts` SET `target_param1` = 65916, `target_param2` = 191580 WHERE (`entryorguid` IN (-128567)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
6+
UPDATE `smart_scripts` SET `target_param1` = 65920, `target_param2` = 191581 WHERE (`entryorguid` IN (-128570)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
7+
UPDATE `smart_scripts` SET `target_param1` = 65921, `target_param2` = 191582 WHERE (`entryorguid` IN (-128576)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
8+
UPDATE `smart_scripts` SET `target_param1` = 65923, `target_param2` = 191583 WHERE (`entryorguid` IN (-128565)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
9+
UPDATE `smart_scripts` SET `target_param1` = 65925, `target_param2` = 191584 WHERE (`entryorguid` IN (-128574)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
10+
UPDATE `smart_scripts` SET `target_param1` = 65926, `target_param2` = 191585 WHERE (`entryorguid` IN (-128573)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
11+
UPDATE `smart_scripts` SET `target_param1` = 65927, `target_param2` = 191586 WHERE (`entryorguid` IN (-128568)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
12+
UPDATE `smart_scripts` SET `target_param1` = 65928, `target_param2` = 191587 WHERE (`entryorguid` IN (-128566)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
13+
UPDATE `smart_scripts` SET `target_param1` = 65929, `target_param2` = 191588 WHERE (`entryorguid` IN (-128572)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
14+
UPDATE `smart_scripts` SET `target_param1` = 65930, `target_param2` = 191589 WHERE (`entryorguid` IN (-128575)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
15+
UPDATE `smart_scripts` SET `target_param1` = 65931, `target_param2` = 191590 WHERE (`entryorguid` IN (-128569)) AND (`source_type` = 0) AND (`id` IN (1, 2, 3));
16+
17+
-- Delete creature_addon table from an Unworthy Initiate.
18+
DELETE FROM `creature_addon` WHERE (`guid` IN (128740));
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
-- DB update 2026_04_23_01 -> 2026_04_23_02
2+
3+
-- Remove Mount from Creature Addon (it is setted using SAI).
4+
UPDATE `creature_addon` SET `mount` = 0 WHERE (`guid` IN (86873));
5+
6+
-- Set General SAI.
7+
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 20159;
8+
9+
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 20159);
10+
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
11+
(20159, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Respawn - Remove Npc Flags Questgiver'),
12+
(20159, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 18, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Respawn - Set Flags Immune To Players'),
13+
(20159, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 43, 0, 18696, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Respawn - Mount To Model 18696'),
14+
(20159, 0, 3, 4, 62, 0, 100, 0, 8081, 0, 0, 0, 0, 0, 64, 23, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Gossip Option 0 Selected - Store Targetlist'),
15+
(20159, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Gossip Option 0 Selected - Remove Npc Flags Gossip'),
16+
(20159, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Gossip Option 0 Selected - Set Event Phase 1'),
17+
(20159, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2015900, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Gossip Option 0 Selected - Run Script'),
18+
(20159, 0, 7, 8, 2, 1, 100, 0, 0, 20, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Between 0-20% Health - Set Event Phase 2 (Phase 1)'),
19+
(20159, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2015901, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Between 0-20% Health - Run Script (Phase 1)'),
20+
(20159, 0, 9, 10, 7, 1, 100, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Evade - Set Event Phase 0 (Phase 1)'),
21+
(20159, 0, 10, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2015902, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Evade - Run Script (Phase 1)'),
22+
(20159, 0, 11, 0, 0, 0, 100, 0, 0, 0, 5000, 8000, 0, 0, 11, 20823, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - In Combat - Cast \'Fireball\''),
23+
(20159, 0, 12, 0, 106, 0, 100, 0, 5000, 10000, 12000, 18000, 0, 10, 11, 11831, 64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - On Hostile in Range - Cast \'Frost Nova\'');
24+
25+
-- Set Action Lists.
26+
DELETE FROM `smart_scripts` WHERE (`source_type` = 9) AND (`entryorguid` IN (2015900, 2015901, 2015902));
27+
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
28+
(2015900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 42, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Set Invincibility Hp 1%'),
29+
(2015900, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 206, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Dismount'),
30+
(2015900, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Say Line 0'),
31+
(2015900, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 19, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Remove Flags Immune To Players'),
32+
(2015900, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 2, 14, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Set Faction 14'),
33+
(2015900, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 12, 23, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Start Attacking'),
34+
(2015901, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Stop Attack'),
35+
(2015901, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 18, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Set Flags Immune To Players'),
36+
(2015901, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 2, 1604, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Set Faction 1604'),
37+
(2015901, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 82, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Add Npc Flags Questgiver'),
38+
(2015901, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Say Line 1'),
39+
(2015901, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 60000, 30, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Despawn In 60000 ms'),
40+
(2015902, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 82, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Add Npc Flags Gossip'),
41+
(2015902, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 18, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Set Flags Immune To Players'),
42+
(2015902, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Reset Invincibility Hp'),
43+
(2015902, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 2, 1604, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Set Faction 1604'),
44+
(2015902, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 43, 0, 18696, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Magister Aledis - Actionlist - Mount To Model 18696');

src/server/game/AI/CreatureAI.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ bool CreatureAI::UpdateVictim()
358358
return false;
359359
}
360360

361+
// Charmed creatures: the charmer controls target selection, don't interfere
362+
if (me->IsCharmed())
363+
return me->GetVictim() != nullptr;
364+
361365
if (!me->HasReactState(REACT_PASSIVE))
362366
{
363367
if (Unit* victim = me->SelectVictim())

src/server/game/AI/SmartScripts/SmartScriptMgr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,6 +2054,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
20542054
case SMART_ACTION_WORLD_SCRIPT:
20552055
case SMART_ACTION_SET_GOSSIP_MENU:
20562056
case SMART_ACTION_SUMMON_GAMEOBJECT_GROUP:
2057+
case SMART_ACTION_SPAWN_SPAWNGROUP:
2058+
case SMART_ACTION_DESPAWN_SPAWNGROUP:
20572059
break;
20582060
default:
20592061
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type({}), event_type({}), Entry {} SourceType {} Event {}, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);

0 commit comments

Comments
 (0)