[WIP] Quest 12512 Leave no one behind

Please test this script and give me some feedback. When I tested it everthing seemed to work just fine…

I tried to get it quite close to retail: Leave no one behind

Only nasty thing is that the following npc does not stay on the ground if the player is flying but I guess this is the usual mob-behavior and can’t be affected by me.

Two things are still missing: The death texts for http://old.wowhead.com/npc=28136 and http://old.wowhead.com/npc=28148

Unfortunately I cannot sniff them. Maybe somebody can help…

[CODE]-- QUEST 12512 “Leave no one behind”
UPDATE creature_template SET AIName= ‘SmartAI’ WHERE entry IN (28133,28141,28143,28136,28142,28148);
DELETE FROM smart_scripts WHERE source_type=0 AND entryorguid IN (28133,28141,28143,28136,28142,28148);
DELETE FROM smart_scripts WHERE source_type=9 AND entryorguid IN (2813600,2814200,2814800);
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
– Crusader Jonathan
(28133,0,0,1,8,0,100,0,50662,0,0,0,85,50664,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘On spellhit revive Crusader Jonathan’),
(28133,0,1,2,61,0,100,0,0,0,0,0,11,50666,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘Apply timed debuff to player’),
(28133,0,2,0,61,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Despawn injured Crusader Jonathan’),
– Crusader Jonathan
(28136,0,0,1,54,0,100,0,0,0,0,0,29,1,0,28044,28136,0,0,7,0,0,0,0,0,0,0, ‘On spawn start follow’),
(28136,0,1,2,61,0,100,0,0,0,0,0,11,50665,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Apply timed debuff to Crusader Jonathan’),
(28136,0,2,0,61,0,100,0,0,0,0,0,80,2813600,0,2,0,0,0,1,0,0,0,0,0,0,0, ‘Start script Crusader Jonathan’),
(28136,0,3,0,65,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘On follow completed say rescued text’),
(2813600,9,0,1,60,0,100,0,180000,180000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘On debuff fade Crusader Jonathan dies’),
(2813600,9,1,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Say text Crusader Jonathan death’),
– Crusader Lamoof
(28141,0,0,1,8,0,100,0,50662,0,0,0,85,50678,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘On spellhit revive Crusader Lamoof’),
(28141,0,1,2,61,0,100,0,0,0,0,0,11,50679,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘Apply timed debuff to player’),
(28141,0,2,0,61,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Despawn dead Crusader Lamoof’),
– Crusader Lamoof
(28142,0,0,1,54,0,100,0,0,0,0,0,29,1,0,28044,28142,0,0,7,0,0,0,0,0,0,0, ‘On spawn start follow’),
(28142,0,1,2,61,0,100,0,0,0,0,0,11,50681,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Apply timed debuff to Crusader Lamoof’),
(28142,0,2,0,61,0,100,0,0,0,0,0,80,2814200,0,2,0,0,0,1,0,0,0,0,0,0,0, ‘Start script Crusader Lamoof’),
(28142,0,3,0,65,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘On follow completed say rescued text’),
(2814200,9,0,1,60,0,100,0,90000,90000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘On debuff fade Crusader Lamoof dies’),
(2814200,9,1,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Say text Crusader Lamoof death’),
– Crusader Josephine
(28143,0,0,1,8,0,100,0,50662,0,0,0,85,50692,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘On spellhit revive Crusader Josephine’),
(28143,0,1,2,61,0,100,0,0,0,0,0,11,50693,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘Apply timed debuff to player’),
(28143,0,2,0,61,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Despawn dead Crusader Josephine’),
– Crusader Josephine
(28148,0,0,1,54,0,100,0,0,0,0,0,29,1,0,28044,28148,0,0,7,0,0,0,0,0,0,0, ‘On spawn start follow’),
(28148,0,1,2,61,0,100,0,0,0,0,0,11,50695,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Apply timed debuff to Crusader Josephine’),
(28148,0,2,0,61,0,100,0,0,0,0,0,80,2814800,0,2,0,0,0,1,0,0,0,0,0,0,0, ‘Start script Crusader Josephine’),
(28148,0,3,0,65,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘On follow completed say rescued text’),
(2814800,9,0,1,60,0,100,0,150000,150000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘On debuff fade Crusader Josephine dies’),
(2814800,9,1,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Say text Crusader Josephine death’);

