./mintrotwins.lua

  1. --[[ 
  2.  
  3. 			_____       _          _______       _            
  4. 		   |_   _|     | |        |__   __|     (_)           
  5.   _ __ ___   | |  _ __ | |_ _ __ ___ | |_      ___ _ __  ___  
  6.  | '_ ` _ \  | | | '_ \| __| '__/ _ \| \ \ /\ / / | '_ \/ __| 
  7.  | | | | | |_| |_| | | | |_| | | (_) | |\ V  V /| | | | \__ \ 
  8.  |_| |_| |_|_____|_| |_|\__|_|  \___/|_| \_/\_/ |_|_| |_|___/ 
  9. 															  
  10. 															  
  11.  
  12. 											   
  13.  
  14. --]] 
  15.  
  16. --[[ 
  17. 	mIntroTwins.lua 
  18. 	SRG Map Event Script 
  19. 	DATE: 2014-05-05 
  20. 	AUTHOR:	Kevin Tyska 
  21. ]]-- 
  22.  
  23. -- Tweakable Parameters -- 
  24. SUPERPOWER_BLAST = 3 
  25. PLAYER_SUPERPOWER_BLAST_STONE = 12 
  26.  
  27.  
  28. -------------------------------------------------------------------------------------------------- 
  29. --[[ 
  30.  
  31.    _____                            
  32.   / ____|                           
  33.  | |  __ _ __ ___  _   _ _ __  ___  
  34.  | | |_ | '__/ _ \| | | | '_ \/ __| 
  35.  | |__| | | | (_) | |_| | |_) \__ \ 
  36.   \_____|_|  \___/ \__,_| .__/|___/ 
  37. 						| |         
  38. 						|_|         
  39.  
  40. ]]-- 
  41. -------------------------------------------------------------------------------------------------- 
  42. 	mIntroTwins_group = { 
  43.  
  44. 		--HOMIE GROUPS 
  45. 		kiki_npc_combat = { 
  46. 			name = "kiki_combat_group", 
  47. 			npcs = { "kiki_combat_npc" }, 
  48. 			kiki = "kiki_combat_npc", 
  49. 		}, 
  50.  
  51. 		viola_npc_combat = { 
  52. 			name = "viola_combat_group", 
  53. 			npcs = { "viola_combat_npc" }, 
  54. 			viola = "viola_combat_npc", 
  55. 		}, 
  56.  
  57. 		--SAM GRUNTS 
  58. 		SAM_Demon_01 = { 
  59. 			name = "SAM_grunt_01", 
  60. 			sam =  "SAM_grunt<001>", 
  61. 		}, 
  62.  
  63. 		SAM_Demon_02 = { 
  64. 			name = "SAM_grunt_02", 
  65. 			sam =  "SAM_grunt<002>", 
  66. 		}, 
  67.  
  68. 		SAM_Demon_03 = { 
  69. 			name = "SAM_grunt_03", 
  70. 			sam =  "SAM_grunt<003>", 
  71. 		}, 
  72.  
  73. 		--ENEMY GROUPS 
  74. 		w1_squad_01 = { 
  75. 			name = "twins_w1_squad_01", 
  76. 			members = {	"w1_squad_01<001>", "w1_squad_01<002>" }, 
  77. 			destination = "w1_squad_01_nav", 
  78. 		}, 
  79.  
  80. 		w1_squad_02 = { 
  81. 			name = "twins_w1_squad_02", 
  82. 			members = {	"w1_squad_02<001>", "w1_squad_02<002>" }, 
  83. 		}, 
  84.  
  85. 		w1_squad_03 = { 
  86. 			name = "twins_w1_squad_03", 
  87. 			members = {	"w1_squad_03<001>", "w1_squad_03<002>" }, 
  88. 			destination = "w1_squad_03_nav", 
  89. 		}, 
  90.  
  91. 		w2_squad_01 = { 
  92. 			name = "twins_w2_squad_01", 
  93. 			members = {	"w2_squad_01<001>", "w2_squad_01<002>" }, 
  94. 		}, 
  95.  
  96. 		w2_squad_02 = { 
  97. 			name = "twins_w2_squad_02", 
  98. 			members = {	"w2_squad_02<001>"}, 
  99. 		}, 
  100.  
  101. 		w2_squad_03 = { 
  102. 			name = "twins_w2_squad_03", 
  103. 			members = {	"w2_squad_03<001>", "w2_squad_03<002>" }, 
  104. 			destination = "w2_squad_03_nav", 
  105. 		}, 
  106.  
  107. 		w2_squad_04 = { 
  108. 			name = "twins_w2_squad_04", 
  109. 			members = {	"w2_squad_02<002>" }, 
  110. 		}, 
  111.  
  112. 		w3_squad_01 = { 
  113. 			name = "twins_w3_squad_01", 
  114. 			members = {	"w3_squad_01<001>" }, 
  115. 		}, 
  116.  
  117. 		w3_squad_02 = { 
  118. 			name = "twins_w3_squad_02", 
  119. 			members = {	 "w3_squad_01<002>" }, 
  120. 		}, 
  121.  
  122. 		w4_squad_01 = { 
  123. 			name = "twins_w4_squad_01", 
  124. 			members = {	"w4_squad_01<001>", "w4_squad_01<002>", "w4_squad_01<003>" }, 
  125. 			destination = "w4_squad_01_nav", 
  126. 		}, 
  127.  
  128. 		w4_squad_02 = { 
  129. 			name = "twins_w4_squad_02", 
  130. 			members = {	"w4_squad_02<001>", "w4_squad_02<002>", "w4_squad_02<003>" }, 
  131. 			destination = "w4_squad_02_nav", 
  132. 		}, 
  133.  
  134. 		w4_boss_01 = { 
  135. 			name = "twins_w4_boss", 
  136. 			members = {	"boss<001>" }, 
  137. 		}, 
  138.  
  139. 		--ENEMY VEHICLES 
  140. 		vehicle_01 = { 
  141. 			name = "vehicle_01_group", 
  142. 			hidden = true, 
  143. 			members = { "vehicle01_troop<001>", "vehicle01_troop<002>" }, 
  144. 			vehicle = "vehicle_01", 
  145. 			path = "vehicle_01_nav", 
  146. 			thread = INVALID_THREAD_HANDLE, 
  147. 		}, 
  148.  
  149. 		vehicle_02 = { 
  150. 			name = "vehicle_02_group", 
  151. 			hidden = true, 
  152. 			members = { "vehicle02_troop<001>", "vehicle02_troop<002>" }, 
  153. 			vehicle = "vehicle_02", 
  154. 			path = "vehicle_02_nav", 
  155. 			thread = INVALID_THREAD_HANDLE, 
  156. 		}, 
  157.  
  158. 	} 
  159.  
  160. -------------------------------------------------------------------------------------------------- 
  161. --[[ 
  162.  
  163.   _   _                         _       _        
  164.  | \ | |                       (_)     | |       
  165.  |  \| | __ ___   ___ __   ___  _ _ __ | |_ ___  
  166.  | . ` |/ _` \ \ / / '_ \ / _ \| | '_ \| __/ __| 
  167.  | |\  | (_| |\ V /| |_) | (_) | | | | | |_\__ \ 
  168.  |_| \_|\__,_| \_/ | .__/ \___/|_|_| |_|\__|___/ 
  169. 				   | |                           
  170. 				   |_|                           
  171.  
  172. ]]-- 
  173. --------------------------------------------------------------------------------------------------	 
  174.  
  175. 	mIntroTwins_navpoints = { 
  176. 		 
  177. 	} 
  178. -------------------------------------------------------------------------------------------------- 
  179. --[[ 
  180.  
  181.   _______ _                        _      
  182.  |__   __| |                      | |     
  183. 	| |  | |__  _ __ ___  __ _  __| |___  
  184. 	| |  | '_ \| '__/ _ \/ _` |/ _` / __| 
  185. 	| |  | | | | | |  __/ (_| | (_| \__ \ 
  186. 	|_|  |_| |_|_|  \___|\__,_|\__,_|___/ 
  187. 										  
  188. 										  
  189. ]]-- 
  190. -------------------------------------------------------------------------------------------------- 
  191. 	mIntroTwins_thread = { 
  192.  
  193. 	} 
  194.  
  195. -------------------------------------------------------------------------------------------------- 
  196. --[[ 
  197. 				 _             _   _           _        _____        _         
  198. 	 /\         (_)           | \ | |         | |      |  __ \      | |        
  199. 	/  \   _ __  _ _ __ ___   |  \| | ___   __| | ___  | |  | | __ _| |_ __ _  
  200.    / /\ \ | '_ \| | '_ ` _ \  | . ` |/ _ \ / _` |/ _ \ | |  | |/ _` | __/ _` | 
  201.   / ____ \| | | | | | | | | | | |\  | (_) | (_| |  __/ | |__| | (_| | || (_| | 
  202.  /_/    \_\_| |_|_|_| |_| |_| |_| \_|\___/ \__,_|\___| |_____/ \__,_|\__\__,_| 
  203. 																			   
  204. ]]-- 
  205. --------------------------------------------------------------------------------------------------      
  206.  
  207. 	mIntroTwins_anim_node = { 
  208.  
  209. 	}	                                                                   
  210.  
  211. -------------------------------------------------------------------------------------------------- 
  212. --[[ 
  213.  
  214.    _____ _               _                _       _        
  215.   / ____| |             | |              (_)     | |       
  216.  | |    | |__   ___  ___| | ___ __   ___  _ _ __ | |_ ___  
  217.  | |    | '_ \ / _ \/ __| |/ / '_ \ / _ \| | '_ \| __/ __| 
  218.  | |____| | | |  __/ (__|   <| |_) | (_) | | | | | |_\__ \ 
  219.   \_____|_| |_|\___|\___|_|\_\ .__/ \___/|_|_| |_|\__|___/ 
  220. 							 | |                           
  221. 							 |_|                           
  222.  
  223. ]]-- 
  224. -------------------------------------------------------------------------------------------------- 
  225. 	mIntroTwins_checkpoint = { 
  226. 		{ 
  227. 			name = MISSION_START_CHECKPOINT,					-- Twins SAM (sam) 
  228. 			init = "mIntroTwins_sam_init", 
  229. 			run = "mIntroTwins_sam_run", 
  230. 			cleanup = "mIntroTwins_sam_cleanup", 
  231. 			next_checkpoint = "Kill_Demons", 
  232. 			host_start = "player_start_host", 
  233. 			client_start = "player_start_client", 
  234. 			p1_car_nav = "", 
  235. 			p2_car_nav = "", 
  236. 			start_groups = { }, 
  237. 			cp_only_groups = {}, 
  238. 		}, 
  239.  
  240. 		{ 
  241. 			name = "Kill_Demons",					-- First Checkpoint (kil) 
  242. 			init = "mIntroTwins_kil_init", 
  243. 			run = "mIntroTwins_kil_run", 
  244. 			cleanup = "mIntroTwins_kil_cleanup", 
  245. 			next_checkpoint = "nil", 
  246. 			host_start = "player_start_host", 
  247. 			client_start = "player_start_client", 
  248. 			p1_car_nav = "", 
  249. 			p2_car_nav = "", 
  250. 			start_groups = { mIntroTwins_group.vehicle_01, mIntroTwins_group.vehicle_02  }, 
  251. 			cp_only_groups = {}, 
  252. 		}, 
  253.  
  254. 	} 
  255. 	 
  256. -------------------------------------------------------------------------------------------------- 
  257. --[[ 
  258.  
  259.    _____      _                                 
  260.   / ____|    | |                                
  261.  | |    _   _| |_ ___  ___ ___ _ __   ___  ___  
  262.  | |   | | | | __/ __|/ __/ _ \ '_ \ / _ \/ __| 
  263.  | |___| |_| | |_\__ \ (_|  __/ | | |  __/\__ \ 
  264.   \_____\__,_|\__|___/\___\___|_| |_|\___||___/ 
  265. 											    
  266. 											    
  267. ]]-- 
  268. -------------------------------------------------------------------------------------------------- 
  269. 	mIntroTwins_scene = { 
  270. 		intro = "", 
  271. 		outro = "Bink_Twins_Aided" 
  272. 	} 
  273.  
  274. -------------------------------------------------------------------------------------------------- 
  275. --[[ 
  276.  
  277.    _____                                    _   _                  
  278.   / ____|                                  | | (_)                 
  279.  | |     ___  _ ____   _____ _ __ ___  __ _| |_ _  ___  _ __  ___  
  280.  | |    / _ \| '_ \ \ / / _ \ '__/ __|/ _` | __| |/ _ \| '_ \/ __| 
  281.  | |___| (_) | | | \ V /  __/ |  \__ \ (_| | |_| | (_) | | | \__ \ 
  282.   \_____\___/|_| |_|\_/ \___|_|  |___/\__,_|\__|_|\___/|_| |_|___/ 
  283. 																   
  284. 																   
  285. ]]-- 
  286. -------------------------------------------------------------------------------------------------- 
  287.  
  288. 	mIntroTwins_persona = {  
  289. 		Johnny = { 
  290. 			persona_name = "Johnny_Gat", 
  291. 			persona_id = INVALID_PERSONA_HANDLE 
  292. 		}, 
  293. 		Kinzie = { 
  294. 			persona_name = "Kinzie", 
  295. 			persona_id = INVALID_PERSONA_HANDLE 
  296. 		}, 
  297.  
  298. 		Kiki = { 
  299. 			persona_name = "kiki", 
  300. 			persona_id = INVALID_PERSONA_HANDLE 
  301. 		}, 
  302. 		Viola = { 
  303. 			persona_name = "suko", 
  304. 			persona_id = INVALID_PERSONA_HANDLE 
  305. 		}, 
  306.  
  307. 	} 
  308.  
  309. 	mIntroTwins_convo = { 
  310. 		--[[ = { 
  311. 			name = "file_name without voice (_bm, _wm, _bf...", 
  312. 			player_talks = true or false, 
  313. 			handle = INVALID_CONVERSATION_HANDLE, 
  314. 			convo_thread = INVALID_THREAD_HANDLE, 
  315. 			max_wait_seconds = 60,	-- if the conversation doesn't complete before this time, kill it 
  316. 			timer_thread = INVALID_THREAD_HANDLE, 
  317. 			priority = CONVO_PRIORITY_HIGH or CONVO_PRIORITY_NORMAL or CONVO_PRIORITY_OPTIONAL 
  318. 			(optional) persona_line = true,	-- this is a single line 
  319. 			(required if persona_line) speaker_name = "name of speaker",	-- single line speaker (might be set before call to play is made?) 
  320. 			(optional)phone_call = true,  -- this is a phone conversation (phone persona must be preloaded) 
  321. 			(required if phone_call) receiving_call = true or false  -- auto-answer is always true in missions (until proven otherwise) 
  322. 			 
  323. 		},]] 
  324. 		Gat_Convo_A = { 
  325. 			name = "mIntroTwins_Con_Gat_A", 
  326. 			player_talks = false, 
  327. 			handle = INVALID_CONVERSATION_HANDLE, 
  328. 			convo_thread = INVALID_THREAD_HANDLE, 
  329. 			max_wait_seconds = 60, 
  330. 			timer_thread = INVALID_THREAD_HANDLE, 
  331. 			priority = CONVO_PRIORITY_NORMAL, 
  332. 		},			 
  333.  
  334. 		Gat_Convo_B = { 
  335. 			name = "mIntroTwins_Con_Gat_B",  
  336. 			player_talks = false, 
  337. 			handle = INVALID_CONVERSATION_HANDLE, 
  338. 			convo_thread = INVALID_THREAD_HANDLE, 
  339. 			max_wait_seconds = 60, 
  340. 			timer_thread = INVALID_THREAD_HANDLE, 
  341. 			priority = CONVO_PRIORITY_NORMAL, 
  342. 		}, 
  343.  
  344. 		Kinzie_Convo_A = { 
  345. 			name = "mIntroTwins_Con_Kinzie_A",  
  346. 			player_talks = false, 
  347. 			handle = INVALID_CONVERSATION_HANDLE, 
  348. 			convo_thread = INVALID_THREAD_HANDLE, 
  349. 			max_wait_seconds = 60, 
  350. 			timer_thread = INVALID_THREAD_HANDLE, 
  351. 			priority = CONVO_PRIORITY_NORMAL, 
  352. 		}, 
  353. 		 
  354. 		Kinzie_Convo_B = { 
  355. 			name = "mIntroTwins_Con_Kinzie_B",  
  356. 			player_talks = false, 
  357. 			handle = INVALID_CONVERSATION_HANDLE, 
  358. 			convo_thread = INVALID_THREAD_HANDLE, 
  359. 			max_wait_seconds = 60, 
  360. 			timer_thread = INVALID_THREAD_HANDLE, 
  361. 			priority = CONVO_PRIORITY_NORMAL, 
  362. 		}, 
  363.  
  364. 		Grant_Power = { 
  365. 			name = "mIntroTwins_grant_power",  
  366. 			player_talks = false, 
  367. 			handle = INVALID_CONVERSATION_HANDLE, 
  368. 			convo_thread = INVALID_THREAD_HANDLE, 
  369. 			max_wait_seconds = 60, 
  370. 			timer_thread = INVALID_THREAD_HANDLE, 
  371. 			priority = CONVO_PRIORITY_NORMAL, 
  372. 		}, 
  373. 		 
  374. 		Gat_End = { 
  375. 			name = "mIntroTwins_End_Gat",  
  376. 			player_talks = false, 
  377. 			handle = INVALID_CONVERSATION_HANDLE, 
  378. 			convo_thread = INVALID_THREAD_HANDLE, 
  379. 			max_wait_seconds = 60, 
  380. 			timer_thread = INVALID_THREAD_HANDLE, 
  381. 			priority = CONVO_PRIORITY_NORMAL, 
  382. 		}, 
  383.  
  384. 		Kinzie_End = { 
  385. 			name = "mIntroTwins_End_Kinzie",  
  386. 			player_talks = false, 
  387. 			handle = INVALID_CONVERSATION_HANDLE, 
  388. 			convo_thread = INVALID_THREAD_HANDLE, 
  389. 			max_wait_seconds = 60, 
  390. 			timer_thread = INVALID_THREAD_HANDLE, 
  391. 			priority = CONVO_PRIORITY_NORMAL, 
  392. 		},	 
  393.  
  394.  
  395. 	} 
  396. 	 
  397. 	mIntroTwins_convo_queue = { 
  398. 		--[[start_drive_queue = {  
  399. 			{ delay = 2.0, convo = mIntroTwins_convo.goto_first_checkpoint_nav }, 
  400. 			{ delay = 4.0, convo = mIntroTwins_convo.goto_first_checkpoint_nav2 }, 
  401. 			{ delay = 3.0, convo = mIntroTwins_convo.goto_first_checkpoint_nav3 }, 
  402. 			{ delay = 5.0, convo = mIntroTwins_convo.goto_first_checkpoint_nav4 } 
  403. 		}, 
  404. 		]]-- 
  405. 	} 
  406. 	 
  407. -------------------------------------------------------------------------------------------------- 
  408. --[[ 
  409.  
  410.   _______   _                            
  411.  |__   __| (_)                           
  412. 	| |_ __ _  __ _  __ _  ___ _ __ ___  
  413. 	| | '__| |/ _` |/ _` |/ _ \ '__/ __| 
  414. 	| | |  | | (_| | (_| |  __/ |  \__ \ 
  415. 	|_|_|  |_|\__, |\__, |\___|_|  |___/ 
  416. 			   __/ | __/ |               
  417. 			  |___/ |___/                
  418.  
  419. ]]-- 
  420. -------------------------------------------------------------------------------------------------- 
  421. 	mIntroTwins_trigger = { 
  422. 		-- = { 
  423. 		--	name = "_trigger", 
  424. 		--	hit = false, 
  425. 		-- 	last_hit_by = nil, -- 	last_hit_human = nil (set to the last human to enter the trigger in the default trigger callback) 
  426. 		--  (optional)callback = "mIntroTwins_function_name_cb" 
  427. 		--	(optional)marker = TRIGGER_LOCATION or TRIGGER_USE or custom or don't include for no marker 
  428. 		--  (optional)waypoint = true, 
  429. 		--  (optional)teleport_to = { 
  430. 		--						host = "host_nav", 
  431. 		--						client = "client_nav"  
  432. 		--					},		 
  433. 		--	(optional)conversation = mIntroTwins_convo.convo_name  -- play a conversation 
  434. 		--	(optional)next_trigger = "next_trigger_name" sets up next trigger when triggered (breadcrumbs) 
  435. 		--}, 
  436. 		 
  437.  
  438. 	} 
  439. 	 
  440. -------------------------------------------------------------------------------------------------- 
  441. 																	  --[[ INTERROGATION DATA ]]-- 
  442. -------------------------------------------------------------------------------------------------- 
  443. 	--mIntroTwins_interrogate = { 
  444. 	--	leader = { 
  445. 	--		target = mIntroTwins_group.friendly_fire.owner, 
  446. 	--		persona = "Interrogation", 
  447. 	--		objective = "mIntroTwins_INTERROGATE_OWNER", 
  448. 	--	--	(optional)conversation = mIntroTwins_convo.convo_name  -- play a conversation while interrogating 
  449. 	--	}, 
  450. 	--} 
  451. 		 
  452. -------------------------------------------------------------------------------------------------- 
  453. --[[ 
  454.  
  455.    ____  _   _                
  456.   / __ \| | | |               
  457.  | |  | | |_| |__   ___ _ __  
  458.  | |  | | __| '_ \ / _ \ '__| 
  459.  | |__| | |_| | | |  __/ |    
  460.   \____/ \__|_| |_|\___|_|    
  461. 							  
  462. 							  
  463. ]]-- 
  464. -------------------------------------------------------------------------------------------------- 
  465.  
  466. 	mIntroTwins_homie = { 
  467. 			viola = "", 
  468. 			kiki = "", 
  469. 	} 
  470. 	 
  471. 	mIntroTwins_tweakables = { 
  472.  
  473. 	} 
  474.  
  475. 	mIntroTwins_players = {} 
  476.  
  477. 	mIntroTwins_runtime = { 
  478. 		cerberus_sam_complete = false, 
  479. 	} 
  480.  
  481. 	mIntroTwins_VFX = 
  482. 	{ 
  483. 		power_up = { name = "vfx_Altars_PowerUp", handle = "" }, 
  484. 	} 
  485.  
  486.  
  487. -------------------------------------------------------------------------------------------------- 
  488. --[[ 
  489.  
  490.    _____ _                  _               _   ______                _   _                  
  491.   / ____| |                | |             | | |  ____|              | | (_)                 
  492.  | (___ | |_ __ _ _ __   __| | __ _ _ __ __| | | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  493.   \___ \| __/ _` | '_ \ / _` |/ _` | '__/ _` | |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  494.   ____) | || (_| | | | | (_| | (_| | | | (_| | | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  495.  |_____/ \__\__,_|_| |_|\__,_|\__,_|_|  \__,_| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  496. 																							 
  497. 																							 
  498. ]]-- 
  499.  
  500. -- This is the primary entry point for the mission, and is responsible for starting up the mission 
  501. -- at the specified checkpoint. 
  502. -- CALLED FROM CODE 
  503. -- 
  504. -- start_checkpoint_name:	(string) The checkpoint the mission should begin at 
  505. -- is_restart:					(bool) TRUE if the mission is restarting, FALSE otherwise 
  506. -- 
  507. function mIntroTwins_start(start_checkpoint_name, is_restart) 
  508.  
  509.  
  510. 	mission_start_fade_out(0.0) 
  511.  
  512.  
  513. 	-- initialize systems 
  514. 	mission_startup(mIntroTwins_trigger, mIntroTwins_convo) -- mIntroTwins_checkpoint 
  515. 	 
  516. 	-- HVS_BDF: we don't necessarily want to call load_persona() because this creates a 2D 
  517. 	-- version, which can prevent actual in-game characters from lip syncing their VO if 
  518. 	-- the 2D persona was loaded prior to their character being spawned. 
  519. 	-- In the case of PC characters, they are present in the world and their characters should lip sync their VO. 
  520. 	--load_persona(mIntro_persona.Johnny) 
  521. 	--load_persona(mIntro_persona.Kinzie) 
  522.  
  523. 	-- if using interrogations 
  524. 	--interrogate_startup(mIntroTwins_interrogate) 
  525. 	 
  526. 	local start_cp = get_table_by_name(mIntroTwins_checkpoint, MISSION_START_CHECKPOINT) 
  527.  
  528. 	-- TEMPORARY: give player approximate loadout of weapons & superpowers 
  529. 	-- TODO: remove this before the game ships!!! 
  530. 	--hvUnlockLoadout("mIntroTwins") 
  531.  
  532. 	-- Check if this mission starting from the beginning 
  533. 	if (start_checkpoint_name == start_cp.name) then 
  534. 		if (is_restart == false and mIntroTwins_scene.intro ~= "") then 
  535. 			-- First time playing mission 
  536. 			local fade_in_after = false 
  537. 			audio_object_post_event("Play_IntroTwins_SamSFX") 
  538. 			cutscene_play(mIntroTwins_scene.intro, nil, {start_cp.host_start, start_cp.client_start}, fade_in_after) 
  539. 		else 
  540. 			teleport_coop(start_cp.host_start, start_cp.client_start, true) 
  541. 		end 
  542. 		fade_out(0) 
  543. 	end 
  544.  
  545. 	-- Handle mission initialization for the current checkpoint 
  546. 	mIntroTwins_initialize(start_checkpoint_name) 
  547.  
  548. 	-- Run the mission from the current checkpoint 
  549. 	checkpoint_run_mission(mIntroTwins_checkpoint, start_checkpoint_name) 
  550. 	 
  551. 	mission_end_success("mIntroTwins") --, mIntroTwins_scene.outro, {"player_start_host", "player_start_client"}) 
  552. end 
  553.  
  554. -- This is the primary function responsible for cleaning up the entire mission 
  555. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  556. -- 
  557. function mIntroTwins_cleanup() 
  558. 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]-- 
  559.  
  560. 	 
  561. 	-- cleanup all threads 
  562. 	cleanup_threads(mIntroTwins_thread) 
  563. 	 
  564. 	-- run checkpoint cleanups (move into mission_shutdown?) 
  565. 	checkpoint_cleanup_mission(mIntroTwins_checkpoint) 
  566. 	 
  567. 	-- cleanup triggers, convos, kill_list and interrogations 
  568. 	mission_shutdown() 
  569. 	 
  570. 	-- cleanup all groups 
  571. 	cleanup_groups(mIntroTwins_group) 
  572.  
  573. 	--return normal player jump/sprint values 
  574. 	notoriety_set_min_and_max("police", 0, MAX_NOTORIETY_LEVEL) 
  575.  
  576.  
  577. 	mIntroTwins_safe_thread_kill( mIntroTwins_group.vehicle_01.thread ) 
  578. 	mIntroTwins_safe_thread_kill( mIntroTwins_group.vehicle_02.thread ) 
  579.  
  580. 	for i, player in pairs( mIntroTwins_players ) do 
  581. 		player_warp_to_shore_enable( player ) 
  582. 	end 
  583.  
  584.  
  585. 	spawning_allow_cop_ambient_spawns(true) 
  586.  
  587.     on_seamless_animated_moment_end("") 
  588.     seamless_animated_moment_cleanup() 
  589.  
  590. 	if not mission_is_failed() then 
  591. 		player_unlock_super_power( SUPERPOWER_BLAST, LOCAL_PLAYER, true ) 
  592. 		if coop_is_active() then 
  593. 			player_unlock_super_power( SUPERPOWER_BLAST, REMOTE_PLAYER, true ) 
  594. 		end 
  595. 	end 
  596.  
  597. end 
  598.  
  599. -- Called when the mission has ended with success 
  600. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  601. -- 
  602. function mIntroTwins_success() 
  603. 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
  604. 	-- Equip the superpower if we finished successfully 
  605. 	player_super_power_select( "freeze", SYNC_ALL, "blast_stone" ) 
  606. end 
  607.  
  608. -------------------------------------------------------------------------------------------------- 
  609. --[[ 
  610.  
  611.  
  612.   _____       _ _   _       _ _           ______                _   _                  
  613.  |_   _|     (_) | (_)     | (_)         |  ____|              | | (_)                 
  614.    | |  _ __  _| |_ _  __ _| |_ _______  | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  615.    | | | '_ \| | __| |/ _` | | |_  / _ \ |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  616.   _| |_| | | | | |_| | (_| | | |/ /  __/ | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  617.  |_____|_| |_|_|\__|_|\__,_|_|_/___\___| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  618. 																					   
  619. 																					   
  620. ]]-- 
  621.  
  622. -- Initialize the mission for the specified checkpoint 
  623. -- 
  624. -- checkpoint_name:		(string) Checkpoint to initialize the mission to 
  625. -- 
  626. function mIntroTwins_initialize(checkpoint_name) 
  627. 	-- Common initialization 
  628. 	mIntroTwins_initialize_common() 
  629.  
  630. 	-- Get the player names 
  631. 	mIntroTwins_players = player_names_get_all() 
  632. 		 
  633. 	-- Checkpoint specific initialization 
  634. 	checkpoint_init(mIntroTwins_checkpoint, checkpoint_name) 
  635.  
  636. 	-- Remove any present subtitles 
  637. 	message_remove_all() 
  638.  
  639. 	-- Start fading in  
  640. 	mission_start_fade_in() 
  641. 	 
  642. 	 
  643. end 
  644.  
  645. -- Handle any common initialization 
  646. -- 
  647. function mIntroTwins_initialize_common() 
  648. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  649. 	notoriety_set_min_and_max("police", 0, 1) 
  650. 	 
  651. 	spawning_allow_cop_ambient_spawns(false) 
  652.  
  653. end 
  654.  
  655. -------------------------------------------------------------------------------------------------- 
  656. --[[ 
  657.  
  658.  
  659.    _____ _               _                _       _     ______                _   _                  
  660.   / ____| |             | |              (_)     | |   |  ____|              | | (_)                 
  661.  | |    | |__   ___  ___| | ___ __   ___  _ _ __ | |_  | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  662.  | |    | '_ \ / _ \/ __| |/ / '_ \ / _ \| | '_ \| __| |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  663.  | |____| | | |  __/ (__|   <| |_) | (_) | | | | | |_  | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  664.   \_____|_| |_|\___|\___|_|\_\ .__/ \___/|_|_| |_|\__| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  665. 							 | |                                                                     
  666. 							 |_|                                                                     
  667.  
  668. ]]-- 
  669. -------------------------------------------------------------------------------------------------- 
  670. -------------------------------------------------------------------------------------------------- 
  671. --[[ 
  672.   _  ___ _ _   _____                                  
  673.  | |/ (_) | | |  __ \                                 
  674.  | ' / _| | | | |  | | ___ _ __ ___   ___  _ __  ___  
  675.  |  < | | | | | |  | |/ _ \ '_ ` _ \ / _ \| '_ \/ __| 
  676.  | . \| | | | | |__| |  __/ | | | | | (_) | | | \__ \ 
  677.  |_|\_\_|_|_| |_____/ \___|_| |_| |_|\___/|_| |_|___/ 
  678. 													  
  679. 		   
  680. ]]-- 
  681. -------------------------------------------------------------------------------------------------- 
  682.  
  683. -- Initialize this checkpoint. 
  684. -- 
  685. -- mission_start: (bool) Whether we're initializing from a mission (re)start or from 
  686. --					a natural play-through. 
  687. -- 
  688.  
  689. -- 
  690. function mIntroTwins_sam_init(mission_start) 
  691.  
  692. 	fade_out(0.0)	 
  693. 		 
  694. 	-- HVS_BDF: moved the spawning of the demons before Kiki and Viola, as there were 
  695. 	-- strange timing issues on the client that were causing certain demons to be  
  696. 	-- NULL during the prep and play phases. 
  697. 	group_create( mIntroTwins_group.SAM_Demon_01.name, true ) 
  698. 	group_create( mIntroTwins_group.SAM_Demon_02.name, true ) 
  699. 	group_create( mIntroTwins_group.SAM_Demon_03.name, true ) 
  700.  
  701. 	--Cerberus SAM 
  702. 	group_create( mIntroTwins_group.kiki_npc_combat.name, true ) 
  703. 	turn_invulnerable( mIntroTwins_group.kiki_npc_combat.npcs[1] ) 
  704. 	character_set_never_catch_fire(mIntroTwins_group.kiki_npc_combat.npcs[1]) 
  705.  
  706. 	group_create( mIntroTwins_group.viola_npc_combat.name, true ) 
  707. 	turn_invulnerable( mIntroTwins_group.viola_npc_combat.npcs[1] ) 
  708. 	character_set_never_catch_fire(mIntroTwins_group.viola_npc_combat.npcs[1]) 
  709.  
  710. 	 
  711. 	on_seamless_animated_moment_end("SAM_Cerberus_complete") 
  712.  
  713. 	local actor_list = { mIntroTwins_group.viola_npc_combat.viola, mIntroTwins_group.SAM_Demon_01.sam, mIntroTwins_group.SAM_Demon_02.sam, mIntroTwins_group.SAM_Demon_03.sam, LOCAL_PLAYER, mIntroTwins_group.kiki_npc_combat.kiki } 
  714. 	seamless_animated_moment_prep("SAM_Cerberus", actor_list) 
  715. 	seamless_animated_moment_start("SAM_Cerberus", actor_list) 
  716. 	audio_object_post_event("Play_IntroTwins_SamSFX") 
  717. 	audio_object_post_event("Play_TwinsMusic") 
  718.  
  719. 	fade_in(0.2) 
  720.  
  721. 	--Wait until the SAM has completed 
  722.     while(mIntroTwins_runtime.cerberus_sam_complete == false) do 
  723.          thread_yield() 
  724. 	end 
  725.  
  726. 	on_seamless_animated_moment_end("") 
  727.  
  728. end 
  729. 								 
  730. -- The next objective 
  731. -- 
  732. function mIntroTwins_sam_run() 
  733.  
  734. 	objective_text_clear(0) 
  735.  
  736. end 
  737.  
  738. -- Do any cleanup for this checkpoint. 
  739. -- 
  740. -- (+++THIS IS CALLED FROM MISSION CLEANUP, MUST RETURN IMMEDIATELY+++) 
  741. -- 
  742. -- mission_exit: (bool) Whether we're exiting the mission entirely, or just 
  743. --					moving on to the next checkpoint. 
  744. -- 
  745. function mIntroTwins_sam_cleanup(mission_exit) 
  746.  
  747. 	if mission_exit then 
  748.  
  749. 	end 
  750.  
  751. end 
  752.  
  753. function mIntroTwins_kil_init(mission_start) 
  754. 		 
  755. 	if mission_start then 
  756.  
  757. 		group_create( mIntroTwins_group.kiki_npc_combat.name, true ) 
  758. 		turn_invulnerable( mIntroTwins_group.kiki_npc_combat.npcs[1] ) 
  759. 		character_set_never_catch_fire(mIntroTwins_group.kiki_npc_combat.npcs[1]) 
  760.  
  761. 		group_create( mIntroTwins_group.viola_npc_combat.name, true ) 
  762. 		turn_invulnerable( mIntroTwins_group.viola_npc_combat.npcs[1] ) 
  763. 		character_set_never_catch_fire(mIntroTwins_group.viola_npc_combat.npcs[1]) 
  764.  
  765. 		group_create( mIntroTwins_group.SAM_Demon_01.name, true ) 
  766. 		group_create( mIntroTwins_group.SAM_Demon_02.name, true ) 
  767. 		group_create( mIntroTwins_group.SAM_Demon_03.name, true ) 
  768. 		 
  769. 		audio_object_post_event("Play_TwinsMusic") 
  770.  
  771. 	end 
  772.  
  773. end 
  774. 								 
  775. -- The next objective 
  776. -- 
  777. function mIntroTwins_kil_run() 
  778.  
  779. 	party_allow_max_followers(true) 
  780.  
  781. 	mIntroTwins_setup_homies ( mIntroTwins_group.kiki_npc_combat ) 
  782. 	set_suppress_synced_attacks_flag(mIntroTwins_group.kiki_npc_combat.kiki, true) 
  783. 	set_gibbable(mIntroTwins_group.kiki_npc_combat.kiki, false) 
  784. 	turn_invulnerable(mIntroTwins_group.kiki_npc_combat.kiki) 
  785.  
  786. 	mIntroTwins_setup_homies ( mIntroTwins_group.viola_npc_combat ) 
  787. 	set_suppress_synced_attacks_flag(mIntroTwins_group.viola_npc_combat.viola, true) 
  788. 	set_gibbable(mIntroTwins_group.viola_npc_combat.viola, false) 
  789. 	turn_invulnerable(mIntroTwins_group.viola_npc_combat.viola) 
  790.  
  791. 	npc_leash_to_nav( mIntroTwins_homie.kiki, "leash_kiki", 75) 
  792. 	npc_leash_to_nav( mIntroTwins_homie.viola, "leash_viola", 75) 
  793.  
  794. 	notoriety_set_min_and_max("police", 1, 1) 
  795.  
  796. 	-- Disable warp to shore  
  797. 	for i, player in pairs( mIntroTwins_players ) do 
  798. 		player_warp_to_shore_disable( player ) 
  799. 	end 
  800.  
  801. 	-- if player is johnny, play johnny line. If not, play kinzie line 
  802. 	if character_get_anim_set(LOCAL_PLAYER) == "PLYM" then 
  803. 		convo_start(mIntroTwins_convo.Gat_Convo_A) 
  804. 	else 
  805. 		convo_start(mIntroTwins_convo.Kinzie_Convo_A) 
  806. 	end 
  807.  
  808. 	--HVS_BAS - so we have an issue in coop that the remote player can leave the area, which is bad 
  809. 	--SO for coop, lets give him a follower so we cant just abandon them. 
  810. 	--also, we want to do this after all the flags and such are set, because  
  811. 	--we dont want to flood the network, since the remote player will own  
  812. 	--viola from here on out. 
  813. 	if coop_is_active() then 
  814. 		party_add(mIntroTwins_homie.viola, REMOTE_PLAYER) 
  815. 	else 
  816. 		party_add(mIntroTwins_homie.viola, LOCAL_PLAYER) 
  817. 	end 
  818.  
  819. 	--WAVE 01 
  820.  
  821. 	mIntroTwins_attack(mIntroTwins_group.w1_squad_01) 
  822. 	mIntroTwins_attack(mIntroTwins_group.w1_squad_03) 
  823. 	group_create( mIntroTwins_group.w1_squad_02.name, true ) 
  824.  
  825. 	--mIntroTwins_tank_start(mIntroTwins_group.tank_01) 
  826.  
  827. 	objective_text( 0, "", "GM_INTRO_KILL_DEMONS", "", SYNC_ALL, OI_ASSET_KILL ) 
  828.  
  829. 	kill_list_add( mIntroTwins_group.w1_squad_02.members, OI_ASSET_KILL ) 
  830. 	kill_list_add( mIntroTwins_group.SAM_Demon_01.sam, OI_ASSET_KILL ) 
  831. 	kill_list_add( mIntroTwins_group.SAM_Demon_02.sam, OI_ASSET_KILL ) 
  832. 	kill_list_add( mIntroTwins_group.SAM_Demon_03.sam, OI_ASSET_KILL ) 
  833.  
  834. 	kill_list_wait_for_complete() 
  835.  
  836. 	--WAVE 02 
  837. 	delay(3.5) 
  838.  
  839. 	--group_create( mIntroTwins_group.w2_squad_01.name, true ) 
  840. 	group_create( mIntroTwins_group.w2_squad_02.name, true ) 
  841. 	group_create( mIntroTwins_group.w2_squad_04.name, true ) 
  842. 	npc_leash_to_nav( mIntroTwins_group.w2_squad_02.members[1], "flight_nav<001>", 15.0) 
  843. 	npc_leash_to_nav( mIntroTwins_group.w2_squad_04.members[1], "flight_nav<002>", 15.0) 
  844.  
  845. 	mIntroTwins_attack(mIntroTwins_group.w2_squad_03) 
  846.  
  847. 	--kill_list_add( mIntroTwins_group.w2_squad_01.members, OI_ASSET_KILL ) 
  848. 	kill_list_add( mIntroTwins_group.w2_squad_02.members, OI_ASSET_KILL ) 
  849. 	kill_list_add( mIntroTwins_group.w2_squad_04.members, OI_ASSET_KILL ) 
  850. 	delay(2.5) 
  851.  
  852. 	mIntroTwins_vehicle_start(mIntroTwins_group.vehicle_01) 
  853.  
  854. 	kill_list_wait_for_complete() 
  855.  
  856. 	--WAVE 03 
  857.  
  858. 	-- if player is johnny, play johnny line. If not, play kinzie line 
  859. 	if character_get_anim_set(LOCAL_PLAYER) == "PLYM" then 
  860. 		convo_start(mIntroTwins_convo.Gat_Convo_B) 
  861. 	else 
  862. 		convo_start(mIntroTwins_convo.Kinzie_Convo_B) 
  863. 	end 
  864.  
  865. 	convo_wait_for_end() 
  866.  
  867. 	group_create( mIntroTwins_group.w3_squad_01.name, true ) 
  868. 	group_create( mIntroTwins_group.w3_squad_02.name, true ) 
  869. 	npc_leash_to_nav( mIntroTwins_group.w3_squad_01.members[1], "flight_nav<003>", 15.0) 
  870. 	npc_leash_to_nav( mIntroTwins_group.w3_squad_02.members[1], "flight_nav<004>", 15.0) 
  871. 	kill_list_add( mIntroTwins_group.w3_squad_01.members, OI_ASSET_KILL ) 
  872. 	kill_list_add( mIntroTwins_group.w3_squad_02.members, OI_ASSET_KILL ) 
  873.  
  874. 	delay(2.0) 
  875.  
  876. 	mIntroTwins_vehicle_start(mIntroTwins_group.vehicle_02) 
  877.  
  878.  
  879. 	kill_list_wait_for_complete() 
  880.  
  881. 	--WAVE 04 
  882. 	group_create( mIntroTwins_group.w4_boss_01.name, true ) 
  883. 	kill_list_add( mIntroTwins_group.w4_boss_01.members, OI_ASSET_KILL_FULL ) 
  884.  
  885. 	mIntroTwins_attack(mIntroTwins_group.w4_squad_01) 
  886. 	mIntroTwins_attack(mIntroTwins_group.w4_squad_02) 
  887.  
  888. 	kill_list_wait_for_complete() 
  889.  
  890. 	delay(1.0) 
  891.  
  892. 	objective_text_clear(0) 
  893.  
  894. 	-- if player is johnny, play johnny line. If not, play kinzie line 
  895. 	if character_get_anim_set(LOCAL_PLAYER) == "PLYM" then 
  896. 		convo_start(mIntroTwins_convo.Gat_End) 
  897. 	else 
  898. 		convo_start(mIntroTwins_convo.Kinzie_End) 
  899. 	end	 
  900.  
  901. 	convo_wait_for_end() 
  902.  
  903. 	player_controls_disable(LOCAL_PLAYER) 
  904. 	if coop_is_active() then 
  905. 		player_controls_enable(REMOTE_PLAYER) 
  906. 	end 
  907. 	cutscene_play(mIntroTwins_scene.outro, nil, {"player_start_host", "player_start_client"}, true ) 
  908.  
  909.  
  910. 	teleport( mIntroTwins_homie.kiki, "kiki_nav") 
  911. 	teleport( mIntroTwins_homie.viola, "viola_nav") 
  912.  
  913. 	npc_leash_remove( mIntroTwins_homie.kiki ) 
  914. 	npc_leash_remove( mIntroTwins_homie.viola ) 
  915. 	npc_leash_to_nav( mIntroTwins_homie.kiki, "kiki_nav", 1) 
  916. 	npc_leash_to_nav( mIntroTwins_homie.viola, "viola_nav", 1) 
  917.  
  918. 	party_dismiss(mIntroTwins_homie.kiki) 
  919. 	party_dismiss(mIntroTwins_homie.viola) 
  920.  
  921. 	if cutscene_check_exiting() then 
  922. 		thread_yield()		 
  923. 	end 
  924. 	convo_start(mIntroTwins_convo.Grant_Power) 
  925.  
  926. 	delay(2.5) 
  927. 		-- Have player(s) fully power up (non-blocking) 
  928. 	local anim_name = "altars_powerup" 
  929. 	local morph_name = anim_name 
  930. 	local force_play = false 
  931. 	local stand_still = true 
  932. 	local zero_movement = true 
  933. 	effect_play_on_human( mIntroTwins_VFX.power_up.name, LOCAL_PLAYER, "spine2" ) 
  934. 	action_play_non_blocking(LOCAL_PLAYER, anim_name, morph_name, force_play, stand_still, zero_movement, "player_start_host" ) 
  935. 	if coop_is_active() then 
  936. 		effect_play_on_human( mIntroTwins_VFX.power_up.name, REMOTE_PLAYER, "spine2"  ) 
  937. 		action_play_non_blocking(REMOTE_PLAYER, anim_name, morph_name, force_play, stand_still, zero_movement, "player_start_client" ) 
  938. 	end 
  939.  
  940. 	-- Wait for player to react 
  941. 	delay(6) 
  942.  
  943. 	fade_out(1) 
  944. 	fade_out_block() 
  945. 	player_super_power_select( "freeze", SYNC_ALL, "blast_stone" ) 
  946. 	force_spawn_contacts() 
  947.  
  948. end 
  949.  
  950. -- Do any cleanup for this checkpoint. 
  951. -- 
  952. -- (+++THIS IS CALLED FROM MISSION CLEANUP, MUST RETURN IMMEDIATELY+++) 
  953. -- 
  954. -- mission_exit: (bool) Whether we're exiting the mission entirely, or just 
  955. --					moving on to the next checkpoint. 
  956. -- 
  957. function mIntroTwins_kil_cleanup(mission_exit) 
  958.  
  959. 	if mission_exit then 
  960. 		mIntroTwins_cleanup_homies()	 
  961. 		party_allow_max_followers(false) 
  962. 		 
  963. 		--player_unlock_element( PLAYER_SUPERPOWER_BLAST_STONE ) 
  964. 		player_super_attacks_enable( true )	 
  965. 	end 
  966.  
  967. end 
  968.  
  969. ------------------------------------ 
  970. -- 
  971. -- Checkpoint helper functions 
  972. -- 
  973. ------------------------------------ 
  974. function mIntroTwins_tank_start(group_table) 
  975. 	vehicle_enter_group_teleport(group_table.members, group_table.vehicle) 
  976. 	group_show(group_table.name, true) 
  977. 	group_table.thread = thread_new( "mIntroTwins_tank" , group_table)	 
  978. 	kill_list_add( group_table.members, OI_ASSET_KILL)	 
  979. end 
  980.  
  981. function mIntroTwins_vehicle_start(group_table) 
  982. 	vehicle_enter_group_teleport(group_table.members, group_table.vehicle) 
  983. 	group_show(group_table.name, true) 
  984. 	group_table.thread = thread_new( "mIntroTwins_vehicle" , group_table) 
  985. 	kill_list_add( group_table.members, OI_ASSET_KILL)	 
  986. end 
  987.  
  988. ------------------------------------ 
  989. -- 
  990. -- Checkpoint callback functions 
  991. -- 
  992. ------------------------------------ 
  993.  
  994. function SAM_Cerberus_complete() 
  995. 	mIntroTwins_runtime.cerberus_sam_complete = true 
  996. end 
  997.  
  998. ------------------------------------ 
  999. -- 
  1000. -- Checkpoint thread functions 
  1001. -- 
  1002. ------------------------------------ 
  1003. function mIntroTwins_tank(car_table) 
  1004. 	local use_navmesh = true 
  1005. 	vehicle_pathfind_to(car_table.vehicle, car_table.path, use_navmesh) 
  1006. end 
  1007.  
  1008. function mIntroTwins_vehicle(car_table) 
  1009. 	local use_navmesh = true 
  1010. 	vehicle_max_speed(car_table.vehicle, 60) 
  1011. 	vehicle_pathfind_to(car_table.vehicle, car_table.path, use_navmesh) 
  1012. 	vehicle_exit_group(car_table.members) 
  1013. end 
  1014.  
  1015. -------------------------------------------------------------------------------------------------- 
  1016. --[[ 
  1017.  
  1018.    _____                                        ______                _   _                  
  1019.   / ____|                                      |  ____|              | | (_)                 
  1020.  | |     ___  _ __ ___  _ __ ___   ___  _ __   | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  1021.  | |    / _ \| '_ ` _ \| '_ ` _ \ / _ \| '_ \  |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  1022.  | |___| (_) | | | | | | | | | | | (_) | | | | | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  1023.   \_____\___/|_| |_| |_|_| |_| |_|\___/|_| |_| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  1024. 																							 
  1025. 																							 
  1026. ]]-- 
  1027.  
  1028. function mIntroTwins_setup_homies ( homie_group ) 
  1029. 	if homie_group.kiki ~= nil and homie_group.kiki ~= "" then 
  1030. 		mIntroTwins_homie.kiki = homie_group.kiki 
  1031. 		party_add(mIntroTwins_homie.kiki, LOCAL_PLAYER) 
  1032. 		follower_set_can_abandon( mIntroTwins_homie.kiki, true ) 
  1033. 		on_death ( "mIntroTwins_failure_kiki_died_cb", mIntroTwins_homie.kiki ) 
  1034. 		on_dismiss ( "mIntroTwins_failure_dismissed_cb", mIntroTwins_homie.kiki ) 
  1035. 		party_set_dismissable(false) 
  1036. 		--npc_super_powers_enable(mIntroTwins_homie.kiki) 
  1037. 		--ai_set_super_attack_cool_down(mIntroTwins_homie.kiki,20) 
  1038. 		--ai_set_preferred_super_attack(mIntroTwins_homie.kiki,"super energy blast") 
  1039. 	end 
  1040.  
  1041. 	if homie_group.viola ~= nil and homie_group.viola ~= "" then 
  1042. 		mIntroTwins_homie.viola = homie_group.viola 
  1043. 		 
  1044. 		 
  1045. 		follower_set_can_abandon( mIntroTwins_homie.viola, true ) 
  1046. 		on_death ( "mIntroTwins_failure_viola_died_cb", mIntroTwins_homie.viola ) 
  1047. 		on_dismiss ( "mIntroTwins_failure_dismissed_cb", mIntroTwins_homie.viola ) 
  1048. 		party_set_dismissable(false) 
  1049. 		--npc_super_powers_enable(mIntroTwins_homie.viola) 
  1050. 		--ai_set_super_attack_cool_down(mIntroTwins_homie.viola,20) 
  1051. 		--ai_set_preferred_super_attack(mIntroTwins_homie.viola,"super energy blast") 
  1052. 	end 
  1053. 	 
  1054. end 
  1055.  
  1056. function mIntroTwins_cleanup_homies() 
  1057. 	if mIntroTwins_homie.kiki ~= nil and mIntroTwins_homie.kiki ~= "" then 
  1058. 		on_death("", mIntroTwins_homie.kiki) 
  1059. 		on_dismiss("", mIntroTwins_homie.kiki) 
  1060. 	end 
  1061.  
  1062. 	if mIntroTwins_homie.viola ~= nil and mIntroTwins_homie.viola ~= "" then 
  1063. 		on_death("", mIntroTwins_homie.viola) 
  1064. 		on_dismiss("", mIntroTwins_homie.viola) 
  1065. 	end 
  1066. 	 
  1067. end 
  1068.  
  1069. --Reinforcement spawn 
  1070. function mIntroTwins_attack(group) 
  1071. 	local block = true 
  1072. 	local should_run = true 
  1073. 	local should_fire = false 
  1074. 	group_create( group.name, true, block ) 
  1075. 	for index, npc in pairs( group.members ) do 
  1076. 		ai_do_scripted_move( npc, group.destination, should_run, should_fire ) 
  1077. 		kill_list_add( group.members, OI_ASSET_KILL) 
  1078. 	end 
  1079. end 
  1080.  
  1081. --Thread Killer 
  1082. function mIntroTwins_safe_thread_kill( thread ) 
  1083. 	 
  1084. 	if( thread ~= nil )	then 
  1085. 		if( thread ~= INVALID_THREAD_HANDLE) then 
  1086. 			thread_kill( thread ) 
  1087. 			thread = INVALID_THREAD_HANDLE 
  1088. 		end 
  1089. 	end 
  1090.  
  1091. end 
  1092.  
  1093. -------------------------------------------------------------------------------------------------- 
  1094. --[[ 
  1095.  
  1096.    _____      _ _ _                _      ______                _   _                  
  1097.   / ____|    | | | |              | |    |  ____|              | | (_)                 
  1098.  | |     __ _| | | |__   __ _  ___| | __ | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  1099.  | |    / _` | | | '_ \ / _` |/ __| |/ / |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  1100.  | |___| (_| | | | |_) | (_| | (__|   <  | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  1101.   \_____\__,_|_|_|_.__/ \__,_|\___|_|\_\ |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  1102. 																					   
  1103. 																					   
  1104. ]]-- 
  1105.  
  1106. function mIntroTwins_failure_kiki_died_cb() 
  1107. 	mission_end_failure("mIntroTwins", "GM_INTROTWINS_FAIL_KIKI_DIED") 
  1108. end 
  1109.  
  1110. function mIntroTwins_failure_viola_died_cb() 
  1111. 	mission_end_failure("mIntroTwins", "GM_INTROTWINS_FAIL_VIOLA_DIED") 
  1112. end 
  1113.  
  1114. function mIntroTwins_failure_dismissed_cb() 
  1115. 	mission_end_failure("mIntroTwins", "GM_INTROTWINS_FAIL_TWIN_DIS") 
  1116. end 
  1117. -------------------------------------------------------------------------------------------------- 
  1118. --[[ 
  1119.  
  1120.   _______ _                        _   ______                _   _                  
  1121.  |__   __| |                      | | |  ____|              | | (_)                 
  1122. 	| |  | |__  _ __ ___  __ _  __| | | |__ _   _ _ __   ___| |_ _  ___  _ __  ___  
  1123. 	| |  | '_ \| '__/ _ \/ _` |/ _` | |  __| | | | '_ \ / __| __| |/ _ \| '_ \/ __| 
  1124. 	| |  | | | | | |  __/ (_| | (_| | | |  | |_| | | | | (__| |_| | (_) | | | \__ \ 
  1125. 	|_|  |_| |_|_|  \___|\__,_|\__,_| |_|   \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ 
  1126. 																				    
  1127. 																				    
  1128. ]]-- 
  1129.  
  1130.