./mmauratutorial.lua

  1.  
  2. --[[ USING THE MISSION START TEMPLATE  
  3. 		1.	Read "SR3 Mission Scripting Standards" if you haven't already. 
  4. 		2.	Save this file as "mmAuraTutorial.lua" in the missions directory. 
  5. 		3.	Replace "mmAuraTutorial" with the name of your mission (must use the same name as your mission start node). 
  6. 		3a.	Replace "mmAuraTutorial" with the capitalized name of your mission 
  7. 		4.	Replace "3-3-2014" with today's date. 
  8. 		5.	Replace "Arturo Mata" with your name. 
  9. 		6.	Replace "Ultor" with the name of the first location to go to 
  10. 		7.	Replace "fcp with a 3-4 letter abbreviation for the first checkpoint. 
  11. 		8.	Replace "" with the second checkpoint name (first is named start)cleanup 
  12. 		9.	Replace "" with a 3-4 letter abbreviation for the next checkpoint. 
  13. 		10.	If you find an error with this template, fix it and check it in!!!! 
  14. 		11.	Remove these instructions.  You're on your own now!conv 
  15. ]]-- 
  16.  
  17. --[[ 
  18. 	mmAuraTutorial.lua 
  19. 	SR3 Mission Script 
  20. 	DATE: 3-3-2014 
  21. 	AUTHOR:	Arturo Mata 
  22. ]]-- 
  23.  
  24.  
  25. -- Debug flags -- 
  26.  
  27. -- Tweakable Parameters -- 
  28.  
  29. -------------------------------------------------------------------------------------------------- 
  30. 																				--[[ GROUPS ]]-- 
  31. -------------------------------------------------------------------------------------------------- 
  32. 	mmAuraTutorial_group = { 
  33. 									--[[ startup GROUPS ]]--	 
  34. 									 
  35. 									--[[ Ultor GROUPS ]]--	 
  36. 	wave_1 = 
  37. 	{ 
  38. 		name = "wave_1", 
  39. 		members = 
  40. 		{ 
  41. 			"Demon<001>", 
  42. 		}, 
  43. 		coop_name = "coop_wave_1", 
  44. 		coop_only_members = 
  45. 		{ 
  46. 			"Demon<002>", 
  47. 		}, 
  48. 		damage_threads = { }, 
  49. 	}, 
  50. 	wave_2 = 
  51. 	{ 
  52. 		name = "wave_2", 
  53. 		members = 
  54. 		{ 
  55. 			"Demon<003>", 
  56. 			"Demon<004>", 
  57. 			"Demon<005>", 
  58. 		}, 
  59. 		coop_name = "coop_wave_2", 
  60. 		coop_only_members = 
  61. 		{ 
  62. 			"Demon<006>", 
  63. 			"Demon<007>", 
  64. 			"Demon<008>", 
  65. 		}, 
  66. 		damage_threads = { }, 
  67. 	}, 
  68. 	wave_3 = 
  69. 	{ 
  70. 		name = "wave_3", 
  71. 		members = 
  72. 		{ 
  73. 			"Demon<009>", 
  74. 			"Demon<010>", 
  75. 			"Demon<011>", 
  76. 		--	"Demon<012>", 
  77. 		--	"Demon<013>", 
  78. 		--	"Demon<014>", 
  79. 		}, 
  80. 		coop_name = "coop_wave_3", 
  81. 		coop_only_members = 
  82. 		{ 
  83. 			"Demon<015>", 
  84. 			"Demon<016>", 
  85. 			"Demon<017>", 
  86. 		--	"Demon<018>", 
  87. 		--	"Demon<019>", 
  88. 		--	"Demon<020>", 
  89. 		}, 
  90. 		damage_threads = { }, 
  91. 	}, 
  92. 	wave_4 = 
  93. 	{ 
  94. 		name = "wave_4", 
  95. 		members = 
  96. 		{ 
  97. 			"Dark_Inciter<001>", 
  98. 		}, 
  99. 		coop_name = "coop_wave_4", 
  100. 		coop_only_members = 
  101. 		{ 
  102. 			"Dark_Inciter<002>", 
  103. 		}, 
  104. 		damage_threads = { }, 
  105. 	}, 
  106.  
  107. 									--[[  GROUPS ]]-- 
  108.  
  109. 	 
  110. } 
  111.  
  112. mmAuraTutorial_respawn_points = 
  113. { 
  114. 	[ "Demon<001>" ] = "DemonSpawn<001>", 
  115. 	[ "Demon<002>" ] = "DemonSpawn<002>", 
  116. 	[ "Demon<003>" ] = "DemonSpawn<003>", 
  117. 	[ "Demon<004>" ] = "DemonSpawn<004>", 
  118. 	[ "Demon<005>" ] = "DemonSpawn<005>", 
  119. 	[ "Demon<006>" ] = "DemonSpawn<006>", 
  120. 	[ "Demon<007>" ] = "DemonSpawn<007>", 
  121. 	[ "Demon<008>" ] = "DemonSpawn<008>", 
  122. 	[ "Demon<009>" ] = "DemonSpawn<009>", 
  123. 	[ "Demon<010>" ] = "DemonSpawn<010>", 
  124. 	[ "Demon<011>" ] = "DemonSpawn<011>", 
  125. 	--[ "Demon<012>" ] = "DemonSpawn<012>", 
  126. 	--[ "Demon<013>" ] = "DemonSpawn<013>", 
  127. 	--[ "Demon<014>" ] = "DemonSpawn<014>", 
  128. 	[ "Demon<015>" ] = "DemonSpawn<015>", 
  129. 	[ "Demon<016>" ] = "DemonSpawn<016>", 
  130. 	[ "Demon<017>" ] = "DemonSpawn<017>", 
  131. 	--[ "Demon<018>" ] = "DemonSpawn<018>", 
  132. 	--[ "Demon<019>" ] = "DemonSpawn<019>", 
  133. 	--[ "Demon<020>" ] = "DemonSpawn<020>", 
  134. 	[ "Dark_Inciter<001>" ] = "DarkInciterSpawn<001>", 
  135. 	[ "Dark_Inciter<002>" ] = "DarkInciterSpawn<003>", 
  136. } 
  137.  
  138. mmAuraTutorial_leash_points =  
  139. { 
  140. 	[ "Dark_Inciter<001>" ] = "DarkInciterLeash<001>", 
  141. 	[ "Dark_Inciter<002>" ] = "DarkInciterLeash<001>", 
  142. } 
  143. -------------------------------------------------------------------------------------------------- 
  144. 																				--[[ THREADS ]]-- 
  145. -------------------------------------------------------------------------------------------------- 
  146. 	mmAuraTutorial_thread = { 
  147. 		-- = INVALID_THREAD_HANDLE, 
  148. 		burn_all_peds_thread = INVALID_THREAD_HANDLE, 
  149. 	} 
  150. 	 
  151. -------------------------------------------------------------------------------------------------- 
  152. 																				--[[ EFFECTS ]]-- 
  153. -------------------------------------------------------------------------------------------------- 
  154. 	mmAuraTutorial_effects = { 
  155. 		respawn_effect = "respawn_effect<001>", 
  156. 	} 
  157.  
  158.  
  159. -------------------------------------------------------------------------------------------------- 
  160. 																			--[[ CHECKPOINTS ]]-- 
  161. -------------------------------------------------------------------------------------------------- 
  162. 	mmAuraTutorial_checkpoint = { 
  163. 		{ 
  164. 			name = MISSION_START_CHECKPOINT,		-- First Checkpoint (fcp) 
  165. 			init = "mmAuraTutorial_fcp_init",				-- init(bool mission_restart) 
  166. 			run = "mmAuraTutorial_fcp_run",					-- run() 
  167. 			cleanup = "mmAuraTutorial_fcp_cleanup",			-- cleanup(bool mission_exit) (+++MUST RETURN IMMEDIATELY+++) 
  168. 			--next_checkpoint = "mmAuraTutorial_", 
  169. 			next_checkpoint = nil, 
  170. 			host_start = "Player_start_nav_host", 
  171. 			client_start = "Player_start_nav_client", 
  172. 			p1_car_nav = "", 
  173. 			p2_car_nav = "", 
  174. 			start_groups = { }, 
  175. 			cp_only_groups = { }, 
  176. 		}, 
  177. 	} 
  178. 	 
  179. -------------------------------------------------------------------------------------------------- 
  180. 																			--[[ CUTSCENES ]]-- 
  181. -------------------------------------------------------------------------------------------------- 
  182. 	mmAuraTutorial_scene = { 
  183. 		intro = "", 
  184. 		outro = "" 
  185. 	} 
  186.  
  187. -------------------------------------------------------------------------------------------------- 
  188. 																			--[[ CONVERSATIONS ]]-- 
  189. -------------------------------------------------------------------------------------------------- 
  190. 	mmAura_persona =  
  191. 	{  
  192. 		Vlad = { 
  193. 			persona_name = "VLAD", 
  194. 			persona_id = INVALID_PERSONA_HANDLE 
  195. 		}, 
  196. 	} 
  197. 	mmAuraTutorial_convo = 
  198. 	{ 
  199. 		intro = { 
  200. 			name = "mmAuraTutorial_intro",  
  201. 			player_talks = false, 
  202. 			handle = INVALID_CONVERSATION_HANDLE, 
  203. 			convo_thread = INVALID_THREAD_HANDLE, 
  204. 			max_wait_seconds = 60, 
  205. 			timer_thread = INVALID_THREAD_HANDLE, 
  206. 			priority = CONVO_PRIORITY_NORMAL, 
  207.  
  208. 		}, 
  209. 		wave = { 
  210. 			name = "mmAuraTutorial_wave",  
  211. 			player_talks = false, 
  212. 			handle = INVALID_CONVERSATION_HANDLE, 
  213. 			convo_thread = INVALID_THREAD_HANDLE, 
  214. 			max_wait_seconds = 60, 
  215. 			timer_thread = INVALID_THREAD_HANDLE, 
  216. 			priority = CONVO_PRIORITY_NORMAL, 
  217.  
  218. 		}, 
  219. 		intro_success = { 
  220. 			name = "mmAuraTutorial_success",  
  221. 			player_talks = false, 
  222. 			handle = INVALID_CONVERSATION_HANDLE, 
  223. 			convo_thread = INVALID_THREAD_HANDLE, 
  224. 			max_wait_seconds = 60, 
  225. 			timer_thread = INVALID_THREAD_HANDLE, 
  226. 			priority = CONVO_PRIORITY_NORMAL, 
  227.  
  228. 		}, 
  229. 		inciter_intro = { 
  230. 			name = "mmAuraTutorial_inciter_intro",  
  231. 			player_talks = false, 
  232. 			handle = INVALID_CONVERSATION_HANDLE, 
  233. 			convo_thread = INVALID_THREAD_HANDLE, 
  234. 			max_wait_seconds = 60, 
  235. 			timer_thread = INVALID_THREAD_HANDLE, 
  236. 			priority = CONVO_PRIORITY_NORMAL, 
  237.  
  238. 		}, 
  239. 		complete = { 
  240. 			name = "mmAuraTutorial_complete",  
  241. 			player_talks = false, 
  242. 			handle = INVALID_CONVERSATION_HANDLE, 
  243. 			convo_thread = INVALID_THREAD_HANDLE, 
  244. 			max_wait_seconds = 60, 
  245. 			timer_thread = INVALID_THREAD_HANDLE, 
  246. 			priority = CONVO_PRIORITY_NORMAL, 
  247.  
  248. 		}, 
  249. 		scold = { 
  250. 			name = "mmAuraTutorial_scold",  
  251. 			player_talks = false, 
  252. 			handle = INVALID_CONVERSATION_HANDLE, 
  253. 			convo_thread = INVALID_THREAD_HANDLE, 
  254. 			max_wait_seconds = 60, 
  255. 			timer_thread = INVALID_THREAD_HANDLE, 
  256. 			priority = CONVO_PRIORITY_NORMAL, 
  257.  
  258. 		}, 
  259. 	} 
  260. 	 
  261. 	mmAuraTutorial_convo_queue = { 
  262. 		--[[start_drive_queue = {  
  263. 			{ delay = 2.0, convo = mmAuraTutorial_convo.goto_Ultor }, 
  264. 			{ delay = 4.0, convo = mmAuraTutorial_convo.goto_Ultor2 }, 
  265. 			{ delay = 3.0, convo = mmAuraTutorial_convo.goto_Ultor3 }, 
  266. 			{ delay = 5.0, convo = mmAuraTutorial_convo.goto_Ultor4 } 
  267. 		}, 
  268. 		]]-- 
  269. 	} 
  270. 	 
  271. -------------------------------------------------------------------------------------------------- 
  272. 																			--[[ TRIGGERS ]]-- 
  273. -------------------------------------------------------------------------------------------------- 
  274. 	mmAuraTutorial_trigger = { 
  275. 		-- = { 
  276. 		--	name = "_trigger", 
  277. 		--	hit = false, 
  278. 		-- 	last_hit_by = nil, -- 	last_hit_human = nil (set to the last human to enter the trigger in the default trigger callback) 
  279. 		--  (optional)callback = "mmAuraTutorial_function_name_cb" 
  280. 		--	(optional)marker = TRIGGER_LOCATION or TRIGGER_USE or custom or don't include for no marker 
  281. 		--  (optional)waypoint = true, 
  282. 		--  (optional)teleport_to = { 
  283. 		--						host = "host_nav", 
  284. 		--						client = "client_nav"  
  285. 		--					},		 
  286. 		--	(optional)conversation = mmAuraTutorial_convo.convo_name  -- play a conversation 
  287. 		--	(optional)next_trigger = "next_trigger_name" sets up next trigger when triggered (breadcrumbs) 
  288. 		--}, 
  289. 		 
  290. 									--[[ Ultor TRIGGERS ]]-- 
  291. 		lava_trigger = { 
  292. 			name = "lava_trigger", 
  293. 			callback = "mmTutorial_lava_trigger_callback", 
  294. 		}, 
  295.  
  296. 	} 
  297. 	 
  298. -------------------------------------------------------------------------------------------------- 
  299. 																	  --[[ INTERROGATION DATA ]]-- 
  300. -------------------------------------------------------------------------------------------------- 
  301. 	--mmAuraTutorial_interrogate = { 
  302. 	--	leader = { 
  303. 	--		target = mmAuraTutorial_group.friendly_fire.owner, 
  304. 	--		persona = "Interrogation", 
  305. 	--		objective = "mmAuraTutorial_INTERROGATE_OWNER", 
  306. 	--	--	(optional)conversation = mmAuraTutorial_convo.convo_name  -- play a conversation while interrogating 
  307. 	--	}, 
  308. 	--} 
  309. 		 
  310. -------------------------------------------------------------------------------------------------- 
  311. 																				   --[[ OTHER ]]-- 
  312. -------------------------------------------------------------------------------------------------- 
  313.  
  314. 	mmAura_runtime =  
  315. 	{ 
  316. 			bPersonaLoaded = false, 
  317. 	} 
  318. 	mmAuraTutorial_CurrentEnemyCount = 0 
  319. 	-- Control variables for the burning ped section 
  320. 	mmAuraTutorial_BurnAllTargetsSuccessful = false 
  321. 	mmAuraTutorial_BurnAllTargetsResetting = false 
  322.  
  323. 	SUPERPOWER_BUFF = 2 
  324. -------------------------------------------------------------------------------------------------- 
  325. 								--[[**********************]]-- 
  326. 								--[[                      ]]-- 
  327. 								--[[  Standard functions  ]]-- 
  328. 								--[[                      ]]-- 
  329. 								--[[**********************]]-- 
  330.  
  331. -- This is the primary entry point for the mission, and is responsible for starting up the mission 
  332. -- at the specified checkpoint. 
  333. -- CALLED FROM CODE 
  334. -- 
  335. -- start_checkpoint_name:	(string) The checkpoint the mission should begin at 
  336. -- is_restart:					(bool) TRUE if the mission is restarting, FALSE otherwise 
  337. -- 
  338. function mmAuraTutorial_start(start_checkpoint_name, is_restart) 
  339.  
  340. 	mission_start_fade_out(0.0) 
  341. 	 
  342. 	disable_diversions(true) 
  343. 	ui_hud_set_current_challenge(-1) 
  344. 	set_ped_override_density(.1) 
  345. 	set_traffic_density(.1) 
  346. 	parking_spot_disable_all(true) 
  347. 	 
  348. 	--hvUnlockLoadout("mmAuraTutorial") 
  349.  
  350. 	trigger_setup( mmAuraTutorial_trigger.lava_trigger ) 
  351.  
  352. 	-- turn off all pickup drops 
  353. 	health_pickups_enable(false) 
  354. 	human_all_stop_dropping_weapons(true) 
  355. 	human_all_stop_dropping_cash(true) 
  356.  
  357. 	-- Swap to the training facility. 
  358. 	city_zone_swap( "u_train", true ) 
  359.  
  360. 	-- initialize systems 
  361. 	mission_startup(mmAuraTutorial_trigger, mmAuraTutorial_convo) -- mmAuraTutorial_checkpoint 
  362. 		 
  363. 	local start_cp = get_table_by_name(mmAuraTutorial_checkpoint, MISSION_START_CHECKPOINT) 
  364.  
  365. 	-- Check if this mission starting from the beginning 
  366. 	if (start_checkpoint_name == start_cp.name) then 
  367. 		if (is_restart == false and mmAuraTutorial_scene.intro ~= "") then 
  368. 			-- First time playing mission 
  369. 			local fade_in_after = false 
  370. 			cutscene_play(mmAuraTutorial_scene.intro, nil, {start_cp.host_start, start_cp.client_start}, fade_in_after) 
  371. 		else 
  372. 			teleport_coop(start_cp.host_start, start_cp.client_start, true) 
  373. 		end 
  374. 		fade_out(0) 
  375. 	end 
  376.  
  377. 	-- Handle mission initialization for the current checkpoint 
  378. 	mmAuraTutorial_initialize(start_checkpoint_name) 
  379.  
  380. 	-- Run the mission from the current checkpoint 
  381. 	checkpoint_run_mission(mmAuraTutorial_checkpoint, start_checkpoint_name) 
  382. 	 
  383. 	mission_end_success("mmAuraTutorial", nil, { "player_end_nav_client", "player_end_nav_host" } ) --, mmAuraTutorial_scene.outro, {, }) 
  384. end 
  385.  
  386. -- This is the primary function responsible for cleaning up the entire mission 
  387. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  388. -- 
  389. function mmAuraTutorial_cleanup() 
  390. 	--[[ INSERT ANY MISSION SPECIFIC CLEAN-UP ]]-- 
  391. 	 
  392. 	city_zone_swap( "u_train", false, true ) 
  393.  
  394. 	-- Clean up lava trigger 
  395. 	trigger_cb( "", mmAuraTutorial_trigger.lava_trigger ) 
  396. 	 
  397. 	disable_diversions(false) 
  398. 	ui_hud_set_current_challenge(-2) 
  399.  
  400. 	-- Enable all weapon slots 
  401. 	inv_weapon_disable_all_slots(false) 
  402. 	set_ped_override_density(-1) 
  403. 	set_traffic_density(1) 
  404. 	parking_spot_disable_all(false) 
  405. 	-- Re-enable all superpowers and weapon radial 
  406. 	inv_weapon_remove_temporary( LOCAL_PLAYER, "Pistol-Gang") 
  407. 	if coop_is_active() == true then 
  408. 		inv_weapon_remove_temporary( REMOTE_PLAYER, "Pistol-Gang") 
  409. 	end 
  410.  
  411.  
  412. 	local enable = true 
  413. 	player_super_attacks_enable( enable, "Stomp" ) 
  414. 	player_super_attacks_enable( enable, "Freeze" ) 
  415. 	player_super_attacks_enable( enable, "Summon" ) 
  416. 	player_super_power_lock_to_tutorial_element( false ) 
  417. 	hud_inventory_disable( false ) 
  418. 	player_super_power_set_regen_scalar_buff(1.0) 
  419.  
  420. 	hud_prompt_clear() 
  421.  
  422. 	npc_respawn_dist_reset() 
  423.  
  424. 	-- turn back on pickup drops 
  425. 	health_pickups_enable(true) 
  426. 	human_all_stop_dropping_weapons(false) 
  427. 	human_all_stop_dropping_cash(false) 
  428.  
  429. 	--ensure warp to shore is back on 
  430. 	player_warp_to_shore_enable( LOCAL_PLAYER ) 
  431. 	if coop_is_active() == true then 
  432. 		player_warp_to_shore_enable( REMOTE_PLAYER ) 
  433. 	end 
  434.  
  435. 	-- cleanup all threads 
  436. 	cleanup_threads(mmAuraTutorial_thread) 
  437. 	cleanup_threads( mmAuraTutorial_thread.burn_all_peds_thread )	 
  438.  
  439. 	-- run checkpoint cleanups (move into mission_shutdown?) 
  440. 	checkpoint_cleanup_mission(mmAuraTutorial_checkpoint) 
  441. 	 
  442. 	-- cleanup triggers, convos, kill_list and interrogations 
  443. 	mission_shutdown() 
  444. 	 
  445. 	-- cleanup all groups 
  446. 	cleanup_groups(mmAuraTutorial_group) 
  447.  
  448.  
  449. 	--fade_out_block() 
  450. 	--	delay(1.0) 
  451. 	--	-- teleport the player 
  452. 	--	teleport_coop("player_end_nav_host", "player_end_nav_client", true) 
  453. 	--	delay(2.0) 
  454. 	--fade_in( 1.0 ) 
  455. 	--fade_in_block() 
  456. end 
  457.  
  458. -- Called when the mission has ended with success 
  459. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATELY+++) 
  460. -- 
  461. function mmAuraTutorial_success() 
  462. 	--[[ INSERT ANY MISSION SPECIFIC SUCCESS STUFF ]]-- 
  463. 	 
  464. end 
  465.  
  466. -------------------------------------------------------------------------------------------------- 
  467. 								--[[**********************]]-- 
  468. 								--[[                      ]]-- 
  469. 								--[[ Initialize functions ]]-- 
  470. 								--[[                      ]]-- 
  471. 								--[[**********************]]-- 
  472.  
  473. -- Initialize the mission for the specified checkpoint 
  474. -- 
  475. -- checkpoint_name:		(string) Checkpoint to initialize the mission to 
  476. -- 
  477. function mmAuraTutorial_initialize(checkpoint_name) 
  478. 	-- Common initialization 
  479. 	mmAuraTutorial_initialize_common() 
  480. 	 
  481. 	-- Checkpoint specific initialization 
  482. 	checkpoint_init(mmAuraTutorial_checkpoint, checkpoint_name) 
  483.  
  484. 	-- Remove any present subtitles 
  485. 	message_remove_all() 
  486.  
  487. 	-- Start fading in  
  488. 	mission_start_fade_in() 
  489. 	audio_object_post_event( "Play_AuraTutorial" ) 
  490. end 
  491.  
  492. -- Handle any common initialization 
  493. -- 
  494. function mmAuraTutorial_initialize_common() 
  495. 	--[[ INSERT ANY COMMON INITIALIZATION CODE HERE ]]-- 
  496. 	waypoint_remove() 
  497. 	mission_set_cancel_warp_location("player_end_nav_host", "player_end_nav_client") 
  498.  
  499. 	-- Disable all superpowers and weapon radial 
  500. 	local enable = false 
  501. 	player_super_attacks_enable( enable, "Freeze" ) 
  502. 	player_super_attacks_enable( enable, "Stomp" ) 
  503. 	player_super_attacks_enable( enable, "Summon" ) 
  504. 	player_super_power_lock_to_tutorial_element( true, "aura_coldfire", SYNC_ALL )		 
  505. 	player_super_power_select( "Aura", SYNC_ALL, "aura_coldfire" ) 
  506. 	hud_inventory_disable( true ) 
  507.  
  508.  
  509.  
  510. 	if mmAura_runtime.bPersonaLoaded == false then 
  511. 		load_persona(mmAura_persona.Vlad) 
  512. 		mmAura_runtime.bPersonaLoaded = true 
  513. 	end  
  514.  
  515.  
  516.  
  517. end 
  518.  
  519. -------------------------------------------------------------------------------------------------- 
  520. 								--[[**********************]]-- 
  521. 								--[[                      ]]-- 
  522. 								--[[ Checkpoint functions ]]-- 
  523. 								--[[                      ]]-- 
  524. 								--[[**********************]]-- 
  525.  
  526. -------------------------------------------------------------------------------------------------- 
  527. 																	--[[ First Checkpoint Name ]]-- 
  528. -------------------------------------------------------------------------------------------------- 
  529.  
  530. -- Initialize this checkpoint. 
  531. -- 
  532. -- mission_start: (bool) Whether we're initializing from a mission (re)start or from 
  533. --					a natural play-through. 
  534. -- 
  535. function mmAuraTutorial_fcp_init(mission_start) 
  536.  
  537. 	-- Set up the players as invulnerable 
  538. 	turn_invulnerable( LOCAL_PLAYER ) 
  539. 	if coop_is_active() == true then 
  540. 		turn_invulnerable( REMOTE_PLAYER ) 
  541. 	end 
  542.  
  543. 	-- Disable warp to shore 
  544. 	player_warp_to_shore_disable( LOCAL_PLAYER ) 
  545. 	if coop_is_active() == true then 
  546. 		player_warp_to_shore_disable( REMOTE_PLAYER ) 
  547. 	end 
  548.  
  549. 	player_unlock_super_power( SUPERPOWER_BUFF, LOCAL_PLAYER, true ) 
  550. 	if coop_is_active() then 
  551. 		player_unlock_super_power( SUPERPOWER_BUFF, REMOTE_PLAYER, true ) 
  552. 	end 
  553.  
  554. 	--Remove all summons 
  555. 	player_super_power_clear_summons(LOCAL_PLAYER) 
  556.  
  557. 	-- Enable superpower stuffs 
  558. 	player_super_movement_enable( true ) 
  559. 	player_super_attacks_enable( true ) 
  560.  
  561. 	-- Disable melee (because if the co-op client melees, they gain ownership of the enemy and that messes up our death callbacks) 
  562. 	set_player_can_take_human_shields( LOCAL_PLAYER, false ) 
  563. 	set_player_can_take_human_shields( REMOTE_PLAYER, false ) 
  564. 	player_allow_weapon_melee( false ) 
  565. 	 
  566. 	-- Disable notoriety 
  567. 	notoriety_set_min_and_max( "luchadores", 0, 0 ) 
  568. 	notoriety_set_min_and_max( "police", 0, 0 ) 
  569.  
  570. end 
  571.  
  572. -- The first objective 
  573. -- 
  574. function mmAuraTutorial_fcp_run() 
  575.  
  576. 	-- Give the player a pistol and make it the only available weapon 
  577. 	inv_weapon_add_temporary( LOCAL_PLAYER, "Pistol-Gang", 100, true, true, false, true ) 
  578. 	inv_item_equip("Pistol-Gang", LOCAL_PLAYER) 
  579. 	if coop_is_active() == true then 
  580. 		inv_weapon_add_temporary( REMOTE_PLAYER, "Pistol-Gang", 100, true, true, false, true ) 
  581. 		inv_item_equip("Pistol-Gang", REMOTE_PLAYER) 
  582. 	end 
  583. 	inv_weapon_disable_all_but_this_slot( WEAPON_SLOT_PISTOL, true, SYNC_ALL ) 
  584.  
  585.  
  586. 	 
  587. 	-- Do not allow access to the hub menu 
  588. 	cellphone_lock(true) 
  589. 	 
  590. 	-- set charge 
  591.  
  592. 	player_super_power_set_regen_scalar_buff(8.0) 
  593. 	 
  594. 	convo_start(mmAuraTutorial_convo.intro) 
  595. 	convo_wait_for_end() 
  596. 	convo_start(mmAuraTutorial_convo.wave) 
  597. 	-- SRG_MM_AURATUT_TIMER 
  598. 	mmAuraTutorial_wave_setup( mmAuraTutorial_group.wave_1 ) 
  599. 	objective_text( 0, "SRG_MMAURA_OBJECTIVE_ENEMIES", "", "", SYNC_ALL, OI_ASSET_POWER_BUFF ) 
  600.  
  601. 	hud_prompt(LOCAL_PLAYER, "SRG_MMAURA_USE_NAG", "", true) 
  602. 	 
  603. 	-- Play the tutorial text 
  604. 	local tutorial_name = "aura_enemies" 
  605. 	local delay_ms = 0 
  606. 	local auto_unlock = false 
  607. 	local allow_redisplay = false 
  608. 	local infinite_display = true 
  609. 	tutorial_start(tutorial_name, delay_ms, auto_unlock, allow_redisplay, infinite_display) 
  610.  
  611.  
  612. 	-- Wait until we successfully complete the activity 
  613. 	mmAuraTutorial_BurnAllTargetsSuccessful = false 
  614. 	mmAuraTutorial_BurnAllTargetsResetting = false 
  615. 	mmAuraTutorial_thread.burn_all_peds_thread = thread_new( "mmAuraTutorial_burn_all_targets_thread_func" ) 
  616.  
  617. 	while not mmAuraTutorial_BurnAllTargetsSuccessful do 
  618. 		thread_yield() 
  619. 	end 
  620. 	hud_prompt_clear() 
  621. 	mmAuraTutorial_wave_setup( mmAuraTutorial_group.wave_2 ) 
  622. 	-- Wait until we successfully complete the activity 
  623. 	mmAuraTutorial_BurnAllTargetsSuccessful = false 
  624. 	mmAuraTutorial_BurnAllTargetsResetting = false 
  625. 	mmAuraTutorial_thread.burn_all_peds_thread = thread_new( "mmAuraTutorial_burn_all_targets_thread_func" ) 
  626.  
  627. 	while not mmAuraTutorial_BurnAllTargetsSuccessful do 
  628. 		thread_yield() 
  629. 	end 
  630.  
  631. 	--convo_start(mmAuraTutorial_convo.inciter_intro) 
  632. 	mmAuraTutorial_wave_setup( mmAuraTutorial_group.wave_3) 
  633.  
  634. 	-- Wait until we successfully complete the activity 
  635. 	mmAuraTutorial_BurnAllTargetsSuccessful = false 
  636. 	mmAuraTutorial_BurnAllTargetsResetting = false 
  637. 	mmAuraTutorial_thread.burn_all_peds_thread = thread_new( "mmAuraTutorial_burn_all_targets_thread_func" ) 
  638.  
  639. 	while not mmAuraTutorial_BurnAllTargetsSuccessful do 
  640. 		thread_yield() 
  641. 	end 
  642. 	convo_end_all() 
  643. 	convo_start(mmAuraTutorial_convo.intro_success) 
  644. 	convo_wait_for_end() 
  645. 	objective_text_clear(0)	 
  646. 	 
  647. 	-- Play the tutorial text 
  648. 	tutorial_stop_current() 
  649. 	tutorial_name = "aura_inciter" 
  650. 	tutorial_start(tutorial_name, delay_ms, auto_unlock, allow_redisplay, infinite_display) 
  651. 	dark_inciter_ultra_shield_only_vulnerable_to_superpowers( true ) 
  652.  
  653. 	mmAuraTutorial_final_wave_setup( mmAuraTutorial_group.wave_4 ) 
  654. 	dark_inciter_disable_summon( mmAuraTutorial_group.wave_4.members[1], true) 
  655. 	npc_leash_to_nav(mmAuraTutorial_group.wave_4.members[1], mmAuraTutorial_get_npc_leash_navpoint(mmAuraTutorial_group.wave_4.members[1]), 4.0) 
  656. 	 
  657. 	objective_text( 0, "SRG_MMAURA_OBJECTIVE_INCITER", "", "", SYNC_ALL, OI_ASSET_POWER_BUFF ) 
  658.  
  659. 	convo_start(mmAuraTutorial_convo.inciter_intro) 
  660. 	mmAuraTutorial_BurnAllTargetsSuccessful = false 
  661. 	mmAuraTutorial_BurnAllTargetsResetting = false 
  662. 	mmAuraTutorial_thread.burn_all_peds_thread = thread_new( "mmAuraTutorial_burn_all_targets_thread_func" ) 
  663.  
  664. 	while not mmAuraTutorial_BurnAllTargetsSuccessful do 
  665. 		thread_yield() 
  666. 	end 
  667.  
  668. 	 
  669. 	dark_inciter_ultra_shield_only_vulnerable_to_superpowers( false ) 
  670. 	objective_text_clear(0)	 
  671. 	convo_end_all() 
  672. 	convo_start(mmAuraTutorial_convo.complete) 
  673. 	convo_wait_for_end() 
  674. 	tutorial_stop_current() 
  675. 	delay(1.0) 
  676. 	 
  677. 	-- Fade the screen so we can zone swap. 
  678. 	fade_out(0.0) 
  679. 	delay(2.0) 
  680. end 
  681.  
  682. -- Do any cleanup for this checkpoint. 
  683. -- 
  684. -- (+++THIS IS CALLED FROM MISSION CLEANUP, MUST RETURN IMMEDIATELY+++) 
  685. -- 
  686. -- mission_exit: (bool) Whether we're exiting the mission entirely, or just 
  687. --					moving on to the next checkpoint. 
  688. -- 
  689. function mmAuraTutorial_fcp_cleanup(mission_exit) 
  690.  
  691. 	-- turn back on all pickup drops 
  692. 	health_pickups_enable(true) 
  693. 	human_all_stop_dropping_weapons(false) 
  694. 	human_all_stop_dropping_cash(false) 
  695.  
  696. -- Re-enable all weapon slots 
  697. 	inv_weapon_disable_all_slots( false, SYNC_ALL ) 
  698. 	inv_weapon_remove_temporary( LOCAL_PLAYER, "Pistol-Gang" ) 
  699. 	if coop_is_active() == true then 
  700. 		inv_weapon_remove_temporary( REMOTE_PLAYER, "Pistol-Gang" ) 
  701. 	end 
  702.  
  703. 	-- Re-enable access to the hub menu 
  704. 	cellphone_lock( false ) 
  705. 	 
  706. 	turn_vulnerable( LOCAL_PLAYER ) 
  707. 	if coop_is_active() == true then 
  708. 		turn_vulnerable( REMOTE_PLAYER ) 
  709. 	end 
  710.  
  711. 	-- Enable warp to shore 
  712. 	player_warp_to_shore_enable( LOCAL_PLAYER ) 
  713. 	if coop_is_active() == true then 
  714. 		player_warp_to_shore_enable( REMOTE_PLAYER ) 
  715. 	end 
  716.  
  717. 	npc_respawn_dist_reset() 
  718. 		 
  719. 	dark_inciter_ultra_shield_only_vulnerable_to_superpowers( false ) 
  720.  
  721. 	-- Re-enable melee 
  722. 	set_player_can_take_human_shields( LOCAL_PLAYER, true ) 
  723. 	set_player_can_take_human_shields( REMOTE_PLAYER, true ) 
  724. 	player_allow_weapon_melee( true ) 
  725. 	 
  726. 	-- Re-enable notoriety 
  727. 	notoriety_set_min_and_max( "luchadores", 0, MAX_NOTORIETY_LEVEL ) 
  728. 	notoriety_set_min_and_max( "police", 0, MAX_NOTORIETY_LEVEL ) 
  729.  
  730.  
  731. 	mmAuraTutorial_cleanup_wave( mmAuraTutorial_group.wave_1 ) 
  732. 	mmAuraTutorial_cleanup_wave( mmAuraTutorial_group.wave_2 ) 
  733. 	mmAuraTutorial_cleanup_wave( mmAuraTutorial_group.wave_3 ) 
  734. 	mmAuraTutorial_cleanup_wave( mmAuraTutorial_group.wave_4 ) 
  735. 	 
  736. 	 
  737. end 
  738.  
  739.  
  740. ------------------------------------ 
  741. -- 
  742. -- Checkpoint helper functions 
  743. -- 
  744. ------------------------------------ 
  745. function mmAuraTutorial_wave_setup( wave_group ) 
  746.  
  747. 	-- Reset our enemy counter 
  748. 	mmAuraTutorial_CurrentEnemyCount = 0 
  749.  
  750. 	-- Create the wave 
  751. 	group_create( wave_group.name ) 
  752.  
  753. 	-- Set special tutorial wave properties. 
  754. 	for i, wave_member in pairs( wave_group.members ) do 
  755.  
  756. 		-- Ensure they know about and see the players 
  757. 		--	ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true ) 
  758. 		--	if coop_is_active() then 
  759. 		--	ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true ) 
  760. 		--	end 
  761. 		 
  762. 		--character_set_animation_overrides(wave_member, "cop_ps_cvch_lft" )--"crv crouch left") 
  763. 		on_death( "mmAuraTutorial_on_death_cb", wave_member ) 
  764. 		wave_group.damage_threads[ wave_member ] = thread_new("mmAuraTutorial_lava_kill_thread", wave_member ) 
  765. 		on_take_damage( "mmAuraTutorial_npc_damaged_cb", wave_member ) 
  766. 		--character_set_animation_overrides(wave_member,"crv crouch left") 
  767. 		marker_add( wave_member, MINIMAP_ICON_BUFF, OI_ASSET_POWER_BUFF, OI_FLAGS_DEFAULT, SYNC_ALL ) 
  768. 		mmAuraTutorial_CurrentEnemyCount = mmAuraTutorial_CurrentEnemyCount + 1 
  769. 		--Set ultra shields to be invulnerable to non-superpowers 
  770. 		tutorial_ultra_shield_only_vulnerable_to_superpowers( wave_member, true) 
  771.  
  772. 		-- Play the fire effect 
  773. 		effect_play_on_human( mmAuraTutorial_effects.respawn_effect, wave_member )  
  774.  
  775. 	end 
  776.  
  777. 	if coop_is_active() then 
  778. 		 
  779. 		-- Create the co-op wave 
  780. 		group_create( wave_group.coop_name ) 
  781.  
  782. 		-- Set special tutorial wave properties. 
  783. 		for i, wave_member in pairs( wave_group.coop_only_members ) do 
  784.  
  785. 			-- Ensure they know about and see the players 
  786. 		--	ai_add_enemy_target( wave_member, LOCAL_PLAYER, ATTACK_ON_SIGHT, false, true ) 
  787. 		--	ai_add_enemy_target( wave_member, REMOTE_PLAYER, ATTACK_ON_SIGHT, false, true ) 
  788. 			 
  789. 			--turn_invulnerable( wave_member ) 
  790. 			--npc_respawn_after_death( wave_member, true ) 
  791. 			--npc_respawn_after_death_time_override( wave_member, 10, true ) 
  792.  
  793. 			on_death( "mmAuraTutorial_on_death_cb", wave_member ) 
  794. 			on_take_damage( "mmAuraTutorial_npc_damaged_cb", wave_member ) 
  795. 			wave_group.damage_threads[ wave_member ] = thread_new("mmAuraTutorial_lava_kill_thread", wave_member ) 
  796. 			tutorial_ultra_shield_only_vulnerable_to_superpowers( wave_member, true) 
  797.  
  798. 			marker_add( wave_member, MINIMAP_ICON_BUFF, OI_ASSET_POWER_BUFF, OI_FLAGS_DEFAULT, SYNC_ALL ) 
  799. 			mmAuraTutorial_CurrentEnemyCount = mmAuraTutorial_CurrentEnemyCount + 1 
  800. 						 
  801. 			-- Play the fire effect 
  802. 			effect_play_on_human( mmAuraTutorial_effects.respawn_effect, wave_member )  
  803.  
  804. 		end 
  805. 	end 
  806.  
  807. end 
  808.  
  809. function mmAuraTutorial_final_wave_setup( wave_group ) 
  810.  
  811. 	-- Reset our enemy counter 
  812. 	mmAuraTutorial_CurrentEnemyCount = 0 
  813.  
  814.  
  815. 	-- Create the wave 
  816. 	group_create( wave_group.name ) 
  817.  
  818. 	-- Set special tutorial wave properties. 
  819. 	for i, wave_member in pairs( wave_group.members ) do 
  820. 			 
  821. 		on_death( "mmAuraTutorial_final_wave_on_death_cb", wave_member ) 
  822.  
  823. 		-- Do not allow them to catch fire. 
  824. 		character_set_never_catch_fire( wave_member ) 
  825.  
  826. 		marker_add( wave_member, MINIMAP_ICON_BUFF, OI_ASSET_POWER_BUFF, OI_FLAGS_DEFAULT, SYNC_ALL ) 
  827. 		mmAuraTutorial_CurrentEnemyCount = mmAuraTutorial_CurrentEnemyCount + 1 
  828.  
  829. 		-- Play the fire effect 
  830. 		effect_play_on_human( mmAuraTutorial_effects.respawn_effect, wave_member )  
  831.  
  832. 	end 
  833.  
  834. 	if coop_is_active() then 
  835. 		 
  836. 		-- Create the co-op wave 
  837. 		group_create( wave_group.coop_name ) 
  838.  
  839. 		-- Set special tutorial wave properties. 
  840. 		for i, wave_member in pairs( wave_group.coop_only_members ) do 
  841. 		 
  842. 			on_death( "mmAuraTutorial_final_wave_on_death_cb", wave_member ) 
  843. 						 
  844. 			-- Do not allow them to catch fire. 
  845. 			character_set_never_catch_fire( wave_member ) 
  846.  
  847. 			marker_add( wave_member, MINIMAP_ICON_BUFF, OI_ASSET_POWER_BUFF, OI_FLAGS_DEFAULT, SYNC_ALL ) 
  848. 			mmAuraTutorial_CurrentEnemyCount = mmAuraTutorial_CurrentEnemyCount + 1 
  849. 						 
  850. 			-- Play the fire effect 
  851. 			effect_play_on_human( mmAuraTutorial_effects.respawn_effect, wave_member )  
  852.  
  853. 		end 
  854. 	end 
  855.  
  856. end 
  857.  
  858. function mmAuraTutorial_clear_wave( wave_group ) 
  859.  
  860. 	-- Reset our enemy counter 
  861. 	mmAuraTutorial_CurrentEnemyCount = 0 
  862.  
  863. 	-- Set special tutorial wave properties. 
  864. 	for i, wave_member in pairs( wave_group.members ) do 
  865.  
  866. 		-- Clear out the callbacks 
  867. 		on_death( "", wave_member ) 
  868. 		on_take_damage( "", wave_member ) 
  869.  
  870. 		-- Remove the marker 
  871. 		marker_remove( wave_member, SYNC_ALL ) 
  872.  
  873. 		-- Hide the character 
  874. 		npc_fade_out( wave_member, 0.1, true, 0 ) 
  875. 		   
  876. 		-- Play the fire effect 
  877. 		effect_play_on_human( mmAuraTutorial_effects.respawn_effect, wave_member )  
  878. 		 
  879. 	end 
  880.  
  881. 	if coop_is_active() then 
  882. 		 
  883. 		-- Set special tutorial wave properties. 
  884. 		for i, wave_member in pairs( wave_group.coop_only_members ) do 
  885. 					 
  886. 			on_death( "", wave_member ) 
  887. 			on_take_damage( "", wave_member ) 
  888. 			 
  889. 			-- Remove the marker 
  890. 			marker_remove( wave_member, SYNC_ALL ) 
  891.  
  892. 			-- Hide the character 
  893. 			npc_fade_out( wave_member, 0.1, true, 0 ) 
  894. 						 
  895. 			-- Play the fire effect 
  896. 			effect_play_on_human( mmAuraTutorial_effects.respawn_effect, wave_member )  
  897.  
  898. 		end 
  899. 	end 
  900.  
  901. 	-- Destroy the groupnnnnn 
  902. 	group_destroy( mmAuraTutorial_group.wave_1.name ) 
  903. 	if coop_is_active() then 
  904. 		group_destroy( mmAuraTutorial_group.wave_1.coop_name ) 
  905. 	end 
  906.  
  907. end 
  908.  
  909. -- Gets the name of the respawn navpoint associated with the npc 
  910. function mmAuraTutorial_get_npc_respawn_navpoint( npc_name ) 
  911.  
  912. 	return mmAuraTutorial_respawn_points[ npc_name ] 
  913.  
  914. end 
  915.  
  916. function mmAuraTutorial_get_npc_leash_navpoint( npc_name ) 
  917. 	 
  918. 	return mmAuraTutorial_leash_points[ npc_name ] 
  919.  
  920. end 
  921. ------------------------------------ 
  922. -- 
  923. -- Checkpoint callback functions 
  924. -- 
  925. ------------------------------------ 
  926. function mmAuraTutorial_on_death_cb( npc ) 
  927.  
  928. 	if character_is_on_fire( npc ) then 
  929. 		mmAuraTutorial_CurrentEnemyCount = mmAuraTutorial_CurrentEnemyCount - 1 
  930. 		on_death( "", npc ) 
  931. 		on_take_damage( "", npc ) 
  932. 		marker_remove( npc ) 
  933. 	else 
  934. 			 
  935. 		-- Fade the character out. 
  936. 		npc_fade_out( npc, 1.0, false, 0 )  
  937. 		 
  938. 		delay( 1.0 ) 
  939. 				 
  940. 		-- TODO: Play the VO for an unsuccessful kill. 
  941. 		if(convo_is_playing() == false) then 
  942. 			convo_start(mmAuraTutorial_convo.scold) 
  943. 		end 
  944. 		 
  945. 				 
  946. 		-- Teleport them to their respawn navpoint 
  947. 		teleport( npc, mmAuraTutorial_get_npc_respawn_navpoint( npc ) ) 
  948.  
  949. 		-- Respawn the character (teleport and revive) 
  950. 		npc_revive( npc ) 
  951.  
  952. 		-- Give him a decent weapon 
  953. 		inv_item_add( "Rifle-LavaBolter", 1, npc, true ) 
  954. 		 
  955. 		delay(1.0) 
  956. 		 
  957. 		-- Play the VFX 
  958. 		effect_play_on_human( mmAuraTutorial_effects.respawn_effect, npc )  
  959. 		 
  960. 		tutorial_ultra_shield_only_vulnerable_to_superpowers( npc, true) 
  961.  
  962. 		-- Show the character and mark them as a target 
  963. 		character_show( npc ) 
  964. 		marker_add( npc, MINIMAP_ICON_BUFF, OI_ASSET_POWER_BUFF, OI_FLAGS_DEFAULT, SYNC_ALL ) 
  965.  
  966. 	end 
  967.  
  968.  
  969. end 
  970.  
  971. function mmAuraTutorial_npc_damaged_cb(npc, attacker, dam_pct, explosion, melee, vomit, dam, tk, dfa, energy, stomp, headshot, sidescroller, buff) 
  972. 	if not buff then 
  973. 		turn_invulnerable(npc, true) 
  974. 	else 
  975. 		turn_vulnerable( npc, true ) 
  976. 	end 
  977. end 
  978.  
  979.  
  980. function mmAuraTutorial_final_wave_on_death_cb( npc ) 
  981.  
  982. 	 
  983. 	mmAuraTutorial_CurrentEnemyCount = mmAuraTutorial_CurrentEnemyCount - 1 
  984. 	on_death( "", npc ) 
  985. 	marker_remove( npc ) 
  986.  
  987. end 
  988.  
  989. ------------------------------------ 
  990. -- 
  991. -- Checkpoint thread functions 
  992. -- 
  993. ------------------------------------ 
  994. --HVS_MO kills enemies if they fall into the lava and get stuck 
  995. function mmAuraTutorial_lava_kill_thread( npc ) 
  996.  
  997. 	while( true )do 
  998. 		 
  999. 		-- Catches npcs which fall into the lava 
  1000. 		-- To make extra sure we catch them, also process enemies near the lava (the lava is at about y: 882) 
  1001. 		if character_is_in_lava( npc ) or (human_get_pos_y(npc) < 883.0) then 
  1002. 			turn_vulnerable( npc ) 
  1003. 			character_kill( npc ) 
  1004. 		end 
  1005.  
  1006. 		thread_yield() 
  1007. 	end 
  1008.  
  1009. end 
  1010.  
  1011.  
  1012. -------------------------------------------------------------------------------------------------- 
  1013. 								--[[**********************]]-- 
  1014. 								--[[                      ]]-- 
  1015. 								--[[   Common functions   ]]-- 
  1016. 								--[[                      ]]-- 
  1017. 								--[[**********************]]-- 
  1018.  
  1019. function mmAuraTutorial_cleanup_wave( wave_group ) 
  1020. 	 
  1021. 	cleanup_threads( wave_group.damage_threads ) 
  1022. 	-- Clean up the sp waves 
  1023. 	for i, wave_member in pairs( wave_group.members ) do 
  1024. 		 
  1025. 		on_death( "", wave_member ) 
  1026. 		on_take_damage( "", wave_member ) 
  1027.  
  1028. 	end 
  1029.  
  1030. 	if coop_is_active() then 
  1031. 		 
  1032. 		-- Clean up the coop waves 
  1033. 		for i, wave_member in pairs( wave_group.coop_only_members ) do 
  1034. 		 
  1035. 			on_death( "", wave_member ) 
  1036. 			on_take_damage( "", wave_member ) 
  1037.  
  1038. 		end 
  1039. 	end 
  1040.  
  1041.  
  1042. end 
  1043.  
  1044. -------------------------------------------------------------------------------------------------- 
  1045. 								--[[**********************]]-- 
  1046. 								--[[                      ]]-- 
  1047. 								--[[  Callback functions  ]]-- 
  1048. 								--[[                      ]]-- 
  1049. 								--[[**********************]]-- 
  1050. local processing_lava_player_local = false 
  1051. local processing_lava_player_remote = false								 
  1052. function mmTutorial_lava_trigger_callback( human, trigger ) 
  1053.  
  1054. 	if human == LOCAL_PLAYER then 
  1055. 		if (processing_lava_player_local == false) then 
  1056. 			-- if we aren't currently trying to warp the player, then warp them 
  1057. 			processing_lava_player_local = true 
  1058. 			 
  1059. 			delay( 1.0 ) 
  1060. 			fade_out( 0, 0, SYNC_LOCAL ) 
  1061. 			delay( 1.0 ) 
  1062. 			teleport( LOCAL_PLAYER, "Player_start_nav_host" ) 
  1063. 			fade_in( 0, 0, SYNC_LOCAL ) 
  1064. 			 
  1065. 			-- done warping the player 
  1066. 			processing_lava_player_local = false 
  1067. 		end 
  1068.  
  1069.  
  1070. 	elseif human == REMOTE_PLAYER then 
  1071. 		if (processing_lava_player_remote == false) then 
  1072. 			processing_lava_player_remote = true 
  1073. 			-- if we aren't currently trying to warp the player, then warp them 
  1074. 			 
  1075. 			delay( 1.0 ) 
  1076. 			fade_out( 0, 0, SYNC_REMOTE ) 
  1077. 			delay( 1.0 ) 
  1078. 			teleport( REMOTE_PLAYER, "Player_start_nav_client" ) 
  1079. 			fade_in( 0, 0, SYNC_REMOTE ) 
  1080. 			 
  1081. 			-- done warping the player 
  1082. 			processing_lava_player_remote = false 
  1083. 		end 
  1084.  
  1085. 	end 
  1086.  
  1087. end 
  1088.  
  1089.  
  1090. -------------------------------------------------------------------------------------------------- 
  1091. 								--[[**********************]]-- 
  1092. 								--[[                      ]]-- 
  1093. 								--[[   Thread functions   ]]-- 
  1094. 								--[[                      ]]-- 
  1095. 								--[[**********************]]-- 
  1096.  
  1097. function mmAuraTutorial_burn_all_targets_thread_func() 
  1098.  
  1099. 	while true do 
  1100.  
  1101. 		if mmAuraTutorial_CurrentEnemyCount == 0 and mmAuraTutorial_BurnAllTargetsResetting == false then 
  1102. 			mmAuraTutorial_BurnAllTargetsSuccessful = true 
  1103. 			break 
  1104. 		end 
  1105.  
  1106. 		thread_yield() 
  1107.  
  1108. 	end 
  1109.  
  1110. end