– NPC text for Crusader Jonathan, Crusader Lamoof, Crusader Josephine
DELETE FROM creature_text WHERE entry IN (28136,28142,28148);
INSERT INTO creature_text (entry,groupid,id,text,type,language,probability,emote,duration,sound,comment) VALUES
(28136,0,0,‘Thank you, friend. Were it not for your aid I would be no more.’,0,0,100,1,0,0,‘Crusader Jonathan rescued text’),
(28136,1,0,‘’,0,0,100,1,0,0,‘Crusader Jonathan death text’),
(28142,0,0,‘… Well, I suppose it could be worse.’,0,0,100,1,0,0,‘Crusader Lamoof rescued text’),
(28142,1,0,‘… This is the end of me.’,0,0,100,1,0,0,‘Crusader Lamoof death text’),
(28148,0,0,‘I am in your debt, friend. Thank you for my life.’,0,0,100,1,0,0,‘Crusader Josephine rescued text’),
(28148,1,0,‘’,0,0,100,1,0,0,‘Crusader Josephine death text’);

UPDATE creature_template SET faction_A=2070,faction_H=2070,npcflag=npcflag|1,unit_flags=unit_flags|32768,speed_run=1.1428571428571 WHERE entry=28136; – Crusader Jonathan
UPDATE creature_model_info SET bounding_radius=0.306,combat_reach=1.5,gender=0 WHERE modelid=25131; – Crusader Jonathan
DELETE FROM creature_template_addon WHERE entry IN (28136,28137);
INSERT INTO creature_template_addon (entry,bytes2,auras) VALUES
(28136,1,NULL), – Crusader Jonathan
(28137,1, ‘50670’); – Leave No One Behind Bunny
UPDATE creature SET MovementType=0,spawndist=0 WHERE id=28137; – Incorrect movement for Leave No One Behind Bunny

[/code]
[/CODE]

