./sr4_5_city.lua

  1. --SR4_5_city Lua file  
  2.  
  3.  
  4. -- Gameplay Choice IDs - 
  5. -- these should match values from level_scripts.cpp 
  6. MISSION_06_CHOICE = 0 
  7. MISSION_22_CHOICE = 1 
  8. MISSION_21_CHOICE = 2 
  9.  
  10. M06_CHOICE_BLOWN_TOWER = true; 
  11. M06_CHOICE_BRANDED_TOWER = false; 
  12. M22_CHOICE_KILLBANE_KILL = true; 
  13. M22_CHOICE_KILLBANE_ESCAPE = false; 
  14. M21_CHOICE_KILLBANE_UNMASKED = true; 
  15. M21_CHOICE_KILLBANE_NOT_UNMASKED = false; 
  16.  
  17. QOC_ASHA				= 0 
  18. QOC_BEN_KING		= 1 
  19. QOC_CID				= 2 
  20. QOC_JOHNNY_GAT		= 3 
  21. QOC_KINZIE			= 4 
  22. QOC_MATT_MILLER	= 5 
  23. QOC_PIERCE			= 6 
  24. QOC_VP				= 7 
  25. QOC_SHAUNDI			= 8 
  26. QOC_SR2_SHAUNDI	= 9 
  27. QOC_VLAD = 10 
  28. QOC_BLACKBEARD = 11 
  29. QOC_DANE = 12 
  30. QOC_VIOLA = 13 
  31. QOC_SHAKESPEARE = 14 
  32.  
  33. sr4_5_city_CONTACTS = { 
  34. 	{ type = QOC_ASHA,			npc = "Asha_01",			trigger = "asha_trigger"			}, 
  35. 	{ type = QOC_BEN_KING,		npc = "Ben_King_01",		trigger = "ben_king_trigger"		}, 
  36. 	{ type = QOC_CID,			npc = "CID_01",				trigger = "cid_trigger"				}, 
  37. 	{ type = QOC_JOHNNY_GAT,	npc = "Johnny_Gat_01",		trigger = "johnny_gat_trigger"	}, 
  38. 	{ type = QOC_KINZIE,		npc = "Kinzie_01",			trigger = "kinzie_trigger"			}, 
  39. 	{ type = QOC_MATT_MILLER,	npc = "Matt_Miller_01",		trigger = "matt_miller_trigger"	}, 
  40. 	{ type = QOC_PIERCE,		npc = "Pierce_01",			trigger = "pierce_trigger"			}, 
  41. 	{ type = QOC_SHAUNDI,		npc = "Shaundi_01",			trigger = "shaundi_trigger"		}, 
  42. 	{ type = QOC_VP,			npc = "VP_01",				trigger = "vp_trigger"				}, 
  43. 	{ type = QOC_VLAD,										trigger = "Vlad_trigger"			}, 
  44. 	{ type = QOC_BLACKBEARD,								trigger = "Blackbeard_trigger"			}, 
  45. 	{ type = QOC_DANE,			npc = "Dane_01",			trigger = "dane_trigger"			}, 
  46. 	{ type = QOC_VIOLA,										trigger = "Kiki_trigger"			}, 
  47. 	{ type = QOC_SHAKESPEARE,								trigger = "Shake_trigger"			}, 
  48. 	{ type = QOC_SR2_SHAUNDI,	trigger = "shaduni_sr2_trigger" }, 
  49. } 
  50.  
  51. function sr4_5_city_init() 
  52. 	--group_create( "sr3_weapons", false) -- Is this still needed? 
  53. 	quest_log_configure_contact_triggers( sr4_5_city_CONTACTS ) 
  54. 	 
  55. end 
  56.  
  57.  
  58. function sr4_5_city_main() 
  59. 	ember_on() 
  60. 	--hotspot_set_waypoint( "MG_Entertainment" ) 
  61. end 
  62.  
  63. function sr4_5_city_init_client() 
  64. 	quest_log_configure_contact_triggers( sr4_5_city_CONTACTS ) 
  65. 	 
  66. 	 
  67. end 
  68.  
  69. function sr4_5_city_main_client() 
  70. end 
  71.  
  72. function mm_1_2_coop_skip( from_gamesave ) 
  73. 	player_unlock_super_power(6) -- Jump 
  74. 	player_unlock_super_power(5) -- Sprint 
  75. end 
  76.  
  77. function mm_1_3_coop_skip( from_gamesave ) 
  78. 	player_unlock_super_power(3) -- Blast 
  79. 	unlockable_unlock("ragdoll_recovery") -- Air Recovery 
  80. end 
  81.  
  82. function m05_coop_skip( from_gamesave ) 
  83. 	player_unlock_super_power(0) -- Telekinesis 
  84. end 
  85.  
  86. function mm_4_1_coop_skip( from_gamesave ) 
  87. 	player_unlock_super_power(1) -- Stomp 
  88. end 
  89.  
  90. function m14_coop_skip( from_gamesave ) 
  91. 	player_unlock_super_power(2) -- Buff 
  92. end 
  93.  
  94. function m15_3_coop_skip( from_gamesave ) 
  95. 	player_unlock_super_power(4) -- Shield 
  96. 	player_unlock_super_power(7) -- DFA 
  97. end 
  98.  
  99. function mm_1_3_setup() 
  100.  
  101. 	-- NZ: Reset hotspot in case player abandons mission 
  102. 	hotspot_reset("Hotspot_NW") 
  103.  
  104. end 
  105.  
  106.  
  107. --===========================GLOBALS==================================== 
  108. -- tables of 'line played' flags for each homie dialogue line 
  109. --====================================================================== 
  110. sr4_5_city_globals = { 
  111.  
  112. 		-- the max number of times you'll get a modal dialogue scene with someone within the same ship visit 
  113. 		num_talks_allowed = 3, 
  114.  
  115. 		 
  116. 		--ship dialogue flags; table of flags for each line situation 
  117. 		said_asha_line = { 
  118. 						benking = false, 
  119. 						cid = false, 
  120. 						keithdavid = false, 
  121. 						kinzie = false, 
  122. 						pierce = false, 
  123. 						shaundi = false, 
  124. 						matt = false, 
  125. 						gat = false, 
  126. 		}, 
  127. 		said_cid_line = { 
  128. 						asha = false, 
  129. 						benking = false, 
  130. 						keithdavid = false, 
  131. 						kinzie = false, 
  132. 						pierce = false, 
  133. 						shaundi = false, 
  134. 						matt = false, 
  135. 						gat = false, 
  136. 		}, 
  137. 		said_johnny_line = { 
  138. 						asha = false, 
  139. 						benking = false, 
  140. 						cid = false,						 
  141. 						keithdavid = false, 
  142. 						kinzie = false, 
  143. 						pierce = false, 
  144. 						shaundi = false, 
  145. 						matt = false, 
  146. 						gat = true, 
  147. 		},		 
  148. 		said_king_line = { 
  149. 						asha = false, 
  150. 						cid = false,						 
  151. 						keithdavid = false, 
  152. 						kinzie = false, 
  153. 						pierce = false, 
  154. 						shaundi = false, 
  155. 						matt = false, 
  156. 						gat = false, 
  157. 		}, 
  158. 		said_kinzie_line = { 
  159. 						asha = false, 
  160. 						benking = false, 
  161. 						cid = false,						 
  162. 						keithdavid = false, 
  163. 						kinzie = true, 
  164. 						pierce = false, 
  165. 						shaundi = false, 
  166. 						matt = false, 
  167. 						gat = false, 
  168. 		},		 
  169. 		said_matt_line = { 
  170. 						asha = false, 
  171. 						benking = false, 
  172. 						cid = false,						 
  173. 						keithdavid = false, 
  174. 						kinzie = false, 
  175. 						pierce = false, 
  176. 						shaundi = false, 
  177. 						matt = true, 
  178. 						gat = false, 
  179. 		},		 
  180. 		said_pierce_line = { 
  181. 						asha = false, 
  182. 						benking = false, 
  183. 						cid = false,						 
  184. 						keithdavid = false, 
  185. 						kinzie = false, 
  186. 						shaundi = false, 
  187. 						matt = false, 
  188. 						gat = false, 
  189. 		},		 
  190. 		said_shaundi_line = { 
  191. 						asha = false, 
  192. 						benking = false, 
  193. 						cid = false,						 
  194. 						keithdavid = false, 
  195. 						kinzie = false, 
  196. 						pierce = false, 
  197. 						matt = false, 
  198. 						gat = false, 
  199. 		}, 
  200. 		said_shaundi_sr2_line = { 
  201. 						asha = false, 
  202. 						benking = false, 
  203. 						cid = false,						 
  204. 						keithdavid = false, 
  205. 						kinzie = false, 
  206. 						pierce = false, 
  207. 						shaundi = false, 
  208. 						matt = false, 
  209. 						gat = false, 
  210. 		}, 
  211. 		said_vp_line = { 
  212. 						asha = false, 
  213. 						benking = false, 
  214. 						cid = false,						 
  215. 						kinzie = false, 
  216. 						pierce = false, 
  217. 						shaundi = false, 
  218. 						matt = false, 
  219. 						gat = false, 
  220. 		}, 
  221. 		said_earth_line = { 
  222. 						asha = false, 
  223. 						benking = false, 
  224. 						cid = false,						 
  225. 						keithdavid = false, 
  226. 						kinzie = false, 
  227. 						pierce = false, 
  228. 						shaundi = false, 
  229. 						matt = false, 
  230. 						gat = false, 
  231. 		},		 
  232. 		said_key_line = { 
  233. 						asha = false, 
  234. 						benking = false, 
  235. 						cid = false,						 
  236. 						keithdavid = false, 
  237. 						kinzie = false, 
  238. 						pierce = false, 
  239. 						shaundi = false, 
  240. 						matt = false, 
  241. 						gat = false, 
  242. 		}, 
  243. 		said_kinzie_kidnapped_line = { 
  244. 						asha = false, 
  245. 						benking = false, 
  246. 						cid = false,						 
  247. 						pierce = false, 
  248. 						shaundi = false, 
  249. 						matt = false, 
  250. 						gat = false, 
  251. 		}, 
  252. 		said_kinzie_rescued_line = { 
  253. 						asha = false, 
  254. 						benking = false, 
  255. 						cid = false,						 
  256. 						keithdavid = false, 
  257. 						kinzie = false, 
  258. 						pierce = false, 
  259. 						shaundi = false, 
  260. 						matt = false, 
  261. 						gat = false, 
  262. 		}, 
  263. 		said_loyalty_complete_line = { 
  264. 						asha = false, 
  265. 						benking = false, 
  266. 						keithdavid = false, 
  267. 						kinzie = false, 
  268. 						matt = false, 
  269. 						pierce = false, 
  270. 						shaundi = false, 
  271. 						cid = true, 
  272. 						gat = true, 
  273. 		}, 
  274. 		said_mech_line = { 
  275. 						asha = false, 
  276. 						benking = false, 
  277. 						cid = false,						 
  278. 						keithdavid = false, 
  279. 						kinzie = false, 
  280. 						pierce = false, 
  281. 						shaundi = false, 
  282. 						matt = false, 
  283. 						gat = false, 
  284. 		}, 
  285. 		said_ship_name_line = { 
  286. 						asha = false, 
  287. 						benking = false, 
  288. 						cid = false,						 
  289. 						keithdavid = false, 
  290. 						kinzie = false, 
  291. 						pierce = false, 
  292. 						shaundi = false, 
  293. 						matt = false, 
  294. 						gat = false, 
  295. 		}, 
  296. 		said_working_on_mech_line = { 
  297. 						kinzie = false, 
  298. 						asha = true, 
  299. 						benking = true, 
  300. 						cid = true,						 
  301. 						keithdavid = true, 
  302. 						pierce = true, 
  303. 						shaundi = true, 
  304. 						matt = true, 
  305. 						gat = false, 
  306. 		}, 
  307. 	} 
  308.  
  309.  
  310. sr4_5_city_CRIBSHIP_num_talks = { 
  311.  
  312. 	-- number of times you talked to an NPC (in a modal sequence) on a given ship visit 
  313. 	num_benking_talks = 0, 
  314. 	num_cid_talks = 0, 
  315. 	num_keithdavid_talks = 0, 
  316. 	num_kinzie_talks = 0, 
  317. 	num_pierce_talks = 0, 
  318. 	num_shaundi_talks = 0, 
  319. 	num_matt_talks = 0, 
  320. 	num_gat_talks = 0, 
  321. 	num_asha_talks = 0, 
  322. 	 
  323. } 
  324.  
  325. sr4_5_city_CRIBSHIP_sex_flags = { 
  326. 		 
  327. 	-- sex flags 
  328. 	flag_benking_sex = false, 
  329. 	flag_cid_sex = false, 
  330. 	flag_keithdavid_sex = false, 
  331. 	flag_kinzie_sex = false, 
  332. 	flag_pierce_sex = false, 
  333. 	flag_shaundi_sex = false, 
  334. 	flag_matt_sex = false, 
  335. 	flag_gat_sex = false, 
  336. 	flag_asha_sex = false, 
  337.  
  338. } 
  339. 	 
  340. --===========================TRIGGERS=================================== 
  341. -- 
  342. --====================================================================== 
  343. sr4_5_city_trigger = { 
  344. 		-- = { 
  345. 		--           name = "johnnygat_con_trig_lean", 
  346. 		--           hit = false, 
  347. 		--  (optional)callback = "sr4_5_city_function_name_cb" 
  348. 		--(optional)marker = TRIGGER_LOCATION or TRIGGER_USE or custom or don't include for no marker 
  349. 		--  (optional)waypoint = true, 
  350. 		--  (optional)teleport_to = { 
  351. 		--             host = "host_nav", 
  352. 		--             client = "client_nav"  
  353. 		--},                           
  354. 		--(optional)conversation = M_RAIL_convo.convo_name  -- play a conversation 
  355. 		--}, 
  356. 						 
  357. 	talk_to_gat_lean = { 
  358. 					name = "johnnygat_con_trig_lean", 
  359. 					hit = false, 
  360. 					callback = "sr4_5_city_talk_to_gat", 
  361. 	}, 
  362. 	talk_to_gat_crates = { 
  363. 					name = "johnnygat_con_trig_crates", 
  364. 					hit = false, 
  365. 					callback = "sr4_5_city_talk_to_gat", 
  366. 	},	 
  367. 	talk_to_gat_chair = { 
  368. 					name = "johnnygat_con_trig_purplechair", 
  369. 					hit = false, 
  370. 					callback = "sr4_5_city_talk_to_gat", 
  371. 	}, 
  372. 	talk_to_shaundi_stand = { 
  373. 					name = "shaundi_con_trig_stand", 
  374. 					hit = false, 
  375. 					callback = "sr4_5_city_talk_to_shaundi", 
  376. 	}, 
  377. 	talk_to_shaundi_catwalk = { 
  378. 					name = "shaundi_con_trig_catwalk", 
  379. 					hit = false, 
  380. 					callback = "sr4_5_city_talk_to_shaundi", 
  381. 	}, 
  382. 	talk_to_shaundi_ctrl = { 
  383. 					name = "shaundi_con_trig_controlroom", 
  384. 					hit = false, 
  385. 					callback = "sr4_5_city_talk_to_shaundi", 
  386. 	}, 
  387. 	talk_to_shaundi_sit = { 
  388. 					name = "shaundi_con_trig_sit", 
  389. 					hit = false, 
  390. 					callback = "sr4_5_city_talk_to_shaundi", 
  391. 	},	 
  392. 	talk_to_kinzie_bag = { 
  393. 					name = "kinzie_con_trig_beanbag", 
  394. 					hit = false, 
  395. 					callback = "sr4_5_city_talk_to_kinzie", 
  396. 	}, 
  397. 	talk_to_kinzie_control = { 
  398. 					name = "kinzie_con_trig_controlroom", 
  399. 					hit = false, 
  400. 					callback = "sr4_5_city_talk_to_kinzie", 
  401. 	},	 
  402. 	talk_to_kinzie_mech = { 
  403. 					name = "kinzie_con_trig_mech", 
  404. 					hit = false, 
  405. 					callback = "sr4_5_city_talk_to_kinzie", 
  406. 	},	 
  407. 	talk_to_asha_bag = { 
  408. 					name = "asha_con_trig_gymbag", 
  409. 					hit = false, 
  410. 					callback = "sr4_5_city_talk_to_asha", 
  411. 	}, 
  412. 	talk_to_asha_bench = { 
  413. 					name = "asha_con_trig_benchpress", 
  414. 					hit = false, 
  415. 					callback = "sr4_5_city_talk_to_asha", 
  416. 	},	 
  417. 	talk_to_asha_stretch = { 
  418. 					name = "asha_con_trig_stretching", 
  419. 					hit = false, 
  420. 					callback = "sr4_5_city_talk_to_asha", 
  421. 	},	 
  422. 	talk_to_ben_lean = { 
  423. 					name = "benking_con_trig_lean", 
  424. 					hit = false, 
  425. 					callback = "sr4_5_city_talk_to_benking", 
  426. 	}, 
  427. 	talk_to_ben_chair = { 
  428. 					name = "benking_con_trig_chair", 
  429. 					hit = false, 
  430. 					callback = "sr4_5_city_talk_to_benking", 
  431. 	}, 
  432. 	talk_to_ben_toilet = { 
  433. 					name = "benking_con_trig_toilet", 
  434. 					hit = false, 
  435. 					callback = "sr4_5_city_talk_to_benking", 
  436. 	},	 
  437. 	talk_to_cid = { 
  438. 					name = "cid_con_trig_sexroom", 
  439. 					hit = false, 
  440. 					callback = "sr4_5_city_talk_to_cid", 
  441. 	}, 
  442. 	talk_to_matt_couch = { 
  443. 					name = "mattmiller_con_trig_couch", 
  444. 					hit = false, 
  445. 					callback = "sr4_5_city_talk_to_matt", 
  446. 	}, 
  447. 	talk_to_matt_tv = { 
  448. 					name = "mattmiller_con_trig_tv", 
  449. 					hit = false, 
  450. 					callback = "sr4_5_city_talk_to_matt", 
  451. 	}, 
  452. 	talk_to_matt_crates = { 
  453. 					name = "mattmiller_con_trig_crates", 
  454. 					hit = false, 
  455. 					callback = "sr4_5_city_talk_to_matt", 
  456. 	}, 
  457. 	talk_to_matt_dep = { 
  458. 					name = "mattmiller_con_trig_depressed", 
  459. 					hit = false, 
  460. 					callback = "sr4_5_city_talk_to_matt", 
  461. 	},	 
  462. 	talk_to_pierce = { 
  463. 					name = "pierce_con_trig_couch", 
  464. 					hit = false, 
  465. 					callback = "sr4_5_city_talk_to_pierce", 
  466. 	}, 
  467. 	talk_to_pierce_egg = { 
  468. 					name = "pierce_con_trig_eggchair", 
  469. 					hit = false, 
  470. 					callback = "sr4_5_city_talk_to_pierce", 
  471. 	},	 
  472. 	talk_to_pierce_pool = { 
  473. 					name = "pierce_con_trig_pooltable", 
  474. 					hit = false, 
  475. 					callback = "sr4_5_city_talk_to_pierce", 
  476. 	},	 
  477. 	talk_to_vp_vport = { 
  478. 					name = "vp_con_trig_stand", 
  479. 					hit = false, 
  480. 					callback = "sr4_5_city_talk_to_vp", 
  481. 	}, 
  482. 	talk_to_vp_cat = { 
  483. 					name = "vp_con_trig_catwalk", 
  484. 					hit = false, 
  485. 					callback = "sr4_5_city_talk_to_vp", 
  486. 	}, 
  487. 	talk_to_vp_chair = { 
  488. 					name = "vp_con_trig_chair", 
  489. 					hit = false, 
  490. 					callback = "sr4_5_city_talk_to_vp", 
  491. 	},	 
  492. 	 
  493. 	--sex triggers 
  494. 	asha_sex = { 
  495. 					name = "asha_sex_trigger", 
  496. 					hit = false, 
  497. 					callback = "sr4_5_city_asha_sex", 
  498. 	}, 
  499. 	ben_king_sex = { 
  500. 					name = "ben_king_sex_trigger", 
  501. 					hit = false, 
  502. 					callback = "sr4_5_city_benking_sex", 
  503. 	}, 
  504. 	cid_sex = { 
  505. 					name = "cid_sex_trigger", 
  506. 					hit = false, 
  507. 					callback = "sr4_5_city_cid_sex", 
  508. 	}, 
  509. 	gat_sex = { 
  510. 					name = "johnny_gat_sex_trigger", 
  511. 					hit = false, 
  512. 					callback = "sr4_5_city_gat_sex", 
  513. 	}, 
  514. 	kinzie_sex = { 
  515. 					name = "kinzie_sex_trigger", 
  516. 					hit = false, 
  517. 					callback = "sr4_5_city_kinzie_sex", 
  518. 	}, 
  519. 	matt_sex = { 
  520. 					name = "matt_miller_sex_trigger", 
  521. 					hit = false, 
  522. 					callback = "sr4_5_city_matt_sex", 
  523. 	}, 
  524. 	pierce_sex = { 
  525. 					name = "pierce_sex_trigger", 
  526. 					hit = false, 
  527. 					callback = "sr4_5_city_pierce_sex", 
  528. 	}, 
  529. 	shaundi_sex = { 
  530. 					name = "shaundi_sex_trigger", 
  531. 					hit = false, 
  532. 					callback = "sr4_5_city_shaundi_sex", 
  533. 	},	 
  534. 	vp_sex = { 
  535. 					name = "vp_sex_trigger", 
  536. 					hit = false, 
  537. 					callback = "sr4_5_city_vp_sex", 
  538. 	}, 
  539. 	 
  540. --[[	hack_cargo = { 
  541. 					name = "hack_sim1_trig", 
  542. 					hit = false, 
  543. 					use_nav = "hack_sim1_nav", 
  544. 					use_anim = "m24 computer hack",					 
  545. 					callback = "sr4_5_city_do_hack", 
  546. 	},	 
  547. ]]	 
  548. 	-- txt adventure computer 
  549. 	start_txt_adventure = { 
  550. 					name = "Text_Adventure_Trigger", 
  551. 					hit = false, 
  552. 					use_nav = "txt_adventure_nav", 
  553. 					use_anim = "m24 computer hack", 
  554. 					callback = "ship_start_text_adventure_cb", 
  555. 					--conversation = sr4_5_city_convo.Matt_Talk_01 
  556. 	}, 
  557. } 
  558.  
  559.  
  560.  
  561. sr4_5_city_ship_action_nodes = { 
  562.  
  563. 	asha = { 
  564. 					{ 
  565. 						-- bag lean 
  566. 						name = "asha_baglean", -- "asha_baglean" 
  567. 						talk_trig = "asha_con_trig_gymbag", 
  568. 						sex_trig = "asha_sex_trigger", 
  569. 						contact_trig = "asha_trigger", 
  570. 						sex_nav = "asha_sex_nav", 
  571. 					},	 
  572. 					{ 
  573. 						-- bench press 
  574. 						name = "asha_benchsit", -- "asha_benchsit" "asha_bench_shp" 
  575. 						talk_trig = "asha_con_trig_benchpress", -- "asha_con_trig_benchpress" 
  576. 						sex_trig = "asha_sex_trigger", 
  577. 						contact_trig = "asha_trigger", 
  578. 						sex_nav = "asha_sex_nav", 
  579. 					},	 
  580. 					{ 
  581. 						-- on floor stretching 
  582. 						name = "asha_shp_stretch", -- "asha_shp_stretch" "asha_stretch_ship" "Situps_Asha" 
  583. 						talk_trig = "asha_con_trig_stretching", -- "asha_con_trig_stretching" 
  584. 						sex_trig = "asha_sex_trigger", 
  585. 						contact_trig = "asha_trigger", 
  586. 						sex_nav = "asha_sex_nav", 
  587. 					}, 
  588. 	}, 
  589. 	benking = { 
  590. 					{ 
  591. 						-- leaning on table 
  592. 						name = "King_leaning", -- "King_leaning" 
  593. 						talk_trig = "benking_con_trig_lean", 
  594. 						sex_trig = "ben_king_sex_trigger", 
  595. 						contact_trig = "ben_king_trigger", 
  596. 						sex_nav = "ben_king_sex_nav", 
  597. 					},	 
  598. 					{ 
  599. 						-- sitting in purple chair 
  600. 						name = "King_ship_pchair", -- "King_ship_pchair" 
  601. 						talk_trig = "benking_con_trig_chair", 
  602. 						sex_trig = "ben_king_sex_trigger", 
  603. 						contact_trig = "ben_king_trigger", 
  604. 						sex_nav = "ben_king_sex_nav", 
  605. 					},	 
  606. 					{ 
  607. 						-- space toilet 
  608. 						name = "pierce_shp_toilet", -- "pierce_shp_toilet" 
  609. 						talk_trig = "benking_con_trig_toilet", 
  610. 						sex_trig = "ben_king_sex_trigger", 
  611. 						contact_trig = "ben_king_trigger", 
  612. 						sex_nav = "benking_sex_nav_toilet", 
  613. 					}, 
  614. 	}, 
  615. 	cid = { 
  616. 					{ 
  617. 						-- sex room 
  618. 						name = "Ship_Cid_Float", 
  619. 						talk_trig = "cid_con_trig_sexroom", 
  620. 						sex_trig = "cid_sex_trigger", 
  621. 						contact_trig = "cid_trigger", 
  622. 						sex_nav = "cid_sex_nav", 
  623. 					}, 
  624. 	}, 
  625. 	gat = { 
  626. 					{ 
  627. 						-- leaning on locker w/knife 
  628. 						name = "Ship_Gat_Locker", -- "Ship_Gat_Locker" 
  629. 						talk_trig = "johnnygat_con_trig_lean", -- "johnnygat_con_trig_lean" 
  630. 						sex_trig = "johnny_gat_sex_trigger", 
  631. 						contact_trig = "johnny_gat_trigger", 
  632. 						sex_nav = "johnny_gat_sex_nav", 
  633. 					},	 
  634. 					{ 
  635. 						-- sitting on crate cleaning gun 
  636. 						name = "gat ship gunclean", -- "gat ship gunclean" 
  637. 						talk_trig = "johnnygat_con_trig_crates", -- johnnygat_con_trig_crates 
  638. 						sex_trig = "johnny_gat_sex_trigger", 
  639. 						contact_trig = "johnny_gat_trigger", 
  640. 						sex_nav = "johnny_gat_sex_nav", 
  641. 					},	 
  642. 					{ 
  643. 						-- sitting in purple chair 
  644. 						name = "Ship_Gat_sit", -- "Ship_Gat_sit" 
  645. 						talk_trig = "johnnygat_con_trig_purplechair", -- johnnygat_con_trig_purplechair 
  646. 						sex_trig = "johnny_gat_sex_trigger", 
  647. 						contact_trig = "johnny_gat_trigger", 
  648. 						sex_nav = "johnny_gat_sex_nav", 
  649. 					}, 
  650. 	},	 
  651. 	kinzie = { 
  652. 					{ 
  653. 						-- working on mech 
  654. 						name = "shp_kinz_mchbox", -- "shp_kinz_mchbox"  
  655. 						talk_trig = "kinzie_con_trig_mech", -- "kinzie_con_trig_mech", 
  656. 						sex_trig = "kinzie_sex_trigger", 
  657. 						contact_trig = "kinzie_trigger", 
  658. 						sex_nav = "kinzie_sex_nav_mech", -- "kinzie_sex_nav_mech", 
  659. 					},	 
  660. 					{ 
  661. 						-- nemo chair 
  662. 						name = "kinzie_nemo", -- "kinzie_nemo" 
  663. 						talk_trig = nil, 
  664. 						sex_trig = nil, 
  665. 						contact_trig = nil, 
  666. 						sex_nav = nil, 
  667. 					},	 
  668. 					{ 
  669. 						-- control room 
  670. 						name = "Kinz_shp_computer", -- "Kinz_shp_computer" 
  671. 						talk_trig = "kinzie_con_trig_controlroom", -- "kinzie_con_trig_controlroom" 
  672. 						sex_trig = "kinzie_sex_trigger", 
  673. 						contact_trig = "kinzie_trigger", 
  674. 						sex_nav = "kinzie_sex_nav_controlroom", -- "kinzie_sex_nav_controlroom" 
  675. 					},					 
  676. 					{ 
  677. 						-- typing in beanbag chair 
  678. 						name = "kinzie_typing", -- "kinzie_typing" 
  679. 						talk_trig = "kinzie_con_trig_beanbag", -- "kinzie_con_trig_beanbag", 
  680. 						sex_trig = "kinzie_sex_trigger", 
  681. 						contact_trig = "kinzie_trigger", 
  682. 						sex_nav = "kinzie_sex_nav", -- "kinzie_sex_nav" 
  683. 					}, 
  684. 					{ 
  685. 						-- tube 
  686. 						name = "shp_kinzie_tiptoe", -- "shp_kinzie_tiptoe" 
  687. 						talk_trig = "kinzie_con_trig_beanbag", -- "kinzie_con_trig_beanbag", 
  688. 						sex_trig = "kinzie_sex_trigger", 
  689. 						contact_trig = "kinzie_trigger", 
  690. 						sex_nav = "kinzie_sex_nav", -- "kinzie_sex_nav" 
  691. 					}, 
  692. 	}, 
  693. 	matt = { 
  694. 					{ 
  695. 						-- depressed sitting at computer 
  696. 						name = "shp_matt_computer", -- "shp_matt_computer" 
  697. 						talk_trig = "mattmiller_con_trig_depressed", -- "mattmiller_con_trig_depressed", 
  698. 						sex_trig = "matt_miller_sex_trigger", 
  699. 						contact_trig = "matt_miller_trigger", 
  700. 						sex_nav = "mattmiller_sex_nav_depressed", -- "mattmiller_sex_nav_depressed", 
  701. 					},	 
  702. 					{ 
  703. 						-- couch w/game 
  704. 						name = "Matt_ship_couch", -- "Matt_ship_couch" 
  705. 						talk_trig = "mattmiller_con_trig_couch", -- mattmiller_con_trig_couch 
  706. 						sex_trig = "matt_miller_sex_trigger", 
  707. 						contact_trig = "matt_miller_trigger", 
  708. 						sex_nav = "matt_miller_sex_nav", -- matt_miller_sex_nav 
  709. 					},	 
  710. 					{ 
  711. 						-- standing at tv 
  712. 						name = "Matt_tv", --"Matt_tv" 
  713. 						talk_trig = "mattmiller_con_trig_tv", -- "mattmiller_con_trig_tv" 
  714. 						sex_trig = "matt_miller_sex_trigger", 
  715. 						contact_trig = "matt_miller_trigger", 
  716. 						sex_nav = "matt_miller_sex_nav", -- matt_miller_sex_nav 
  717. 					},	 
  718. 					{ 
  719. 						-- sitting on crates fixing electronics 
  720. 						name = "Matt_shp_crates", --"Matt_shp_crates" 
  721. 						talk_trig = "mattmiller_con_trig_crates", -- mattmiller_con_trig_crates 
  722. 						sex_trig = "matt_miller_sex_trigger", 
  723. 						contact_trig = "matt_miller_trigger", 
  724. 						sex_nav = "mattmiller_sex_nav_crates", -- mattmiller_sex_nav_crates 
  725. 					}, 
  726. 	},	 
  727. 	pierce = { 
  728. 					{ 
  729. 						-- laying on couch 
  730. 						name = "Pierce_couch", -- "Pierce_couch" 
  731. 						talk_trig = "pierce_con_trig_couch", -- pierce_con_trig_couch 
  732. 						sex_trig = "pierce_sex_trigger", 
  733. 						contact_trig = "pierce_trigger", 
  734. 						sex_nav = "pierce_sex_nav", 
  735. 					},	 
  736. 					{ 
  737. 						-- pool table 
  738. 						name = "Pirc_ship_pltable", -- "Pirc_ship_pltable" 
  739. 						talk_trig = "pierce_con_trig_pooltable", -- pierce_con_trig_pooltable 
  740. 						sex_trig = "pierce_sex_trigger", 
  741. 						contact_trig = "pierce_trigger", 
  742. 						sex_nav = "pierce_sex_nav", 
  743. 					},	 
  744. 					{ 
  745. 						-- egg chair 
  746. 						name = "Peirce_reading", -- "Peirce_reading" 
  747. 						talk_trig = "pierce_con_trig_eggchair", -- pierce_con_trig_eggchair 
  748. 						sex_trig = "pierce_sex_trigger", 
  749. 						contact_trig = "pierce_trigger", 
  750. 						sex_nav = "pierce_sex_nav", 
  751. 					}, 
  752. 	},	 
  753. 	shaundi = { 
  754. 					{ 
  755. 						-- control room 
  756. 						name = "Shp_shndi_pTble", -- "Shp_shndi_pTble" 
  757. 						talk_trig = "shaundi_con_trig_controlroom", -- "shaundi_con_trig_controlroom", 
  758. 						sex_trig = "shaundi_sex_trigger", 
  759. 						contact_trig = "shaundi_trigger", 
  760. 						sex_nav = "shaundi_sex_nav_controlroom", -- "shaundi_sex_nav_controlroom", 
  761. 					},	 
  762. 					{ 
  763. 						-- depressed sitting on catwalk 
  764. 						name = "Shndi_railsit", -- "Shndi_railsit" 
  765. 						talk_trig = "shaundi_con_trig_catwalk", -- "shaundi_con_trig_catwalk", 
  766. 						sex_trig = "shaundi_sex_trigger", 
  767. 						contact_trig = "shaundi_trigger", 
  768. 						sex_nav = "shaundi_sex_nav_catwalk", -- "shaundi_sex_nav_catwalk", 
  769. 					},	 
  770. 					{ 
  771. 						-- standing on bridge 
  772. 						name = "shaundi_shp_stnd", -- "shaundi_shp_stnd" 
  773. 						talk_trig = "shaundi_con_trig_stand", -- shaundi_con_trig_stand 
  774. 						sex_trig = "shaundi_sex_trigger", 
  775. 						contact_trig = "shaundi_trigger", 
  776. 						sex_nav = "shaundi_sex_nav", 
  777. 					}, 
  778. 					{ 
  779. 						-- in/near chair on bridge 
  780. 						name = "Shandi_bridge_sit", -- "Shandi_bridge_sit" 
  781. 						talk_trig = "shaundi_con_trig_sit", -- shaundi_con_trig_sit 
  782. 						sex_trig = "shaundi_sex_trigger", 
  783. 						contact_trig = "shaundi_trigger", 
  784. 						sex_nav = "shaundi_sex_nav", 
  785. 					}, 
  786. 	},		 
  787. 	vp = { 
  788. 					{ 
  789. 						-- standing on catwalk 
  790. 						name = "kiethD_shp_catwlk", -- "kiethD_shp_catwlk" 
  791. 						talk_trig = "vp_con_trig_catwalk", -- "vp_con_trig_catwalk" 
  792. 						sex_trig = "vp_sex_trigger", 
  793. 						contact_trig = "vp_trigger", 
  794. 						sex_nav = nil, 
  795. 					},	 
  796. 					{ 
  797. 						-- sitting in chair on bridge 
  798. 						name = "Keith_cmpter_shp", -- "Keith_cmpter_shp" 
  799. 						talk_trig = "vp_con_trig_chair", -- vp_con_trig_chair 
  800. 						sex_trig = "vp_sex_trigger", 
  801. 						contact_trig = "vp_trigger", 
  802. 						sex_nav = nil, 
  803. 					},	 
  804. 					{ 
  805. 						-- standing in bridge looking thru viewfinder 
  806. 						name = "shp_keith_vport", -- "shp_keith_vport" 
  807. 						talk_trig = "vp_con_trig_stand", -- vp_con_trig_stand 
  808. 						sex_trig = "vp_sex_trigger", 
  809. 						contact_trig = "vp_trigger", 
  810. 						sex_nav = nil, 
  811. 					},	 
  812. 	},		 
  813. } 
  814.  
  815.  
  816. --========================CONVERSATIONS================================= 
  817. -- have around 200 lines, all of which play outside a mission context and mostly in modal sequences, so no convo table currently 
  818. -- lines play as individual persona lines 
  819. -- however if we find we need a convo table added let me (alvan) know 
  820. -- 
  821. --====================================================================== 
  822.  
  823. sr4_5_city_convo = {} 
  824.  
  825. --called from do_dialogue; decides what line to play based on player progression and returns string for that line situation 
  826. function get_line_situation( npc ) 
  827.  
  828. 	if ( ( npc == "asha" and mission_is_complete( "mol_jb_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or 
  829. 		( npc == "benking" and mission_is_complete( "mol_bk_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or 
  830. 		( npc == "gat" and mission_is_complete( "mol_jg_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or 
  831. 		( npc == "kinzie" and mission_is_complete( "mol_kz_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or 
  832. 		( npc == "matt" and mission_is_complete( "mol_mm_01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or 
  833. 		( npc == "pierce" and mission_is_complete( "mol_p01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) or 
  834. 		( npc == "shaundi" and mission_is_complete( "mol_sh01" ) and sr4_5_city_globals.said_loyalty_complete_line[npc] == false ) ) then 
  835. 		 
  836. 		sr4_5_city_globals.said_loyalty_complete_line[npc] = true	 
  837. 		return "ship_loyalty_complete" 
  838.  
  839. 	elseif mission_is_complete( "m19" ) and not mission_is_complete( "m22-1" ) and (sr4_5_city_globals.said_key_line[npc] == false) then 
  840. 		--message("key line", 2.0, false) 
  841. 		sr4_5_city_globals.said_key_line[npc] = true	 
  842. 		return "ship_getting_key_ready" 
  843. 		 
  844. 	elseif mission_is_complete( "m19" ) and (sr4_5_city_globals.said_kinzie_rescued_line[npc] == false) then 
  845. 		--message("kinzie rescued line", 2.0, false) 
  846. 		sr4_5_city_globals.said_kinzie_rescued_line[npc] = true	 
  847. 		return "ship_kinzie_rescued" 
  848. 		 
  849. 	elseif mission_is_complete( "m16" ) and not mission_is_complete( "m19" ) and (sr4_5_city_globals.said_kinzie_kidnapped_line[npc] == false) then 
  850. 		--message("kinzie kidnapped line", 2.0, false) 
  851. 		sr4_5_city_globals.said_kinzie_kidnapped_line[npc] = true	 
  852. 		return "ship_kinzie_kidnapped" 
  853. 		 
  854. 	elseif mission_is_complete( "m15_3" ) and (sr4_5_city_globals.said_johnny_line[npc] == false) then 
  855. 		--message("johnny line", 2.0, false) 
  856. 		sr4_5_city_globals.said_johnny_line[npc] = true 
  857. 		return "ship_comment_on_johnny" 
  858. 		 
  859. 	elseif mission_is_complete( "m11" ) and (sr4_5_city_globals.said_asha_line[npc] == false) then 
  860. 		--message("asha line", 2.0, false) 
  861. 		sr4_5_city_globals.said_asha_line[npc] = true	 
  862. 		return "ship_comment_on_asha" 
  863. 		 
  864. 	elseif mission_is_complete( "m10" ) and (sr4_5_city_globals.said_king_line[npc] == false) then 
  865. 		--message("king line", 2.0, false) 
  866. 		sr4_5_city_globals.said_king_line[npc] = true	 
  867. 		return "ship_comment_on_king" 
  868. 		 
  869. 	elseif mission_is_complete( "m09" ) and (sr4_5_city_globals.said_pierce_line[npc] == false) then 
  870. 		--message("pierce line", 2.0, false) 
  871. 		sr4_5_city_globals.said_pierce_line[npc] = true	 
  872. 		return "ship_comment_on_pierce" 
  873. 		 
  874. 	elseif mission_is_complete( "m08" ) and (sr4_5_city_globals.said_shaundi_line[npc] == false) then	 
  875. 		--message("shaundi line", 2.0, false) 
  876. 		sr4_5_city_globals.said_shaundi_line[npc] = true	 
  877. 		return "ship_comment_on_shaundi" 
  878. 		 
  879. 	elseif mission_is_complete( "m08" ) and (sr4_5_city_globals.said_shaundi_sr2_line[npc] == false) then 
  880. 		--message("shaundi sr2 line", 2.0, false) 
  881. 		sr4_5_city_globals.said_shaundi_sr2_line[npc] = true	 
  882. 		return "ship_comment_on_shaundi_sr2" 
  883. 		 
  884. 	elseif mission_is_complete( "m08" ) and (sr4_5_city_globals.said_cid_line[npc] == false) then	 
  885. 		--message("cid line", 2.0, false) 
  886. 		sr4_5_city_globals.said_cid_line[npc] = true	 
  887. 		return "ship_comment_on_cid" 
  888. 		 
  889. 	elseif mission_is_complete( "m07" ) and (sr4_5_city_globals.said_mech_line[npc] == false) then 
  890. 		--message("mech line", 2.0, false) 
  891. 		sr4_5_city_globals.said_mech_line[npc] = true	 
  892. 		return "ship_mech_comment" 
  893. 		 
  894. 	elseif mission_is_complete( "m03" ) and (sr4_5_city_globals.said_earth_line[npc] == false) then 
  895. 		--message("earth line", 2.0, false) 
  896. 		sr4_5_city_globals.said_earth_line[npc] = true 
  897. 		return "ship_earth_blew_up" 
  898. 		 
  899. 	elseif mission_is_complete( "m03" ) and (sr4_5_city_globals.said_vp_line[npc] == false) then	 
  900. 		--message("vp line", 2.0, false) 
  901. 		sr4_5_city_globals.said_vp_line[npc] = true 
  902. 		return "ship_comment_on_vp"		 
  903. 		 
  904. 	elseif mission_is_complete( "m03" ) and (sr4_5_city_globals.said_kinzie_line[npc] == false) then 
  905. 		--message("kinzie line", 2.0, false) 
  906. 		sr4_5_city_globals.said_kinzie_line[npc] = true 
  907. 		return "ship_comment_on_kinzie" 
  908. 	 
  909. 	else 
  910. 		--message("generic line", 2.0, false) 
  911. 		return "ship_generic_comment" 
  912. 		 
  913. 	end 
  914. end 
  915.  
  916.  
  917. --do modal dialogue sequence w/camera cut; selects line to play, sets camera, plays line etc. 
  918. function do_dialogue( npc_flag, npc_name ) 
  919. 	local count = 0 
  920. 	local situation 
  921. 	 
  922. 	--figure out which line to play 
  923. 	situation = get_line_situation( npc_flag ) 
  924. 	 
  925. 	--setup, play 
  926. 	player_controls_disable( LOCAL_PLAYER ) 
  927. 	camera_set_target( npc_name, true, SYNC_LOCAL ) 
  928. 	audio_play_persona_line( npc_name, situation ) 
  929. 	 
  930. 	--wait till line is done playing or 20 seconds have passed 
  931. 	while ( audio_persona_line_playing( npc_name ) and count <= 80 ) do 
  932. 		delay(0.25) 
  933. 		count = count + 1 
  934. 	end 
  935. 	 
  936. 	--cleanup 
  937. 	player_controls_enable( LOCAL_PLAYER ) 
  938. 	camera_revert_target( true, SYNC_LOCAL ) 
  939. end 
  940.  
  941.  
  942. --dialogue wrapper function 
  943. function do_dialogue_wrapper( talk_trig, sex_trig, num_talks, npc_flag, npc_name ) 
  944. 	local count = 0 
  945. 	 
  946. 	sr4_5_city_CRIBSHIP_num_talks[num_talks] = sr4_5_city_CRIBSHIP_num_talks[num_talks] + 1 
  947. 	trigger_enable( talk_trig, false ) 
  948. 	trigger_enable( sex_trig, false ) 
  949. 	 
  950. 	if ( sr4_5_city_CRIBSHIP_num_talks[num_talks] <= sr4_5_city_globals.num_talks_allowed) then 
  951. 		--do modal dialogue sequence 
  952. 		character_hide( LOCAL_PLAYER )  
  953. 		do_dialogue( npc_flag, npc_name ) 
  954. 		character_show( LOCAL_PLAYER )  
  955. 	else 
  956. 		--do non-modal busy line 
  957. 		audio_play_persona_line( npc_name, "ship_generic_comment" ) 
  958. 		--audio_play_persona_line( npc_name, "ship_busy" ) 
  959. 		while ( audio_persona_line_playing( npc_name ) and count <= 50 ) do 
  960. 			delay(0.25) 
  961. 			count = count + 1 
  962. 		end 
  963. 	end 
  964. 	 
  965. 	trigger_enable( talk_trig, true ) 
  966. 	trigger_enable( sex_trig, true ) 
  967. end 
  968.  
  969.  
  970. --dialogue trigger callbacks 
  971. function sr4_5_city_talk_to_kinzie( human, talk_trig ) 
  972. 	do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.kinzie_sex.name, "num_kinzie_talks", "kinzie", "Kinzie_01" ) 
  973. 	--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_kinzie.name, sr4_5_city_trigger.kinzie_sex.name, "num_kinzie_talks", "kinzie", "Kinzie_01", "kinzie_dlg_aft_player01", "kinzie_dlg_aft_cam02a", "kinzie_dlg_aft_cam02b") 
  974. end 
  975.  
  976. function sr4_5_city_talk_to_pierce( human, talk_trig ) 
  977. 	do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.pierce_sex.name, "num_pierce_talks", "pierce", "Pierce_01" ) 
  978. 	--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_pierce.name, sr4_5_city_trigger.pierce_sex.name, "num_pierce_talks", "pierce", "Pierce_01", "pierce_dlg_pool_player01", "pierce_dlg_pool_cam01a", "pierce_dlg_pool_cam01b") 
  979. end 
  980.  
  981. function sr4_5_city_talk_to_shaundi( human, talk_trig ) 
  982. 	do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.shaundi_sex.name, "num_shaundi_talks", "shaundi", "Shaundi_01" ) 
  983. 	--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_shaundi.name, sr4_5_city_trigger.shaundi_sex.name, "num_shaundi_talks", "shaundi", "Shaundi_01", "shaundi_dlg_brdg_player01", "shaundi_dlg_brdg_cam02a", "shaundi_dlg_brdg_cam02b") 
  984. end 
  985.  
  986. function sr4_5_city_talk_to_asha( human, talk_trig ) 
  987. 	do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.asha_sex.name, "num_asha_talks", "asha", "Asha_01" ) 
  988. 	--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_asha.name, sr4_5_city_trigger.asha_sex.name, "num_asha_talks", "asha", "Asha_01", "asha_dlg_bag_player01", "asha_dlg_bag_cam01a", "asha_dlg_bag_cam01b") 
  989. end 
  990.  
  991. function sr4_5_city_talk_to_benking( human, talk_trig ) 
  992. 	do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.ben_king_sex.name, "num_benking_talks", "benking", "Ben_King_01" ) 
  993. 	--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_ben.name, sr4_5_city_trigger.ben_king_sex.name, "num_benking_talks", "benking", "Ben_King_01", "benking_dlg_messhall_player01", "benking_dlg_messhall_cam01a", "benking_dlg_messhall_cam01b") 
  994. end 
  995.  
  996. function sr4_5_city_talk_to_cid( human, talk_trig ) 
  997. 	do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.cid_sex.name, "num_cid_talks", "cid", "CID_01" ) 
  998. 	--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_cid.name, sr4_5_city_trigger.cid_sex.name, "num_cid_talks", "cid", "CID_01", "cid_dlg_storage_player01", "cid_dlg_storage_cam01a", "cid_dlg_storage_cam01b") 
  999. end 
  1000.  
  1001. function sr4_5_city_talk_to_vp( human, talk_trig ) 
  1002. 	do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.vp_sex.name, "num_keithdavid_talks", "keithdavid", "VP_01" ) 
  1003. 	--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_vp.name, sr4_5_city_trigger.vp_sex.name, "num_keithdavid_talks", "keithdavid", "VP_01", "vp_dlg_brdg_player01", "vp_dlg_brdg_cam01a", "vp_dlg_brdg_cam01b") 
  1004. end 
  1005.  
  1006. function sr4_5_city_talk_to_matt( human, talk_trig ) 
  1007. 	do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.matt_sex.name, "num_matt_talks", "matt", "Matt_Miller_01" ) 
  1008. 	--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_matt.name, sr4_5_city_trigger.matt_sex.name, "num_matt_talks", "matt", "Matt_Miller_01", "matt_dlg_storage_player", "matt_dlg_storage_cam01a", "matt_dlg_storage_cam01b") 
  1009. end 
  1010.  
  1011. function sr4_5_city_talk_to_gat( human, talk_trig ) 
  1012. 	do_dialogue_wrapper( talk_trig, sr4_5_city_trigger.gat_sex.name, "num_gat_talks", "gat", "Johnny_Gat_01" ) 
  1013. 	--do_dialogue_wrapper( sr4_5_city_trigger.talk_to_gat.name, sr4_5_city_trigger.gat_sex.name, "num_gat_talks", "gat", "Johnny_Gat_01", "gat_dlg_deck_player01", "gat_dlg_deck_cam01a", "gat_dlg_deck_cam01b") 
  1014. end 
  1015.  
  1016.  
  1017. --====================SEX CALLBACKS AND DO_SEX FUNCTION==================== 
  1018. -- 
  1019. -- 
  1020. -- 
  1021. --========================================================================= 
  1022.  
  1023. --do modal sex sequence OR play no sex line 
  1024. function do_sex( node_table, msn_trig, npc, npc_flag, anim, length ) 
  1025.  
  1026. 	local msn_trig_was_active = false 
  1027. 	local active_node = nil 
  1028. 	local active_talk_trig = nil 
  1029. 	local active_sex_trig = nil 
  1030. 	local sex_nav = nil 
  1031. 	local count = 0 
  1032. 	 
  1033. 	-- figure out which action node is active 
  1034. 	for i = 1, #node_table do 
  1035. 		if ( node_table[i].talk_trig ~= nil and trigger_is_enabled( node_table[i].talk_trig ) ) then 
  1036. 			active_node = node_table[i].name 
  1037. 			active_talk_trig = node_table[i].talk_trig 
  1038. 			active_sex_trig = node_table[i].sex_trig 
  1039. 			sex_nav = node_table[i].sex_nav 
  1040. 			break 
  1041. 		end 
  1042. 	end 
  1043.  
  1044. 	-- disable triggers 
  1045. 	if ( active_sex_trig ~= nil ) then 
  1046. 		trigger_enable( active_sex_trig, false ) 
  1047. 	end 
  1048. 	if ( active_talk_trig ~= nil ) then 
  1049. 		trigger_enable( active_talk_trig, false ) 
  1050. 	end	 
  1051. 	if ( trigger_is_enabled( msn_trig ) == true ) then 
  1052. 		msn_trig_was_active = true 
  1053. 		trigger_enable( msn_trig, false ) 
  1054. 	end 
  1055. 	 
  1056. 	if ( npc == "VP_01" ) then 
  1057. 	 
  1058. 		-- vp 
  1059. 		audio_play_persona_line( npc, "ship_no_sex_ever" ) 
  1060.  
  1061. 		-- wait until line finishes, or 20 seconds have passed (whichever comes first) 
  1062. 		while ( audio_persona_line_playing( "VP_01" ) and count <= 80 ) do 
  1063. 			delay(0.25) 
  1064. 			count = count + 1 
  1065. 		end 
  1066. 		 
  1067. 		delay(0.25)		 
  1068. 		 
  1069. 	else 
  1070. 	 
  1071. 		-- all other homies 
  1072. 		if ( sr4_5_city_CRIBSHIP_sex_flags[npc_flag] == false ) then 
  1073. 		 
  1074. 			--start modal sex sequence 
  1075. 			sr4_5_city_CRIBSHIP_sex_flags[npc_flag] = true 
  1076. 			fade_out(0.5, SFX_FADE_ALPHA_FADE, SYNC_LOCAL) 
  1077. 			delay(0.5) 
  1078. 			 
  1079. 			--teleport to sex nav 
  1080. 			if ( sex_nav ~= nil ) then 
  1081. 				teleport( npc, sex_nav ) 
  1082. 			end 
  1083. 			 
  1084. 			player_controls_disable( LOCAL_PLAYER )		 
  1085. 			action_play_synced_non_blocking( LOCAL_PLAYER, npc, anim, sex_nav, SYNC_LOCAL ) 
  1086. 			 
  1087. 			if (npc == "Shaundi_01") then 
  1088. 				character_hide( "VP_01" ) 
  1089. 			end 
  1090. 			 
  1091. 			delay(0.75) 
  1092. 			fade_in(0.5, SFX_FADE_ALPHA_FADE, SYNC_LOCAL, {0,0,0} ) 
  1093.  
  1094. 			delay( length ) 
  1095. 			 
  1096. 			fade_out(0.75, SFX_FADE_ALPHA_FADE, SYNC_LOCAL) 
  1097. 			delay(6) 
  1098. 			 
  1099. 			if (active_node ~= nil) then 
  1100. 				npc_use_closest_action_node_of_type(npc, active_node, 200, true ) 
  1101. 			end 
  1102. 			 
  1103. 			delay(0.5) 
  1104. 			player_controls_enable( LOCAL_PLAYER ) 
  1105. 			 
  1106. 			if (npc == "Shaundi_01") then 
  1107. 				character_show( "VP_01" ) 
  1108. 			end		 
  1109. 			 
  1110. 			fade_in(0.75, SFX_FADE_ALPHA_FADE, SYNC_LOCAL, {0,0,0} ) 
  1111. 			 
  1112. 		else 
  1113. 		 
  1114. 			--play no sex line 
  1115. 			audio_play_persona_line( npc, "ship_no_sex_right_now" )	 
  1116. 			 
  1117. 			-- wait until line finishes, or 20 seconds have passed (whichever comes first) 
  1118. 			while ( audio_persona_line_playing( npc ) and count <= 80 ) do 
  1119. 				delay(0.25) 
  1120. 				count = count + 1 
  1121. 			end 
  1122.  
  1123. 			delay(0.25) 
  1124. 			 
  1125. 		end 
  1126. 		 
  1127. 	end 
  1128. 	 
  1129. 	-- reactivate triggers if necessary 
  1130. 	if ( active_sex_trig ~= nil ) then 
  1131. 		trigger_enable( active_sex_trig, true ) 
  1132. 	end 
  1133. 	if ( active_talk_trig ~= nil ) then 
  1134. 		trigger_enable( active_talk_trig, true ) 
  1135. 	end 
  1136. 	if ( msn_trig_was_active == true ) then 
  1137. 		trigger_enable( msn_trig, true ) 
  1138. 	end 
  1139. 	 
  1140. end 
  1141.  
  1142.  
  1143. --sex trigger callbacks 
  1144. function sr4_5_city_asha_sex() 
  1145. 	local node_table = sr4_5_city_ship_action_nodes.asha 
  1146. 	local contact_trig = "asha_trigger" 
  1147. 	local npc = "Asha_01" 
  1148. 	local flag = "flag_asha_sex" 
  1149. 	local anim = "FuckBuddy Asha" 
  1150. 	local anim_duration = 13.5 
  1151. 	 
  1152. 	gds_sex("Asha_01", "fb - asha") 
  1153. 	do_sex( node_table, contact_trig, npc, flag, anim, anim_duration ) 
  1154. 	stat_increment("fb - asha") 
  1155. 	 
  1156. 	--do_sex( "asha_sex_nav", false, sr4_5_city_trigger.asha_sex.name, sr4_5_city_trigger.talk_to_asha.name, "", "", "", "", 14.0, "asha_baglean", true ) 
  1157. end 
  1158.  
  1159. function sr4_5_city_benking_sex() 
  1160. 	local node_table = sr4_5_city_ship_action_nodes.benking 
  1161. 	local contact_trig = "ben_king_trigger" 
  1162. 	local npc = "Ben_King_01" 
  1163. 	local flag = "flag_benking_sex" 
  1164. 	local anim = "FuckBuddy King" 
  1165. 	local anim_duration = 32.5 
  1166. 	 
  1167. 	gds_sex("Ben_King_01", "fb - ben") 
  1168. 	do_sex( node_table, contact_trig, npc, flag, anim, anim_duration ) 
  1169. 	stat_increment("fb - ben") 
  1170. 	 
  1171. 	--do_sex( "ben_king_sex_nav", true, sr4_5_city_trigger.ben_king_sex.name, sr4_5_city_trigger.talk_to_ben.name, "ben_king_trigger", "Ben_King_01", "flag_benking_sex", "FuckBuddy King", 32.5, "King_leaning", true ) 
  1172. end 
  1173.  
  1174. function sr4_5_city_cid_sex() 
  1175. 	local node_table = sr4_5_city_ship_action_nodes.cid 
  1176. 	local contact_trig = "cid_trigger" 
  1177. 	local npc = "CID_01" 
  1178. 	local flag = "flag_cid_sex" 
  1179. 	local anim = "FuckBuddy Cid" 
  1180. 	local anim_duration = 10.25 
  1181. 	 
  1182. 	gds_sex("CID_01", "fb - cid") 
  1183. 	do_sex( node_table, contact_trig, npc, flag, anim, anim_duration ) 
  1184. 	stat_increment("fb - cid") 
  1185. 	 
  1186. 	--do_sex( "cid_sex_nav", false, sr4_5_city_trigger.cid_sex.name, sr4_5_city_trigger.talk_to_cid.name, "cid_trigger", "CID_01", "flag_cid_sex", "FuckBuddy Cid", 10.25, nil, nil ) 
  1187. end 
  1188.  
  1189. function sr4_5_city_gat_sex() 
  1190. 	local node_table = sr4_5_city_ship_action_nodes.gat 
  1191. 	local contact_trig = "johnny_gat_trigger" 
  1192. 	local npc = "Johnny_Gat_01" 
  1193. 	local flag = "flag_gat_sex" 
  1194. 	local anim = "FuckBuddy Gat" 
  1195. 	local anim_duration = 32.0 
  1196. 	 
  1197. 	gds_sex("Johnny_Gat_01", "fb - gat") 
  1198. 	do_sex( node_table, contact_trig, npc, flag, anim, anim_duration ) 
  1199. 	stat_increment("fb - gat") 
  1200. 	 
  1201. 	--do_sex( "johnny_gat_sex_nav", true, sr4_5_city_trigger.gat_sex.name, sr4_5_city_trigger.talk_to_gat.name, "johnny_gat_trigger", "Johnny_Gat_01", "flag_gat_sex", "FuckBuddy Gat", 33.0, "Ship_Gat_Locker", true ) 
  1202. end 
  1203.  
  1204. function sr4_5_city_kinzie_sex() 
  1205. 	local node_table = sr4_5_city_ship_action_nodes.kinzie 
  1206. 	local contact_trig = "kinzie_trigger" 
  1207. 	local npc = "Kinzie_01" 
  1208. 	local flag = "flag_kinzie_sex" 
  1209. 	local anim = "FuckBuddy Kinzie" 
  1210. 	local anim_duration = 5.5 
  1211. 	 
  1212. 	gds_sex("Kinzie_01", "fb - kinzie") 
  1213. 	do_sex( node_table, contact_trig, npc, flag, anim, anim_duration ) 
  1214. 	stat_increment("fb - kinzie") 
  1215. 	 
  1216. 	--do_sex( "kinzie_sex_nav", false, sr4_5_city_trigger.kinzie_sex.name, sr4_5_city_trigger.talk_to_kinzie.name, "kinzie_trigger", "Kinzie_01", "flag_kinzie_sex", "FuckBuddy Kinzie", 5.5, "kinzie_typing", true ) 
  1217. end 
  1218.  
  1219. function sr4_5_city_matt_sex() 
  1220. 	local node_table = sr4_5_city_ship_action_nodes.matt 
  1221. 	local contact_trig = "matt_miller_trigger" 
  1222. 	local npc = "Matt_Miller_01" 
  1223. 	local flag = "flag_matt_sex" 
  1224. 	local anim = "FuckBuddy Matt" 
  1225. 	local anim_duration = 20.5 
  1226. 	 
  1227. 	gds_sex("Matt_Miller_01", "fb - matt") 
  1228. 	do_sex( node_table, contact_trig, npc, flag, anim, anim_duration ) 
  1229. 	stat_increment("fb - matt") 
  1230. 	 
  1231. 	--do_sex( "matt_miller_sex_nav", false, sr4_5_city_trigger.matt_sex.name, sr4_5_city_trigger.talk_to_matt.name, "matt_miller_trigger", "Matt_Miller_01", "flag_matt_sex", "FuckBuddy Matt", 20.5, "Matt_ship_couch", true ) 
  1232. end 
  1233.  
  1234. function sr4_5_city_pierce_sex() 
  1235. 	local node_table = sr4_5_city_ship_action_nodes.pierce 
  1236. 	local contact_trig = "pierce_trigger" 
  1237. 	local npc = "Pierce_01" 
  1238. 	local flag = "flag_pierce_sex" 
  1239. 	local anim = "FuckBuddy Pierce" 
  1240. 	local anim_duration = 13.25 
  1241. 	 
  1242. 	gds_sex("Pierce_01", "fb - pierce") 
  1243. 	do_sex( node_table, contact_trig, npc, flag, anim, anim_duration ) 
  1244. 	stat_increment("fb - pierce") 
  1245. 	 
  1246. 	--do_sex( "pierce_sex_nav", false, sr4_5_city_trigger.pierce_sex.name, sr4_5_city_trigger.talk_to_pierce.name, "pierce_trigger", "Pierce_01", "flag_pierce_sex", "FuckBuddy Pierce", 13.75, "Pierce_couch", true ) 
  1247. end 
  1248.  
  1249. function sr4_5_city_shaundi_sex() 
  1250. 	local node_table = sr4_5_city_ship_action_nodes.shaundi 
  1251. 	local contact_trig = "shaundi_trigger" 
  1252. 	local npc = "Shaundi_01" 
  1253. 	local flag = "flag_shaundi_sex" 
  1254. 	local anim = "FuckBuddy Shaundi" 
  1255. 	local anim_duration = 32.0 
  1256. 	 
  1257. 	gds_sex("Shaundi_01", "fb - shaundi") 
  1258. 	do_sex( node_table, contact_trig, npc, flag, anim, anim_duration ) 
  1259. 	stat_increment("fb - shaundi") 
  1260. 	 
  1261. 	--do_sex( "shaundi_sex_nav", false, sr4_5_city_trigger.shaundi_sex.name, sr4_5_city_trigger.talk_to_shaundi.name, "shaundi_trigger", "Shaundi_01", "flag_shaundi_sex", "FuckBuddy Shaundi", 32.0, nil, nil ) 
  1262. end 
  1263.  
  1264. function sr4_5_city_vp_sex() 
  1265. 	local node_table = sr4_5_city_ship_action_nodes.vp 
  1266. 	local contact_trig = "vp_trigger" 
  1267. 	local npc = "VP_01" 
  1268. 	local flag = nil 
  1269. 	local anim = nil 
  1270. 	local anim_duration = nil 
  1271. 	 
  1272. 	gds_sex("VP_01", "fb - veep") 
  1273. 	do_sex( node_table, contact_trig, npc, flag, anim, anim_duration ) 
  1274. end 
  1275.  
  1276.  
  1277. --[[   If you re-enable this, you'll need to re-enable the trigger...the definition above is commented out 
  1278. -- hacking test 
  1279. function sr4_5_city_do_hack( human, trigger ) 
  1280. 	local table_entry = crib_ship_trigger_get_table( trigger ) 
  1281. 	local hack_attempt = rand_int( 1, 100 ) 
  1282.  
  1283. 	action_play( human, table_entry.use_anim, table_entry.use_anim, false, 0.7, true, true, table_entry.use_nav ) 
  1284.  
  1285. 	message( "CRIB_SHIP_HACK_BEGIN", 2 ) 
  1286. 	delay( 2.5 ) 
  1287. 	 
  1288. 	if ( hack_attempt >= 1 and hack_attempt <= 30 ) then 
  1289. 		message( "CRIB_SHIP_HACK_FAIL", 1.0 ) 
  1290. 	elseif ( hack_attempt > 30 and hack_attempt <= 75 ) then 
  1291. 		message( "CRIB_SHIP_HACK_SUCCESS", 1.0 ) 
  1292. 		delay(1) 
  1293. 		cash_add( 25, LOCAL_PLAYER ) 
  1294. 	elseif ( hack_attempt > 75 and hack_attempt <= 95 ) then 
  1295. 		message( "CRIB_SHIP_HACK_SUCCESS", 1.0 ) 
  1296. 		delay(1) 
  1297. 		cash_add( 50, LOCAL_PLAYER )		 
  1298. 	elseif ( hack_attempt > 95 and hack_attempt <= 100 ) then 
  1299. 		message( "CRIB_SHIP_HACK_SUCCESS", 1.0 ) 
  1300. 		delay(1) 
  1301. 		cash_add( 1000, LOCAL_PLAYER ) 
  1302. 	end 
  1303.  
  1304. 	trigger_enable( trigger, false ) 
  1305. end 
  1306. ]] 
  1307.  
  1308.  
  1309.  
  1310. 	-- text adventure completion variable 
  1311. 	Ship_UI_completion = {} 
  1312. 	 
  1313.  
  1314. -- get the trigger table from the trigger name 
  1315. -- 
  1316. -- trigger:		(string) trigger name 
  1317. -- 
  1318. function crib_ship_trigger_get_table(trigger) 
  1319. 	local trigger_table 
  1320. 	for i,trig in pairs(sr4_5_city_trigger) do 
  1321. 		if trig.name == trigger then 
  1322. 			trigger_table = trig 
  1323. 		end 
  1324. 	end 
  1325. 	return trigger_table 
  1326. end 
  1327.  
  1328. function crib_ship_trigger_cb( human, trigger ) 
  1329. 	-- This may be called multiple times in the same frame.  Never create groups in a trigger callback.  Use show group instead. 
  1330. 	 
  1331. 	-- find this trigger 
  1332. 	local table_entry = crib_ship_trigger_get_table( trigger ) 
  1333. 	 
  1334. 	if table_entry ~= nil then 
  1335. 		if table_entry.hit == true then 
  1336. 			return 
  1337. 		end 
  1338. 		 
  1339. 		table_entry.hit = true 
  1340. 		table_entry.last_hit_by = human 
  1341. 		 
  1342. 		on_trigger( "", table_entry.name ) 
  1343. 		trigger_enable( table_entry.name, false ) 
  1344. 		 
  1345. 		-- Conversation system link 
  1346. 		if table_entry.conversation ~= nil and table_entry.conversation ~= "" then 
  1347. 			convo_start(table_entry.conversation) 
  1348. 		end 
  1349. 	end 
  1350. end 
  1351.  
  1352. -- CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  1353. function hub_loaded( ) 
  1354. 	convo_startup(sr4_5_city_convo) 
  1355.  
  1356. 	for i, trig in pairs(sr4_5_city_trigger) do 
  1357. 		if trig.callback == nil or trig.callback == "" then 
  1358. 			on_trigger( "crib_ship_trigger_cb", trig.name ) 
  1359. 		else 
  1360. 			on_trigger( trig.callback, trig.name ) 
  1361. 		end 
  1362. 		trig.hit = false 
  1363. 		trig.last_hit_by = nil 
  1364. 	end 
  1365.  
  1366. 	trigger_enable (sr4_5_city_trigger.start_txt_adventure.name, true) 
  1367. 	--trigger_enable (sr4_5_city_trigger.hack_cargo.name, true) 
  1368. 	 
  1369. 	-- reset global vars needed for each crib ship visit	 
  1370. 	for i, num_talks in pairs(sr4_5_city_CRIBSHIP_num_talks) do 
  1371. 		sr4_5_city_CRIBSHIP_num_talks[i] = 0 
  1372. 	end 
  1373. 	for i, sex_flag in pairs(sr4_5_city_CRIBSHIP_sex_flags) do 
  1374. 		sr4_5_city_CRIBSHIP_sex_flags[i] = false 
  1375. 	end	 
  1376. 	 
  1377. 	sr4_5_city_homie_setup_wrapper() 
  1378. end 
  1379.  
  1380.  
  1381. --set up homies wrapper function; decide which action nodes to use 
  1382. function sr4_5_city_homie_setup_wrapper() 
  1383.  
  1384. 	 
  1385. 	------ KINZIE ------ 
  1386. 	local kinzie_node = nil 
  1387. 	 
  1388. 	if mission_is_complete( "m05" ) and not mission_is_complete( "m07" ) then	 
  1389. 	 
  1390. 		-- working on mech node 
  1391. 		kinzie_node = sr4_5_city_ship_action_nodes.kinzie[1] 
  1392. 	 
  1393. 	elseif mission_is_complete( "m07" ) and not mission_is_complete( "m10" ) then 
  1394. 	 
  1395. 		-- beanbag, tube, or control room 
  1396. 		local kinzie_idx = rand_int( 3, #sr4_5_city_ship_action_nodes.kinzie ) 
  1397. 		kinzie_node = sr4_5_city_ship_action_nodes.kinzie[kinzie_idx]	 
  1398. 	 
  1399. 	elseif mission_is_complete( "m17" ) and not mission_is_complete( "m19" ) then 
  1400. 	 
  1401. 		-- nemo chair node 
  1402. 		kinzie_node = sr4_5_city_ship_action_nodes.kinzie[2] 
  1403. 		--mesh_mover_update_control( "nemo_rig_kinzie", "is nemo open", true ) 
  1404. 		--mesh_mover_update_control( "nemo_rig_kinzie", "closed restart", true )		 
  1405. 		 
  1406. 	else 
  1407. 	 
  1408. 		-- beanbag or tube (NOT control room) 
  1409. 		local kinzie_idx = rand_int( 4, #sr4_5_city_ship_action_nodes.kinzie ) 
  1410. 		kinzie_node = sr4_5_city_ship_action_nodes.kinzie[kinzie_idx] 
  1411. 		 
  1412. 	end 
  1413. 	 
  1414. 	sr4_5_city_homie_setup( "Kinzie_Group_001", "Kinzie_01", kinzie_node.talk_trig, kinzie_node.sex_trig, kinzie_node.contact_trig, kinzie_node.name, true ) 
  1415. 	 
  1416. 	 
  1417. 	------ VP ------ 
  1418. 	local vp_idx = nil 
  1419. 	local vp_node = nil 
  1420. 	 
  1421. 	if not mission_is_complete ( "m08" ) then 
  1422. 	 
  1423. 		-- catwalk, bridge seat, or bridge stand 
  1424. 		vp_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.vp ) 
  1425. 		vp_node = sr4_5_city_ship_action_nodes.vp[vp_idx]	 
  1426. 		sr4_5_city_homie_setup( "VP_Group_001", "VP_01", vp_node.talk_trig, vp_node.sex_trig, vp_node.contact_trig, vp_node.name, true )			 
  1427. 	elseif not mission_is_complete ( "m17" ) or mission_is_complete ( "m18" ) then 
  1428. 	 
  1429. 		-- bridge seat or bridge stand (NOT catwalk) 
  1430. 		vp_idx = rand_int( 2 , #sr4_5_city_ship_action_nodes.vp ) 
  1431. 		vp_node = sr4_5_city_ship_action_nodes.vp[vp_idx]		 
  1432. 		sr4_5_city_homie_setup( "VP_Group_001", "VP_01", vp_node.talk_trig, vp_node.sex_trig, vp_node.contact_trig, vp_node.name, true )			 
  1433. 	end 
  1434. 	 
  1435. 	 
  1436. 	------ CID ------ 
  1437. 	if mission_is_complete( "m05" ) then 
  1438. 		local cid_node = sr4_5_city_ship_action_nodes.cid[1] 
  1439. 		 
  1440. 		sr4_5_city_homie_setup( "CID_Group_001", "CID_01", cid_node.talk_trig, cid_node.sex_trig, cid_node.contact_trig, cid_node.name, true ) 
  1441. 	end 
  1442. 	 
  1443. 	 
  1444. 	------ MATT MILLER ------ 
  1445. 	if mission_is_complete( "m07" ) then 
  1446. 		local matt_node = nil 
  1447. 		local matt_idx = nil 
  1448. 	 
  1449. 		if not mission_is_complete( "m18" ) or mission_is_complete( "m19" ) then 
  1450. 		 
  1451. 			-- anywhere EXCEPT control room 
  1452. 			matt_idx = rand_int( 2, #sr4_5_city_ship_action_nodes.matt ) 
  1453. 			matt_node = sr4_5_city_ship_action_nodes.matt[matt_idx] 
  1454. 		 
  1455. 		else 
  1456. 	 
  1457. 			-- m18 complete, m19 not complete - control room 
  1458. 			matt_node = sr4_5_city_ship_action_nodes.matt[1] 
  1459. 		 
  1460. 		end 
  1461. 		 
  1462. 		sr4_5_city_homie_setup( "Matt_Miller_Group_001", "Matt_Miller_01", matt_node.talk_trig, matt_node.sex_trig, matt_node.contact_trig, matt_node.name, true )		 
  1463. 	end 
  1464. 	 
  1465. 	 
  1466. 	------ SHAUNDI ------ 
  1467. 	if mission_is_complete( "m08" ) then 
  1468. 	 
  1469. 		local shaundi_idx = nil 
  1470. 		local shaundi_node = nil 
  1471. 		 
  1472. 		if not mission_is_complete( "m10" ) then 
  1473. 	 
  1474. 			-- catwalk 
  1475. 			shaundi_node = sr4_5_city_ship_action_nodes.shaundi[2] 
  1476. 		 
  1477. 		elseif mission_is_complete( "m10" ) and not mission_is_complete( "m14" ) then 
  1478. 	 
  1479. 			-- control room 
  1480. 			shaundi_node = sr4_5_city_ship_action_nodes.shaundi[1] 
  1481. 		 
  1482. 		elseif mission_is_complete( "m14" ) and not mission_is_complete( "m19" ) then 
  1483. 	 
  1484. 			-- any on bridge 
  1485. 			shaundi_idx = rand_int( 3 , #sr4_5_city_ship_action_nodes.shaundi ) 
  1486. 			shaundi_node = sr4_5_city_ship_action_nodes.shaundi[shaundi_idx]	 
  1487. 		 
  1488. 		elseif mission_is_complete( "m19" ) then 
  1489. 	 
  1490. 			-- control room 
  1491. 			shaundi_node = sr4_5_city_ship_action_nodes.shaundi[1] 
  1492. 			 
  1493. 		end 
  1494. 		 
  1495. 		sr4_5_city_homie_setup( "Shaundi_Group_001", "Shaundi_01", shaundi_node.talk_trig, shaundi_node.sex_trig, shaundi_node.contact_trig, shaundi_node.name, true ) 
  1496. 		 
  1497. 	end 
  1498. 	 
  1499. 	 
  1500. 	------ PIERCE ------ 
  1501. 	if mission_is_complete( "m09" ) then 
  1502. 		local pierce_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.pierce ) 
  1503. 		local pierce_node = sr4_5_city_ship_action_nodes.pierce[pierce_idx]	 
  1504. 	 
  1505. 		sr4_5_city_homie_setup( "Pierce_Group_001", "Pierce_01", pierce_node.talk_trig, pierce_node.sex_trig, pierce_node.contact_trig, pierce_node.name, true ) 
  1506. 	end 
  1507. 	 
  1508. 	 
  1509. 	------ BEN KING ------ 
  1510. 	if mission_is_complete( "m10" ) then 
  1511. 		local benking_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.benking ) 
  1512. 		local benking_node = sr4_5_city_ship_action_nodes.benking[benking_idx] 
  1513. 	 
  1514. 		sr4_5_city_homie_setup( "Ben_King_Group_001", "Ben_King_01", benking_node.talk_trig, benking_node.sex_trig, benking_node.contact_trig, benking_node.name, true ) 
  1515. 	end 
  1516. 	 
  1517. 	 
  1518. 	------ ASHA ------ 
  1519. 	if mission_is_complete( "m11" ) then 
  1520. 		local asha_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.asha ) 
  1521. 		local asha_node = sr4_5_city_ship_action_nodes.asha[asha_idx] 
  1522. 		 
  1523. 		sr4_5_city_homie_setup( "Asha_Group_001", "Asha_01", asha_node.talk_trig, asha_node.sex_trig, asha_node.contact_trig, asha_node.name, true ) 
  1524. 	end 
  1525.  
  1526. 	 
  1527. 	------ GAT ------	 
  1528. 	if mission_is_complete( "m15_3" ) then 
  1529. 		local gat_idx = rand_int( 1 , #sr4_5_city_ship_action_nodes.gat ) 
  1530. 		local gat_node = sr4_5_city_ship_action_nodes.gat[gat_idx] 
  1531.  
  1532. 		sr4_5_city_homie_setup( "Johnny_Gat_Group_001", "Johnny_Gat_01", gat_node.talk_trig, gat_node.sex_trig, gat_node.contact_trig, gat_node.name, true ) 
  1533. 	end 
  1534.  
  1535. 	 
  1536. end 
  1537.  
  1538. --set up homies for crib ship -- group, triggers, action node 
  1539. function sr4_5_city_homie_setup( group, npc, talk_trig, sex_trig, contact_trig, action_node, teleport_bool ) 
  1540. 	if not group_is_loaded(group) then 
  1541. 		group_create( group ) 
  1542. 	end 
  1543. 	 
  1544. 	if (talk_trig ~= nil) then 
  1545. 		trigger_enable( talk_trig, true ) 
  1546. 	end 
  1547. 	 
  1548. 	if (sex_trig ~= nil) then 
  1549. 		trigger_enable( sex_trig, true ) 
  1550. 		trigger_copy_pos_from( sex_trig, talk_trig ) -- move sex trigger to same position as talk trigger 
  1551. 	end 
  1552. 	 
  1553. 	if (action_node ~= nil) then 
  1554. 		npc_use_closest_action_node_of_type( npc, action_node, 200, teleport_bool ) 
  1555. 	end 
  1556.  
  1557. 	if (contact_trig ~= nil) then 
  1558. 		trigger_copy_pos_from( contact_trig, talk_trig ) -- move contact trigger to same position as talk trigger 
  1559. 	end 
  1560. end 
  1561.  
  1562.  
  1563. -- ALL FOLLOWING COOP SKIP FUNCTIONS CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  1564.  
  1565. -- Teleport players to a mission start node 
  1566. -- 
  1567. -- mission_name:	(string) name of the mission start node (should be same as mission name) 
  1568. -- skip_teleport:	(boolean) true to basically skip this whole function, nil or not true will run it 
  1569. -- 
  1570. function sr3_teleport_mission_start(mission_name, skip_teleport) 
  1571. 	if skip_teleport == nil or skip_teleport ~= true then 
  1572. 		-- send them to the mission start 
  1573. 		local vehicle_exit = true 
  1574. 		local offset_x = 0.5 
  1575. 		teleport_to_object(LOCAL_PLAYER, mission_name, vehicle_exit, nil, offset_x) 
  1576. 		-- remote player not on top of player 
  1577. 		offset_x = -0.5 
  1578. 		teleport_to_object(REMOTE_PLAYER, mission_name, vehicle_exit, nil, offset_x) 
  1579. 	end 
  1580. end 
  1581.  
  1582. function ship_use_trigger_cb(human, trigger) 
  1583. 	-- do default trigger behavior 
  1584. 	-- trigger_cb(human, trigger) 
  1585. 		local trigger_table = trigger_get_table(trigger) 
  1586. 		 
  1587. 	if trigger_table.use_anim ~= nil and trigger_table.use_anim ~= "" then 
  1588. 		local anim_name = trigger_table.use_anim 
  1589. 		local morph_name = anim_name 
  1590. 		local force_play = false	 
  1591. 		local percentage = 0.8 
  1592. 		local stand_still = true 
  1593. 		local zero_movement = true 
  1594. 		action_play(human, anim_name, morph_name, force_play, percentage, stand_still, zero_movement, trigger_table.use_nav) 
  1595. 	end 
  1596. end 
  1597.  
  1598. -- start the text adventure 
  1599. -- 
  1600. -- human:		(string) name of human that tripped the trigger 
  1601. -- trigger:		(string) name of the trigger 
  1602. --	 
  1603. function ship_start_text_adventure_cb(human, trigger) 
  1604. 	-- find this trigger 
  1605. 	local table_entry = crib_ship_trigger_get_table( trigger ) 
  1606. 	 
  1607. 	if table_entry ~= nil then 
  1608. 		if table_entry.hit == true then 
  1609. 			return 
  1610. 		end 
  1611. 		 
  1612. 		table_entry.hit = true 
  1613. 		table_entry.last_hit_by = LOCAL_PLAYER 
  1614. 		 
  1615. 		on_trigger( "", table_entry.name ) 
  1616. 		trigger_enable( table_entry.name, false ) 
  1617. 		 
  1618. 		-- play anim 
  1619. 		action_play( LOCAL_PLAYER, table_entry.use_anim, table_entry.use_anim, false, 0.9, true, true, table_entry.use_nav ) 
  1620. 		 
  1621. 		-- start the text adventure and hook up a callback to know when they're done 
  1622. 		Ship_UI_completion[ LOCAL_PLAYER ] = false 
  1623. 		hud_push_screen( "col_main", SYNC_LOCAL ) 
  1624. 		--on_hud_screen_exit( "ship_UI_text_complete_cb", "col_main" ) 
  1625. 		player_controls_disable(LOCAL_PLAYER) 
  1626. 		 
  1627. 		-- wait until player exits screen 
  1628. 		while hud_is_screen_on_stack( "col_main" ) do 
  1629. 			thread_yield() 
  1630. 		end 
  1631. 		 
  1632. 		--[[ 
  1633. 		while not Ship_UI_completion[ LOCAL_PLAYER ] do 
  1634. 			thread_yield() 
  1635. 		end 
  1636. 		]] 
  1637. 		 
  1638. 		-- re-enable trigger 
  1639. 		table_entry.hit = false 
  1640. 		on_trigger( "ship_start_text_adventure_cb", table_entry.name ) 
  1641. 		trigger_enable( table_entry.name, true ) 
  1642. 		player_controls_enable( LOCAL_PLAYER ) 
  1643. 		Ship_UI_completion[ LOCAL_PLAYER ] = true 
  1644. 	end 
  1645. end 
  1646.  
  1647. --[[ 
  1648. -- callback to handle text adventure being completed 
  1649. -- 
  1650. --	screen_name:	(string) screen completed 
  1651. --	player_name:	(string) player using the screen 
  1652. -- 
  1653. function ship_UI_text_complete_cb( screen_name, player_name ) 
  1654. 	if (screen_name ~= "col_main") then 
  1655. 		return 
  1656. 	end 
  1657. 	 
  1658. 	player_controls_enable( player_name ) 
  1659. 	 
  1660. 	-- flag the player as completed 
  1661. 	Ship_UI_completion[ player_name ] = true	 
  1662. end 
  1663. ]]