sr2lua/tss03.lua

  1. -- tss03.lua 
  2. -- SR2 mission script 
  3. -- 03/21/08 
  4.  
  5. -- Global Variables -- 
  6.  
  7. -- This factor is applied to player damage in single player.  
  8. SINGLE_PLAYER_DAMAGE_MULTIPLIER = 0.50 
  9.  
  10. -- This factor is applied to player damage in co-op. 
  11. COOP_DAMAGE_MULTIPLIER = 0.75 
  12.  
  13. Tss03_samedi_characters					= {"tss03_$samedi001", "tss03_$samedi002", "tss03_$samedi003", "tss03_$samedi004",  
  14. 													"tss03_$samedi005", "tss03_$samedi006", "tss03_$samedi007","tss03_$samedi012",  
  15. 													"tss03_$samedi013", "tss03_$samedi014", "tss03_$samedi015", "tss03_$samedi016",  
  16. 													"tss03_$samedi017", "tss03_$samedi018"} 
  17. Num_tss03_samedi_characters			= sizeof_table(Tss03_samedi_characters) 
  18.  
  19. Tss03_samedi_characters_coop			= {"tss03_$samedi008", "tss03_$samedi009", "tss03_$samedi010", "tss03_$samedi011"} 
  20. Num_tss03_samedi_characters_coop		= sizeof_table(Tss03_samedi_characters_coop) 
  21.  
  22. Tss03_samedi_kill_count					= 0 
  23. Total_tss03_samedi_characters			= Num_tss03_samedi_characters 
  24.  
  25. Tss03_samedi_patrol_01					= {"tss03_$n004", "tss03_$n001", "tss03_$n005", "tss03_$n007", "tss03_$n008",  
  26. 													"tss03_$n002", "tss03_$n003", "tss03_$n004", "tss03_$n001"} 
  27. Num_tss03_samedi_patrol_01				= sizeof_table(Tss03_samedi_patrol_01) 
  28.  
  29. Tss03_bum_characters						= {"tss03_$bum002", "tss03_$bum003", "tss03_$bum004"} 
  30. Num_tss03_bum_characters				= sizeof_table(Tss03_bum_characters) 
  31.  
  32. Tss03_bum_characters_coop				= {"tss03_$bum006", "tss03_$bum007", "tss03_$bum008"} 
  33. Num_tss03_bum_characters_coop			= sizeof_table(Tss03_bum_characters_coop) 
  34.  
  35. Tss03_bum_characters_rush				= {"tss03_$bum014", "tss03_$bum016", "tss03_$bum017", "tss03_$bum018"} 
  36. Num_tss03_bum_characters_rush			= sizeof_table(Tss03_bum_characters_rush) 
  37.  
  38. Tss03_bum_kill_count						= 0 
  39. Total_tss03_bum_characters				= Num_tss03_bum_characters 
  40.  
  41. Tss03_shanties								= {"tss03_ShantyA080", "tss03_ShantyB070", "tss03_ShantyB050", "tss03_ShantyA070",  
  42. 													"tss03_ShantyA090", "tss03_ShantyD050", "tss03_ShantyB060"} 
  43. Num_tss03_shanties						= sizeof_table(Tss03_shanties) 
  44. Tss03_shanty_destroyed_count			= 0 
  45. Tss03_shanties_destroyed				= {} 
  46.  
  47. Tss03_compliment							= {"Compliment A", "Compliment B", "Compliment C", "Compliment D"} 
  48. Num_tss03_compliment						= sizeof_table(Tss03_compliment) 
  49.  
  50. Tss03_taunt									= {"Insult A", "Insult B", "Insult C", "Insult D"} 
  51. Num_tss03_taunt							= sizeof_table(Tss03_taunt) 
  52.  
  53. IN_COOP										= false 
  54. CAN_TAUNT_PLAYER							= true 
  55. PERFORMING_COMPLIMENT					= false 
  56.  
  57. CONVERSATION_THREAD						= INVALID_THREAD_HANDLE 
  58. PATROL_THREAD								= INVALID_THREAD_HANDLE 
  59. SEES_PLAYER_THREAD						= INVALID_THREAD_HANDLE 
  60. MOLOTOVS_THREAD							= INVALID_THREAD_HANDLE 
  61. HUMAN_SHIELD_BUMS							= INVALID_THREAD_HANDLE 
  62. HUMAN_SHIELD_BUMS_COOP					= INVALID_THREAD_HANDLE 
  63. BUMS_REGENERATE							= INVALID_THREAD_HANDLE 
  64. BUMS_REGENERATE_COOP						= INVALID_THREAD_HANDLE 
  65. SHANTIES_REGENERATE						= INVALID_THREAD_HANDLE 
  66.  
  67. LOCATION_START								= "mission_start_sr2_city_$tss03" 
  68. LOCATION_START_GAT						= "tss03_$gat" 
  69. LOCATION_START_PLAYER_2					= "tss03_$player2_start" 
  70.  
  71. GROUP_START									= "tss03_$group_start" 
  72. GROUP_START_VEHICLE						= "tss03_$group_start_vehicle" 
  73. GROUP_ENTRYWAY								= "tss03_$group_entryway" 
  74. GROUP_SAMEDI								= "tss03_$group_samedi" 
  75. GROUP_SAMEDI_COOP							= "tss03_$group_samedi_coop" 
  76. GROUP_BUMS_SHANTY							= "tss03_$group_pistoleros" 
  77. GROUP_BUMS_RUSH							= "tss03_$group_bumrush" 
  78.  
  79. CHARACTER_GAT								= "tss03_$gat" 
  80. CHARACTER_SAMEDI_PATROL_01				= "tss03_$samedi006" 
  81. CHARACTER_SAMEDI_PATROL_02				= "tss03_$samedi018" 
  82.  
  83. TRIGGER_ENTRY								= "tss03_$trig_entry" 
  84. TRIGGER_WAYPOINT_1						= "tss03_$t000" 
  85. TRIGGER_WAYPOINT_2						= "tss03_$t001" 
  86. TRIGGER_WAYPOINT_3						= "tss03_$t002" 
  87. TRIGGER_SHANTYTOWN						= "tss03_$trig_shanty" 
  88.  
  89. NAVPOINT_LOCAL_SUCCESS					= "tss03_$Nlocal_success" 
  90. NAVPOINT_REMOTE_SUCCESS					= "tss03_$Nremote_success" 
  91.  
  92. -- This needs to come after Gat being defined... 
  93. Tss03_gat_player_drive_conversation = {{"TSSP3_INTRO_L1",			CHARACTER_GAT,	0.2}, 
  94. 													{"PLAYER_TSSP3_INTRO_L2",	LOCAL_PLAYER,	0.2}, 
  95. 													{"TSSP3_INTRO_L3",			CHARACTER_GAT,	0.2}, 
  96. 													{"PLAYER_TSSP3_INTRO_L4",	LOCAL_PLAYER,	0.2}, 
  97. 													{"TSSP3_INTRO_L5",			CHARACTER_GAT,	0.2}, 
  98. 													{"PLAYER_TSSP3_INTRO_L6",	LOCAL_PLAYER,	0.2}, 
  99. 													{"TSSP3_INTRO_L7",			CHARACTER_GAT,	0.2}, 
  100. 													{"PLAYER_TSSP3_INTRO_L8",	LOCAL_PLAYER,	0.2}, 
  101. 													{"TSSP3_INTRO_L9",			CHARACTER_GAT,	0.2}, 
  102. 													{"PLAYER_TSSP3_INTRO_L10",	LOCAL_PLAYER,	0.2}} 
  103.  
  104. -- Human shields are not allowed in some builds. 
  105. HUMAN_SHIELDS_ALLOWED					= (not human_shielding_disabled()) 
  106.  
  107. -- Functions -- 
  108.  
  109. function tss03_start(checkpoint, is_restart) 
  110.  
  111. 	if (checkpoint == MISSION_START_CHECKPOINT) then 
  112. 		if (not is_restart) then 
  113. 			cutscene_play("tssp03-01", {GROUP_START, GROUP_START_VEHICLE}, {LOCATION_START, LOCATION_START_PLAYER_2}, false) 
  114. 			group_show(GROUP_START) 
  115. 			group_show(GROUP_START_VEHICLE) 
  116. 		end 
  117. 	end 
  118.  
  119. 	-- Start trigger is hit...the activate button was hit 
  120. 	set_mission_author("Ryan Spencer") 
  121.  
  122. 	-- Check for coop being active 
  123. 	if (coop_is_active()) then 
  124. 		IN_COOP	= true 
  125.  
  126. 		-- In coop we want to change some values 
  127. 		Total_tss03_samedi_characters	= (Num_tss03_samedi_characters + Num_tss03_samedi_characters_coop) 
  128. 		Total_tss03_bum_characters		= (Num_tss03_bum_characters + Num_tss03_bum_characters_coop) 
  129. 	end 
  130.  
  131. 	-- Prevent accidental notoriety overload 
  132. 	notoriety_set_max("Samedi", 2) 
  133. 	notoriety_set_max("Police", 2) 
  134.  
  135. 	-- Reduce the amount of damage applied to the players 
  136. 	if (IN_COOP) then 
  137. 		character_set_damage_multiplier(REMOTE_PLAYER, COOP_DAMAGE_MULTIPLIER) 
  138. 		character_set_damage_multiplier(LOCAL_PLAYER, COOP_DAMAGE_MULTIPLIER) 
  139. 	else 
  140. 		character_set_damage_multiplier(LOCAL_PLAYER, SINGLE_PLAYER_DAMAGE_MULTIPLIER) 
  141. 	end 
  142.  
  143. 	-- The total bum characters that will need to be eliminated include the rush group of characters 
  144. 	Total_tss03_bum_characters = Total_tss03_bum_characters + Num_tss03_bum_characters_rush 
  145.  
  146. 	-- Play the intro cutscene 
  147. 	cutscene_in() 
  148.  
  149. 	-- Disable the controls so the player can't move 
  150. 	player_controls_disable(LOCAL_PLAYER) 
  151. 	if (IN_COOP) then 
  152. 		player_controls_disable(REMOTE_PLAYER) 
  153. 	end 
  154.  
  155. 	-- Checkpoint or not...we need this to be set 
  156. 	on_trigger("tss03_waypoint1", TRIGGER_WAYPOINT_1) 
  157. 	on_trigger("tss03_waypoint2", TRIGGER_WAYPOINT_2) 
  158. 	on_trigger("tss03_waypoint3", TRIGGER_WAYPOINT_3) 
  159. 	on_trigger("tss03_shantytown", TRIGGER_SHANTYTOWN) 
  160.  
  161. 	if (checkpoint == MISSION_START_CHECKPOINT) then 
  162.  
  163. 		-- Create our necessary groups 
  164. 		if (is_restart) then 
  165. 			group_create(GROUP_START, true) 
  166. 			group_create(GROUP_START_VEHICLE, true) 
  167.  
  168. 			-- Teleport Gat and the player(s) to where they will need to be 
  169. 			teleport_coop(LOCATION_START, LOCATION_START_PLAYER_2) 
  170. 		end 
  171.  
  172. 		-- Teleport Gat to his starting position 
  173. 		teleport(CHARACTER_GAT, LOCATION_START_GAT) 
  174.  
  175. 		-- Add the objective destination 
  176. 		marker_add_trigger(TRIGGER_ENTRY, MINIMAP_ICON_LOCATION, INGAME_EFFECT_VEHICLE_LOCATION, SYNC_ALL) 
  177. 		mission_waypoint_add(TRIGGER_ENTRY) 
  178.  
  179. 		-- We need to remove and add another destination 
  180. 		on_trigger("tss03_checkpoint", TRIGGER_ENTRY) 
  181. 		trigger_enable(TRIGGER_ENTRY, true)	 
  182.  
  183. 		-- Prompt the user to drive to the location 
  184. 		mission_help_table("tss03_drive") 
  185.  
  186. 		-- Spawn off the conversation thread... 
  187. 		CONVERSATION_THREAD = thread_new("tss03_gat_player_intro_conversation") 
  188. 	else 
  189. 		-- We hit the checkpoint so we need to start from there...all handled in entry point 
  190. 		tss03_entrypoint() 
  191. 	end 
  192.  
  193. 	-- When Johnny Gat dies 
  194. 	on_death("tss03_failure", CHARACTER_GAT) 
  195. 	-- When Johnny Gat is dismissed as a follower 
  196. 	on_dismiss("tss03_abandon_gat", CHARACTER_GAT) 
  197.  
  198. 	-- Put Johnny Gat in player's party 
  199. 	party_add(CHARACTER_GAT, LOCAL_PLAYER) 
  200.  
  201. 	-- Re-enable the controls so the player can move 
  202. 	player_controls_enable(LOCAL_PLAYER) 
  203. 	if (IN_COOP) then 
  204. 		player_controls_enable(REMOTE_PLAYER) 
  205. 	end 
  206.  
  207. 	-- Fade back into the game... 
  208. 	cutscene_out() 
  209. end 
  210.  
  211. function tss03_cleanup() 
  212.  
  213. 	-- Cleanup mission here... 
  214.  
  215. 	-- Reset IN_COOP in case mission end was triggered by a disconnect 
  216. 	IN_COOP = coop_is_active() 
  217.  
  218. 	-- Reset the amount of damage applied to the players 
  219. 	character_set_damage_multiplier(LOCAL_PLAYER, 1.0) 
  220. 	if (IN_COOP) then 
  221. 		character_set_damage_multiplier(REMOTE_PLAYER, 1.0) 
  222. 	end 
  223.  
  224. 	on_weapon_fired("", LOCAL_PLAYER) 
  225.  
  226.  
  227. 	-- Kill any active threads 
  228. 	thread_kill(CONVERSATION_THREAD) 
  229. 	thread_kill(PATROL_THREAD) 
  230. 	thread_kill(SEES_PLAYER_THREAD) 
  231. 	thread_kill(MOLOTOVS_THREAD) 
  232. 	thread_kill(HUMAN_SHIELD_BUMS) 
  233. 	thread_kill(HUMAN_SHIELD_BUMS_COOP) 
  234. 	thread_kill(BUMS_REGENERATE) 
  235. 	thread_kill(BUMS_REGENERATE_COOP) 
  236. 	thread_kill(SHANTIES_REGENERATE) 
  237.  
  238. 	-- Just reset all of the persona overrides... 
  239. 	if (character_exists(CHARACTER_GAT)) then 
  240. 		persona_override_character_stop_all(CHARACTER_GAT) 
  241. 	end 
  242.  
  243. 	-- Reset the spawning 
  244. 	spawning_vehicles(true) 
  245. 	spawning_pedestrians(true) 
  246. 	-- Restore notoriety spawning 
  247. 	notoriety_force_no_spawn("Samedi", false) 
  248.  
  249. 	-- Invalidate the deaths 
  250. 	on_death("", CHARACTER_GAT) 
  251.  
  252. 	-- Invalidate Gat being dismissed 
  253. 	on_dismiss("", CHARACTER_GAT) 
  254. 	party_dismiss(CHARACTER_GAT) 
  255.  
  256. 	-- Invalidate the triggers 
  257. 	on_trigger("", TRIGGER_ENTRY) 
  258. 	on_trigger("", TRIGGER_WAYPOINT_1) 
  259. 	on_trigger("", TRIGGER_WAYPOINT_2) 
  260. 	on_trigger("", TRIGGER_WAYPOINT_3) 
  261. 	on_trigger("", TRIGGER_SHANTYTOWN) 
  262.  
  263. 	-- Remove icons and waypoint...they might still exist 
  264. 	marker_remove_trigger(TRIGGER_ENTRY, SYNC_ALL) 
  265. 	marker_remove_trigger(TRIGGER_WAYPOINT_1, SYNC_ALL) 
  266. 	marker_remove_trigger(TRIGGER_WAYPOINT_2, SYNC_ALL) 
  267. 	marker_remove_trigger(TRIGGER_WAYPOINT_3, SYNC_ALL) 
  268. 	marker_remove_trigger(TRIGGER_SHANTYTOWN, SYNC_ALL) 
  269. 	mission_waypoint_remove(SYNC_ALL) 
  270.  
  271. 	-- Remove the icons from the Samedi characters 
  272. 	for i = 1, Num_tss03_samedi_characters, 1 do 
  273. 		tss03_cleanup_on_death_callback(Tss03_samedi_characters[i]) 
  274. 		marker_remove_npc(Tss03_samedi_characters[i], SYNC_ALL) 
  275. 	end 
  276.  
  277. 	-- Remove the icons from the Samedi characters coop 
  278. 	for i = 1, Num_tss03_samedi_characters_coop, 1 do 
  279. 		tss03_cleanup_on_death_callback(Tss03_samedi_characters_coop[i]) 
  280. 		marker_remove_npc(Tss03_samedi_characters_coop[i], SYNC_ALL) 
  281. 	end 
  282.  
  283. 	-- Remove the icons from the Bum characters 
  284. 	for i = 1, Num_tss03_bum_characters, 1 do 
  285. 		tss03_cleanup_on_death_callback(Tss03_bum_characters[i]) 
  286. 		marker_remove_npc(Tss03_bum_characters[i], SYNC_ALL) 
  287. 	end 
  288.  
  289. 	-- Remove the icons from the Bum characters coop 
  290. 	for i = 1, Num_tss03_bum_characters_coop, 1 do 
  291. 		tss03_cleanup_on_death_callback(Tss03_bum_characters_coop[i]) 
  292. 		marker_remove_npc(Tss03_bum_characters_coop[i], SYNC_ALL) 
  293. 	end 
  294.  
  295. 	-- Remove the icons from the bum rush characters 
  296. 	for i,bum in pairs (Tss03_bum_characters_rush) do 
  297. 		tss03_cleanup_on_death_callback(bum) 
  298. 		marker_remove_npc(bum) 
  299. 	end 
  300.  
  301. 	-- Remove icons from the shanties 
  302. 	for i = 1, Num_tss03_shanties, 1 do 
  303. 		if (not mesh_mover_destroyed(Tss03_shanties[i])) then 
  304. 			marker_remove_mover(Tss03_shanties[i]) 
  305. 			on_mover_destroyed("", Tss03_shanties[i]) 
  306. 		end 
  307. 	end 
  308.  
  309. end 
  310.  
  311. function tss03_cleanup_on_death_callback(npc) 
  312.  
  313. 	if (	character_exists(npc) ) then 
  314. 		on_death("", npc) 
  315. 	end 
  316.  
  317. end 
  318.  
  319. function tss03_success() 
  320. 	-- Called when the mission has ended with success 
  321.  
  322. 	-- Post the news event 
  323. 	radio_post_event("JANE_NEWS_TSSP03", true) 
  324.  
  325. end 
  326.  
  327. function tss03_complete() 
  328. 	-- End the mission with success 
  329. 	mission_end_success("tss03", "tssp03-02", {NAVPOINT_LOCAL_SUCCESS, NAVPOINT_REMOTE_SUCCESS}) 
  330. end 
  331.  
  332. function tss03_failure() 
  333. 	-- End the mission since Gat was killed 
  334. 	mission_end_failure("tss03", "tss03_gat_died") 
  335. end 
  336.  
  337. function tss03_abandon_gat() 
  338. 	-- End the mission since Gat was abandoned 
  339. 	mission_end_failure("tss03", "tss03_gat_abandoned") 
  340. end 
  341.  
  342. function tss03_checkpoint() 
  343. 	-- Checkpoint 
  344. 	mission_set_checkpoint("shantytown") 
  345.  
  346. 	-- Kill the conversation thread 
  347. 	thread_kill(CONVERSATION_THREAD) 
  348.  
  349. 	-- Start the next section 
  350. 	tss03_entrypoint() 
  351. end 
  352.  
  353. function tss03_gat_player_intro_conversation() 
  354. 	-- Play the conversation table 
  355. 	audio_play_conversation_in_vehicle(Tss03_gat_player_drive_conversation) 
  356. end 
  357.  
  358. function tss03_entrypoint() 
  359. 	-- Disable the entry trigger and enable the first waypoint trigger 
  360. 	trigger_enable(TRIGGER_ENTRY, false) 
  361. 	trigger_enable(TRIGGER_WAYPOINT_1, true) 
  362.  
  363. 	-- Remove the objective destination 
  364. 	marker_remove_trigger(TRIGGER_ENTRY, SYNC_ALL) 
  365. 	mission_waypoint_remove(SYNC_ALL) 
  366.  
  367. 	-- Add the objective destination 
  368. 	marker_add_trigger(TRIGGER_WAYPOINT_1, MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION, SYNC_ALL) 
  369.  
  370. 	-- Create our first group of enemies 
  371. 	-- group_create_hidden(GROUP_ENTRYWAY) 
  372. 	group_create_hidden(GROUP_SAMEDI) 
  373. 	group_create_hidden(GROUP_BUMS_SHANTY) 
  374.  
  375. 	-- Create the bum groups... 
  376. 	for i = 1, Num_tss03_bum_characters, 1 do 
  377. 		group_create_hidden(Tss03_bum_characters[i]) 
  378. 	end 
  379.  
  380. 	-- If we are in coop create the coop groups too 
  381. 	if (IN_COOP) then 
  382. 		group_create_hidden(GROUP_SAMEDI_COOP) 
  383. 		 
  384. 		for i = 1, Num_tss03_bum_characters_coop, 1 do 
  385. 			group_create_hidden(Tss03_bum_characters_coop[i]) 
  386. 		end 
  387. 	end 
  388.  
  389. 	-- Prompt the user to enter the underground 
  390. 	mission_help_table("tss03_enter") 
  391.  
  392. 	-- Show the entry way bums 
  393. 	-- group_show(GROUP_ENTRYWAY) 
  394.  
  395. 	-- Lets do some persona override here... 
  396. 	persona_override_character_stop_all(CHARACTER_GAT) 
  397. 	persona_override_character_start(CHARACTER_GAT, POT_SITUATIONS[POT_ATTACK],		"GAT_TSSP03_ATTACK") 
  398. 	persona_override_character_start(CHARACTER_GAT, POT_SITUATIONS[POT_TAKE_DAMAGE], "GAT_TSSP03_TAKEDAM") 
  399.  
  400. end 
  401.  
  402. function tss03_waypoint1() 
  403. 	-- Disable the waypoint trigger and enable the next waypoint trigger 
  404. 	trigger_enable(TRIGGER_WAYPOINT_1, false) 
  405. 	trigger_enable(TRIGGER_WAYPOINT_2, true) 
  406.  
  407. 	-- Remove the objective destination 
  408. 	marker_remove_trigger(TRIGGER_WAYPOINT_1, SYNC_ALL) 
  409. 	-- Add the objective destination 
  410. 	marker_add_trigger(TRIGGER_WAYPOINT_2, MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION, SYNC_ALL) 
  411.  
  412. end 
  413.  
  414. function tss03_waypoint2() 
  415. 	-- Disable the waypoint trigger and enable the next waypoint trigger 
  416. 	trigger_enable(TRIGGER_WAYPOINT_2, false) 
  417. 	trigger_enable(TRIGGER_WAYPOINT_3, true) 
  418.  
  419. 	-- Remove the objective destination 
  420. 	marker_remove_trigger(TRIGGER_WAYPOINT_2, SYNC_ALL) 
  421. 	-- Add the objective destination 
  422. 	marker_add_trigger(TRIGGER_WAYPOINT_3, MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION, SYNC_ALL) 
  423. end 
  424.  
  425. function tss03_waypoint3() 
  426. 	-- Disable the waypoint trigger and enable the shantytown trigger 
  427. 	trigger_enable(TRIGGER_WAYPOINT_3, false) 
  428. 	trigger_enable(TRIGGER_SHANTYTOWN, true) 
  429.  
  430. 	-- Remove the objective destination 
  431. 	marker_remove_trigger(TRIGGER_WAYPOINT_3, SYNC_ALL) 
  432. 	-- Add the objective destination 
  433. 	marker_add_trigger(TRIGGER_SHANTYTOWN, MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION, SYNC_ALL) 
  434. end 
  435.  
  436. function tss03_patrol_01(name) 
  437. 	local	i = 1 
  438.  
  439. 	SEES_PLAYER_THREAD = thread_new("tss03_patrol_sees_player", name) 
  440. 	MOLOTOVS_THREAD = thread_new("tss03_molotovs", "tss03_$samedi001") 
  441.  
  442. 	-- Walk this path until the character attacks or is dead 
  443. 	while (1) do 
  444. 		-- Yields until path is completed 
  445. 		move_to(name, Tss03_samedi_patrol_01[i]) 
  446.  
  447. 		if (Tss03_samedi_patrol_01[i] == "tss03_$n005") then 
  448. 			PERFORMING_COMPLIMENT = true 
  449. 			 
  450. 			turn_to_char(name, CHARACTER_SAMEDI_PATROL_02) 
  451. 			action_play(name, Tss03_compliment[rand_int(1, Num_tss03_compliment)], nil, true, 0.95, true) 
  452. 			 
  453. 			PERFORMING_COMPLIMENT = false 
  454. 		end 
  455.  
  456. 		i = i + 1 
  457. 		if (i > Num_tss03_samedi_patrol_01) then 
  458. 			i = 1 
  459. 		end 
  460. 	end 
  461. end 
  462.  
  463. function tss03_patrol_sees_player(name) 
  464. 	-- The patrol needs to be loaded 
  465. 	while (not character_check_resource_loaded(name)) do 
  466. 		thread_yield() 
  467. 	end 
  468.  
  469. 	-- As long as the player can be taunted 
  470. 	while (CAN_TAUNT_PLAYER) do 
  471. 		-- Make sure the patrol is still alive 
  472. 		if (character_is_dead(name)) then 
  473. 			return 
  474. 		end 
  475.  
  476. 		-- Taunt the player if possible 
  477. 		if (not PERFORMING_COMPLIMENT and (fov_check(name, LOCAL_PLAYER) > 0.0) and los_check(name, LOCAL_PLAYER)) then 
  478. 			patrol_pause(PATROL_THREAD) 
  479. 			npc_go_idle(name) 
  480. 			turn_to_char(name, LOCAL_PLAYER) 
  481. 			action_play(name, Tss03_taunt[rand_int(1, Num_tss03_taunt)], nil, true, .95, true) 
  482. 			patrol_unpause(PATROL_THREAD) 
  483. 		end 
  484.  
  485. 		delay(8) 
  486. 	end 
  487. end 
  488.  
  489. function tss03_shantytown() 
  490. 	-- Reset the movers in case they were destroyed before this sequence 
  491. 	for i = 1, Num_tss03_shanties, 1 do 
  492. 		mesh_mover_reset(Tss03_shanties[i]) 
  493. 	end 
  494.  
  495. 	-- Disable the trigger...the action starts now! 
  496. 	trigger_enable(TRIGGER_SHANTYTOWN, false) 
  497.  
  498. 	-- Release the entry way bums to the world 
  499. 	-- release_to_world(GROUP_ENTRYWAY) 
  500.  
  501. 	-- Remove the objective destination 
  502. 	marker_remove_trigger(TRIGGER_SHANTYTOWN, SYNC_ALL) 
  503.  
  504. 	-- No notoriety spawning 
  505. 	notoriety_force_no_spawn("Samedi", true) 
  506.  
  507. 	-- Show our first group of enemies 
  508. 	group_show(GROUP_SAMEDI) 
  509. 	-- Add markers to the Samedi 
  510. 	marker_add_group(GROUP_SAMEDI, MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  511.  
  512. 	-- Add an on death function to the Samedi NPCs... 
  513. 	for i = 1, Num_tss03_samedi_characters, 1 do 
  514. 		on_death("tss03_samedi_killer", Tss03_samedi_characters[i]) 
  515. 	end 
  516.  
  517. 	-- Force a character to patrol 
  518. 	PATROL_THREAD = patrol("tss03_patrol_01", CHARACTER_SAMEDI_PATROL_01) 
  519.  
  520. 	-- If we are in coop then show the coop group too 
  521. 	if (IN_COOP) then 
  522. 		-- Show our first group of enemies 
  523. 		group_show(GROUP_SAMEDI_COOP) 
  524. 		-- Add markers to the Samedi 
  525. 		marker_add_group(GROUP_SAMEDI_COOP, MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  526.  
  527. 		-- Add an on death function to the Samedi NPCs... 
  528. 		for i = 1, Num_tss03_samedi_characters_coop, 1 do 
  529. 			on_death("tss03_samedi_killer", Tss03_samedi_characters_coop[i]) 
  530. 		end 
  531. 	end 
  532.  
  533. 	-- Setup the Shanties...we need to keep track of shanties destroyed before the player is instructed to do so 
  534. 	for i = 1, Num_tss03_shanties, 1 do 
  535. 		on_mover_destroyed("tss03_shanty_destroyed", Tss03_shanties[i]) 
  536. 		if (not HUMAN_SHIELDS_ALLOWED) then 
  537. 			set_current_hit_points(Tss03_shanties[i], 375) 
  538. 		end 
  539. 	end 
  540.  
  541. 	-- Show the bums with pistols in the shanty area...currently don't regenerate if killed early 
  542. 	group_show(GROUP_BUMS_SHANTY) 
  543.  
  544. 	-- Setup the barkeeper to attack on fire... 
  545. 	on_weapon_fired("tss03_attack_now", LOCAL_PLAYER) 
  546.  
  547. 	-- Prompt the user to kill the Samedi 
  548. 	mission_help_table("tss03_samedi") 
  549.  
  550. 	-- Show the objective text on the HUD 
  551. 	objective_text(0, "tss03_samedi_left", Tss03_samedi_kill_count, Total_tss03_samedi_characters) 
  552. end 
  553.  
  554. function tss03_attack_now(human, weapon, name) 
  555. 	-- Only do this when a weapon is fired 
  556. 	if (name ~= "firearm") then 
  557. 		return 
  558. 	end 
  559. 	 
  560. 	-- Do not allow this callback to happen again 
  561. 	on_weapon_fired("", human) 
  562.  
  563. 	CAN_TAUNT_PLAYER = false 
  564.  
  565. 	attack(CHARACTER_SAMEDI_PATROL_01) 
  566. 	attack(CHARACTER_SAMEDI_PATROL_02) 
  567. end 
  568.  
  569. function tss03_molotovs(human) 
  570. 	-- Make sure this human has the molotov 
  571. 	inv_item_remove_all(human) 
  572. 	inv_item_add("molotov", 1, human) 
  573.  
  574. 	while (1) do 
  575. 		-- If the human is dead just exit 
  576. 		if (character_is_dead(human)) then 
  577. 			return 
  578. 		end 
  579.  
  580. 		-- Make sure the player is close enough and is in line of sight 
  581. 		if ((get_dist_char_to_char(human, LOCAL_PLAYER) < 25.0) and los_check(human, LOCAL_PLAYER)) then 
  582. 			-- Turn to and throw a molotov 
  583. 			npc_go_idle(human) 
  584. 			turn_to_char(human, LOCAL_PLAYER) 
  585. 			npc_go_idle(human) 
  586. 			force_throw_char(human, LOCAL_PLAYER) 
  587.  
  588. 			delay(rand_int(3, 8)) 
  589. 		elseif (IN_COOP) then 
  590. 			-- Time to check the remote player 
  591. 			if ((get_dist_char_to_char(human, REMOTE_PLAYER) < 25.0) and los_check(human, REMOTE_PLAYER)) then 
  592. 				-- Turn to and throw a molotov 
  593. 				npc_go_idle(human) 
  594. 				turn_to_char(human, REMOTE_PLAYER) 
  595. 				npc_go_idle(human) 
  596. 				force_throw_char(human, REMOTE_PLAYER) 
  597.  
  598. 				delay(rand_int(3, 8)) 
  599. 			else 
  600. 				-- Can't throw at anyone so just yield 
  601. 				thread_yield() 
  602. 			end 
  603. 		else 
  604. 			-- Not in coop so just yield 
  605. 			thread_yield() 
  606. 		end 
  607. 	end 
  608. end 
  609.  
  610. function tss03_throw_kill_tutorial() 
  611.  
  612. 	local function tss03_wait_for_human_shield() 
  613. 		local		local_has_human_shield = false 
  614. 		local		remote_has_human_shield = false 
  615. 		while (not local_has_human_shield and (not remote_has_human_shield)) do 
  616. 			-- Do any of the player(s) have a human shield 
  617. 			local_has_human_shield = character_has_human_shield(LOCAL_PLAYER) 
  618. 			if (IN_COOP) then 
  619. 				remote_has_human_shield = character_has_human_shield(REMOTE_PLAYER) 
  620. 			end 
  621.  
  622. 			thread_yield() 
  623. 		end 
  624. 	end 
  625.  
  626. 	-- Wait until a player has a human shield 
  627. 	tss03_wait_for_human_shield() 
  628.  
  629. 	-- Show the human shield throw/kill help text 
  630. 	tutorial_start("throw_kill", 0, true) 
  631.  
  632. 	-- Delay a bit before showing the next messgae 
  633. 	delay(15) 
  634.  
  635. 	-- Tell the player that they can use human shields to destroy the shanties 
  636. 	-- Only show this message if shanties remain. 
  637. 	if (Tss03_shanty_destroyed_count < Num_tss03_shanties) then 
  638. 		mission_help_table_nag("tss03_toss") 
  639. 	end 
  640.  
  641. 	-- Delay a bit before showing the next messgae 
  642. 	delay(15) 
  643.  
  644. 	-- Tell the player that they can use LB to quick toss humans 
  645. 	-- Only show this message if shanties remain. 
  646. 	if (Tss03_shanty_destroyed_count < Num_tss03_shanties) then 
  647. 		mission_help_table_nag("tss01_push_throw") 
  648. 	end 
  649.  
  650. 	-- Wait a bit longer 
  651. 	delay(15) 
  652.  
  653. 	-- Wait until a player has a human shield 
  654. 	tss03_wait_for_human_shield() 
  655.  
  656. 	-- Tell the player to hold RB to sprint. This is displayed while they're holding a humah shield 
  657. 	-- so that they'll realize that they can still use the sprint meter in this state. 
  658. 	mission_help_table_nag("TUT_SPRINT") 
  659.  
  660. end 
  661.  
  662. function tss03_human_shield_bums() 
  663. 	local		local_player_close_enough = false 
  664. 	local		remote_player_close_enough = false 
  665.  
  666. 	-- Wait until either player is close enough to a bum 
  667. 	while ( (not local_player_close_enough) and (not remote_player_close_enough) ) do 
  668. 		for i = 1, Num_tss03_bum_characters, 1 do 
  669. 			local_player_close_enough = local_player_close_enough or (get_dist(LOCAL_PLAYER, Tss03_bum_characters[i]) < 5.0) 
  670.  
  671. 			if (not local_player_close_enough and IN_COOP) then 
  672. 				remote_player_close_enough = remote_player_close_enough or (get_dist(REMOTE_PLAYER, Tss03_bum_characters[i]) < 5.0) 
  673. 			end 
  674. 		end 
  675.  
  676. 		thread_yield() 
  677. 	end 
  678.  
  679. 	-- Kill the other thread 
  680. 	thread_kill(HUMAN_SHIELD_BUMS_COOP) 
  681.  
  682. 	-- Show the human shield help text 
  683. 	tutorial_start("human_shield", 0, true) 
  684.  
  685.  
  686. 	-- Show the throw tutorial once a human shield has been taken 
  687. 	thread_new("tss03_throw_kill_tutorial") 
  688. end 
  689.  
  690. function tss03_human_shield_bums_coop() 
  691. 	local		local_player_close_enough = false 
  692. 	local		remote_player_close_enough = false 
  693.  
  694. 	-- Wait until either player is close enough to a bum 
  695. 	while ( (not local_player_close_enough) and (not remote_player_close_enough)) do 
  696. 		for i = 1, Num_tss03_bum_characters_coop, 1 do 
  697. 			local_player_close_enough = local_player_close_enough or (get_dist(LOCAL_PLAYER, Tss03_bum_characters_coop[i]) < 5.0) 
  698.  
  699. 			if (not local_player_close_enough and IN_COOP) then 
  700. 				remote_player_close_enough = remote_player_close_enough or (get_dist(REMOTE_PLAYER, Tss03_bum_characters_coop[i]) < 5.0) 
  701. 			end 
  702. 		end 
  703.  
  704. 		thread_yield() 
  705. 	end 
  706.  
  707. 	-- Kill the other thread 
  708. 	thread_kill(HUMAN_SHIELD_BUMS) 
  709.  
  710. 	-- Show the human shield help text 
  711. 	tutorial_start("human_shield", 0, true) 
  712.  
  713. 	-- Show the throw tutorial once a human shield has been taken 
  714. 	thread_new("tss03_throw_kill_tutorial") 
  715. end 
  716.  
  717. function tss03_samedi_killer(name) 
  718. 	-- Remove the marker 
  719. 	marker_remove_npc(name, SYNC_ALL) 
  720. 	Tss03_samedi_kill_count = Tss03_samedi_kill_count + 1 
  721.  
  722. 	if (name == CHARACTER_SAMEDI_PATROL_01) then 
  723. 		thread_kill(SEES_PLAYER_THREAD) 
  724. 	end 
  725.  
  726. 	if (name == "tss03_$samedi001") then 
  727. 		thread_kill(MOLOTOVS_THREAD) 
  728. 	end 
  729.  
  730. 	-- Show the objective text on the HUD 
  731. 	objective_text(0, "tss03_samedi_left", Tss03_samedi_kill_count, Total_tss03_samedi_characters) 
  732.  
  733. 	-- If all the Samedi are killed activate the bum sequence and destroy the shanties 
  734. 	if (Tss03_samedi_kill_count == Total_tss03_samedi_characters) then 
  735. 		-- Delay for a moment before this is setup 
  736. 		delay(1) 
  737. 		tss03_destroy_the_shanties() 
  738. 	end 
  739. end 
  740.  
  741. function tss03_shanty_destroyer(mover, human) 
  742. 	-- Remove the marker 
  743. 	marker_remove_mover(mover, SYNC_ALL) 
  744. 	Tss03_shanty_destroyed_count = Tss03_shanty_destroyed_count + 1 
  745.  
  746. 	-- Remove the on death callback for this shanty 
  747. 	on_mover_destroyed("", mover) 
  748.  
  749. 	-- Check to see if a human destroyed it 
  750. 	if (not (human == nil) and not (human == CHARACTER_GAT)) then 
  751. 		-- We know the human is valid and is not Gat 
  752. 		if (not (human == LOCAL_PLAYER) and not (human == REMOTE_PLAYER)) then 
  753. 			-- The human is not either the local or remote player so kill him! 
  754. 			character_kill(human) 
  755. 		end 
  756. 	end 
  757.  
  758. 	objective_text(0, "tss03_shanties_left", Tss03_shanty_destroyed_count, Num_tss03_shanties) 
  759.  
  760. 	-- If all the shanties are destroyed activate the bum sequence 
  761. 	if (Tss03_shanty_destroyed_count == Num_tss03_shanties) then 
  762. 		-- Delay for a moment before this is setup 
  763. 		delay(1) 
  764. 		tss03_eliminate_bums() 
  765. 	end 
  766. end 
  767.  
  768. function tss03_shanty_destroyed(name) 
  769. 	-- Decrease the shanty count left to destroy 
  770. 	Tss03_shanty_destroyed_count = Tss03_shanty_destroyed_count + 1 
  771. 	Tss03_shanties_destroyed[name] = true 
  772.  
  773. 	-- Remove the on death callback for this shanty 
  774. 	on_mover_destroyed("", name) 
  775. end 
  776.  
  777. function tss03_bum_killer(name) 
  778. 	-- Remove the marker 
  779. 	marker_remove_npc(name, SYNC_ALL) 
  780. 	Tss03_bum_kill_count = Tss03_bum_kill_count + 1 
  781.  
  782. 	objective_text(0, "tss03_bums_left", Tss03_bum_kill_count, Total_tss03_bum_characters) 
  783.  
  784. 	-- If all the Bums are killed, the mission is complete 
  785. 	if (Tss03_bum_kill_count == Total_tss03_bum_characters) then 
  786. 		tss03_complete() 
  787. 	end 
  788. end 
  789.  
  790. function tss03_bum_died(name) 
  791.  
  792. 	-- Remove the death callback 
  793. 	on_death("", name) 
  794. 	-- Release this bum (his group) to the world 
  795. 	release_to_world(name) 
  796. end 
  797.  
  798. function tss03_destroy_the_shanties() 
  799. 	-- Release any Samedi bodies to the world 
  800. 	release_to_world(GROUP_SAMEDI) 
  801. 	marker_remove_group(GROUP_SAMEDI, SYNC_ALL) 
  802.  
  803. 	-- Add an on death function to the Bum NPCs... 
  804. 	for i = 1, Num_tss03_bum_characters, 1 do 
  805. 		on_death("tss03_bum_died", Tss03_bum_characters[i]) 
  806. 	end 
  807.  
  808. 	-- If we are in coop then do this for the coop group 
  809. 	if (IN_COOP) then 
  810. 		-- Release any Samedi coop bodies to the world 
  811. 		release_to_world(GROUP_SAMEDI_COOP) 
  812. 		marker_remove_group(GROUP_SAMEDI_COOP, SYNC_ALL) 
  813. 		 
  814. 		-- Add an on death function to the coop Bum NPCs... 
  815. 		for i = 1, Num_tss03_bum_characters_coop, 1 do 
  816. 			on_death("tss03_bum_died", Tss03_bum_characters_coop[i]) 
  817. 		end 
  818. 	end 
  819.  
  820. 	-- Setup the Shanties 
  821. 	for i = 1, Num_tss03_shanties, 1 do 
  822. 		if (not Tss03_shanties_destroyed[Tss03_shanties[i]]) then 
  823. 			marker_add_mover(Tss03_shanties[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  824. 			on_mover_destroyed("tss03_shanty_destroyer", Tss03_shanties[i]) 
  825. 			if (HUMAN_SHIELDS_ALLOWED) then 
  826. 				set_current_hit_points(Tss03_shanties[i], 2) 
  827. 			else 
  828. 				-- In builds which don't allow human shields 
  829. 				set_current_hit_points(Tss03_shanties[i], 375) 
  830. 			end 
  831. 		end 
  832. 	end 
  833.  
  834. 	if (HUMAN_SHIELDS_ALLOWED) then 
  835.  
  836. 		-- Look to show the human shield help text 
  837. 		HUMAN_SHIELD_BUMS = thread_new("tss03_human_shield_bums") 
  838. 		if (IN_COOP) then 
  839. 			HUMAN_SHIELD_BUMS_COOP = thread_new("tss03_human_shield_bums_coop") 
  840. 		end 
  841.  
  842.  
  843. 	end 
  844.  
  845. 	-- Let the regenerate script initially reveal and recreate the bums when they are killed 
  846. 	BUMS_REGENERATE = thread_new("tss03_regenerate_bums") 
  847. 	if (IN_COOP) then 
  848. 		BUMS_REGENERATE_COOP = thread_new("tss03_regenerate_bums_coop") 
  849. 	end 
  850.  
  851.  
  852. 	-- If all the Shanties were killed before hand, activate the bum sequence 
  853. 	if (Tss03_shanty_destroyed_count == Num_tss03_shanties) then 
  854. 		tss03_eliminate_bums() 
  855. 	else 
  856. 		-- Prompt the user to destroy the Shanties 
  857. 		mission_help_table("tss03_shanties") 
  858. 		-- Show the objective text on the HUD 
  859. 		objective_text(0, "tss03_shanties_left", Tss03_shanty_destroyed_count, Num_tss03_shanties) 
  860. 	end 
  861.  
  862. end 
  863.  
  864. function tss03_regenerate_bums() 
  865. 	-- While in this mission 
  866. 	while (1) do 
  867. 		-- Loop through the zombies and check for revival 
  868. 		for i = 1, Num_tss03_bum_characters, 1 do 
  869. 			-- When a group is no longer loaded and is dead, recreate the group 
  870. 			if (not group_is_loaded(Tss03_bum_characters[i])) then 
  871. 				-- Create the group, hidden 
  872. 				group_create_hidden(Tss03_bum_characters[i]) 
  873. 			end 
  874.  
  875. 			-- If the current bum is hidden then see if we can reveal it 
  876. 			if (character_hidden(Tss03_bum_characters[i])) then 
  877.  
  878. 				if (tss03_can_show_bum(Tss03_bum_characters[i])) then 
  879. 					tss03_regenerate_bum(Tss03_bum_characters[i]) 
  880. 				end 
  881. 			end 
  882.  
  883. 			-- Yield and check the next bum in the next frame 
  884. 			thread_yield() 
  885. 		end 
  886. 	end 
  887. end 
  888.  
  889. function tss03_regenerate_bums_coop() 
  890. 	-- While in this mission 
  891. 	while (1) do 
  892. 		-- Loop through the zombies and check for revival 
  893. 		for i = 1, Num_tss03_bum_characters_coop, 1 do 
  894. 			-- When a group is no longer loaded and is dead, recreate the group 
  895. 			if (not group_is_loaded(Tss03_bum_characters_coop[i])) then 
  896. 				-- Create the group, hidden 
  897. 				group_create_hidden(Tss03_bum_characters_coop[i]) 
  898. 			end 
  899.  
  900. 			-- If the current bum is hidden then see if we can reveal it 
  901. 			if (character_hidden(Tss03_bum_characters_coop[i])) then 
  902.  
  903. 				if (tss03_can_show_bum(Tss03_bum_characters_coop[i])) then 
  904. 					tss03_regenerate_bum(Tss03_bum_characters_coop[i]) 
  905. 				end 
  906. 			end 
  907.  
  908. 			-- Yield and check the next bum in the next frame 
  909. 			thread_yield() 
  910. 		end 
  911. 	end 
  912. end 
  913.  
  914. function tss03_regenerate_bum(bum) 
  915. 	-- Wait for the resources to be loaded 
  916. 	character_wait_for_loaded_resource(bum) 
  917. 	-- Show the bum 
  918. 	group_show(bum) 
  919. 	-- Setup the death callback 
  920. 	on_death("tss03_bum_died", bum) 
  921. end 
  922.  
  923. function tss03_eliminate_bums() 
  924. 	-- Create the bum rush group 
  925. 	group_create_hidden(GROUP_BUMS_RUSH) 
  926.  
  927. 	-- Kill the regenerate threads 
  928. 	thread_kill(BUMS_REGENERATE) 
  929. 	thread_kill(BUMS_REGENERATE_COOP) 
  930.  
  931. 	-- Add markers to the bums 
  932. 	for i = 1, Num_tss03_bum_characters, 1 do 
  933. 		if (not character_is_dead(Tss03_bum_characters[i]) and not character_hidden(Tss03_bum_characters[i])) then 
  934. 			marker_add_npc(Tss03_bum_characters[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  935. 			on_death("tss03_bum_killer", Tss03_bum_characters[i]) 
  936. 		else 
  937. 			Tss03_bum_kill_count = Tss03_bum_kill_count + 1 
  938. 		end 
  939. 	end 
  940.  
  941. 	-- If we are in coop then do this for the coop bums 
  942. 	if (IN_COOP) then 
  943. 		-- Add markers to the coop bums 
  944. 		for i = 1, Num_tss03_bum_characters_coop, 1 do 
  945. 			if (not character_is_dead(Tss03_bum_characters_coop[i]) and not character_hidden(Tss03_bum_characters_coop[i])) then 
  946. 				marker_add_npc(Tss03_bum_characters_coop[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  947. 				on_death("tss03_bum_killer", Tss03_bum_characters_coop[i]) 
  948. 			else 
  949. 				Tss03_bum_kill_count = Tss03_bum_kill_count + 1 
  950. 			end 
  951. 		end 
  952. 	end 
  953.  
  954. 	-- Add markers to the rush bums 
  955. 	for i,bum in pairs (Tss03_bum_characters_rush) do 
  956. 		if (tss03_can_show_bum(bum)) then 
  957. 			character_show(bum) 
  958. 			marker_add_npc(bum, MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  959. 			on_death("tss03_bum_killer", bum) 
  960. 			attack(bum) 
  961. 		else 
  962. 			Tss03_bum_kill_count = Tss03_bum_kill_count + 1 
  963. 		end 
  964. 	end 
  965.  
  966. 	-- If all the Bums are killed, the mission is complete 
  967. 	if (Tss03_bum_kill_count == Total_tss03_bum_characters) then 
  968. 		tss03_complete() 
  969. 	else 
  970. 		-- Prompt the user to kill the bums 
  971. 		mission_help_table("tss03_bums") 
  972. 		-- Show the objective text on the HUD 
  973. 		objective_text(0, "tss03_bums_left", Tss03_bum_kill_count, Total_tss03_bum_characters) 
  974. 	end 
  975. end 
  976.  
  977. function tss03_can_show_bum(bum) 
  978.  
  979. 	local local_can_show		= not npc_in_player_fov(bum, LOCAL_PLAYER) 
  980. 	local remote_can_show	= true 
  981.  
  982. 	if (IN_COOP) then 
  983. 		remote_can_show = not npc_in_player_fov(bum, REMOTE_PLAYER) 
  984. 	end 
  985. 	 
  986. 	local dist_can_show = get_dist_closest_player_to_object(bum) > 8 
  987.  
  988. 	if (local_can_show and remote_can_show and dist_can_show) then 
  989. 		return true 
  990. 	end 
  991.  
  992. end 
  993.  
  994.