[wip] Quest: Fate, Up Against Your Will

I used this quest as an excuse to learn how to work with SAI several months ago, but ran into problems with no clear solutions, and unfortunately ran out of time to keep working at it. I finally tried to get back into it this weekend, but it’s like starting from square one, and I really don’t have enough time to devote to it, so I’m posting what I have in case anyone else can use it.

[SPOILER]/* Alliance post-wrathgate */

INSERT INTO spell_area (spell, area, quest_start, racemask, autocast) VALUES

(58932, 4169, 12499, 1101, 1),

(58932, 4170, 12499, 1101, 1),

(58932, 4171, 12499, 1101, 1),

(58932, 4172, 12499, 1101, 1);

/* Horde post-wrathgate */

INSERT INTO spell_area (spell, area, quest_start, racemask, autocast) VALUES

(58932, 4169, 12500, 690, 1),

(58932, 4170, 12500, 690, 1),

(58932, 4171, 12500, 690, 1),

(58932, 4172, 12500, 690, 1);

/* Stormwind, Orgrimmar, Undercity, Durotar, and Tirisfal Glades */

INSERT INTO spell_area (spell, area, quest_start, quest_end, racemask, autocast) VALUES

(60815, 1519, 12499, 13377, 1101, 1),

(60815, 1637, 12499, 13377, 1101, 1),

(60815, 1497, 12499, 13377, 1101, 1),

(60815, 14, 12499, 13377, 1101, 1),

(60815, 85, 12499, 13377, 1101, 1);

/* Orgrimmar, Undercity, Durotar, and Tirisfal Glades, for Horde */

INSERT INTO spell_area (spell, area, quest_start, quest_end, racemask, autocast) VALUES

(59062, 1637, 12500, 13267, 690, 1),

(59062, 1497, 12500, 13267, 690, 1),

(59062, 14, 12500, 13267, 690, 1),

(59062, 85, 12500, 13267, 690, 1);

/* Update Phase masks in Stormwind Keep */

UPDATE creature SET phaseMask=129 WHERE guid=10495 LIMIT 1;

/* Spawns */

/* Add Jaina */

INSERT INTO creature (id, map, phaseMask, position_x, position_y, position_z, orientation, npcflag) VALUES (32346, 0, 128, -8443.36, 332.2, 122.579, 1.570795, 1);

UPDATE creature_template SET AIName=SmartAI WHERE entry=32346 LIMIT 1;

UPDATE creature_template SET gossip_menu_id=10189 WHERE entry=32346 LIMIT 1;

UPDATE creature_template SET npcflag=1 WHERE entry=32346 LIMIT 1;

/INSERT INTO gossip_menu_option (menu_id, option_icon, option_text, option_id, npc_option_npcflag) VALUES (10189, 0, “Lady Proudmoore, I am ready to go to Orgrimmar. Please open a portal.”, 1, 1);/

/* Thrall */

INSERT INTO creature (id, map, phaseMask, position_x, position_y, position_z, orientation) VALUES (32363, 1, 128, 1920.57, 4136.53, 40.5368, -1.570795);

UPDATE creature_template SET AIName=SmartAI WHERE entry=32363 LIMIT 1;

/* Sylvanas */

INSERT INTO creature (id, map, phaseMask, position_x, position_y, position_z, orientation) VALUES (32365, 1, 128, 1920, 4129.52, 43.1409, -1.570795);

UPDATE creature_template SET AIName=SmartAI WHERE entry=32365 LIMIT 1;

/* Guards */

SET @GUARD := 32367;

INSERT INTO creature (guid, id, map, phaseMask, modelid, position_x, position_y, position_z, orientation) VALUES

((@GUARD * 100), @GUARD, 1, 128, 14362, 1911.631, -4139.943, 40.625, 2.3561925),

(((@GUARD * 100) + 1), @GUARD, 1, 128, 14360, 1911.631, -4157.943, 40.625, 0.7853975),

(((@GUARD * 100) + 2), @GUARD, 1, 128, 14362, 1930.631, -4157.943, 40.625, -2.3561925),

(((@GUARD * 100) + 3), @GUARD, 1, 128, 14360, 1930.631, -4139.943, 40.625, 3.9269875);

