sr2lua/mission_globals.lua

  1. -- mission_globals.lua 
  2. -- SR2 global mission script 
  3. -- 4/11/07 
  4.  
  5. ---------------------- 
  6. -- Global Variables -- 
  7. ---------------------- 
  8.  
  9. --Strongold Globals 
  10. LAST_DOOR_OPENED = "" 
  11.  
  12. -- How often the pre-mission phonecall function checks 
  13. -- to see if a phonecall should be made to the player 
  14. PRE_MISSION_PHONECALL_UPDATE_DELAY_SECONDS	= 10 
  15. RECEIVED_PHONECALL_FUNCTION_SUFFIX				= "_phonecall" 
  16.  
  17. -- Cell phone calls received identifiers. Note that these are tracked as bits and  
  18. -- stored as a uint16, so we're currently limited to 16 unique calls. 
  19. CELLPHONE_CALL_TSS03							= 1 
  20. CELLPHONE_CALL_BH09                    = 2 
  21. CELLPHONE_CALL_BH11                    = 3 
  22. CELLPHONE_CALL_BH01							= 4 
  23. CELLPHONE_CALL_MID_MISSION             = 5 
  24.  
  25. -- TSS02 checks the route taken in TSS01, by default we will say the tutorial route was chosen 
  26. Tss01_tutorial_route_chosen				= true 
  27.  
  28. -- Special checkpoint data for BH07 
  29. Bh07_checkpoint_firebombers_complete	= false 
  30. Bh07_checkpoint_swat_complete				= false 
  31. Bh07_checkpoint_store_complete			= false 
  32. Bh07_checkpoint_coordinator_complete	= false 
  33.  
  34. -- Special checkpoint data for RN07 
  35. Rn07_gat_health								= 0 
  36.  
  37. -- Each defense objective has an associated trigger. If a player completes an objective while they are standing 
  38. -- inside the trigger of another incomplete objective, then they should immediately start or join that objective. 
  39. -- This structure keeps track of which defense objective triggers each player occupies. 
  40. Rn10_player_defense_objectives_occupied_at_checkpoint = 
  41. 	{ 
  42. 		[LOCAL_PLAYER]		= {}, 
  43. 		[REMOTE_PLAYER]	= {}, 
  44. 	} 
  45.  
  46. -- Ep01 requires the player(s) to save Pierce and Shaundi from the Ultor. In 
  47. -- coop, these objectives can be worked on simultaneously. In single player, 
  48. -- we have a checkpoint after one ltnt is saved. We can't do this in coop 
  49. -- because the other player might be in the middle of saving the other ltnt, 
  50. -- and our checkpointing system isn't robust enough to restart in the middle 
  51. -- of a sequence. Instead, we merely save the name of the ltnt. that has been 
  52. -- saved. 
  53. Ep01_lieutenant_saved						= "" 
  54.  
  55. -- Checks to see if all the missions in the passed-in table are 
  56. -- completed. Returns true if they are, false otherwise. 
  57. -- 
  58. -- missions: Names of the missions to check for completion. 
  59. -- 
  60. function missions_completed( missions ) 
  61.  
  62.    local all_completed = true 
  63.    for index, mission_name in pairs( missions ) do 
  64.       if ( mission_is_complete( mission_name ) == false ) then 
  65.          all_completed = false 
  66.       end 
  67.    end 
  68.  
  69.    return all_completed 
  70. end 
  71.  
  72. -- Have the player take a mid-mission phone call 
  73. -- 
  74. function mid_mission_phonecall(pickup_callback) 
  75.  
  76. 	-- Reset the mid-mission phone call 
  77. 	cellphone_reset_call( CELLPHONE_CALL_MID_MISSION ) 
  78. 	 
  79. 	-- Do the cellphone pre-mission phone call 
  80. 	audio_play_for_cellphone( CELLPHONE_INCOMING, 4, 1.5, 0.25, "RON2_INTRO_L1", "", true, pickup_callback, "", true) 
  81.  
  82. end 
  83.  
  84. function mid_mission_phonecall_reset() 
  85. 	cellphone_remove("RON2_INTRO_L1") 
  86.    cellphone_clear_between_call_delay() 
  87. end 
  88.  
  89. function mid_mission_phonecall_received() 
  90. 	cellphone_receive_call(CELLPHONE_CALL_MID_MISSION) 
  91. end 
  92.  
  93.  
  94. -- Do the actual pre-mission phone call 
  95. -- 
  96. function mission_globals_pre_mission_phonecall_do(mission_name, preq_missions, min_delay_s, max_delay_s, which_call, what_person, audio_tag, required_respect) 
  97. 	-- If the mission is already considered complete...exit thread 
  98. 	if ( mission_is_complete( mission_name ) ) then 
  99. 		return true 
  100. 	end 
  101.  
  102.    -- If there's a prereq or prereqs 
  103.    if ( preq_missions ~= nil ) then 
  104.       -- Turn it into a table if it's not 
  105.       if ( type( preq_missions ) ~= "table" ) then 
  106.          preq_missions = { preq_missions } 
  107.       end 
  108.  
  109.       -- If the prerequisite mission(s) are not complete delay 
  110.       while ( missions_completed( preq_missions ) == false ) do 
  111.          delay( PRE_MISSION_PHONECALL_UPDATE_DELAY_SECONDS ) 
  112.       end 
  113.    end 
  114. 	 
  115. 	-- If we do not have enough props to do this mission then delay 
  116. 	if (required_respect ~= nil) then 
  117. 		while ( get_player_respect( ) < required_respect ) do 
  118. 			delay( PRE_MISSION_PHONECALL_UPDATE_DELAY_SECONDS ) 
  119. 		end 
  120. 	end 
  121. 	 
  122. 	-- Delay a little while before we post the phone call (2 minutes) 
  123. 	delay( rand_int(min_delay_s, max_delay_s) ) 
  124. 	 
  125. 	-- If the cell call has already been received then do not do it 
  126. 	if ( cellphone_has_received_call( which_call ) ) then 
  127. 		return true 
  128. 	end 
  129. 	 
  130. 	-- Mission is not complete and the cell phone call has not been done yet so do the phone call 
  131. 	if ( not mission_is_complete( mission_name ) ) then 
  132. 		-- Do the cellphone pre-mission phone call 
  133. 		audio_play_for_cellphone( CELLPHONE_INCOMING, 4, 1.5, 0.75, audio_tag, what_person, false, "", 
  134.                                 mission_name..RECEIVED_PHONECALL_FUNCTION_SUFFIX ) 
  135.  
  136. 		-- If the mission is in progress then we need to kill the phone call... 
  137. 		-- 
  138. 		-- NOTE: The phone call is pre-mission only!!! 
  139. 		-- 
  140. 		-- Wait until the phone call is considered to be received 
  141. 		while (not cellphone_has_received_call(which_call)) do 
  142. 			-- While the phone call has not be received, look to see if the mission it is suppose to play before is active 
  143. 			if (mission_is_active(mission_name)) then 
  144. 				-- We are playing the mission the phone call is suppose to happen before so kill it 
  145. 				cellphone_remove(audio_tag) 
  146.  
  147. 				-- Wait until the mission is no longer active 
  148. 				while (mission_is_active(mission_name)) do 
  149. 					delay(1.0) 
  150. 				end 
  151.  
  152. 				-- Return false so the phone call will be posted again if possible 
  153. 				return false 
  154. 			end 
  155.  
  156. 			delay(1.0) 
  157. 		end 
  158. 	end 
  159.  
  160. 	return true 
  161. end 
  162.  
  163. -- Automatically handles a pre-mission phonecall. 
  164. -- IMPORTANT NOTE: Make sure that the mission_name.."_phonecall" function is defined and that it 
  165. --                 calls cellphone_receive_call() with the appropriate unique call ID, listed in 
  166. --                 the list with "CELLPHONE_CALL_"s 
  167. -- 
  168. --						Also, make sure this function is spawned as a thread...if not then it may not  
  169. --						work as intended 
  170. -- 
  171. -- mission_name: Name of the mission this phonecall is being made for. 
  172. -- preq_missions: Name of the prerequisite mission or missions that must be completed before this 
  173. --                mission can be played. Set to nil if this mission doesn't have prereqs. 
  174. -- min_delay_s: The minimum delay before the call is received once all requirements are met. 
  175. -- max_delay_s: The max delay before the call is received once all requirements are met. 
  176. -- which_call: The unique ID for the call. See the "CELLPHONE_CALL_" list. 
  177. -- what_person: Who's making the call. 
  178. -- audio_tag: The audio to play for the call. 
  179. -- min_respect: The minimum amount of respect(props) the player needs to have before receiving the call. 
  180. --  
  181. function mission_globals_pre_mission_phonecall(mission_name, preq_missions, min_delay_s, max_delay_s, which_call, what_person, audio_tag, min_respect) 
  182. 	-- Until the phone call has been received or "mission_name" has been completed, post the phone call 
  183.    while (not mission_globals_pre_mission_phonecall_do(mission_name, preq_missions, min_delay_s, max_delay_s, which_call, what_person, audio_tag, min_respect)) do 
  184. 		thread_yield() 
  185. 	end 
  186. end 
  187.  
  188. function mission_globals_init() 
  189. 	-- Init any data that is needed when the game is loaded...vary rarely should there be anything here 
  190. 	-- In SR1, this was mission_add(...). For SR2, this is done through a table file 
  191. end 
  192.  
  193. ---------------------------------- 
  194. -- Third Street Saints Prologue -- 
  195. ---------------------------------- 
  196.  
  197. function tss01_setup() 
  198. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  199. end 
  200.  
  201. function tss01_main() 
  202. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  203. end 
  204.  
  205. function tss01_skip_coop() 
  206. 	-- Called when the player skips a mission previously completed as a co-op client. 
  207.  
  208. 	-- Post the news events 
  209. 	radio_post_event("JANE_NEWS_TSSP01", true) 
  210.  
  211. end 
  212.  
  213. function tss02_setup() 
  214. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  215. end 
  216.  
  217. function tss02_main() 
  218. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  219. end 
  220.  
  221.  
  222. function tss02_skip_coop() 
  223. 	-- Called when the player skips a mission previously completed as a co-op client. 
  224.  
  225. 	-- Unlock all activities and diversions except heli. Both heli instances 
  226. 	-- have cutscenes w/ Shaundi and Pierce who are introduced in TSS04 so 
  227. 	-- heli is unlocked after sccessfully completeing that mission. 
  228. 	mission_unlock("crowd_ht") 
  229. 	mission_unlock("crowd_su") 
  230. 	mission_unlock("demoderby_un") 
  231. 	mission_unlock("drug_ai") 
  232. 	mission_unlock("drug_ht") 
  233. 	mission_unlock("escort_rl") 
  234. 	mission_unlock("escort_un") 
  235. 	mission_unlock("fight_ar") 
  236. 	mission_unlock("fight_pr") 
  237. 	mission_unlock("fraud_fc") 
  238. 	mission_unlock("fraud_mu") 
  239. 	mission_unlock("fuzz_pj") 
  240. 	mission_unlock("fuzz_sx") 
  241. 	mission_unlock("mayhem_nu") 
  242. 	mission_unlock("mayhem_st") 
  243. 	mission_unlock("sewage_rl") 
  244. 	mission_unlock("sewage_sx") 
  245. 	mission_unlock("snatch_ct") 
  246. 	mission_unlock("snatch_dt") 
  247. 	mission_unlock("torch_ap") 
  248. 	mission_unlock("torch_dt") 
  249. 	mission_unlock("zombie") 
  250.  
  251. end 
  252.  
  253. function tss03_setup() 
  254. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  255. end 
  256.  
  257. function tss03_phonecall() 
  258. 	cellphone_receive_call(CELLPHONE_CALL_TSS03) 
  259. end 
  260.  
  261. function tss03_main() 
  262. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  263. 	-- 
  264.  
  265. 	-- The player is required to have one bar of respect to start this mission 
  266. 	local min_respect = 8000 
  267.  
  268. 	-- Spawn a thread to watch the pre-mission phone call 
  269.    thread_new("mission_globals_pre_mission_phonecall", "tss03", "tss02", 10, 20, CELLPHONE_CALL_TSS03, "Gat", "GAT_TSSP03_PHONECALL_1", min_respect) 
  270. end 
  271.  
  272. function tss03_skip_coop() 
  273. 	-- Called when the player skips a mission previously completed as a co-op client. 
  274.  
  275. 	-- Post the news event 
  276. 	radio_post_event("JANE_NEWS_TSSP03", true) 
  277.  
  278. end 
  279.  
  280. function tss04_setup() 
  281. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  282. end 
  283.  
  284. function tss04_main() 
  285. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  286. end 
  287.  
  288. function tss04_skip_coop() 
  289. 	-- Called when the player skips a mission previously completed as a co-op client. 
  290.  
  291. 	-- Post the news event 
  292. 	radio_post_event("JANE_NEWS_TSSP04", true) 
  293.  
  294. 	-- Unlock heli activities. Both instances include cutscenes w/ Shaundi and Pierce who 
  295. 	-- aren't introduced until this mission. Most activities are unlocked after tss02. 
  296. 	mission_unlock("heli_br") 
  297. 	mission_unlock("heli_tp") 
  298.  
  299. end 
  300.  
  301.  
  302. ----------------- 
  303. -- Brotherhood -- 
  304. ----------------- 
  305.  
  306. function bh01_setup() 
  307. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  308. end 
  309.  
  310. function bh01_phonecall() 
  311. 	cellphone_receive_call(CELLPHONE_CALL_BH01) 
  312. end 
  313. function bh01_main() 
  314. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  315.    thread_new("mission_globals_pre_mission_phonecall", "bh01", "tss04", 10, 60, CELLPHONE_CALL_BH01, "Carlos", "CARLOS_BR01_PHONECALL_2") 
  316. end 
  317.  
  318. function bh02_setup() 
  319. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  320. end 
  321.  
  322. function bh02_main() 
  323. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  324. end 
  325.  
  326. function bh03_setup() 
  327. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  328. end 
  329.  
  330. function bh03_main() 
  331. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  332. end 
  333.  
  334. function bh04_setup() 
  335. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  336. end 
  337.  
  338. function bh04_main() 
  339. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  340. end 
  341.  
  342. function bh05_setup() 
  343. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  344. end 
  345.  
  346. function bh05_main() 
  347. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  348. end 
  349.  
  350. function bh06_setup() 
  351. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  352. end 
  353.  
  354. function bh06_main() 
  355. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  356. end 
  357.  
  358. function bh07_setup() 
  359. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  360. end 
  361.  
  362. function bh07_main() 
  363. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  364. end 
  365.  
  366. function bh08_setup() 
  367. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  368. end 
  369.  
  370. function bh08_main() 
  371. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  372. end 
  373.  
  374. function bh08_skip_coop() 
  375. 	-- Called when the player skips a mission previously completed as a co-op client. 
  376.  
  377. 	-- Post the news event 
  378. 	radio_post_event("JANE_NEWS_BR08", true) 
  379.  
  380. end 
  381.  
  382. function bh09_setup() 
  383. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  384. end 
  385.  
  386. function bh09_phonecall() 
  387. 	cellphone_receive_call(CELLPHONE_CALL_BH09) 
  388. end 
  389.  
  390. function bh09_main() 
  391. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  392. 	-- 
  393. 	 
  394. 	-- Spawn a thread to watch the pre-mission phone call 
  395.    thread_new("mission_globals_pre_mission_phonecall", "bh09", "bh08", 10, 60, CELLPHONE_CALL_BH09, "Shaundi", "BR09_SHAUNDI_PHONECALL_1") 
  396. end 
  397.  
  398. function bh10_setup() 
  399. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  400. end 
  401.  
  402. function bh10_main() 
  403. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  404. end 
  405.  
  406. function bh11_phonecall() 
  407. 	cellphone_receive_call(CELLPHONE_CALL_BH11) 
  408. end 
  409.  
  410. function bh11_setup() 
  411. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  412. end 
  413.  
  414. function bh11_main() 
  415. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  416.    local prereqs = { "bh10", "sh_bh_airport", "sh_bh_apartments", "sh_bh_chinatown", "sh_bh_docks" } 
  417.     
  418. 	-- Spawn a thread to watch the pre-mission phone call 
  419.    thread_new("mission_globals_pre_mission_phonecall", "bh11", prereqs, 10, 60, CELLPHONE_CALL_BH11, "Maero", "MAERO_BR11_PHONECALL_1") 
  420. end 
  421.  
  422. ----------- 
  423. -- Ronin -- 
  424. ----------- 
  425.  
  426. -- Players locations are tracked during rn01. We need to declare those 
  427. -- variables here so that the locations are available when restarting 
  428. -- from checkpoints. 
  429. Rn01_local_player_location		= "" 
  430. Rn01_remote_player_location	= "" 
  431.  
  432. Rn04_vehicle_homie				= "" 
  433.  
  434. function rn01_setup() 
  435. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  436. end 
  437.  
  438. function rn01_main() 
  439. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  440. end 
  441.  
  442. function rn01_skip_coop() 
  443. 	-- Called when the player skips a mission previously completed as a co-op client. 
  444.  
  445. 	-- Post the news event 
  446. 	radio_post_event("JANE_NEWS_RON01", true) 
  447.  
  448. end 
  449.  
  450. function rn02_setup() 
  451. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  452. end 
  453.  
  454. function rn02_main() 
  455. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  456. end 
  457.  
  458. function rn03_setup() 
  459. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  460. end 
  461.  
  462. function rn03_main() 
  463. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  464. end 
  465.  
  466. function rn04_setup() 
  467. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  468. end 
  469.  
  470. function rn04_main() 
  471. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  472. end 
  473.  
  474. function rn05_setup() 
  475. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  476. end 
  477.  
  478. function rn05_main() 
  479. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  480. end 
  481.  
  482. function rn06_setup() 
  483. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  484. end 
  485.  
  486. function rn06_main() 
  487. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  488. end 
  489.  
  490. function rn07_setup() 
  491. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  492. end 
  493.  
  494. function rn07_main() 
  495. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  496. end 
  497.  
  498. function rn08_setup() 
  499. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  500. end 
  501.  
  502. function rn08_main() 
  503. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  504. end 
  505.  
  506. function rn09_setup() 
  507. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  508. end 
  509.  
  510. function rn09_main() 
  511. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  512. end 
  513.  
  514. function rn10_setup() 
  515. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  516. end 
  517.  
  518. function rn10_main() 
  519. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  520. end 
  521.  
  522. function rn11_setup() 
  523. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  524. end 
  525.  
  526. function rn11_main() 
  527. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  528. end 
  529.  
  530. function rn11_skip_coop() 
  531. 	-- Called when the player skips a mission previously completed as a co-op client. 
  532.  
  533. 	-- Post the news event 
  534. 	radio_post_event("JANE_NEWS_RON11", true) 
  535.  
  536. end 
  537.  
  538. -------------------- 
  539. -- Sons of Samedi -- 
  540. -------------------- 
  541.  
  542. function ss01_setup() 
  543. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  544. end 
  545.  
  546. function ss01_main() 
  547. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  548. end 
  549.  
  550. function ss02_setup() 
  551. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  552. end 
  553.  
  554. function ss02_main() 
  555. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  556. end 
  557.  
  558. function ss03_setup() 
  559. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  560. end 
  561.  
  562. function ss03_main() 
  563. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  564. end 
  565.  
  566. function ss04_setup() 
  567. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  568. end 
  569.  
  570. function ss04_main() 
  571. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  572. end 
  573.  
  574. function ss05_setup() 
  575. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  576. end 
  577.  
  578. function ss05_main() 
  579. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  580. end 
  581.  
  582. function ss05_on_coop_skip() 
  583.    local CHUNK_SWAP_FIRES = { "Chunk_Fire_1", "Chunk_Fire_2", "Lab_Fire_1", "Lab_Fire_2", "Lab_Fire_3" } 
  584.  
  585.    for index, name in pairs( CHUNK_SWAP_FIRES ) do 
  586.       chunk_swap_sequence_start( name, false ) 
  587. 		 
  588. 		chunk_swap_sequence_make_permanent( name ) 
  589.    end 
  590.  
  591. 	-- Post the news event 
  592. 	radio_post_event("JANE_NEWS_SOS05", true) 
  593.  
  594. end 
  595.  
  596. function ss06_setup() 
  597. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  598. end 
  599.  
  600. function ss06_main() 
  601. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  602. end 
  603.  
  604. function ss07_setup() 
  605. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  606. end 
  607.  
  608. function ss07_main() 
  609. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  610. end 
  611.  
  612. function ss08_setup() 
  613. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  614. end 
  615.  
  616. function ss08_main() 
  617. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  618. end 
  619.  
  620. function ss09_setup() 
  621. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  622. end 
  623.  
  624. function ss09_main() 
  625. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  626. end 
  627.  
  628. function ss10_setup() 
  629. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  630. end 
  631.  
  632. function ss10_main() 
  633. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  634. end 
  635.  
  636. function ss11_setup() 
  637. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  638. end 
  639.  
  640. function ss11_main() 
  641. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  642. end 
  643.  
  644. ---------------------------------- 
  645. -- Third Street Saints Epilogue -- 
  646. ---------------------------------- 
  647.  
  648. function ep01_setup() 
  649. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  650. end 
  651.  
  652. function ep01_main() 
  653. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  654. end 
  655.  
  656. function ep02_setup() 
  657. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  658. end 
  659.  
  660. function ep02_main() 
  661. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  662. end 
  663.  
  664. function ep02_skip_coop() 
  665. 	-- Called when the player skips a mission previously completed as a co-op client. 
  666.  
  667. 	-- Post the news event 
  668. 	radio_post_event("JANE_NEWS_TSSE02", true) 
  669. end 
  670.  
  671. function ep03_setup() 
  672. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  673. end 
  674.  
  675. function ep03_main() 
  676. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  677. end 
  678.  
  679. function ep03_skip_coop() 
  680. 	-- Called when the player skips a mission previously completed as a co-op client. 
  681.  
  682. 	-- Post the news event 
  683. 	radio_post_event("JANE_NEWS_TSSE03", true) 
  684. end 
  685.  
  686. function ep04_setup() 
  687. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  688. end 
  689.  
  690. function ep04_main() 
  691. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  692. end 
  693.  
  694. function ep04_skip_coop() 
  695. 	-- Called when the player skips a mission previously completed as a co-op client. 
  696.  
  697. 	-- Post the news event 
  698. 	radio_post_event("JANE_NEWS_TSSE04", true) 
  699. end 
  700.  
  701. ---------------------------------- 
  702. -- Third Street Saints Emergent -- 
  703. ---------------------------------- 
  704.  
  705. function em01_setup() 
  706. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  707. end 
  708.  
  709. function em01_main() 
  710. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  711.  
  712. 	-- If this mission has been completed then just ignore 
  713. 	if (mission_is_complete("em01") or mission_is_unlocked("em01")) then 
  714. 		return 
  715. 	end 
  716. 	 
  717. 	-- Make sure the prologue is finished 
  718. 	while (not mission_is_complete("tss04")) do 
  719. 		thread_yield() 
  720. 	end 
  721.  
  722. 	-- Setup our trigger callback to unlock the mission 
  723. 	--trigger_enable("mission_start_sr2_city_$em01_unlock", true) 
  724. 	--ingame_effect_add_trigger("mission_start_sr2_city_$em01_unlock", INGAME_EFFECT_LOCATION, SYNC_ALL) 
  725. end 
  726.  
  727. function em01_skip_coop() 
  728. 	-- Called when the player skips a mission previously completed as a co-op client. 
  729.  
  730. 	-- Post the news event 
  731. 	radio_post_event("JANE_NEWS_BONUS", true) 
  732.  
  733. end 
  734.  
  735. function em02_setup() 
  736. 	-- Setup/restore mission data after being unlock/cleanup respectively. 
  737. end 
  738.  
  739. function em02_main() 
  740. 	-- Special process that needs to happen during or after the mission is completed...such as a cellphone call 
  741. end 
  742.