[WIP] Quest 11617 "Hampering Their Escape" Borean Tundra

2 Issues:

Flames are not despawning after 60 sec.

Spell should not cast if you are not in range of trigger.

[CODE]-- Quest 11617 “Hampering Their Escape”
– North Platform, East Platform, West Platform SAI
UPDATE creature_template SET AIName= ‘SmartAI’ WHERE entry IN (25441,25442,25443);
DELETE FROM smart_scripts WHERE source_type=0 AND entryorguid IN (25441,25442,25443);
DELETE FROM smart_scripts WHERE source_type=9 AND entryorguid IN (2544100,2544200,2544300);
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
(25441,0,0,0,8,0,100,0,45583,0,0,0,80,2544100,0,0,0,0,0,1,0,0,0,0,0,0,0,‘North Platform - On Spell hit - Run Script’),
(25442,0,0,0,8,0,100,0,45583,0,0,0,80,2544200,0,0,0,0,0,1,0,0,0,0,0,0,0,‘East Platform - On Spell hit - Run Script’),
(25443,0,0,0,8,0,100,0,45583,0,0,0,80,2544300,0,0,0,0,0,1,0,0,0,0,0,0,0,‘West Platform - On Spell hit - Run Script’),
– North Platform Script
(2544100,9,0,0,0,0,100,0,0,0,0,0,33,25441,0,0,0,0,0,7,0,0,0,0,0,0,0,‘North Platform - Script - Give quest credit’),
(2544100,9,1,0,0,0,100,0,0,0,0,0,50,187675,60000,0,0,0,0,8,0,0,0,3671.11,5557.07,64.8022,2.91469,‘North Platform - Script - Spawn flame’),
(2544100,9,2,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3654.99,5558.21,64.1389,-0.610864,‘North Platform - Script - Spawn flame’),
(2544100,9,3,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3670.3,5575.24,65.0104,0.925024,‘North Platform - Script - Spawn flame’),
(2544100,9,4,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3686.95,5561.02,65.0278,-1.48353,‘North Platform - Script - Spawn flame’),
(2544100,9,5,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3666.13,5557.6,55.3273,3.01941,‘North Platform - Script - Spawn flame’),
(2544100,9,6,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3669.95,5550.14,54.613,-2.11185,‘North Platform - Script - Spawn flame’),
(2544100,9,7,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3661.4,5560.14,64.962,1.65806,‘North Platform - Script - Spawn flame’),
(2544100,9,8,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3681.69,5564.71,65.0939,2.54818,‘North Platform - Script - Spawn flame’),
(2544100,9,9,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3680.52,5549.36,65.0731,2.93214,‘North Platform - Script - Spawn flame’),
(2544100,9,10,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3663.64,5541.97,64.8959,-0.139624,‘North Platform - Script - Spawn flame’),
(2544100,9,11,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3671.82,5537.21,65.924,-1.64061,‘North Platform - Script - Spawn flame’),
(2544100,9,12,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3664.62,5555.1,54.6427,3.01941,‘North Platform - Script - Spawn flame’),
– East Platform Script
(2544200,9,0,0,0,0,100,0,0,0,0,0,33,25442,0,0,0,0,0,7,0,0,0,0,0,0,0,‘East Platform - Script - Give quest credit’),
(2544200,9,1,0,0,0,100,0,0,0,0,0,50,187675,60000,0,0,0,0,8,0,0,0,3567.02832,5530.725,86.75361,-2.91468954,‘East Platform - Script - Spawn flame’),
(2544200,9,2,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3547.85,5525.57861,83.44276,2.3910985,‘East Platform - Script - Spawn flame’),
(2544200,9,3,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3551.81519,5537.208,85.85419,0.5934101,‘East Platform - Script - Spawn flame’),
(2544200,9,4,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3558.709,5530.077,75.47846,2.82742977,‘East Platform - Script - Spawn flame’),
(2544200,9,5,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3560.75659,5544.268,87.7508,-0.5061446,‘East Platform - Script - Spawn flame’),
(2544200,9,6,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3562.42114,5538.395,75.21444,-1.55334139,‘East Platform - Script - Spawn flame’),
(2544200,9,7,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3565.86548,5514.692,85.72919,2.0594883,‘East Platform - Script - Spawn flame’),
(2544200,9,8,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3571.31567,5533.095,74.9838257,-1.23918331,‘East Platform - Script - Spawn flame’),
(2544200,9,9,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3571.78735,5544.19971,87.26057,0.383971,‘East Platform - Script - Spawn flame’),
(2544200,9,10,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3573.25269,5517.94434,86.92722,2.02457881,‘East Platform - Script - Spawn flame’),
(2544200,9,11,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3580.3938,5536.65039,86.5073,1.134463,‘East Platform - Script - Spawn flame’),
(2544200,9,12,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3581.925,5524.272,86.6597443,1.39626181,‘East Platform - Script - Spawn flame’),
– West Platform Script
(2544300,9,0,0,0,0,100,0,0,0,0,0,33,25443,0,0,0,0,0,7,0,0,0,0,0,0,0,‘West Platform - Script - Give quest credit’),
(2544300,9,1,0,0,0,100,0,0,0,0,0,50,187675,60000,0,0,0,0,8,0,0,0,3590.9917,5631.12,75.53494,1.18682325,‘West Platform - Script - Spawn flame’),
(2544300,9,2,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3575.896,5629.07,75.4168854,-2.00712848,‘West Platform - Script - Spawn flame’),
(2544300,9,3,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3579.39014,5642.362,77.5937347,-1.0122894,‘West Platform - Script - Spawn flame’),
(2544300,9,4,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3580.77466,5620.292,75.6107559,1.06464958,‘West Platform - Script - Spawn flame’),
(2544300,9,5,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3586.41724,5635.27734,65.31032,1.81514192,‘West Platform - Script - Spawn flame’),
(2544300,9,6,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3591.92139,5646.22754,75.15994,2.042035,‘West Platform - Script - Spawn flame’),
(2544300,9,7,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3592.143,5614.88672,75.2258,2.86233544,‘West Platform - Script - Spawn flame’),
(2544300,9,8,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3594.72119,5637.13135,65.02226,0.95993,‘West Platform - Script - Spawn flame’),
(2544300,9,9,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3595.71216,5626.9375,65.27551,-3.124123,‘West Platform - Script - Spawn flame’),
(2544300,9,10,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3601.01,5642.26563,75.64725,1.48352814,‘West Platform - Script - Spawn flame’),
(2544300,9,11,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3601.68872,5621.22559,75.4045944,-1.22172928,‘West Platform - Script - Spawn flame’),
(2544300,9,12,0,0,0,100,0,0,0,0,0,50,187676,60000,0,0,0,0,8,0,0,0,3607.263,5631.06055,75.13552,-1.09955645,‘West Platform - Script - Spawn flame’);

– Fix North Platform, East Platform, West Platform triggers, Borean Tundra
UPDATE creature SET modelid=0,spawndist=0,MovementType=0 WHERE id IN (25441,25442,25443);
UPDATE creature_template SET InhabitType=5,flags_extra=flags_extra|128 WHERE entry IN (25441,25442,25443);
– Add spell conditions for 45583
DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry=45583;
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,ConditionValue3,ErrorTextId,ScriptName,Comment) VALUES
(13,0,45583,0,18,1,25441,0,0,‘’,‘Spell 45583 target North Platform’),
(13,0,45583,0,18,1,25442,0,0,‘’,‘Spell 45583 target East Platform’),
(13,0,45583,0,18,1,25443,0,0,‘’,‘Spell 45583 target West Platform’);
– Remove Spawnen flames
DELETE FROM gameobject WHERE id IN (187675,187676);[/sql]
[/CODE]