sr2lua/sh_rn_rec_center.lua

  1. -- TABLES ------ 
  2.  
  3. Yakuza_1stfloor = {"sh_rn_rec_center_$c1stfloor001","sh_rn_rec_center_$c1stfloor002","sh_rn_rec_center_$c1stfloor003","sh_rn_rec_center_$c1stfloor004","sh_rn_rec_center_$c1stfloor005","sh_rn_rec_center_$c1stfloor006","sh_rn_rec_center_$c1stfloor007","sh_rn_rec_center_$c1stfloor008","sh_rn_rec_center_$c1stfloor009","sh_rn_rec_center_$c1stfloor010","sh_rn_rec_center_$c1stfloor011","sh_rn_rec_center_$c1stfloor012","sh_rn_rec_center_$c1stfloor013","sh_rn_rec_center_$c1stfloor014","sh_rn_rec_center_$c1stfloor015","sh_rn_rec_center_$c1stfloor016", "sh_rn_rec_center_GaurdDoor"} 
  4. Yakuza_Reinforcements = {"sh_rn_rec_center_$cReinf000","sh_rn_rec_center_$cReinf001","sh_rn_rec_center_$cReinf002","sh_rn_rec_center_$cReinf003","sh_rn_rec_center_$cReinf004","sh_rn_rec_center_$cReinf005","sh_rn_rec_center_$cReinf006","sh_rn_rec_center_$cReinf007","sh_rn_rec_center_$cReinf008","sh_rn_rec_center_$cReinf009","sh_rn_rec_center_$cReinf010","sh_rn_rec_center_$cReinf011"} 
  5. Ambient_NPC ={"sh_rn_rec_center_$c000", "sh_rn_rec_center_$c001", "sh_rn_rec_center_$c002", "sh_rn_rec_center_$c003"}  
  6. doors = {"sh_rn_rec_center_FrontDoor1", "sh_rn_rec_center_FrontDoor2", "sh_rn_rec_center_DoorToBack","sh_rn_rec_center_DoorToCas1A", "sh_rn_rec_center_DoorToCas2B", "sh_rn_rec_center_ExitCas1A", "sh_rn_rec_center_ExitCas1B", "sh_rn_rec_center_DoorToJail", "sh_rn_rec_center_CellDoor", "sh_rn_rec_center_DoorCas2B", "sh_rn_rec_center_DoorToCas2B", "sh_rn_rec_center_ExitCas2", "sh_rn_rec_center_GaurdDoor"} 
  7. boxes = {"sh_rn_rec_center_SE_REC_MoneyBoxA110", "sh_rn_rec_center_SE_REC_MoneyBoxA120", "sh_rn_rec_center_SE_REC_MoneyBoxA100", "sh_rn_rec_center_SE_REC_MoneyBoxA090", "sh_rn_rec_center_SE_REC_MoneyBoxA080", "sh_rn_rec_center_SE_REC_MoneyBoxA030", "sh_rn_rec_center_SE_REC_MoneyBoxA020", "sh_rn_rec_center_SE_REC_MoneyBoxA010", "sh_rn_rec_center_SE_REC_MoneyBoxA040", "sh_rn_rec_center_SE_REC_MoneyBoxA070", "sh_rn_rec_center_SE_REC_MoneyBoxA060", "sh_rn_rec_center_SE_REC_MoneyBoxA050"} 
  8. GROUPS ={"sh_rn_rec_center_saintagent", "sh_rn_rec_center_1stfloor_guards", "sh_rn_rec_center_casino_guards1", "sh_rn_rec_center_casino_guards2", "sh_rn_rec_center_casino_patrons1", "sh_rn_rec_center_casino_patrons2", "sh_rn_rec_center_captured_saint", "sh_rn_rec_center_hos", "sh_rn_rec_center_johns", "sh_rn_rec_center_1stfloor", "sh_rn_rec_center_reinf1"} 
  9.  
  10. --- GLOBAL VARIABLES ------ 
  11. boxes_count = 0 
  12. boxes_total = sizeof_table( boxes ) 
  13. Yakuza_1stfloor_count = 0 
  14. Yakuza_1stfloor_total = sizeof_table( Yakuza_1stfloor ) 
  15. Reinforcements_count = 0 
  16. Reinforcements_total = sizeof_table( Yakuza_Reinforcements ) 
  17. door_count = 0  
  18. door_total = sizeof_table( doors ) 
  19. Process_thread_handle = 0 
  20. groups_total = sizeof_table( GROUPS ) 
  21. total_destroyed = 0 
  22. destroyed_value = 3473 
  23. destroyed_target = 100000 
  24.  
  25.  
  26. ----------------------------------------very first set of stuff to do when starting------------------- 
  27. function sh_rn_rec_center_start(checkpoint, is_restart) 
  28. 	set_mission_author("David Bowring with First Pass by Scott Phillips") 
  29. 	for i = 1, door_total, 1 do 
  30. 		door_close(doors[i]) 
  31. 	end 
  32.  
  33. if checkpoint == MISSION_START_CHECKPOINT	then 
  34. 	door_lock("sh_rn_rec_center_LOCKTHIS", true) 
  35. 	group_create("sh_rn_rec_center_1stfloor_guards", true) 
  36. 	mission_start_fade_out() 
  37. 	teleport_coop("sh_rn_rec_center_$nstart","sh_rn_rec_center_$nstart", true) 
  38. 	on_projectile_hit("sh_rn_rec_center_satchel") 
  39. 	notoriety_set("police", 0) 
  40. 	notoriety_set_max("police", 0) 
  41. 	notoriety_set("ronin", 0) 
  42. 	notoriety_set_max("ronin", 0) 
  43. 	on_trigger("sh_rn_rec_center_talk_to_agent", "sh_rn_rec_center_$t000") 
  44. --	on_trigger("sh_rn_rec_center_TEMP_TELEPORT", "sh_rn_rec_center_$tTEMP")  --!!!!TEMP!!!  
  45. 	on_trigger("sh_rn_rec_center_locker_room", "sh_rn_rec_center_$t001") 
  46. 	on_trigger("sh_rn_rec_center_past_guards", "sh_rn_rec_center_$tpast_guards") 
  47. 	on_trigger("sh_rn_rec_center_stairs_entrance", "sh_rn_rec_center_$tstairs_entrance") 
  48. 	on_trigger("sh_rn_rec_center_casino_entrance", "sh_rn_rec_center_$tcasino_entrance") 
  49. 	on_trigger("sh_rn_rec_center_open_cell", "sh_rn_rec_center_$topen_cell") 
  50. 	on_trigger("sh_rn_rec_center_casino_2", "sh_rn_rec_center_$tcasino_2") 
  51. 	on_trigger("sh_rn_rec_center_brothel_entrance", "sh_rn_rec_center_$tbrothel_entrance") 
  52. 	on_trigger("sh_rn_rec_center_elevator", "sh_rn_rec_center_$televator")		 
  53. 	--door_lock("sh_rn_rec_center_FrontDoor2", true) 
  54. 	door_lock("sh_rn_rec_center_DoorToBack", true) 
  55. 	door_lock("sh_rn_rec_center_GaurdDoor", true) 
  56. 	--door_lock("sh_rn_rec_center_DoorToCas1A", true) 
  57. 	--door_lock("sh_rn_rec_center_DoorToCas2B", true) 
  58. 	door_lock("sh_rn_rec_center_ExitCas1A", true) 
  59. 	door_lock("sh_rn_rec_center_ExitCas1B", true) 
  60. 	door_lock("sh_rn_rec_center_DoorToJail", true) 
  61. 	door_lock("sh_rn_rec_center_CellDoor", true) 
  62. 	door_lock("sh_rn_rec_center_DoorCas2B", true) 
  63. 	door_lock("sh_rn_rec_center_DoorToCas2A", true) 
  64. 	door_lock("sh_rn_rec_center_ExitCas2", true) 
  65. 	trigger_enable("sh_rn_rec_center_$t000", true) 
  66. --	trigger_enable("sh_rn_rec_center_$tTEMP", true) --!!!!TEMP!!! 
  67. --	trigger_enable("sh_rn_rec_center_$tbrothel_entrance", true) --!!!!TEMP!!! this should be called after machines are destroyed, but until they work this is here 
  68. --	trigger_enable("sh_rn_rec_center_$televator", true) --!!!!TEMP!!! this is normally called after the johns are killed	 
  69. 	fade_out(.1)	 
  70.  
  71. 	group_create_hidden("sh_rn_rec_center_saintagent") 
  72. 	if (not is_restart) then 
  73. 		cutscene_play("sh_rn_rec_center_ct1")	 
  74. 	end 
  75. 	-- 
  76. 	--cutscene_play("strongholds_rec_scene2") 
  77. 	--delay(10) 
  78. 	group_show("sh_rn_rec_center_saintagent") 
  79. -------create agent and if the player kills her before she's in the party the player fails	 
  80. --	group_create("") 
  81. 	npc_suppress_persona("sh_rn_rec_center_$cSaintAgent", true) 
  82. 	on_death("sh_rn_rec_center_failure","sh_rn_rec_center_$cSaintAgent") 
  83. 	set_unrecruitable_flag("sh_rn_rec_center_$cSaintAgent", true) 
  84. 	mission_help_table("sh_rn_rec_center_meet_agent")  --TEXT: Meet the 3rd Street Saint agent 
  85. 	marker_add_npc("sh_rn_rec_center_$cSaintAgent", MINIMAP_ICON_PROTECT_ACQUIRE, INGAME_EFFECT_PROTECT_ACQUIRE)	 
  86. 	if (not character_is_dead("sh_rn_rec_center_$cSaintAgent")) then 
  87. 		move_to("sh_rn_rec_center_$cSaintAgent","sh_rn_rec_center_$t000", 1, true) 
  88. 	end 
  89. 	mission_start_fade_in() 
  90. 	else 
  91. 		sh_rn_rec_center_elevator() 
  92. 	end 
  93. end 
  94.  
  95.  
  96. function sh_rn_rec_center_satchel(type, name, weapon) 
  97. --mission_debug("type=  "..type) 
  98. --mission_debug("name=  "..name) 
  99. --mission_debug("weapon=  "..weapon) 
  100.  
  101. 	if type == "human" and name == "sh_rn_rec_center_$cSaintAgent" and weapon == "satchel" then 
  102. 	mission_end_failure("sh_rn_rec_center","MSN_SH_RN_REC_CENTER_FAIL_BETRAY") 
  103. 	end 
  104.  
  105. end 
  106. ----------------------------------------TEMP FUNCTION TO TELEPORT PAST THE SCREWED UP COLLISION IN LOBBY ---------------------------------------- 
  107. function sh_rn_rec_center_TEMP_TELEPORT() 
  108. 	teleport(LOCAL_PLAYER,"sh_rn_rec_center_$t001") 
  109. end 
  110.  
  111. ----------------------------------------after talking to agent------------------- 
  112. function sh_rn_rec_center_talk_to_agent() 
  113. 	trigger_enable("sh_rn_rec_center_$t001", true) 
  114. 	marker_remove_npc("sh_rn_rec_center_$cSaintAgent") 
  115. 	turn_to_char("sh_rn_rec_center_$cSaintAgent","#PLAYER#") 
  116. 	Process_thread_handle = thread_new("sh_rn_rec_center_saint_dialog") 
  117. 	action_play("sh_rn_rec_center_$cSaintAgent", "compliment d")	 
  118. 	set_unrecruitable_flag("sh_rn_rec_center_$cSaintAgent", false)	 
  119. end 
  120.  
  121.  
  122. ----------------------------------------while talking to agent------------------- 
  123. function sh_rn_rec_center_saint_dialog() 
  124. 	local saint_talking 
  125. 	saint_talking = audio_play_for_character("AMTSS3_RN_STRONG_REC_01","sh_rn_rec_center_$cSaintAgent", "voice", false, false) --VOICE: Hey Boss. I think the Yakuza are set up somewhere in the Sauna room. Yakuza go in, but nobody comes out. 
  126.  
  127. 	while (audio_is_playing(saint_talking)) do 
  128. 		thread_yield() 
  129. 	end 
  130. 	 
  131. 	if (not character_is_dead("sh_rn_rec_center_$cSaintAgent")) then 
  132. 		party_add("sh_rn_rec_center_$cSaintAgent") 
  133. 		marker_add_navpoint("sh_rn_rec_center_$t001", MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION) 
  134. 		mission_help_table("MSN_SH_RN_REC_CENTER_BACK_ROOM") 
  135. 		npc_suppress_persona("sh_rn_rec_center_$cSaintAgent", false) 
  136. 		npc_unholster_best_weapon("sh_rn_rec_center_$cSaintAgent")	 
  137. 		--audio_play_for_character("FRANK_SHPLACEHOLDER_2","#PLAYER#", "foley", false, false)  --VOICE: Alright, let's mount up. 
  138. 		on_death("","sh_rn_rec_center_$cSaintAgent")  --turn off death failure for agent 
  139. 	end 
  140. 	 
  141. 	 
  142. 	 
  143. end 
  144.  
  145.  
  146. ----------------------------------------at the entrance to the locker room------------------- 
  147. function sh_rn_rec_center_locker_room() 
  148. --unlock rec locker rooms doors 
  149. 	door_lock("sh_rn_rec_center_DoorToBack",false) 
  150. 	door_lock("sh_rn_rec_center_GaurdDoor",false) 
  151. 	marker_remove_navpoint("sh_rn_rec_center_$t001") 
  152. 	trigger_enable("sh_rn_rec_center_$t001", false)	 
  153. 	npc_unholster_best_weapon("sh_rn_rec_center_$cyak1-1") 
  154. 	npc_unholster_best_weapon("sh_rn_rec_center_$cyak1-2") 
  155. 	--npc_suppress_persona("sh_rn_rec_center_$cyak1-1", true) 
  156. 	--npc_suppress_persona("sh_rn_rec_center_$cyak1-2", true)	 
  157. 	--audio_play_for_character("sh_rn_rec_center_$cyak1-1", "threat - alert (solo attack)")  
  158. 	trigger_enable("sh_rn_rec_center_$tstairs_entrance", true) 
  159. 	marker_add_navpoint("sh_rn_rec_center_$tstairs_entrance", MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION) 
  160. 	mission_help_table("sh_rn_rec_center_locker_room")  --TEXT: Find the underground Yakuza racket. 
  161. end 
  162.  
  163.  
  164.  
  165. ----------------------------------------at the door to the basement stairs with 2 guards they tell player to get lost------------------- 
  166. function sh_rn_rec_center_stairs_entrance() 
  167. 	marker_remove_navpoint("sh_rn_rec_center_$tstairs_entrance") 
  168. 	trigger_enable("sh_rn_rec_center_$tcasino_entrance", true) 
  169. 	trigger_enable("sh_rn_rec_center_$tpast_guards", true) 
  170. 	audio_play_for_character("AMRON1_RN_STRONG_REC","sh_rn_rec_center_$cyak1-1", "voice", false, false) 
  171. 	turn_to_char("sh_rn_rec_center_$cyak1-1","#PLAYER#") 
  172. 	audio_play_for_character("AMRON1_RN_STRONG_REC","sh_rn_rec_center_$cyak1-1", "foley", false, false) --VOICE: Get Lost 
  173. 	action_play("sh_rn_rec_center_$cyak1-1", "insult a") 
  174. end 
  175.  
  176.  
  177. ----------------------------------------if player passes the 2 guards at top of basement stairs they attack and set notoriety to 2------------------- 
  178. function sh_rn_rec_center_past_guards() 
  179. 	npc_suppress_persona("sh_rn_rec_center_$cyak1-1", false) 
  180. 	npc_suppress_persona("sh_rn_rec_center_$cyak1-2", false) 
  181. 	attack("sh_rn_rec_center_$cyak1-1","sh_rn_rec_center_$cSaintAgent") --set the first two guards to attack if they haven't already 
  182. 	attack("sh_rn_rec_center_$cyak1-2",LOCAL_PLAYER)--	delay(2) 
  183. end  
  184.  
  185.  
  186. ----------------------------------------at the entrance to the casino everything gets set up and player gets objectives------------------- 
  187. function sh_rn_rec_center_casino_entrance() 
  188. 	 
  189. 	 
  190. 		 
  191. 	--Spawn casino patrons  
  192. 	group_create("sh_rn_rec_center_casino_patrons1") 
  193. 	mission_help_table("sh_rn_rec_center_casino_entrance")  --TEXT: Destroy the Yakuza casino machines. -- replace with TEXT: DESTROY 100,000 Dollars worth of stuff 
  194. 	objective_text(0, "sh_rn_rec_center_casino",total_destroyed, destroyed_target) 
  195. 	--objective_text(0, "sh_rn_rec_center_casino", Casino_machines_count, Casino_machines_total) 
  196. 	trigger_enable("sh_rn_rec_center_$tstairs_entrance", false) 
  197. 	trigger_enable("sh_rn_rec_center_$tcasino_2", false)	 
  198. 	--marker_add_trigger("sh_rn_rec_center_$topen_jail", ,INGAME_EFFECT_LOCATION) 
  199. 	on_trigger("sh_rn_rec_center_open_cell", "sh_rn_rec_center_$topen_jail") 
  200. 	group_create("sh_rn_rec_center_captured_saint") 
  201. 	set_unrecruitable_flag("sh_rn_rec_center_$ccaptured_saint", true) 
  202. 	delay(1)	 
  203. 	trigger_enable("sh_rn_rec_center_$topen_cell", true)  
  204. 	---adding this for mayhem gameplay 
  205. 	mission_debug("ods called") 
  206. 	on_random_ods_killed("sh_rn_rec_center_casino_killcount", "sh_rn_rec_center")	 
  207. 	while total_destroyed < destroyed_target do	 
  208. 		thread_yield()	 
  209. 	end		 
  210. 		on_random_ods_killed("", "sh_rn_rec_center") 
  211. 		mission_debug("PROCEED") 
  212. 		objective_text_clear(0) 
  213. 		delay(1) 
  214. 		--trigger_enable("sh_rn_rec_center_$tbrothel_entrance", true)		 
  215. 		--objective_text_clear(0) 
  216. 		sh_rn_rec_center_casinoTwo()	 
  217. end 
  218.  
  219.  
  220.  
  221.  
  222. function sh_rn_rec_center_casino_killcount(attacker, mover_type, X, Y, Z) 
  223. 	local part_one_done =false 
  224. 	local groupone = {"sh_rn_rec_center_$ccasino_guard008", "sh_rn_rec_center_$ccasino_guard004", "sh_rn_rec_center_$ccasino_guard001", "sh_rn_rec_center_$ccasino_guard003",  "sh_rn_rec_center_$ccasino_guard005", "sh_rn_rec_center_$ccasino_guard002"} 
  225. 	local groupone_total = sizeof_table( groupone ) 
  226. 	mission_debug("Kill Called") 
  227. 	--Casino_machines_count = Casino_machines_count + 1 
  228. 	--marker_remove_mover(mesh) 
  229.  
  230. 	 
  231. 	if	(total_destroyed >= destroyed_target) then 
  232. 		part_one_done = true 
  233. 		--objective_text_clear(0) 
  234. 		--delay(1) 
  235. 		--trigger_enable("sh_rn_rec_center_$tbrothel_entrance", true) 
  236. 		--on_random_ods_killed("", "sh_rn_rec_center") 
  237. 		--objective_text_clear(0) 
  238. 		--sh_rn_rec_center_casinoTwo()	 
  239. 	end 
  240.  
  241. 	if part_one_done == false then 
  242. 		total_destroyed = total_destroyed+destroyed_value  
  243. 		objective_text(0, "sh_rn_rec_center_casino",total_destroyed, destroyed_target) 
  244. 	end 
  245. 	 
  246. 	 
  247. 	 
  248. 	--wait until player starts busting up shit to spawn bad guys 
  249. 	if (total_destroyed == (destroyed_value*2)) then  
  250. 	group_create("sh_rn_rec_center_$Gjail_guards") 
  251. 	group_create("sh_rn_rec_center_casino_guards1", true)		 
  252. 	npc_suppress_persona("sh_rn_rec_center_$ccaptured_saint", true)	 
  253. 	notoriety_set_max("ronin",2) 
  254. 	notoriety_set_min("ronin",2) 
  255. 	notoriety_set("ronin",2) 
  256. 	 
  257. 	--notoriety_set_desired_vehicle_count("0", "ronin") 
  258. 	--Open doors for guards to charge out 
  259. 	door_open("sh_rn_rec_center_ExitCas1A") 
  260. 	door_open("sh_rn_rec_center_ExitCas1B") 
  261. 	--Move gang members into the room 
  262. 		if (group_is_loaded("sh_rn_rec_center_casino_guards1")) then 
  263. 			for i = 1, groupone_total, 1 do			 
  264. 				if   character_is_dead(groupone[i]) ~= true then					 
  265. 					thread_new("sh_rn_rec_center_movenattack", groupone[i]) 
  266. 				end 
  267. 			end 
  268. 		end 
  269. 	end 
  270.  
  271. 	 
  272.  
  273. 	 
  274. 	--mesh_mover_hide(mesh) 
  275. end 
  276.  
  277. function sh_rn_rec_center_movenattack(char) 
  278. 	move_to_safe(char,"sh_rn_rec_center_$nCasone", 3) 
  279. 	attack(char) 
  280. 	return 
  281. end 
  282.  
  283. function sh_rn_rec_center_casinoTwo()	 
  284. 	total_destroyed = 0 
  285. 	destroyed_value = 0 
  286. 	trigger_enable("sh_rn_rec_center_$tcasino_2", true)	 
  287. 	mission_help_table("sh_rn_rec_center_casino_nextroom")  --TEXT: Conintue on to the next room. 
  288. 	door_lock("sh_rn_rec_center_DoorCas2B",false) 
  289. 	door_lock("sh_rn_rec_center_DoorToCas2A",false)	 
  290. end 
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297. function sh_rn_rec_center_casino_killcountTwo(attacker, mover_type, X, Y, Z)		 
  298. 	objective_text(0, "sh_rn_rec_center_casinoTwo", total_destroyed, destroyed_target) 
  299. 	 
  300. 	if position_is_in_trigger("sh_rn_rec_center_$tAreaTwo", X, Y, Z) then 
  301. 		total_destroyed = total_destroyed+destroyed_value 
  302. 		if	(total_destroyed >= destroyed_target) then 
  303. 			on_random_ods_killed("", "sh_rn_rec_center") 
  304. 			objective_text_clear(0) 
  305. 			delay(1) 
  306. 			trigger_enable("sh_rn_rec_center_$tbrothel_entrance", true) 
  307. 			marker_add_navpoint("sh_rn_rec_center_$tbrothel_entrance", MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION) 
  308. 			mission_help_table("sh_rn_rec_center_brothel_goto")  --TEXT: Continue on to the Brothel. 
  309. 		---keep the brothel door locked until this is true 
  310. 			door_lock("sh_rn_rec_center_ExitCas2",false) 
  311. 		end	 
  312. 	end 
  313. end 
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323. ----------------------------------------prison cell with saint---------------------------------------- 
  324. function sh_rn_rec_center_open_cell(name) 
  325. --unlock the cell door meshmover 
  326. 	marker_remove_navpoint("sh_rn_rec_center_$topen_jail") 
  327. 	trigger_enable("sh_rn_rec_center_$topen_jail", false) 
  328. 	trigger_enable("sh_rn_rec_center_$topen_cell", false) 
  329. 	door_lock("sh_rn_rec_center_CellDoor",false) 
  330. 	door_open("sh_rn_rec_center_CellDoor") 
  331. 	npc_suppress_persona("sh_rn_rec_center_$ccaptured_saint", false) 
  332. 	set_unrecruitable_flag("sh_rn_rec_center_$ccaptured_saint", false) 
  333. 	party_add_optional("sh_rn_rec_center_$ccaptured_saint", name) 
  334. 	door_lock("sh_rn_rec_center_DoorToJail",false) 
  335. 	door_open("sh_rn_rec_center_DoorToJail") 
  336. end 
  337.  
  338. ----------------------------------------spawn groups in second casino area---------------------------------------- 
  339. function sh_rn_rec_center_casino_2() 
  340. 	destroyed_value = 3973 
  341. 	group_create("sh_rn_rec_center_casino_guards2") 
  342. 	group_create("sh_rn_rec_center_casino_patrons2") 
  343. 	trigger_enable("sh_rn_rec_center_$tcasino_2", false) 
  344. 	on_random_ods_killed("sh_rn_rec_center_casino_killcountTwo", "sh_rn_rec_center") 
  345. 	objective_text(0, "sh_rn_rec_center_casinoTwo", total_destroyed, destroyed_target) 
  346. end 
  347.  
  348.  
  349. ----------------------------------------just inside the brothel area---------------------------------------- 
  350. function sh_rn_rec_center_brothel_entrance() 
  351.  
  352. 	marker_remove_navpoint("sh_rn_rec_center_$tbrothel_entrance") 
  353. 	group_create("sh_rn_rec_center_johns") 
  354. 	group_create("sh_rn_rec_center_hos")	 
  355. 	mission_help_table("sh_rn_rec_center_brothel_entrance")  --TEXT: Kill the johns visiting the prostitutes. 
  356. 	objective_text(0, "sh_rn_rec_center_johns",boxes_count, boxes_total ) 
  357.  
  358. 	for i = 1, boxes_total, 1 do 
  359. 		marker_add_mover(boxes[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL) 
  360. 		on_mover_destroyed("sh_rn_rec_center_boxes_killcount", boxes[i]) 
  361. 	end 
  362. end 
  363.  
  364. function sh_rn_rec_center_boxes_killcount(mesh) 
  365. 	boxes_count = boxes_count + 1 
  366. 	marker_remove_mover(mesh) 
  367. 	objective_text(0, "sh_rn_rec_center_johns",boxes_count, boxes_total ) 
  368.  
  369. 	if (boxes_count == boxes_total) then 
  370. 	--keep the elevator door locked until this happens 
  371. 	objective_text_clear(0) 
  372. 	delay(3) 
  373. 	trigger_enable("sh_rn_rec_center_$televator", true) 
  374. 	marker_add_navpoint("sh_rn_rec_center_$televator", MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION) 
  375. 	mission_help_table("sh_rn_rec_center_elevator") -- TEXT: Take the elevator back to the 1st floor 
  376.    mission_set_checkpoint("rec 2") 
  377. 	end 
  378. end 
  379.  
  380.  
  381.  
  382.  
  383.  
  384. ----------------------------------------inside the elevator spawn reinforcements------------------- 
  385. function sh_rn_rec_center_elevator() 
  386. 	marker_remove_navpoint("sh_rn_rec_center_$televator") 
  387. 	marker_remove_navpoint("sh_rn_rec_center_$topen_jail") 
  388. 	local groups_to_destroy = {"sh_rn_rec_center_$Gjail_guards", "sh_rn_rec_center_casino_guards1", "sh_rn_rec_center_casino_guards2", "sh_rn_rec_center_casino_patrons1", "sh_rn_rec_center_casino_patrons2", "sh_rn_rec_center_hos", "sh_rn_rec_center_johns"} 
  389. 	local groups_to_destroy_total = sizeof_table(groups_to_destroy) 
  390. 	delay(1) 
  391. 	--Cleaning up previous groups to clear spots for next round  
  392. 	 
  393. 	for i = 1, groups_to_destroy_total, 1 do 
  394. 		if group_is_loaded(groups_to_destroy[i]) then 
  395. 			release_to_world(groups_to_destroy[i])		 
  396. 		end 
  397. 	end 
  398.  
  399. 	mission_start_fade_out(.5) 
  400. 	group_create("sh_rn_rec_center_reinf1",true)	 
  401. 	teleport_coop("sh_rn_rec_center_$nelevator_teleport","sh_rn_rec_center_$nelevator_teleport (0)", true) 
  402. 	sh_rn_rec_center_reinforcement_cutscene() 
  403. 	while group_is_loaded("sh_rn_rec_center_reinf1") == false do 
  404. 	thread_yield() 
  405. 	end 
  406. 	mission_start_fade_in(.5) 
  407. 	objective_text(0, "sh_rn_rec_center_reinforcements_killcount", Reinforcements_count, Reinforcements_total) 
  408. 	mission_help_table("sh_rn_rec_center_reinforcements")  --TEXT: Kill all Yakuza reinforcements! 
  409.  
  410. 		-------add markers and decrement the counter when one is killed 
  411. 	for i = 1, Reinforcements_total, 1 do 
  412. 		marker_add_npc(Yakuza_Reinforcements[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL) 
  413. 		on_death("sh_rn_rec_center_killcount", Yakuza_Reinforcements[i]) 
  414. 	end 
  415.  
  416. end 
  417.  
  418.  
  419. ----------------------------------------Reinforcements objective text kill counter---------------------------------------- 
  420. function sh_rn_rec_center_killcount(char) 
  421. 	Reinforcements_count = Reinforcements_count + 1 
  422. 	marker_remove_npc(char) 
  423. 	on_death("",char) 
  424. 	release_to_world(char) 
  425. 	objective_text(0, "sh_rn_rec_center_reinforcements_killcount", Reinforcements_count, Reinforcements_total) 
  426.  
  427. 	if (Reinforcements_count == Reinforcements_total) then 
  428. 	delay(3) 
  429. 	mission_end_success("sh_rn_rec_center")	 
  430. 	end 
  431. end 
  432.  
  433. ----------------------------------------Reinforcements arrival cutscene---------------------------------------- 
  434. function sh_rn_rec_center_reinforcement_cutscene() 
  435. 	 
  436. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf000", "sh_rn_rec_center_$nreinf_move1") 
  437. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf001", "sh_rn_rec_center_$nreinf_move2") 
  438. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf002", "sh_rn_rec_center_$nreinf_move3") 
  439. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf003", "sh_rn_rec_center_$nreinf_move4") 
  440. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf004", "sh_rn_rec_center_$nreinf_move5") 
  441. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf005", "sh_rn_rec_center_$nreinf_move6") 
  442. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf006", "sh_rn_rec_center_$nreinf_move7") 
  443. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf007", "sh_rn_rec_center_$nreinf_move8") 
  444. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf008", "sh_rn_rec_center_$nreinf_move9") 
  445. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf009", "sh_rn_rec_center_$nreinf_move10") 
  446. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf010", "sh_rn_rec_center_$nreinf_move11") 
  447. 	thread_new("sh_rn_rec_center_exit_car_run", "sh_rn_rec_center_$cReinf011", "sh_rn_rec_center_$nreinf_move12") 
  448.  
  449. end 
  450.  
  451.  
  452. ----------------------------------------Final reinforcements that arrive in vehicles/on foot------------------- 
  453. function sh_rn_rec_center_reinforcements() 
  454. 	--spawn reinforcements, drive car to location, get out and attack 
  455. 	 
  456. --[[	 
  457. 	character_add_vehicle("sh_rn_rec_center_$cReinf000", "sh_rn_rec_center_$v000", 0) 
  458. 	character_add_vehicle("sh_rn_rec_center_$cReinf001", "sh_rn_rec_center_$v000", 1) 
  459. 	character_add_vehicle("sh_rn_rec_center_$cReinf002", "sh_rn_rec_center_$v001", 0) 
  460. 	character_add_vehicle("sh_rn_rec_center_$cReinf003", "sh_rn_rec_center_$v001", 1) 
  461. 	character_add_vehicle("sh_rn_rec_center_$cReinf004", "sh_rn_rec_center_$vbike04", 0) 
  462. 	character_add_vehicle("sh_rn_rec_center_$cReinf005", "sh_rn_rec_center_$vbike05", 0) 
  463. 	character_add_vehicle("sh_rn_rec_center_$cReinf006", "sh_rn_rec_center_$vbike06", 0) 
  464. 	character_add_vehicle("sh_rn_rec_center_$cReinf007", "sh_rn_rec_center_$vbike07", 0) 
  465. 	character_add_vehicle("sh_rn_rec_center_$cReinf008", "sh_rn_rec_center_$vbike08", 0) 
  466. 	character_add_vehicle("sh_rn_rec_center_$cReinf009", "sh_rn_rec_center_$vbike09", 0) 
  467. 	character_add_vehicle("sh_rn_rec_center_$cReinf010", "sh_rn_rec_center_$vbike010", 0) 
  468. 	character_add_vehicle("sh_rn_rec_center_$cReinf011", "sh_rn_rec_center_$vbike011", 0) 
  469.  
  470. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$v000", "sh_rn_rec_center_$nyak_carstop") 
  471. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$v001", "sh_rn_rec_center_$nyak_carstop2") 
  472. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$vbike04", "sh_rn_rec_center_$nyak_carstop3") 
  473. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$vbike05", "sh_rn_rec_center_$nyak_carstop3") 
  474. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$vbike06", "sh_rn_rec_center_$nyak_carstop3") 
  475. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$vbike07", "sh_rn_rec_center_$nyak_carstop3") 
  476. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$vbike08", "sh_rn_rec_center_$nyak_carstop3") 
  477. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$vbike09", "sh_rn_rec_center_$nyak_carstop3") 
  478. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$vbike010", "sh_rn_rec_center_$nyak_carstop3") 
  479. 	thread_new("sh_rn_rec_center_vehicle_go","sh_rn_rec_center_$vbike011", "sh_rn_rec_center_$nyak_carstop3") 
  480. --]] 
  481. end 
  482.  
  483. ----------------------------------------Force all vehicles to pathfind at the same time for cutscene---------------------------------------- 
  484. function sh_rn_rec_center_vehicle_go(car, nav) 
  485. 	vehicle_pathfind_to(car, nav, true, true) 
  486. end 
  487.  
  488.  
  489. ----------------------------------------Everybody teleport out of your vehicle and engage---------------------------------------- 
  490. function sh_rn_rec_center_exit_car_run(npc, nav) 
  491. 	--vehicle_exit(npc)	 
  492. 	teleport(npc, nav) 
  493. 	turn_vulnerable(npc) 
  494. 	npc_unholster_best_weapon(npc) 
  495. 	npc_combat_enable(npc, true) 
  496. 	set_always_sees_player_flag(npc, true) 
  497. end 
  498.  
  499.  
  500.  
  501. ----------------------------------------if you fail, you fail---------------------------------------- 
  502. function sh_rn_rec_center_failure() 
  503. 	mission_end_failure("sh_rn_rec_center","sh_rn_rec_center_fail") 
  504. end 
  505.  
  506. function sh_rn_rec_center_success() 
  507. 	--release_to_world("sh_rn_rec_center_reinf_vehicles") 
  508. end 
  509.  
  510. ----------------------------------------stuff to do when winning/losing/quitting the mission---------------------------------------- 
  511. function sh_rn_rec_center_cleanup() 
  512. 	teleport("#PLAYER#","sh_rn_rec_center_$nstart") 
  513. 	notoriety_set_min("ronin", 0) 
  514. 	notoriety_set("police", 0) 
  515. 	notoriety_set("ronin", 0) 
  516. 	party_dismiss_all() 
  517. 	marker_remove_npc("sh_rn_rec_center_$cSaintAgent") 
  518. 	on_death("","sh_rn_rec_center_$cSaintAgent") 
  519. 	door_lock("sh_rn_rec_center_LOCKTHIS",false) 
  520. 	marker_remove_navpoint("sh_rn_rec_center_$tstairs_entrance") 
  521. 	marker_remove_navpoint("sh_rn_rec_center_$televator") 
  522. 	marker_remove_navpoint("sh_rn_rec_center_$topen_jail") 
  523. 	marker_remove_navpoint("sh_rn_rec_center_$t001") 
  524. 	on_trigger("", "sh_rn_rec_center_$t000") 
  525. 	on_trigger("", "sh_rn_rec_center_$t001") 
  526. 	on_trigger("", "sh_rn_rec_center_$tpast_guards") 
  527. 	on_trigger("", "sh_rn_rec_center_$tstairs_entrance") 
  528. 	on_trigger("", "sh_rn_rec_center_$tcasino_entrance") 
  529. 	on_trigger("", "sh_rn_rec_center_$topen_cell") 
  530. 	on_trigger("", "sh_rn_rec_center_$tcasino_2") 
  531. 	on_trigger("sh_rn_rec_center_brothel_entrance", "sh_rn_rec_center_$tbrothel_entrance") 
  532. 	on_trigger("sh_rn_rec_center_elevator", "sh_rn_rec_center_$televator") 
  533. 	door_lock("sh_rn_rec_center_LOCKTHIS", false) 
  534. 	--persona_override_group_stop(RONIN_PERSONAS,POT_SITUATIONS[POT_ATTACK]) 
  535. 	on_projectile_hit("") 
  536. 	for i = 1, door_total, 1 do 
  537. 		door_close(doors[i]) 
  538. 	end 
  539. 	objective_text_clear(0) 
  540. 	spawning_vehicles(true)		 
  541. 	--Casino_machines_count = 0 
  542. 	Reinforcements_count = 0	 
  543. 	for i = 1, boxes_total, 1 do 
  544. 		marker_remove_mover(boxes[i]) 
  545. 	end 
  546.  
  547. 	for i = 1, Reinforcements_total, 1 do 
  548. 		marker_remove_npc(Yakuza_Reinforcements[i]) 
  549. 	end 
  550.  
  551. 	 
  552. 	for i = 1, groups_total, 1 do 
  553. 		 if ( group_is_loaded( GROUPS[i] ) ) then 
  554. 			release_to_world( GROUPS[i] ) 
  555. 		end 
  556. 	end 
  557.  
  558. 	if Process_thread_handle ~= "" then 
  559. 	thread_kill( Process_thread_handle ) 
  560. 	end 
  561. 	on_random_ods_killed("", "sh_rn_rec_center") 
  562. end 
  563.  
  564. function sh_rn_rec_center_unlock() 
  565.  
  566. 	 
  567.  
  568. end 
  569.  
  570.  
  571.  
  572. 	 
  573.