sr2lua/sh_ss_fishingdock.lua

  1. ---Tables 
  2.  
  3. --boats = {"sh_ss_fishingdock_BoatFishingB010", "sh_ss_fishingdock_BoatFishingB020", "sh_ss_fishingdock_BoatFishingB030", "sh_ss_fishingdock_BoatFishingB040", "sh_ss_fishingdock_BoatFishingB050"} 
  4. ex_triggers = {"sh_ss_fishingdock_$tex_trig01","sh_ss_fishingdock_$tex_trig02","sh_ss_fishingdock_$tex_trig03","sh_ss_fishingdock_$tex_trig04","sh_ss_fishingdock_$tex_trig05","sh_ss_fishingdock_$tex_trig06", "sh_ss_fishingdock_$tBomb"} 
  5. explosions = {"sh_ss_fishingdock_$nexplode01","sh_ss_fishingdock_$nexplode02","sh_ss_fishingdock_$nexplode03","sh_ss_fishingdock_$nexplode04","sh_ss_fishingdock_$nexplode05","sh_ss_fishingdock_$nexplode06","sh_ss_fishingdock_$nexplode_placeholder"} 
  6. boatDefense = {"sh_ss_fishingdock_$cOne (0)", "sh_ss_fishingdock_$cOne (1)", "sh_ss_fishingdock_$cOne (2)","sh_ss_fishingdock_$cTwo (0)", "sh_ss_fishingdock_$cTwo (1)", "sh_ss_fishingdock_$cTwo (2)"} 
  7. labs = {{"sh_ss_fishingdock_1FrozenFishA180", 1}, 
  8. 		  {"sh_ss_fishingdock_1FrozenFishA210", 1}, 
  9. 		  {"sh_ss_fishingdock_1FrozenFishA190", 1}, 
  10. 		  {"sh_ss_fishingdock_1FrozenFishA200", 1}, 
  11. 		  {"sh_ss_fishingdock_1FrozenFishA170", 1}, 
  12. 		  {"sh_ss_fishingdock_1FrozenFishA160", 1}, 
  13. 		  {"sh_ss_fishingdock_2FrozenFishA010", 2}, 
  14. 		  {"sh_ss_fishingdock_2FrozenFishA030", 2}, 
  15. 		  {"sh_ss_fishingdock_2FrozenFishA020", 2}, 
  16. 		  {"sh_ss_fishingdock_3FrozenFishA240", 3}, 
  17. 		  {"sh_ss_fishingdock_3FrozenFishA270", 3}, 
  18. 		  {"sh_ss_fishingdock_3FrozenFishA250", 3}, 
  19. 		  {"sh_ss_fishingdock_3FrozenFishA260", 3}, 
  20. 		  {"sh_ss_fishingdock_3FrozenFishA220", 3}, 
  21. 		  {"sh_ss_fishingdock_3FrozenFishA230", 3}, 
  22. 		  {"sh_ss_fishingdock_4FrozenFishA060", 4}, 
  23. 		  {"sh_ss_fishingdock_4FrozenFishA040", 4}, 
  24. 		  {"sh_ss_fishingdock_4FrozenFishA050", 4}, 
  25. 		  {"sh_ss_fishingdock_5FrozenFishA150", 5}, 
  26. 		  {"sh_ss_fishingdock_5FrozenFishA130", 5}, 
  27. 		  {"sh_ss_fishingdock_5FrozenFishA120", 5}, 
  28. 		  {"sh_ss_fishingdock_5FrozenFishA140", 5}, 
  29. 		  {"sh_ss_fishingdock_6FrozenFishA090", 6}, 
  30. 		  {"sh_ss_fishingdock_6FrozenFishA080", 6}, 
  31. 		  {"sh_ss_fishingdock_6FrozenFishA070", 6} 
  32. 		 } 
  33.  
  34. fish_nav = {"sh_ss_fishingdock_$nfisharrow1", "sh_ss_fishingdock_$nfisharrow2", "sh_ss_fishingdock_$nfisharrow3", "sh_ss_fishingdock_$nfisharrow4", "sh_ss_fishingdock_$nfisharrow5", "sh_ss_fishingdock_$nfisharrowsix"} 
  35. real_boats =  {"sh_ss_fishingdock_$v002 (2)", "sh_ss_fishingdock_$v002 (1)", "sh_ss_fishingdock_$v002 (0)", "sh_ss_fishingdock_$v002"} 
  36.  
  37. --Globals 
  38. --boat_total = sizeof_table( boats ) 
  39. --boat_count = 0 
  40. labs_total = sizeof_table( labs ) 
  41. labs_count = 0 
  42. boatDefense_total = sizeof_table ( boatDefense ) 
  43. in_radius_player1 = false --Determines if the player is in the blast radius of the bomb 
  44. in_radius_player2 = false 
  45. boat_active = false 
  46. fish_done = false 
  47. boats_done = false 
  48. labs_one = 0 
  49. labs_two = 0 
  50. labs_three = 0 
  51. labs_four = 0 
  52. labs_five = 0 
  53. labs_six = 0 
  54. fish_nav_total = sizeof_table( fish_nav ) 
  55. drug_level_local = 0 
  56. drug_level_remote = 0 
  57. drug_time =  0 
  58. distance_from_fish = 10 
  59. drug_handle_local ="" 
  60. drug_handle_remote ="" 
  61. last_fish_group = "" 
  62. real_boats_count = 0 
  63. real_boats_total = sizeof_table ( real_boats ) 
  64. real_boats_hitpoints = 0 
  65. ex_triggers_total = sizeof_table ( ex_triggers ) 
  66. smoke_handle1 = "" 
  67. smoke_handle2 = "" 
  68. smoke_handle3 = "" 
  69. smoke_handle4 = "" 
  70. smoke_handle5 = "" 
  71. smoke_handles = { smoke_handle1, smoke_handle2, smoke_handle3, smoke_handle4, smoke_handle5 } 
  72. smoke_handle_size = sizeof_table( smoke_handles ) 
  73. hud_timer_handle = "" 
  74.  
  75.  
  76. function sh_ss_fishingdock_start(checkpoint, is_restart) 
  77.  
  78. 	set_mission_author("David Bowring")	  
  79. if checkpoint == MISSION_START_CHECKPOINT then	 
  80. 	mission_start_fade_out() 
  81. 	group_create_hidden("sh_ss_fishingdock_$Gbomb") 
  82. 	teleport_coop("sh_ss_fishingdock_$nstart1","sh_ss_fishingdock_$nstart2") 
  83. 	group_create("sh_ss_fishingdock_$Gfisingboats",true) 
  84. 	 
  85. 	if (not is_restart) then 
  86. 		cutscene_play("sh_ss_fishingdockct1","sh_ss_fishingdock_$Gone") 
  87. 	else 
  88. 		group_create_hidden("sh_ss_fishingdock_$Gone", true) 
  89. 	end 
  90. 	group_show("sh_ss_fishingdock_$Gone") 
  91. 	door_lock("sh_ss_fishingdock_SHIP_DOOR", true)	 
  92. 	--group_create("sh_ss_fishingdock_$Gtrucks", true) 
  93. 	on_trigger("sh_ss_fishingdock_timer", "sh_ss_fishingdock_$tBomb") 
  94. 	on_trigger("sh_ss_fishingdock_bomb_text", "sh_ss_fishingdock_$tBombMessage") 
  95. 	--on_trigger("sh_ss_fishingdock_four", "sh_ss_fishingdock_$tSafe") 
  96. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig01") 
  97. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig02") 
  98. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig03") 
  99. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig04") 
  100. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig05") 
  101. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig06") 
  102. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig07") 
  103. 	--on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig08") 
  104. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig09") 
  105. 	on_trigger("sh_ss_fishingdock_alert", "sh_ss_fishingdock_$talert") 
  106. 	trigger_enable("sh_ss_fishingdock_$talert",true) 
  107. 	on_trigger("sh_ss_fishingdock_radius_enter","sh_ss_fishingdock_$tRadius") 
  108. 	on_trigger_exit("sh_ss_fishingdock_radius_exit","sh_ss_fishingdock_$tRadius") 
  109. 	drug_handle_local =thread_new("sh_ss_fishingdock_drug_effect_timer_local") 
  110. 	if coop_is_active() then 
  111. 		drug_handle_remote =thread_new("sh_ss_fishingdock_drug_effect_timer_remote") 
  112. 	end 
  113.  
  114. 	for i = 1, real_boats_total, 1 do 
  115. 		on_vehicle_destroyed("sh_ss_fishingdock_killcountTwo", real_boats[i])   
  116. 	end	 
  117. 		sh_ss_fishingdock_one() 
  118. 	else 
  119.  
  120. 	if group_is_loaded("sh_ss_fishingdock_$Gbomb")==false then 
  121. 		group_create("sh_ss_fishingdock_$Gbomb") 
  122. 	end 
  123. 	group_create("sh_ss_fishingdock_$Gboatdefense") 
  124. 	group_create("sh_ss_fishingdock_$Gone", true) 
  125. 	fade_in(.5) 
  126. 	on_trigger("sh_ss_fishingdock_timer", "sh_ss_fishingdock_$tBomb") 
  127. 	on_trigger("sh_ss_fishingdock_bomb_text", "sh_ss_fishingdock_$tBombMessage") 
  128. 	on_trigger("sh_ss_fishingdock_radius_enter","sh_ss_fishingdock_$tRadius") 
  129. 	on_trigger_exit("sh_ss_fishingdock_radius_exit","sh_ss_fishingdock_$tRadius") 
  130. 	--on_trigger("sh_ss_fishingdock_four", "sh_ss_fishingdock_$tSafe") 
  131. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig01") 
  132. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig02") 
  133. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig03") 
  134. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig04") 
  135. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig05") 
  136. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig06") 
  137. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig07") 
  138. 	--on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig08") 
  139. 	on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig09") 
  140. 	on_trigger("sh_ss_fishingdock_alert", "sh_ss_fishingdock_$talert") 
  141. 	trigger_enable("sh_ss_fishingdock_$tBomb", false) 
  142. 	trigger_enable("sh_ss_fishingdock_$tBombMessage", false) 
  143. 	trigger_enable("sh_ss_fishingdock_$tSafe", false) 
  144. 	sh_ss_fishingdock_three() 
  145. 	end 
  146. end 
  147.  
  148. function sh_ss_fishingdock_alert() 
  149.  
  150. notoriety_set_max("samedi", 3) 
  151. notoriety_set_min("samedi", 3) 
  152. if coop_is_active() then 
  153. 	notoriety_set_max("samedi", 4) 
  154. 	notoriety_set_min("samedi", 4) 
  155. end 
  156. on_trigger("", "sh_ss_fishingdock_$talert") 
  157. trigger_enable("sh_ss_fishingdock_$talert",false) 
  158.  
  159. end 
  160.  
  161.  
  162. function sh_ss_fishingdock_radius_enter(triggerer_name, trigger_name) 
  163. 	if (triggerer_name == LOCAL_PLAYER) then 
  164. 		in_radius_player1 = true 
  165. 	elseif (triggerer_name == REMOTE_PLAYER) then 
  166. 		in_radius_player2 = true 
  167. 	end 
  168. end 
  169.  
  170. function sh_ss_fishingdock_radius_exit(triggerer_name, trigger_name) 
  171. 	if (triggerer_name == LOCAL_PLAYER and character_is_dead(LOCAL_PLAYER)==false) then 
  172. 		in_radius_player1 = false 
  173. 		mission_debug("RADIUS EXIT") 
  174. 	elseif  coop_is_active() and triggerer_name == REMOTE_PLAYER and character_is_dead(REMOTE_PLAYER)==false  then 
  175. 		in_radius_player2 = false 
  176. 	end 
  177. end 
  178.  
  179.  
  180. function sh_ss_fishingdock_one() --Destroy all the labs 
  181. mission_help_table("sh_ss_fishingdock_instruct_one") 
  182. objective_text(0, "sh_ss_fishingdock_objective_one", labs_count, fish_nav_total) 
  183. for i = 1, labs_total, 1 do 
  184. 	mission_debug("on destroyed set".. labs[i][1])			 
  185. 	on_mover_destroyed("sh_ss_fishingdock_killcountOne", labs[i][1]) 
  186. 	mission_debug("labs count="..labs_total) 
  187. end 
  188.  
  189. for i = 1, fish_nav_total, 1 do 
  190. 	marker_add_navpoint(fish_nav[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL) 
  191. end 
  192. mission_start_fade_in() 
  193. end 
  194.  
  195.  
  196. function sh_ss_fishingdock_killcountOne(mesh, who_killed) 
  197. local labs_one_total = 6	 
  198. local labs_two_total = 3 
  199. local labs_three_total = 6 
  200. local labs_four_total = 3 
  201. local labs_five_total = 4 
  202. local labs_six_total = 3 
  203.  
  204. -- over complicated function to process groups of destroyed fish 
  205. on_mover_destroyed("",mesh) 
  206.  
  207. 	for i=1, labs_total, 1 do 
  208. 		 
  209. 		if mesh == labs[i][1] then			 
  210. 			if labs[i][2] == 1 then 
  211. 				labs_one = labs_one +1 
  212. 				last_fish_group = fish_nav[1] 
  213. 				mission_debug("One="..mesh) 
  214. 				if labs_one==labs_one_total then 
  215. 					labs_count = labs_count + 1 
  216. 					marker_remove_navpoint(fish_nav[1]) 
  217. 				end 
  218. 			elseif labs[i][2] == 2 then 
  219. 				labs_two = labs_two +1 
  220. 				mission_debug("two="..mesh) 
  221. 				last_fish_group = fish_nav[2] 
  222. 				if labs_two == labs_two_total then 
  223. 					labs_count = labs_count + 1 
  224. 					marker_remove_navpoint(fish_nav[2]) 
  225. 				end			 
  226. 			elseif labs[i][2] == 3 then 
  227. 				labs_three = labs_three +1 
  228. 				mission_debug("three="..mesh) 
  229. 				last_fish_group = fish_nav[3] 
  230. 				if labs_three==labs_three_total then 
  231. 					labs_count = labs_count + 1 
  232. 					marker_remove_navpoint(fish_nav[3]) 
  233. 				end 
  234. 			elseif labs[i][2] == 4 then 
  235. 				labs_four = labs_four +1 
  236. 				mission_debug("four="..mesh) 
  237. 				last_fish_group = fish_nav[4] 
  238. 				if labs_four==labs_four_total then 
  239. 					labs_count = labs_count + 1 
  240. 					marker_remove_navpoint(fish_nav[4]) 
  241. 				end 
  242. 			elseif labs[i][2] == 5 then 
  243. 				labs_five = labs_five +1 
  244. 				mission_debug("five="..mesh) 
  245. 				last_fish_group = fish_nav[5] 
  246. 				if labs_five == labs_five_total then 
  247. 					labs_count = labs_count + 1 
  248. 					marker_remove_navpoint(fish_nav[5]) 
  249. 				end					 
  250. 			elseif labs[i][2] == 6 then 
  251. 				labs_six = labs_six +1 
  252. 				mission_debug("six="..mesh) 
  253. 				last_fish_group = fish_nav[6] 
  254. 				if labs_six==labs_six_total then 
  255. 					labs_count = labs_count + 1 
  256. 					marker_remove_navpoint(fish_nav[6]) 
  257. 				end			 
  258. 			end 
  259. 		end 
  260. 	end 
  261. 	 
  262. 	--call drug effect 
  263. sh_ss_fishingdock_drug_effect() 
  264. 	mission_debug("update gsi") 
  265. 	objective_text(0, "sh_ss_fishingdock_objective_one", labs_count, fish_nav_total)	 
  266. 	--check to see if things are blown up  
  267. 	if labs_count == fish_nav_total then 
  268. 		fish_done=true 
  269. 		if boats_done and fish_done then 
  270. 			sh_ss_fishingdock_three() 
  271. 		else			 
  272. 			sh_ss_fishingdock_two() 
  273. 		end 
  274. 	end 
  275. end 
  276.  
  277. function sh_ss_fishingdock_drug_effect()	 
  278. 	mission_debug("drug_effect") 
  279. 	---function to apply drug effect	 
  280. 	drug_enable_disable_effect_override( true, SYNC_ALL ) 
  281. 	if get_dist_char_to_nav(LOCAL_PLAYER, last_fish_group) < distance_from_fish then 
  282. 		drug_level_local=1 
  283. 		drug_effect_set_override_values(0, drug_level_local, SYNC_LOCAL) 
  284. 		mission_debug("drug_effect"..drug_level_local) 
  285. 	end 
  286. 	if coop_is_active() then 
  287. 		if get_dist_char_to_nav(REMOTE_PLAYER, last_fish_group) < distance_from_fish then 
  288. 			drug_level_remote=1 
  289. 			drug_effect_set_override_values(0, drug_level_remote, SYNC_REMOTE) 
  290. 		end 
  291. 	end 
  292. end 
  293.  
  294. function sh_ss_fishingdock_drug_effect_timer_local() 
  295. 	mission_debug("drug_effect_decrease enter ="..drug_level_local) 
  296. 	while drug_level_local > 0 or fish_done == false do 
  297. 		mission_debug("drug_effect"..drug_level_local) 
  298. 		drug_level_local = drug_level_local - .1 
  299. 		drug_effect_set_override_values(0, drug_level_local, SYNC_LOCAL) 
  300. 		delay(3) 
  301. 	end 
  302. end 
  303.  
  304. function sh_ss_fishingdock_drug_effect_timer_remote() 
  305. 	while drug_level_remote > 0 or fish_done == false do		 
  306. 		drug_level_remote = drug_level_remote - .1 
  307. 		drug_effect_set_override_values(0, drug_level_remote, SYNC_REMOTE) 
  308. 		delay(3) 
  309. 	end 
  310. end 
  311.  
  312.  
  313. function sh_ss_fishingdock_two() --Destroy the fishing boats 
  314. 	mission_help_table("sh_ss_fishingdock_instruct_two") 
  315. 	objective_text(0, "sh_ss_fishingdock_objective_two", real_boats_count, real_boats_total) 
  316. 	boat_active = true	 
  317. 	for i = 1, real_boats_total, 1 do 
  318. 		if vehicle_is_destroyed(real_boats[i]) == false then 
  319. 			marker_add_vehicle(real_boats[i], MINIMAP_ICON_KILL, INGAME_EFFECT_VEHICLE_KILL) 
  320. 			real_boats_hitpoints = get_max_hit_points(real_boats[i])/5 
  321. 			set_max_hit_points(real_boats[i], real_boats_hitpoints) 
  322. 		end 
  323. 	end 
  324. end 
  325.  
  326.  
  327. function sh_ss_fishingdock_killcountTwo(vehicle) 
  328.  
  329. 	real_boats_count = real_boats_count + 1 
  330. 	marker_remove_vehicle(vehicle) 
  331. 	release_to_world(vehicle)	 
  332. 	if boat_active and fish_done then 
  333. 		objective_text(0, "sh_ss_fishingdock_objective_two", real_boats_count, real_boats_total) 
  334. 	end 
  335. 		 
  336. 		--Spawn a wave to attack player 
  337. 		if real_boats_count == 2 then 
  338. 			mission_debug("Defense coming", 30) 
  339. 			group_create("sh_ss_fishingdock_$Gboatdefense") 
  340. 			vehicle_enter_group_teleport("sh_ss_fishingdock_$cOne (0)", "sh_ss_fishingdock_$cOne (1)", "sh_ss_fishingdock_$cOne (2)", "sh_ss_fishingdock_$vOne") 		 
  341. 			vehicle_enter_group_teleport("sh_ss_fishingdock_$cTwo (0)", "sh_ss_fishingdock_$cTwo (1)", "sh_ss_fishingdock_$cTwo (2)", "sh_ss_fishingdock_$vTwo")  
  342. 			for i = 1, boatDefense_total, 1 do 
  343. 				set_blitz_flag(boatDefense[i], true) 
  344. 				set_always_sees_player_flag(boatDefense[i], true) 
  345. 				set_attack_player_flag(boatDefense[i], true) 
  346. 				attack(boatDefense[i], "#CLOSEST_PLAYER#") 
  347. 			end 
  348. 		end 
  349. 		 
  350. 		if real_boats_count == real_boats_total then 
  351. 			boats_done=true 
  352. 			mission_debug("boats done") 
  353. 		end 
  354. 		--Send the player into the ship 
  355. 	if real_boats_count == real_boats_total and fish_done then 
  356. 		delay(3) 
  357. 		sh_ss_fishingdock_three_set_checkpoint() 
  358. 	end 
  359. end 
  360.  
  361. function sh_ss_fishingdock_three_set_checkpoint() --Blow up the fuel chute 
  362. 	mission_set_checkpoint("chute") 
  363. 	sh_ss_fishingdock_three()	 
  364. end 
  365.  
  366. function sh_ss_fishingdock_three() --Blow up the fuel chute	 
  367. 	if group_is_loaded("sh_ss_fishingdock_$Gtwo") == false then 
  368. 	group_create("sh_ss_fishingdock_$Gtwo") 
  369. 	end 
  370. 	objective_text_clear(0) 
  371. 	trigger_enable("sh_ss_fishingdock_$tBomb", true) 
  372. 	trigger_enable("sh_ss_fishingdock_$tBombMessage", true) 
  373. 	mission_help_table("sh_ss_fishingdock_instruct_three") 
  374. 	marker_add_navpoint("sh_ss_fishingdock_$tBomb", MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION) 
  375. 	door_lock("sh_ss_fishingdock_SHIP_DOOR", false) 
  376. 	door_open("sh_ss_fishingdock_SHIP_DOOR") 
  377. end 
  378.  
  379.  
  380. function sh_ss_fishingdock_bomb_text( triggerer_name, trigger_name ) --Press Y to blow up the ship 
  381. 	 
  382. 	if ( triggerer_name == LOCAL_PLAYER ) then 
  383. 		mission_help_table_nag( "sh_ss_fishingdock_bomb_message", "", "", SYNC_LOCAL )		 
  384. 	elseif ( triggerer_name == REMOTE_PLAYER ) then 
  385. 		mission_help_table_nag( "sh_ss_fishingdock_bomb_message", "", "", SYNC_REMOTE )		 
  386. 	end 
  387. end 
  388.  
  389.   
  390.  
  391. function sh_ss_fishingdock_timer( triggerer_name, trigger_name ) --Escape the ship	 
  392. 	if group_is_loaded("sh_ss_fishingdock_$Gone") then 
  393. 	release_to_world("sh_ss_fishingdock_$Gone") 
  394. 	end 
  395. 	--objective_text(0, "sh_ss_fishingdock_objective_three") 
  396. 	mission_help_table("sh_ss_fishingdock_instruct_four") 
  397. 	marker_remove_navpoint("sh_ss_fishingdock_$tBomb") 
  398. 	trigger_enable("sh_ss_fishingdock_$tBomb", false) 
  399. 	trigger_enable("sh_ss_fishingdock_$tBombMessage", false) 
  400. 	--trigger_enable("sh_ss_fishingdock_$tSafe", true) 
  401. 	character_release_human_shield(triggerer_name) 
  402. 	--item_drop(nil,triggerer_name) 
  403. 	mesh_mover_wield_stop(triggerer_name) 
  404. 	action_play(triggerer_name,"bomb plant","bomb plant",true,.80,true) 
  405. 	trigger_enable("sh_ss_fishingdock_$tRadius", true) 
  406. 	group_show("sh_ss_fishingdock_$Gbomb") 
  407. 	if get_dist_char_to_nav(LOCAL_PLAYER, "sh_ss_fishingdock_$tRadius") < 60 then 
  408. 		in_radius_player1 = true 
  409. 	end 
  410. 	 
  411. 	if (coop_is_active()) then 
  412. 		if get_dist_char_to_nav(REMOTE_PLAYER, "sh_ss_fishingdock_$tRadius") < 60 then		 
  413. 			in_radius_player2 = true 
  414. 		end 
  415. 	end 
  416. 	mission_help_clear() 
  417. 	hud_timer_set(0, 180000,"sh_ss_fishingdock_end") 
  418. 	--marker_add_navpoint("sh_ss_fishingdock_$tSafe", MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION) 
  419. 	minimap_icon_add_navpoint_radius("sh_ss_fishingdock_$tRadius", MINIMAP_ICON_LOCATION, 63, nil, SYNC_ALL) 
  420. 	group_create("sh_ss_fishingdock_$Gthree") 
  421. 	trigger_enable("sh_ss_fishingdock_$tex_trig01", true) 
  422. 	trigger_enable("sh_ss_fishingdock_$tex_trig02", true) 
  423. 	trigger_enable("sh_ss_fishingdock_$tex_trig03", true) 
  424. 	trigger_enable("sh_ss_fishingdock_$tex_trig04", true) 
  425. 	trigger_enable("sh_ss_fishingdock_$tex_trig05", true) 
  426. 	trigger_enable("sh_ss_fishingdock_$tex_trig06", true) 
  427. 	trigger_enable("sh_ss_fishingdock_$tex_trig07", true) 
  428. 	trigger_enable("sh_ss_fishingdock_$tex_trig09", true) 
  429. end 
  430.  
  431. function sh_ss_fishingdock_end() --Failed to escape 
  432.  
  433. 	hud_timer_stop(0) 
  434. 	objective_text_clear(0) 
  435. 	trigger_enable("sh_ss_fishingdock_$tSafe", false) 
  436. 	--marker_remove_navpoint("sh_ss_fishingdock_$tSafe") 
  437. 	trigger_enable("sh_ss_fishingdock_$tRadius", false) 
  438.  
  439. 	--big boom 
  440. 	explosion_create("Tanker", "sh_ss_fishingdock_$nexplode04", "", true) 
  441. 	explosion_create("Car Bomb", "sh_ss_fishingdock_$nexplode04", "", true) 
  442. 	explosion_create("Big Bang", "sh_ss_fishingdock_$nexplode04", "", true)	 
  443. 	explosion_create("Tanker", "sh_ss_fishingdock_$nexplode02b", "", true) 
  444. 	explosion_create("Tanker", "sh_ss_fishingdock_$nexplode05", "", true) 
  445. 	explosion_create("Big Bang", "sh_ss_fishingdock_$nexplode02b", "", true) 
  446. 	delay(1) 
  447. 	explosion_create("Car Bomb", "sh_ss_fishingdock_$nexplode05", "", true) 
  448. 	explosion_create("Tanker", "sh_ss_fishingdock_$nexplode02a", "", true) 
  449. 	explosion_create("Car Bomb", "sh_ss_fishingdock_$nexplode02a", "", true) 
  450. 	explosion_create("Car Bomb Big", "sh_ss_fishingdock_$nexplode03", "", true) 
  451. 	explosion_create("Tanker", "sh_ss_fishingdock_$nexplode05", "", true) 
  452. 	delay(1) 
  453.  
  454. 	--Kill players that are in the bomb radius 
  455.  
  456. 	if (coop_is_active()) then --Checks that if either player dies the mission fails, else success 
  457. 		if (in_radius_player1 and in_radius_player2) then 
  458. 			character_kill( LOCAL_PLAYER ) 
  459. 			character_ragdoll( LOCAL_PLAYER, 100 )			 
  460. 			character_kill( REMOTE_PLAYER ) 
  461. 			character_ragdoll( REMOTE_PLAYER, 100 ) 
  462. 			mission_end_failure("sh_ss_fishingdock", "sh_ss_fishingdock_fail_bomb") 
  463.  
  464. 		elseif (in_radius_player1) then 
  465. 			character_kill( LOCAL_PLAYER ) 
  466. 			character_ragdoll( LOCAL_PLAYER, 100 )	 
  467. 			mission_end_failure("sh_ss_fishingdock", "sh_ss_fishingdock_fail_bomb") 
  468. 		 
  469. 		elseif (in_radius_player2) then 
  470. 			character_kill( REMOTE_PLAYER ) 
  471. 			character_ragdoll( REMOTE_PLAYER, 100 ) 
  472. 			mission_end_failure("sh_ss_fishingdock", "sh_ss_fishingdock_fail_bomb") 
  473. 		 
  474. 		else 
  475. 			--delay(6) 
  476. 			mission_end_success("sh_ss_fishingdock")		 
  477. 		end 
  478. 	 
  479. 	elseif (in_radius_player1) then --Checks if player 1 dies 
  480. 		mission_debug("Player is being killed") 
  481. 		character_ignite(LOCAL_PLAYER, true) 
  482. 		--character_kill( LOCAL_PLAYER ) 
  483. 		character_ragdoll( LOCAL_PLAYER, 100 ) 
  484. 		mission_end_failure("sh_ss_fishingdock", "sh_ss_fishingdock_fail_bomb")	 
  485. 	else 
  486. 		--delay(3) 
  487. 		mission_end_success("sh_ss_fishingdock") 
  488. 	end 
  489. end 
  490. 	 
  491.  
  492.  
  493.  
  494. function sh_ss_fishingdock_boat_explosions(triggerer, trigger_name)  
  495. --Sets up explosions to go off in places that won't kill the player 
  496.  
  497. 	if (trigger_name == "sh_ss_fishingdock_$tex_trig01") then 
  498. 		mission_debug("explosion play") 
  499. 		hud_timer_stop(0) 
  500. 		objective_text_clear(0) 
  501. 		trigger_enable(trigger_name, false) 
  502. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode01", "", true) 
  503. 		explosion_create("Small Bang", "sh_ss_fishingdock_$nexplode01", "", true) 
  504. 		mission_help_table("sh_ss_fishingdock_instruct_five") --The bomb malfunctioned and went off early! 
  505. 		--objective_text(0, "sh_ss_fishingdock_objective_three") 
  506. 		hud_timer_set(0, 30000,"sh_ss_fishingdock_end")	 
  507. 	end 
  508.  
  509.  
  510.  
  511. 	if (trigger_name == "sh_ss_fishingdock_$tex_trig02") then 
  512. 		mission_debug("explosion play") 
  513. 		trigger_enable(trigger_name, false) 
  514. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode02b", "", false) 
  515. 		explosion_create("Small Bang", "sh_ss_fishingdock_$nexplode02b", "", false) 
  516. 		delay(1) 
  517. 		smoke_handle1 = effect_play("exp_nuclear_fueltank", "sh_ss_fishingdock_$nexplode02b",true) 
  518. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode02a", "", true) 
  519. 		explosion_create("Small Bang", "sh_ss_fishingdock_$nexplode02a", "", true)	 
  520. 	end 
  521.  
  522.  
  523. 	if (trigger_name == "sh_ss_fishingdock_$tex_trig03") then 
  524. 		mission_debug("explosion play") 
  525. 		trigger_enable(trigger_name, false) 
  526. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode03", "", false) 
  527. 		explosion_create("Medium Bang", "sh_ss_fishingdock_$nexplode03", "", false) 
  528. 		delay(1) 
  529. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode03", "", true) 
  530. 		explosion_create("Small Bang", "sh_ss_fishingdock_$nexplode03", "", true) 
  531.  
  532. 	end 
  533.  
  534. 	 
  535. 	if (trigger_name == "sh_ss_fishingdock_$tex_trig04") then 
  536. 		mission_debug("explosion play") 
  537. 		trigger_enable(trigger_name, false) 
  538. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode04", "", false) 
  539. 		smoke_handle2= effect_play("exp_nuclear_fueltank", "sh_ss_fishingdock_$nexplode04",true) 
  540. 	 
  541. 	end 
  542.  
  543. 	if (trigger_name == "sh_ss_fishingdock_$tex_trig05") then 
  544. 		mission_debug("explosion play") 
  545. 		trigger_enable(trigger_name, false) 
  546. 		smoke_handle3 = effect_play("exp_nuclear_fueltank", "sh_ss_fishingdock_$nexplode03", false) 
  547. 		smoke_handle4 = effect_play("exp_nuclear_fueltank", "sh_ss_fishingdock_$nexplode02b",false) 
  548. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode05", "", false) 
  549. 		explosion_create("Car Bomb", "sh_ss_fishingdock_$nexplode05", "", false) 
  550. 		delay(1) 
  551. 		smoke_handle5 = effect_play("exp_nuclear_fueltank", "sh_ss_fishingdock_$nexplode05", true) 
  552. 	 
  553. 	end 
  554.  
  555. 	if (trigger_name == "sh_ss_fishingdock_$tex_trig06") then	 
  556. 		trigger_enable(trigger_name, false) 
  557. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode06", "", false) 
  558. 	end 
  559.  
  560. 	if (trigger_name == "sh_ss_fishingdock_$tex_trig07") then	 
  561. 		trigger_enable(trigger_name, false) 
  562. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode06", "", false) 
  563. 	end 
  564.  
  565.  
  566.  
  567. 	if (trigger_name == "sh_ss_fishingdock_$tex_trig09") then	 
  568. 		trigger_enable(trigger_name, false) 
  569. 		explosion_create("Tanker", "sh_ss_fishingdock_$nexplode09", "", false) 
  570. 		explosion_create("Car Bomb", "sh_ss_fishingdock_$nexplode09", "", false) 
  571. 	end 
  572.  
  573. end 
  574.  
  575.  
  576.         
  577.  
  578. function sh_ss_fishingdock_cleanup()	 
  579. 	in_radius_player1 = false --Determines if the player is in the blast radius of the bomb 
  580. 	in_radius_player2 = false 
  581. 	on_trigger("", "sh_ss_fishingdock_$talert") 
  582. 	on_trigger("", "sh_ss_fishingdock_$tBomb") 
  583. 	on_trigger("", "sh_ss_fishingdock_$tBombMessage") 
  584. 	--on_trigger("sh_ss_fishingdock_four", "sh_ss_fishingdock_$tSafe") 
  585. 	on_trigger("", "sh_ss_fishingdock_$tex_trig01") 
  586. 	on_trigger("", "sh_ss_fishingdock_$tex_trig02") 
  587. 	on_trigger("", "sh_ss_fishingdock_$tex_trig03") 
  588. 	on_trigger("", "sh_ss_fishingdock_$tex_trig04") 
  589. 	on_trigger("", "sh_ss_fishingdock_$tex_trig05") 
  590. 	on_trigger("", "sh_ss_fishingdock_$tex_trig06") 
  591. 	on_trigger("", "sh_ss_fishingdock_$tex_trig07") 
  592. 	--on_trigger("sh_ss_fishingdock_boat_explosions", "sh_ss_fishingdock_$tex_trig08") 
  593. 	on_trigger("", "sh_ss_fishingdock_$tex_trig09") 
  594. 	on_trigger("","sh_ss_fishingdock_$tRadius") 
  595. 	on_trigger_exit("","sh_ss_fishingdock_$tRadius") 
  596. 	trigger_enable("sh_ss_fishingdock_$talert",false) 
  597. 	trigger_enable("sh_ss_fishingdock_$tBomb", false) 
  598. 	trigger_enable("sh_ss_fishingdock_$tBombMessage", false) 
  599. 	trigger_enable("sh_ss_fishingdock_$tSafe", false) 
  600. 	--marker_remove_navpoint("sh_ss_fishingdock_$tSafe") 
  601. 	trigger_enable("sh_ss_fishingdock_$tRadius", false) 
  602. 	drug_enable_disable_effect_override( false, SYNC_ALL ) 
  603. 	marker_remove_navpoint("sh_ss_fishingdock_$tBomb") 
  604. 	hud_timer_stop(0) 
  605.  
  606. 	if group_is_loaded("sh_ss_fishingdock_$Gbomb") then 
  607. 		group_destroy("sh_ss_fishingdock_$Gbomb") 
  608. 	end 
  609.  
  610.  
  611.  
  612. 	if drug_handle_local ~= "" then 
  613. 	thread_kill(drug_handle_local) 
  614. 	end 
  615. 	if coop_is_active() then 
  616. 	if drug_handle_remote ~= "" then 
  617. 	thread_kill(drug_handle_remote) 
  618. 	end 
  619. 	end 
  620.  
  621. 	for i = 1, real_boats_total, 1 do 
  622. 		if vehicle_is_destroyed(real_boats[i])== false then 
  623. 			marker_remove_vehicle(real_boats[i]) 
  624. 			on_vehicle_destroyed("", real_boats[i])   
  625. 		end 
  626. 	end 
  627.  
  628. 	for i = 1, ex_triggers_total, 1 do 
  629. 		trigger_enable(ex_triggers[i], false) 
  630. 	end 
  631.  
  632. 	for i = 1, fish_nav_total, 1 do 
  633. 		marker_remove_navpoint(fish_nav[i]) 
  634. 	end 
  635.  
  636. 	for i = 1, labs_total, 1 do 
  637. 		on_mover_destroyed("", labs[i][1]) 
  638. 	end 
  639.  
  640. 	for i=1, smoke_handle_size, 1 do  
  641. 		if smoke_handles[i] ~= "" then 
  642. 			effect_stop(smoke_handles[i]) 
  643. 		end 
  644. 	end 
  645.  
  646. end 
  647.  
  648.  
  649. function sh_ss_fishingdock_success() 
  650.  
  651.  
  652. end