-- QUEST 12512 "Leave no one behind" UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN (28133,28141,28143,28136,28142,28148); DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (28133,28141,28143,28136,28142,28148); DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (2813600,2814200,2814800); 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 -- Crusader Jonathan (28133,0,0,1,8,0,100,0,50662,0,0,0,85,50664,0,0,0,0,0,7,0,0,0,0,0,0,0, 'On spellhit revive Crusader Jonathan'), (28133,0,1,2,61,0,100,0,0,0,0,0,11,50666,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Apply timed debuff to player'), (28133,0,2,0,61,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Despawn injured Crusader Jonathan'), -- Crusader Jonathan (28136,0,0,1,54,0,100,0,0,0,0,0,29,1,0,28044,28136,0,0,7,0,0,0,0,0,0,0, 'On spawn start follow'), (28136,0,1,2,61,0,100,0,0,0,0,0,11,50665,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Apply timed debuff to Crusader Jonathan'), (28136,0,2,0,61,0,100,0,0,0,0,0,80,2813600,0,2,0,0,0,1,0,0,0,0,0,0,0, 'Start script Crusader Jonathan'), (28136,0,3,0,65,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On follow completed say rescued text'), (2813600,9,0,1,60,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text Crusader Jonathan death'), (2813600,9,1,0,61,0,100,0,180000,180000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On debuff fade Crusader Jonathan dies'), -- Crusader Lamoof (28141,0,0,1,8,0,100,0,50662,0,0,0,85,50678,0,0,0,0,0,7,0,0,0,0,0,0,0, 'On spellhit revive Crusader Lamoof'), (28141,0,1,2,61,0,100,0,0,0,0,0,11,50679,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Apply timed debuff to player'), (28141,0,2,0,61,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Despawn dead Crusader Lamoof'), -- Crusader Lamoof (28142,0,0,1,54,0,100,0,0,0,0,0,29,1,0,28044,28142,0,0,7,0,0,0,0,0,0,0, 'On spawn start follow'), (28142,0,1,2,61,0,100,0,0,0,0,0,11,50681,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Apply timed debuff to Crusader Lamoof'), (28142,0,2,0,61,0,100,0,0,0,0,0,80,2814200,0,2,0,0,0,1,0,0,0,0,0,0,0, 'Start script Crusader Lamoof'), (28142,0,3,0,65,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On follow completed say rescued text'), (2814200,9,0,1,60,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text Crusader Lamoof death'), (2814200,9,1,0,61,0,100,0,120000,120000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On debuff fade Crusader Lamoof dies'), -- Crusader Josephine (28143,0,0,1,8,0,100,0,50662,0,0,0,85,50692,0,0,0,0,0,7,0,0,0,0,0,0,0, 'On spellhit revive Crusader Josephine'), (28143,0,1,2,61,0,100,0,0,0,0,0,11,50693,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Apply timed debuff to player'), (28143,0,2,0,61,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Despawn dead Crusader Josephine'), -- Crusader Josephine (28148,0,0,1,54,0,100,0,0,0,0,0,29,1,0,28044,28148,0,0,7,0,0,0,0,0,0,0, 'On spawn start follow'), (28148,0,1,2,61,0,100,0,0,0,0,0,11,50695,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Apply timed debuff to Crusader Josephine'), (28148,0,2,0,61,0,100,0,0,0,0,0,80,2814800,0,2,0,0,0,1,0,0,0,0,0,0,0, 'Start script Crusader Josephine'), (28148,0,3,0,65,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On follow completed say rescued text'), (2814800,9,0,1,60,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text Crusader Josephine death'), (2814800,9,1,0,61,0,100,0,180000,180000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On debuff fade Crusader Josephine dies'); -- NPC text for Crusader Jonathan, Crusader Lamoof, Crusader Josephine DELETE FROM `creature_text` WHERE `entry` IN (28136,28142,28148); INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES (28136,0,0,'Thank you, friend. Were it not for your aid I would be no more.',0,0,100,1,0,0,'Crusader Jonathan rescued text'), (28136,1,0,'',0,0,100,1,0,0,'Crusader Jonathan death text'), (28142,0,0,'<sigh>... Well, I suppose it could be worse.',0,0,100,1,0,0,'Crusader Lamoof rescued text'), (28142,1,0,'<sigh>... This is the end of me.',0,0,100,1,0,0,'Crusader Lamoof death text'), (28148,0,0,'I am in your debt, friend. Thank you for my life.',0,0,100,1,0,0,'Crusader Josephine rescued text'), (28148,1,0,'',0,0,100,1,0,0,'Crusader Josephine death text');[/sql]

After some further investigation I have some correction for the SAI:

(2813600,9,0,1,60,0,100,0,180000,180000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On debuff fade Crusader Jonathan dies'),
(2813600,9,1,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text Crusader Jonathan death'),
[/sql]


[sql]
(2814200,9,0,1,60,0,100,0,90000,90000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On debuff fade Crusader Lamoof dies'),
(2814200,9,1,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text Crusader Lamoof death'),
(2814800,9,0,1,60,0,100,0,150000,150000,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On debuff fade Crusader Josephine dies'),
(2814800,9,1,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text Crusader Josephine death'),
[/sql]

Otherwise the npcs will say their death texts just after they were revived. And the time in the scripts should now fit with the debuff duration.

Credit giving for when 28136 has been escorted:

http://www.wowhead.com/npc=28137 got aura 50670.

28136 is hit by 50669 when in range, starting the following event:

UPDATE `creature_template` SET `faction_A`=2070,`faction_H`=2070,`npcflag`=`npcflag`|1,`unit_flags`=`unit_flags`|32768,`speed_run`=1.1428571428571 WHERE `entry`=28136; -- Crusader Jonathan
UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=25131; -- Crusader Jonathan
DELETE FROM `creature_template_addon` WHERE `entry` IN (28136,28137);
INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES
(28136,1,NULL), -- Crusader Jonathan
(28137,1, '50670 0'), -- Leave No One Behind Bunny
UPDATE `creature` SET `MovementType`=0,`spawndist`=0 WHERE `id`=28137; -- Incorrect movement for Leave No One Behind Bunny
[/SQL]

Great!

The quest didn’t work, so i put this fix, and now i can complete it.
But, i’ve got a problem. If time is up, and the debuff fades away, it crashs the server.