This is still WIP since I wanna add things from https://wow.gamepedia.com/The_Attack!#Notes, almost everything is not implemented.
I'm still searching for a video of this quest, except https://www.youtube.com/watch?v=Io8EsfNb3Mw
Idk if we need this
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp#L107-L114
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp#L243-L255
They're both too close to each other, so cannot be pulled separately
-- Tyrion SAI (Source: CPP & https://www.youtube.com/watch?v=Io8EsfNb3Mw)
SET @ID := 7766;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID*100+0 AND `source_type` = 9;
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`,`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
-- Do not send or store target if Spybot didn't yet left the atrium
-- Other safety checks are done by the conditions below
(@ID,0,0,0,11,0,100,0,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Respawn - Set Event Phase 1"),
(@ID,0,1,0,19,1,100,0,434,0,0,0,0,80,@ID*100+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Quest 'The Attack!' Taken - Run Script (Phase 1)"),
(@ID*100+0,9,0,0,0,0,100,0,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Tyrion - On Script - Store Targetlist"),
(@ID*100+0,9,1,0,0,0,100,0,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Script - Set Event Phase 0"),
(@ID*100+0,9,2,0,0,0,100,0,0,0,0,0,0,66,0,0,0,0,0,0,19,8856,10,0,0,0,0,0,0,"Tyrion - On Script - Set Orientation Closest Creature (Tyrion's Spybot)"),
(@ID*100+0,9,3,0,0,0,100,0,1000,1000,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Script - Set Emote State 69"),
(@ID*100+0,9,4,0,0,0,100,0,3000,3000,0,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Script - Set Emote State 0"),
(@ID*100+0,9,5,0,0,0,100,0,2000,2000,0,0,0,1,0,0,0,0,0,0,19,8856,10,0,0,0,0,0,0,"Tyrion - On Script - Say Line 0 (Tyrion's Spybot)"),
(@ID*100+0,9,6,0,0,0,100,0,0,0,0,0,0,86,11048,0,19,8856,10,0,19,8856,10,0,0,0,0,0,0,"Tyrion - On Script - Cross Cast 'Perm. Illusion Bishop Tyriona' (Tyrion's Spybot)"),
(@ID*100+0,9,7,0,0,0,100,0,3500,3500,0,0,0,1,0,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Tyrion - On Script - Say Line 0"),
(@ID*100+0,9,8,0,0,0,100,0,0,0,0,0,0,66,0,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Tyrion - On Script - Set Orientation Stored Target"),
(@ID*100+0,9,9,0,0,0,100,0,2000,2000,0,0,0,36,7779,0,0,0,0,0,19,8856,10,0,0,0,0,0,0,"Tyrion - On Script - Update Template To 'Priestess Tyriona' (Tyrion's Spybot)"),
(@ID*100+0,9,10,0,0,0,100,0,3000,3000,0,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Script - Set Orientation Home Position"),
(@ID*100+0,9,11,0,0,0,100,0,2000,2000,0,0,0,100,1,0,0,0,0,0,19,7779,10,0,0,0,0,0,0,"Tyrion - On Script - Send Target 1 (Priestess Tyriona)"),
(@ID*100+0,9,12,0,0,0,100,0,0,0,0,0,0,45,0,1,0,0,0,0,19,7779,10,0,0,0,0,0,0,"Tyrion - On Script - Set Data 0 1 (Priestess Tyriona)"),
(@ID*100+0,9,13,0,0,0,100,0,9000,9000,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Script - Set Event Phase 1");
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 7766 AND `SourceId` = 0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(22,2,7766,0,0,29,0,8856,10,0,0,0,0,"","Group 0: Execute SAI (Action 1) if creature 'Tyrion's Spybot' is near"),
(22,2,7766,0,0,29,0,1754,100,0,0,0,0,"","Group 0: Execute SAI (Action 1) if creature 'Lord Gregor Lescovar' is near");
-- Tyrion's Spybot SAI
SET @ID := 8856;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN @ID*100+0 AND @ID*100+2 AND `source_type` = 9;
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`,`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
(@ID,0,0,0,38,0,100,0,0,1,0,0,0,53,0,8856,0,0,0,1,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Data Set 0 1 - Start Waypoint"),
(@ID,0,1,0,40,0,100,0,5,0,0,0,0,80,@ID*100+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Waypoint 5 Reached - Run Script"),
(@ID,0,2,0,40,0,100,0,17,0,0,0,0,80,@ID*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Waypoint 17 Reached - Run Script"),
(@ID,0,3,0,40,0,100,0,32,0,0,0,0,80,@ID*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Waypoint 32 Reached - Run Script"),
(@ID,0,4,0,40,0,100,0,37,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Waypoint 37 Reached - Despawn (0)"),
(@ID*100+0,9,0,0,0,0,100,0,0,0,0,0,0,54,11000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Pause Waypoint"),
(@ID*100+0,9,1,0,0,0,100,0,1000,1000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 1"),
(@ID*100+0,9,2,0,0,0,100,0,0,0,0,0,0,45,0,1,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Tyrion - On Script - Set Data 0 1 (Stormwind Royal Guard)"),
(@ID*100+0,9,3,0,0,0,100,0,2000,2000,0,0,0,90,8,0,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Flag Standstate Kneel (Stormwind Royal Guard)"),
(@ID*100+0,9,4,0,0,0,100,0,3000,3000,0,0,0,91,8,0,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Remove Standstate Kneel (Stormwind Royal Guard)"),
(@ID*100+0,9,5,0,0,0,100,0,0,0,0,0,0,1,1,0,0,0,0,0,10,10524,1756,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 1 (Stormwind Royal Guard)"),
(@ID*100+0,9,6,0,0,0,100,0,4000,4000,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 2"),
(@ID*100+0,9,7,0,0,0,100,0,0,0,0,0,0,45,0,2,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Data 0 2 (Stormwind Royal Guard)"),
(@ID*100+1,9,0,0,0,0,100,0,0,0,0,0,0,54,14000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Pause Waypoint"),
(@ID*100+1,9,1,0,0,0,100,0,1000,1000,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 3"),
(@ID*100+1,9,2,0,0,0,100,0,0,0,0,0,0,100,1,0,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Send Target 1 (Lord Gregor Lescovar)"),
(@ID*100+1,9,3,0,0,0,100,0,0,0,0,0,0,45,0,1,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Data 0 1 (Lord Gregor Lescovar)"),
(@ID*100+1,9,4,0,0,0,100,0,3000,3000,0,0,0,1,3,0,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 3 (Lord Gregor Lescovar)"),
(@ID*100+1,9,5,0,0,0,100,0,6000,6000,0,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 4"),
(@ID*100+1,9,6,0,0,0,100,0,1000,1000,0,0,0,45,0,2,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Data 0 2 (Lord Gregor Lescovar)"),
(@ID*100+2,9,0,0,0,0,100,0,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Pause Waypoint"),
(@ID*100+2,9,1,0,0,0,100,0,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Run On"),
(@ID*100+2,9,2,0,0,0,100,0,2000,2000,0,0,0,11,11067,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Cast 'Perm. Illusion Tyrion'"),
(@ID*100+2,9,3,0,0,0,100,0,3500,3500,0,0,0,36,8856,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Update Template To 'Tyrion's Spybot'"),
(@ID*100+2,9,4,0,0,0,100,0,0,0,0,0,0,11,11013,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Cast 'Sneak'");
-- Stormwind Royal Guard
DELETE FROM `smart_scripts` WHERE `entryorguid` = 1756 AND `source_type` = 0 AND `id` IN (12,13);
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`,`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
(1756,0,12,0,38,0,100,0,0,1,0,0,0,66,0,0,0,0,0,0,19,7779,0,0,0,0,0,0,0,"Stormwind Royal Guard - On Data Set 0 1 - Set Orientation Closest Creature 'Priestess Tyriona'"),
(1756,0,13,0,38,0,100,0,0,2,0,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Stormwind Royal Guard - On Data Set 0 2 - Set Orientation Home Position");
-- Lord Gregor Lescovar SAI
SET @ID := 1754;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN @ID*100+0 AND @ID*100+2 AND `source_type` = 9;
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`,`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
(@ID,0,0,0,38,0,100,0,0,1,0,0,0,66,0,0,0,0,0,0,19,7779,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Data Set 0 1 - Set Orientation Closest Creature 'Priestess Tyriona'"),
(@ID,0,1,0,38,0,100,0,0,2,0,0,0,53,0,1754,0,0,0,2,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Data Set 0 2 - Start Waypoint"),
(@ID,0,2,0,40,0,100,0,11,0,0,0,0,80,@ID*100+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Waypoint 11 Reached - Run Script"),
(@ID,0,3,0,40,0,100,0,13,0,0,0,0,80,@ID*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Waypoint 13 Reached - Run Script"),
(@ID,0,4,0,38,0,100,0,0,3,0,0,0,80,@ID*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Data Set 0 3 - Run Script"),
(@ID,0,5,0,7,0,100,0,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Evade - Despawn (0)"),
-- No info about this part, simply converted
(@ID*100+0,9,0,0,0,0,100,0,0,0,0,0,0,54,8000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Pause Waypoint"),
(@ID*100+0,9,1,0,0,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 0"),
(@ID*100+0,9,2,0,0,0,100,0,3000,3000,0,0,0,1,0,0,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 0 (Stormwind Royal Guard)"),
(@ID*100+0,9,3,0,0,0,100,0,3000,3000,0,0,0,41,0,0,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Despawn (0) (Stormwind Royal Guard)"),
(@ID*100+1,9,0,0,0,0,100,0,0,0,0,0,0,54,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Pause Waypoint"),
(@ID*100+1,9,1,0,0,0,100,0,0,0,0,0,0,12,1755,2,60000,0,0,0,8,0,0,0,0,-8411.360352,480.069733,123.760895,4.941504,"Lord Gregor Lescovar - On Script - Summon Creature 'Marzon the Silent Blade'"),
(@ID*100+1,9,2,0,0,0,100,0,2000,2000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 1"),
(@ID*100+2,9,0,0,0,0,100,0,2000,2000,0,0,0,1,0,0,0,0,0,0,19,1755,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 0 (Marzon the Silent Blade)"),
(@ID*100+2,9,1,0,0,0,100,0,3000,3000,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 2"),
(@ID*100+2,9,2,0,0,0,100,0,0,0,0,0,0,15,434,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Quest Credit 'The Attack!'"),
(@ID*100+2,9,3,0,0,0,100,0,2000,2000,0,0,0,1,1,0,0,0,0,0,19,7766,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 1 (Tyrion)"),
(@ID*100+2,9,4,0,0,0,100,0,0,0,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Set Faction 2"),
(@ID*100+2,9,5,0,0,0,100,0,0,0,0,0,0,2,14,0,0,0,0,0,19,1755,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Set Faction 2 (Marzon the Silent Blade)");
-- Marzon the Silent Blade SAI
SET @ID := 1755;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
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`,`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
(@ID,0,0,1,54,0,100,0,0,0,0,0,0,69,1,0,0,0,0,0,8,0,0,0,0,-8408.000977,468.611450,123.759903,0,"Marzon the Silent Blade - On Just Summoned - Move To Position"),
(@ID,0,1,0,61,0,100,0,0,0,0,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Marzon the Silent Blade - On Link - Set Run Off"),
(@ID,0,2,0,34,0,100,0,8,1,0,0,0,45,0,3,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Marzon the Silent Blade - On Reached Point 1 - Set Data 0 3 (Lord Gregor Lescovar)"),
(@ID,0,3,0,4,0,100,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Marzon the Silent Blade - On Aggro - Say Line 1"),
(@ID,0,4,0,7,0,100,0,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Marzon the Silent Blade - On Evade - Despawn (0)");
DELETE FROM `script_waypoint` WHERE `entry` IN (8856,1754);
DELETE FROM `waypoints` WHERE `entry` IN (8856,1754);
INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
(8856,1,-8409.34,453.345,123.761,"Tyrion's Spybot"),
(8856,2,-8409.52,462.677,123.761,"Tyrion's Spybot"),
(8856,3,-8402.42,461.646,123.761,"Tyrion's Spybot"),
(8856,4,-8397.52,457.326,123.761,"Tyrion's Spybot"),
(8856,5,-8392.84,452.397,123.761,"Tyrion's Spybot"),
(8856,6,-8390.25,449.247,124.275,"Tyrion's Spybot"),
(8856,7,-8388.5,447.314,123.275,"Tyrion's Spybot"),
(8856,8,-8386.37,444.906,122.275,"Tyrion's Spybot"),
(8856,9,-8380.45,437.115,122.275,"Tyrion's Spybot"),
(8856,10,-8370.42,424.6,122.275,"Tyrion's Spybot"),
(8856,11,-8362.84,415.409,122.275,"Tyrion's Spybot"),
(8856,12,-8359.94,410.92,122.275,"Tyrion's Spybot"),
(8856,13,-8361.75,402.852,122.275,"Tyrion's Spybot"),
(8856,14,-8364.29,395.317,122.275,"Tyrion's Spybot"),
(8856,15,-8356.65,385.247,122.275,"Tyrion's Spybot"),
(8856,16,-8352.99,379.932,122.275,"Tyrion's Spybot"),
(8856,17,-8335.58,393.519,122.275,"Tyrion's Spybot"),
(8856,18,-8335.58,393.519,122.275,"Tyrion's Spybot"),
(8856,19,-8352.99,379.932,122.275,"Tyrion's Spybot"),
(8856,20,-8356.65,385.247,122.275,"Tyrion's Spybot"),
(8856,21,-8364.29,395.317,122.275,"Tyrion's Spybot"),
(8856,22,-8361.75,402.852,122.275,"Tyrion's Spybot"),
(8856,23,-8359.94,410.92,122.275,"Tyrion's Spybot"),
(8856,24,-8362.84,415.409,122.275,"Tyrion's Spybot"),
(8856,25,-8370.42,424.6,122.275,"Tyrion's Spybot"),
(8856,26,-8380.45,437.115,122.275,"Tyrion's Spybot"),
(8856,27,-8384.98,443.240,122.275,"Tyrion's Spybot"),
(8856,28,-8406.01,426.637,122.275,"Tyrion's Spybot"),
(8856,29,-8406.01,426.637,122.275,"Tyrion's Spybot"),
(8856,30,-8410.90,427.383,122.275,"Tyrion's Spybot"),
(8856,31,-8410.90,427.383,122.275,"Tyrion's Spybot"),
(8856,32,-8424.74,444.123,122.275,"Tyrion's Spybot"),
(8856,33,-8428.06,447.918,122.275,"Tyrion's Spybot"),
(8856,34,-8434.28,442.995,122.274,"Tyrion's Spybot"),
(8856,35,-8446.08,433.609,118.920,"Tyrion's Spybot"),
(8856,36,-8460.70,421.968,114.760,"Tyrion's Spybot"),
(8856,37,-8483.02,404.150,108.401,"Tyrion's Spybot"),
(1754,1,-8336.32,397.468,122.275,"Lord Gregor Lescovar"),
(1754,2,-8338.63,404.048,122.275,"Lord Gregor Lescovar"),
(1754,3,-8345.59,412.439,122.275,"Lord Gregor Lescovar"),
(1754,4,-8359.94,410.92,122.275,"Lord Gregor Lescovar"),
(1754,5,-8362.84,415.409,122.275,"Lord Gregor Lescovar"),
(1754,6,-8370.42,424.6,122.275,"Lord Gregor Lescovar"),
(1754,7,-8380.45,437.115,122.275,"Lord Gregor Lescovar"),
(1754,8,-8386.37,444.906,122.275,"Lord Gregor Lescovar"),
(1754,9,-8388.5,447.314,123.275,"Lord Gregor Lescovar"),
(1754,10,-8390.25,449.247,124.275,"Lord Gregor Lescovar"),
(1754,11,-8392.84,452.397,123.761,"Lord Gregor Lescovar"),
(1754,12,-8397.52,457.326,123.761,"Lord Gregor Lescovar"),
(1754,13,-8402.42,461.646,123.761,"Lord Gregor Lescovar");
Branch: 3.3.5
TC rev. hash/commit: 12679fdd080e
Operating system: Windows 8.1
Idk if we need this
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp#L107-L114
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp#L243-L255
They're both too close to each other, so cannot be pulled separately
They're now neutral and can be pulled separately. https://github.com/TrinityCore/TrinityCore/issues/24257 must be fixed. Or better have both https://github.com/TrinityCore/TrinityCore/issues/24257 and https://github.com/cmangos/issues/wiki/creature_linking_template since this template is used all around the world, by summoned and static creatures outdoor or not.
I can make them both aggro if needed.
This is still WIP since I wanna add things from https://wow.gamepedia.com/The_Attack!#Notes, almost everything is not implemented.
Updated with some visuals, safety checks and notes from Wiki.
You will be not able to restart the event if Lescovar due to some reason will be not able to return to his spawn position(stuck between the home position and the event position). But I simply can't reproduce it. Maybe I miss something?
I once left him (left grid) and after returning he was able to continue the event.
And once I left him for 10 minutes so the grid was reloaded.
We can force him to return to his spawn position on event start.
-- Tyrion SAI (Source: CPP & https://www.youtube.com/watch?v=Io8EsfNb3Mw)
SET @ID := 7766;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID*100+0 AND `source_type` = 9;
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`,`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
(@ID,0,0,0,19,0,100,0,434,0,0,0,0,80,@ID*100+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Quest 'The Attack!' Taken - Run Script"),
-- Restore questgiver flag every 10 minutes
-- This is not good because he can restore flag during the event
-- But can help if something went wrong
-- He will NOT start event again if event is not completed
-- Heh https://classic.wowhead.com/npc=7766/tyrion#comments:id=3152769:reply=1326569
(@ID,0,1,0,1,0,100,0,600000,600000,600000,600000,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - Out Of Combat - Add Npc Flag Questgiver"),
(@ID*100+0,9,0,0,0,0,100,0,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Tyrion - On Script - Store Targetlist"),
-- Flag will be restored in Tyrion's script (above)
-- Or if Lescovar was not killed
(@ID*100+0,9,1,0,0,0,100,0,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Script - Remove Npc Flag Questgiver"),
(@ID*100+0,9,2,0,0,0,100,0,0,0,0,0,0,66,0,0,0,0,0,0,19,8856,10,0,0,0,0,0,0,"Tyrion - On Script - Set Orientation Closest Creature (Tyrion's Spybot)"),
(@ID*100+0,9,3,0,0,0,100,0,1000,1000,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Script - Set Emote State 69"),
(@ID*100+0,9,4,0,0,0,100,0,3000,3000,0,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Script - Set Emote State 0"),
(@ID*100+0,9,5,0,0,0,100,0,2000,2000,0,0,0,1,0,0,0,0,0,0,19,8856,10,0,0,0,0,0,0,"Tyrion - On Script - Say Line 0 (Tyrion's Spybot)"),
(@ID*100+0,9,6,0,0,0,100,0,0,0,0,0,0,86,11048,0,19,8856,10,0,19,8856,10,0,0,0,0,0,0,"Tyrion - On Script - Cross Cast 'Perm. Illusion Bishop Tyriona' (Tyrion's Spybot)"),
(@ID*100+0,9,7,0,0,0,100,0,3500,3500,0,0,0,1,0,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Tyrion - On Script - Say Line 0"),
(@ID*100+0,9,8,0,0,0,100,0,0,0,0,0,0,66,0,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Tyrion - On Script - Set Orientation Stored Target"),
(@ID*100+0,9,9,0,0,0,100,0,2000,2000,0,0,0,36,7779,0,0,0,0,0,19,8856,10,0,0,0,0,0,0,"Tyrion - On Script - Update Template To 'Priestess Tyriona' (Tyrion's Spybot)"),
(@ID*100+0,9,10,0,0,0,100,0,3000,3000,0,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion - On Script - Set Orientation Home Position"),
(@ID*100+0,9,11,0,0,0,100,0,2000,2000,0,0,0,100,1,0,0,0,0,0,19,7779,10,0,0,0,0,0,0,"Tyrion - On Script - Send Target 1 (Priestess Tyriona)"),
(@ID*100+0,9,12,0,0,0,100,0,0,0,0,0,0,45,0,1,0,0,0,0,19,7779,10,0,0,0,0,0,0,"Tyrion - On Script - Set Data 0 1 (Priestess Tyriona)");
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 7766 AND `SourceId` = 0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
-- Execute only if both are in their spawn positions
(22,2,7766,0,0,29,0,8856,10,0,0,0,0,"","Group 0: Execute SAI (Action 1) if creature 'Tyrion's Spybot' is near (in spawn position)"),
(22,2,7766,0,0,29,0,1754,100,0,0,0,0,"","Group 0: Execute SAI (Action 1) if creature 'Lord Gregor Lescovar' is near (in spawn position)"),
-- And if Lescovar is NOT nearby
(22,2,7766,0,0,29,0,1754,90,0,1,0,0,"","Group 0: Execute SAI (Action 1) if creature 'Lord Gregor Lescovar' is not near (not in spawn position)");
-- Tyrion's Spybot SAI
SET @ID := 8856;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN @ID*100+0 AND @ID*100+2 AND `source_type` = 9;
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`,`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
(@ID,0,0,0,38,0,100,0,0,1,0,0,0,53,0,8856,0,0,0,1,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Data Set 0 1 - Start Waypoint"),
(@ID,0,1,0,40,0,100,0,5,0,0,0,0,80,@ID*100+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Waypoint 5 Reached - Run Script"),
(@ID,0,2,0,40,0,100,0,17,0,0,0,0,80,@ID*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Waypoint 17 Reached - Run Script"),
(@ID,0,3,0,40,0,100,0,32,0,0,0,0,80,@ID*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Waypoint 32 Reached - Run Script"),
(@ID,0,4,0,40,0,100,0,37,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Waypoint 37 Reached - Despawn (0)"),
(@ID*100+0,9,0,0,0,0,100,0,0,0,0,0,0,54,11000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Pause Waypoint"),
(@ID*100+0,9,1,0,0,0,100,0,1000,1000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 1"),
(@ID*100+0,9,2,0,0,0,100,0,0,0,0,0,0,45,0,1,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Tyrion - On Script - Set Data 0 1 (Stormwind Royal Guard)"),
(@ID*100+0,9,3,0,0,0,100,0,2000,2000,0,0,0,90,8,0,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Flag Standstate Kneel (Stormwind Royal Guard)"),
(@ID*100+0,9,4,0,0,0,100,0,3000,3000,0,0,0,91,8,0,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Remove Standstate Kneel (Stormwind Royal Guard)"),
(@ID*100+0,9,5,0,0,0,100,0,0,0,0,0,0,1,1,0,0,0,0,0,10,10524,1756,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 1 (Stormwind Royal Guard)"),
(@ID*100+0,9,6,0,0,0,100,0,4000,4000,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 2"),
(@ID*100+0,9,7,0,0,0,100,0,0,0,0,0,0,45,0,2,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Data 0 2 (Stormwind Royal Guard)"),
(@ID*100+1,9,0,0,0,0,100,0,0,0,0,0,0,54,14000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Pause Waypoint"),
(@ID*100+1,9,1,0,0,0,100,0,1000,1000,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 3"),
(@ID*100+1,9,2,0,0,0,100,0,0,0,0,0,0,100,1,0,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Send Target 1 (Lord Gregor Lescovar)"),
(@ID*100+1,9,3,0,0,0,100,0,0,0,0,0,0,45,0,1,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Data 0 1 (Lord Gregor Lescovar)"),
(@ID*100+1,9,4,0,0,0,100,0,3000,3000,0,0,0,1,0,0,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 0 (Lord Gregor Lescovar)"),
(@ID*100+1,9,5,0,0,0,100,0,6000,6000,0,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Say Line 4"),
(@ID*100+1,9,6,0,0,0,100,0,1000,1000,0,0,0,45,0,2,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Data 0 2 (Lord Gregor Lescovar)"),
(@ID*100+2,9,0,0,0,0,100,0,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Pause Waypoint"),
(@ID*100+2,9,1,0,0,0,100,0,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Set Run On"),
(@ID*100+2,9,2,0,0,0,100,0,2000,2000,0,0,0,11,11067,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Cast 'Perm. Illusion Tyrion'"),
(@ID*100+2,9,3,0,0,0,100,0,3500,3500,0,0,0,36,8856,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Update Template To 'Tyrion's Spybot'"),
(@ID*100+2,9,4,0,0,0,100,0,0,0,0,0,0,11,11013,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Tyrion's Spybot - On Script - Cast 'Sneak'");
-- Stormwind Royal Guard
DELETE FROM `smart_scripts` WHERE `entryorguid` = 1756 AND `source_type` = 0 AND `id` IN (12,13);
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`,`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
(1756,0,12,0,38,0,100,0,0,1,0,0,0,66,0,0,0,0,0,0,19,7779,0,0,0,0,0,0,0,"Stormwind Royal Guard - On Data Set 0 1 - Set Orientation Closest Creature 'Priestess Tyriona'"),
(1756,0,13,0,38,0,100,0,0,2,0,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Stormwind Royal Guard - On Data Set 0 2 - Set Orientation Home Position");
-- Lord Gregor Lescovar SAI
SET @ID := 1754;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN @ID*100+0 AND @ID*100+2 AND `source_type` = 9;
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`,`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
(@ID,0,0,0,4,0,100,0,0,0,0,0,0,74,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Aggro - Remove Timed Event 1"),
-- Restore Tirion's quest flag on respawn
(@ID,0,1,0,11,0,100,0,0,0,0,0,0,82,2,0,0,0,0,0,19,7766,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Respawn - Add NPC Flag Questgiver (Tyrion)"),
(@ID,0,2,0,38,0,100,0,0,1,0,0,0,66,0,0,0,0,0,0,19,7779,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Data Set 0 1 - Set Orientation Closest Creature 'Priestess Tyriona'"),
(@ID,0,3,0,38,0,100,0,0,2,0,0,0,53,0,1754,0,0,0,2,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Data Set 0 2 - Start Waypoint"),
(@ID,0,4,0,40,0,100,0,11,1754,0,0,0,80,@ID*100+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Waypoint 11 Reached - Run Script"),
(@ID,0,5,0,40,0,100,0,13,1754,0,0,0,80,@ID*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Waypoint 13 Reached - Run Script"),
(@ID,0,6,0,38,0,100,0,0,3,0,0,0,80,@ID*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Data Set 0 3 - Run Script"),
-- If Lescovar is not attacked (in time), he will walk off,
-- and return to being friendly - and thus untargettable.
-- Return to home position
(@ID,0,7,8,59,0,100,0,1,0,0,0,0,2,12,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Timed Event - Set Faction 12"),
(@ID,0,8,0,61,0,100,0,0,0,0,0,0,53,0,175400,0,0,0,2,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Link - Start Waypoint"),
-- Restore Tirion's quest after returning to home position
(@ID,0,9,10,40,0,100,0,13,175400,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0,2.596,"Lord Gregor Lescovar - On Waypoint 13 Reached - Set Orientation"),
(@ID,0,10,0,61,0,100,0,0,0,0,0,0,82,2,0,0,0,0,0,19,7766,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Link - Add NPC Flag Questgiver (Tyrion)"),
-- If Lescovar is not attacked (in time), he will walk off,
-- and return to being friendly - and thus untargettable.
-- Do not simply despawn him on evade
(@ID,0,11,0,7,0,100,0,0,0,0,0,0,74,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Evade - Remove Timed Event 1"),
(@ID,0,12,0,21,0,100,0,0,0,0,0,0,73,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Reached Home - Trigger Timed Event 1"),
-- No info about this part, simply converted
(@ID*100+0,9,0,0,0,0,100,0,0,0,0,0,0,54,8000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Pause Waypoint"),
(@ID*100+0,9,1,0,0,0,100,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 1"),
(@ID*100+0,9,2,0,0,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 2"),
(@ID*100+0,9,3,0,0,0,100,0,3000,3000,0,0,0,1,0,0,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 0 (Stormwind Royal Guard)"),
(@ID*100+0,9,4,0,0,0,100,0,3000,3000,0,0,0,41,0,0,0,0,0,0,11,1756,10,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Despawn (0) (Stormwind Royal Guard)"),
(@ID*100+1,9,0,0,0,0,100,0,0,0,0,0,0,54,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Pause Waypoint"),
(@ID*100+1,9,1,0,0,0,100,0,0,0,0,0,0,12,1755,1,60000,0,0,0,8,0,0,0,0,-8411.360352,480.069733,123.760895,4.941504,"Lord Gregor Lescovar - On Script - Summon Creature 'Marzon the Silent Blade'"),
(@ID*100+1,9,2,0,0,0,100,0,2000,2000,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 3"),
(@ID*100+2,9,0,0,0,0,100,0,2000,2000,0,0,0,1,0,0,0,0,0,0,19,1755,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 0 (Marzon the Silent Blade)"),
(@ID*100+2,9,1,0,0,0,100,0,3000,3000,0,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 4"),
(@ID*100+2,9,2,0,0,0,100,0,5000,5000,0,0,0,1,1,0,0,0,0,0,19,1755,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 1 (Marzon the Silent Blade)"),
(@ID*100+2,9,3,0,0,0,100,0,0,0,0,0,0,15,434,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Quest Credit 'The Attack!'"),
(@ID*100+2,9,4,0,0,0,100,0,2000,2000,0,0,0,1,1,0,0,0,0,0,19,7766,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 1 (Tyrion)"),
(@ID*100+2,9,5,0,0,0,100,0,3000,3000,0,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Say Line 5"),
(@ID*100+2,9,6,0,0,0,100,0,0,0,0,0,0,2,7,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Set Faction 7"),
(@ID*100+2,9,7,0,0,0,100,0,0,0,0,0,0,2,7,0,0,0,0,0,19,1755,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Set Faction 7 (Marzon the Silent Blade)"),
-- If Lescovar is not attacked (in time), he will walk off,
-- and return to being friendly - and thus untargettable.
(@ID*100+2,9,8,0,0,0,100,0,0,0,0,0,0,67,1,60000,60000,0,0,100,1,0,0,0,0,0,0,0,0,"Lord Gregor Lescovar - On Script - Create Timed Event 1");
-- Marzon the Silent Blade SAI
SET @ID := 1755;
UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID;
DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
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`,`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
(@ID,0,0,1,54,0,100,0,0,0,0,0,0,69,1,0,0,0,0,0,8,0,0,0,0,-8408.000977,468.611450,123.759903,0,"Marzon the Silent Blade - On Just Summoned - Move To Position"),
(@ID,0,1,0,61,0,100,0,0,0,0,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Marzon the Silent Blade - On Link - Set Run Off"),
(@ID,0,2,0,34,0,100,0,8,1,0,0,0,45,0,3,0,0,0,0,19,1754,0,0,0,0,0,0,0,"Marzon the Silent Blade - On Reached Point 1 - Set Data 0 3 (Lord Gregor Lescovar)"),
(@ID,0,3,0,4,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Marzon the Silent Blade - On Aggro - Say Line 2"),
(@ID,0,4,0,21,0,100,0,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Marzon the Silent Blade - On Reached Home - Despawn (0)");
DELETE FROM `script_waypoint` WHERE `entry` IN (8856,1754);
DELETE FROM `waypoints` WHERE `entry` IN (8856,1754,175400);
INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
(8856,1,-8409.34,453.345,123.761,"Tyrion's Spybot"),
(8856,2,-8409.52,462.677,123.761,"Tyrion's Spybot"),
(8856,3,-8402.42,461.646,123.761,"Tyrion's Spybot"),
(8856,4,-8397.52,457.326,123.761,"Tyrion's Spybot"),
(8856,5,-8392.84,452.397,123.761,"Tyrion's Spybot"),
(8856,6,-8390.25,449.247,124.275,"Tyrion's Spybot"),
(8856,7,-8388.5,447.314,123.275,"Tyrion's Spybot"),
(8856,8,-8386.37,444.906,122.275,"Tyrion's Spybot"),
(8856,9,-8380.45,437.115,122.275,"Tyrion's Spybot"),
(8856,10,-8370.42,424.6,122.275,"Tyrion's Spybot"),
(8856,11,-8362.84,415.409,122.275,"Tyrion's Spybot"),
(8856,12,-8359.94,410.92,122.275,"Tyrion's Spybot"),
(8856,13,-8361.75,402.852,122.275,"Tyrion's Spybot"),
(8856,14,-8364.29,395.317,122.275,"Tyrion's Spybot"),
(8856,15,-8356.65,385.247,122.275,"Tyrion's Spybot"),
(8856,16,-8352.99,379.932,122.275,"Tyrion's Spybot"),
(8856,17,-8335.58,393.519,122.275,"Tyrion's Spybot"),
(8856,18,-8335.58,393.519,122.275,"Tyrion's Spybot"),
(8856,19,-8352.99,379.932,122.275,"Tyrion's Spybot"),
(8856,20,-8356.65,385.247,122.275,"Tyrion's Spybot"),
(8856,21,-8364.29,395.317,122.275,"Tyrion's Spybot"),
(8856,22,-8361.75,402.852,122.275,"Tyrion's Spybot"),
(8856,23,-8359.94,410.92,122.275,"Tyrion's Spybot"),
(8856,24,-8362.84,415.409,122.275,"Tyrion's Spybot"),
(8856,25,-8370.42,424.6,122.275,"Tyrion's Spybot"),
(8856,26,-8380.45,437.115,122.275,"Tyrion's Spybot"),
(8856,27,-8384.98,443.240,122.275,"Tyrion's Spybot"),
(8856,28,-8406.01,426.637,122.275,"Tyrion's Spybot"),
(8856,29,-8406.01,426.637,122.275,"Tyrion's Spybot"),
(8856,30,-8410.90,427.383,122.275,"Tyrion's Spybot"),
(8856,31,-8410.90,427.383,122.275,"Tyrion's Spybot"),
(8856,32,-8424.74,444.123,122.275,"Tyrion's Spybot"),
(8856,33,-8428.06,447.918,122.275,"Tyrion's Spybot"),
(8856,34,-8434.28,442.995,122.274,"Tyrion's Spybot"),
(8856,35,-8446.08,433.609,118.920,"Tyrion's Spybot"),
(8856,36,-8460.70,421.968,114.760,"Tyrion's Spybot"),
(8856,37,-8483.02,404.150,108.401,"Tyrion's Spybot"),
(1754,1,-8336.32,397.468,122.275,"Lord Gregor Lescovar"),
(1754,2,-8338.63,404.048,122.275,"Lord Gregor Lescovar"),
(1754,3,-8345.59,412.439,122.275,"Lord Gregor Lescovar"),
(1754,4,-8359.94,410.92,122.275,"Lord Gregor Lescovar"),
(1754,5,-8362.84,415.409,122.275,"Lord Gregor Lescovar"),
(1754,6,-8370.42,424.6,122.275,"Lord Gregor Lescovar"),
(1754,7,-8380.45,437.115,122.275,"Lord Gregor Lescovar"),
(1754,8,-8386.37,444.906,122.275,"Lord Gregor Lescovar"),
(1754,9,-8388.5,447.314,123.275,"Lord Gregor Lescovar"),
(1754,10,-8390.25,449.247,124.275,"Lord Gregor Lescovar"),
(1754,11,-8392.84,452.397,123.761,"Lord Gregor Lescovar"),
(1754,12,-8397.52,457.326,123.761,"Lord Gregor Lescovar"),
(1754,13,-8402.42,461.646,123.761,"Lord Gregor Lescovar"),
(175400,1,-8397.52,457.326,123.761,"Lord Gregor Lescovar"),
(175400,2,-8392.84,452.397,123.761,"Lord Gregor Lescovar"),
(175400,3,-8390.25,449.247,124.275,"Lord Gregor Lescovar"),
(175400,4,-8388.5,447.314,123.275,"Lord Gregor Lescovar"),
(175400,5,-8386.37,444.906,122.275,"Lord Gregor Lescovar"),
(175400,6,-8380.45,437.115,122.275,"Lord Gregor Lescovar"),
(175400,7,-8370.42,424.6,122.275,"Lord Gregor Lescovar"),
(175400,8,-8362.84,415.409,122.275,"Lord Gregor Lescovar"),
(175400,9,-8359.94,410.92,122.275,"Lord Gregor Lescovar"),
(175400,10,-8345.59,412.439,122.275,"Lord Gregor Lescovar"),
(175400,11,-8338.63,404.048,122.275,"Lord Gregor Lescovar"),
(175400,12,-8336.32,397.468,122.275,"Lord Gregor Lescovar"),
(175400,13,-8334,394.722,122.275,"Lord Gregor Lescovar");
UPDATE `creature_text` SET `comment` = "Tyrion" WHERE `CreatureID` = 7766;
UPDATE `creature_text` SET `Type` = 12 WHERE `CreatureID` = 7766 AND `GroupID` = 1;
UPDATE `creature_text` SET `comment` = "Tyrion's Spybot" WHERE `CreatureID` = 8856;
UPDATE `creature_text` SET `BroadcastTextId` = 4593 WHERE `CreatureID` = 8856 AND `GroupID` = 0;
UPDATE `creature_text` SET `Emote` = 1 WHERE `CreatureID` IN (7779,8856) AND `GroupID` IN (1,2,3);
UPDATE `creature_text` SET `Emote` = 2 WHERE `CreatureID` IN (7779,8856) AND `GroupID` = 4;
UPDATE `creature_text` SET `comment` = "Stormwind Royal Guard" WHERE `CreatureID` = 1756;
UPDATE `creature_text` SET `BroadcastTextId` = 3690 WHERE `CreatureID` = 1756 AND `GroupID` = 0;
UPDATE `creature_text` SET `Emote` = 1 WHERE `CreatureID` = 1756 AND `GroupID` = 1;
DELETE FROM `creature_text` WHERE `CreatureID` = 7766 AND `GroupID` = 2;
DELETE FROM `creature_text` WHERE `CreatureID` IN (1754,1755);
INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
-- Unused now, purpose unknown. We despawn Spybot with no return
-- Source: https://classic.wowhead.com/npc=7766
(7766,2,0,"You did a great job, Spybot! Glad to have you back here with me!",12,0,100,0,0,0,4612,0,"Tyrion"),
(1754,0,0,"Ah, thank you kindly. I will leave you to the library while I tend to this small matter.",12,0,100,1,0,0,3784,0,"Lord Gregor Lescovar"),
(1754,1,0,"It's time for my meditation, leave me.",12,7,100,0,0,0,322,0,"Lord Gregor Lescovar"),
(1754,2,0,"%s waits for the guards to be out of sight.",16,0,100,0,0,0,3721,0,"Lord Gregor Lescovar"),
(1754,3,0,"There you are. What news from Westfall?",12,7,100,0,0,0,323,0,"Lord Gregor Lescovar"),
(1754,4,0,"Hmm, it could be that meddler Shaw. I will see what I can discover. Be off with you. I'll contact you again soon.",12,7,100,0,0,0,326,0,"Lord Gregor Lescovar"),
(1754,5,0,"What?! How dare you!",12,0,100,0,0,0,3934,0,"Lord Gregor Lescovar"),
(1755,0,0,"VanCleef sends word that the plans are underway. But he's heard rumors about someone snooping about.",12,7,100,0,0,0,324,0,"Marzon the Silent Blade"),
(1755,1,0,"Very well. I will return then.",12,7,100,0,0,0,325,0,"Marzon the Silent Blade"),
(1755,2,0,"The Defias shall succeed! No meek adventurer will stop us!",12,0,100,0,0,0,3936,0,"Marzon the Silent Blade");
-- Fix incorrect coords
UPDATE `creature` SET `position_x` = -8407.9296, `position_y` = 450.6628, `position_z` = 123.8431, `orientation` = 0.05235, `VerifiedBuild` = 12340 WHERE `guid` = 43667 AND `id` = 7766;
UPDATE `creature` SET `position_x` = -8408.8496, `position_y` = 452.0239, `position_z` = 123.7598, `orientation` = 5.60754, `VerifiedBuild` = 12340 WHERE `guid` = 45707 AND `id` = 8856;
Updated with correct coords for Tyrion & Spybot & fixed / added events for Lescovar & Marzon evade case.
Call for help does not work with neutral creatures
https://github.com/TrinityCore/TrinityCore/issues/25608 to be fixed if I / someone decide to update existing CPP scripts(because of https://github.com/TrinityCore/TrinityCore/issues/24735#issuecomment-678633142 I don't want to convert it right now to SAI + the script is slightly bigger & confusing for SAI than I expected)
Fair enough, I can see that the scripting for the quests related to The Attack! and other activities in Stormwind closely related to Tyrion & Spybot will be quite a lot of work.
Would it be acceptable if I provide a C++ script fix in the meanwhile, by opening a PR to modify the Talk() line?
If you think it worth time, I mean it'll be fixed with all other bugs
Sure, it should be only a 1 line fix, I am building it now to double-check that it works. I am also considering it a "workaround" since it will be a "temporary" fix.
Building the latest result from my testing now, this is what I ended up with:
diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
index 1b5fe4de36..ac19ab11be 100644
--- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
@@ -386,13 +386,16 @@ public:
Talk(SAY_QUEST_ACCEPT_ATTACK);
uiTimer = 3000;
uiPhase = 2;
break;
case 2:
if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 10.0f))
- pTyrion->AI()->Talk(SAY_TYRION_1);
+ {
+ if (Player* player = GetPlayerForEscort())
+ pTyrion->AI()->Talk(SAY_TYRION_1, player->GetGUID());
+ }
uiTimer = 3000;
uiPhase = 3;
break;
case 3:
me->UpdateEntry(NPC_PRIESTESS_TYRIONA);
uiTimer = 2000;
Sorry, I didn't manage to get that to work either.
15>zone_stormwind_city.cpp
15>C:\Trinity\Source\src\server\scripts\EasternKingdoms\zone_stormwind_city.cpp(394,1):
error C2664: 'void CreatureAI::Talk(uint8,const WorldObject *)': cannot convert argument 2 from 'ObjectGuid' to 'const WorldObject *'
15>C:\Trinity\Source\src\server\scripts\EasternKingdoms\zone_stormwind_city.cpp(394,86):
message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
15>C:\Trinity\Source\src\server\game\AI\CreatureAI.h(107,14): message :
see declaration of 'CreatureAI::Talk' (compiling source file C:\Trinity\Source\src\server\scripts\EasternKingdoms\zone_stormwind_city.cpp)
Talk() requires a WorldObject* as 2nd parameter, not an ObjectGuid. Instead of passing player->GetGUID() pass only player
Aha. I see. I tried to follow the example in case 10 too much in detail.
edit: I guess I thought it would fail again if I only used player , because my first 2 attempts to add a 2nd parameter was done without defining the parameter.
if you get to compile successfully and the ingame test works, please open a PR so we can merge it 馃憤
Sure thing, the compile (VS2019) part is done already, just need to test it and see that it works as expected in-game.
Test worked just fine. The quest animation started slightly faster than I expected, but it seemed to work very well. Feel free to request more details, if the image below does not provide enough of it.
The Attack! (screenshot)

BTW, if you wonder why it took more than 3 hours to do the test, it is because I started off with a level 16 nelf hunter still without a pet (which I got 1 level later), but equipped with iLevel 165 armor & slightly OP weapons to deal with Deadmines and the Stockades (ran the full chain of quests from exiting Deadmines and up to Tyrion).
Maybe I'll change my mind later but now I think better to update CPP using SAI I posted
If someone sniffed this quest in classic, maybe we can update it way much faster