UPDATE creature_template SET AIName=SmartAI WHERE entry=32367 LIMIT 1;

/* Text */

INSERT INTO creature_text (entry, groupid, id, text, type, language, probability, emote, duration, sound, comment) VALUES

(32346, 0, 0, ‘Do not do anything that would incite the Horde, $N. The Warchief has agreed to see us on good faith.’, 12, 0, 100, 1, 0, 16124, ‘Jaina Proudmoore’),

(32346, 1, 0, ‘Let’s go.’, 12, 0, 100, 1, 0, 16125, ‘Jaina Proudmoore’);

/* Portal to Orgrimmar */

–SET @PORTALGO := 500000;

SET @PORTAL := 193948;

UPDATE gameobject_template SET AIName=‘SmartGameObjectAI’ WHERE entry=@PORTAL LIMIT 1;

–INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES

– (@PORTALGO, @PORTAL, 0, 1, 128, -8446.12, 332.768, 122.163, 5.29388, 0, 0, 0.474727, -0.880133, -15, 0, 1);

/* Scripting */

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, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o, comment)

VALUES (32346, 0, 0, 0, 62, 0, 100, 0, 10189, 0, 0, 0, 80, 3234600, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ‘On gossip option select run script’);

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, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o, comment) VALUES

(3234600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ‘Turn off Gossip & Questgiver flags’),

(3234600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ‘Say text 0’),

(3234600, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 11, 60904, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ‘Cast spell 60904’),

(3234600, 9, 3, 0, 0, 0, 100, 0, 5500, 5500, 0, 0, 50, @PORTAL, 60, 0, 0, 0, 0, 1, 0, 0, 0, -8446.12, 332.768, 122.163, 0, ‘Spawn portal to Orgrimmar’),

(3234600, 9, 4, 0, 0, 0, 100, 0, 500, 500, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ‘Say text 1’),

(3234600, 9, 5, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ‘Turn on Gossip & Questgiver flags’);

–SET @PORTALGO := -@PORTALGO;

INSERT INTO smart_scripts VALUES (@PORTAL, 1, 0,0,64,0,100,0,0,0,0,0,62,1,0,0,0,0,0,0,0,0,0, 1921.130615, -4148.943359, 40.637367, 1.570795)

INSERT INTO areatrigger_scripts (entry, ScriptName) VALUES (5311, ‘SmartTrigger’);

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, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o, comment) VALUES

(32363, 2, 0, 0, 46, 0, 100, 0, 5311, 0, 0, 0, 80, 3236300

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, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o, comment) VALUES (5311, 2, 0, 0, 46, 0, 100, 0, 5311, 0, 0, 0, 80, 3236300, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ‘Trigger Orgrimmar event for quest 13369’);

– add condition for gossip option

SET @MENUID := 10189;

SET @OPTION := 0;

DELETE FROM conditions WHERE SourceTypeOrReferenceId=15 AND SourceGroup=@MENUID AND SourceEntry=@OPTION;

INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ErrorTextId,ScriptName,Comment) VALUES

(15,@MENUID,@OPTION,0,9,13369,0,‘’,‘Show gossip option 0 if player is on quest 13369 (Alliance)’);

[/SPOILER]

Here’s a video of how it currently works, or is supposed to, anyway - Fate, Up Against Your Will - YouTube

At least one thing I’m sure is incorrect, is the phasing in Stormwind. I can’t remember if Jaina was visible in the keep all throughout the expansion, or if she might have used a quest invisibility aura.

While every thing in the Keep was working, I could never get the Orgrimmar portion to work. There are two areatriggers inside Grommash Hold, one for the Alliance quest, and one for the Horde version. Alliance players are teleported right on top of their trigger, which should set off the event… only it doesn’t. No matter what I tried, I could’t get a timed action list or even a simple “welcome” to trigger.

What you people have against spoiler tags???

Please rather use code tag, so it will display with a monospaced font…makes it more readable.

Anyway, your SQL for SmartTrigger is incomplete:

(32363, 2, 0, 0, 46, 0, 100, 0, 5311, 0, 0, 0, 80, 3236300