sr2lua/tss03_demo.lua

  1. -- tss03_demo.lua 
  2. -- SR2 mission script 
  3. -- 8/09/07 
  4.  
  5. -- Global Variables -- 
  6.  
  7. Tss03_demo_samedi_characters				= {"tss03_demo_$samedi001", "tss03_demo_$samedi002", "tss03_demo_$samedi003", "tss03_demo_$samedi004", "tss03_demo_$samedi005", "tss03_demo_$samedi006", "tss03_demo_$samedi007","tss03_demo_$samedi012", "tss03_demo_$samedi013", "tss03_demo_$samedi014", "tss03_demo_$samedi015", "tss03_demo_$samedi016", "tss03_demo_$samedi017", "tss03_demo_$samedi018"} 
  8. Tss03_demo_samedi_characters_coop		= {"tss03_demo_$samedi008", "tss03_demo_$samedi009", "tss03_demo_$samedi010", "tss03_demo_$samedi011"} 
  9. Num_tss03_demo_samedi_characters			= sizeof_table(Tss03_demo_samedi_characters) 
  10. Num_tss03_demo_samedi_characters_coop	= sizeof_table(Tss03_demo_samedi_characters_coop) 
  11. Tss03_demo_samedi_kill_count				= 0 
  12. Total_tss03_demo_samedi_characters		= Num_tss03_demo_samedi_characters 
  13.  
  14. Tss03_demo_samedi_patrol_01				= {"tss03_demo_$n004", "tss03_demo_$n001", "tss03_demo_$n005", "tss03_demo_$n007", "tss03_demo_$n008", "tss03_demo_$n002", "tss03_demo_$n003", "tss03_demo_$n004", "tss03_demo_$n001"} 
  15. Num_tss03_demo_samedi_patrol_01			= sizeof_table(Tss03_demo_samedi_patrol_01) 
  16.  
  17. --Tss03_demo_bum_characters					= {"tss03_demo_$bum001", "tss03_demo_$bum002", "tss03_demo_$bum003", "tss03_demo_$bum004", "tss03_demo_$bum005", "tss03_demo_$bum011", "tss03_demo_$bum012", "tss03_demo_$bum013"} 
  18. Tss03_demo_bum_characters					= {"tss03_demo_$bum002", "tss03_demo_$bum003", "tss03_demo_$bum004", "tss03_demo_$bum005"} 
  19. Tss03_demo_bum_characters_coop			= {"tss03_demo_$bum006", "tss03_demo_$bum007", "tss03_demo_$bum008", "tss03_demo_$bum009", "tss03_demo_$bum010"} 
  20. Tss03_demo_bum_characters_rush			= {"tss03_demo_$bum014", "tss03_demo_$bum016", "tss03_demo_$bum017", "tss03_demo_$bum018"} 
  21. Num_tss03_demo_bum_characters				= sizeof_table(Tss03_demo_bum_characters) 
  22. Num_tss03_demo_bum_characters_coop		= sizeof_table(Tss03_demo_bum_characters_coop) 
  23. Num_tss03_demo_bum_characters_rush		= sizeof_table(Tss03_demo_bum_characters_rush) 
  24. Tss03_demo_bum_kill_count					= 0 
  25. Total_tss03_demo_bum_characters			= Num_tss03_demo_bum_characters 
  26.  
  27. Tss03_demo_shanties							= {"tss03_demo_ShantyA080", "tss03_demo_ShantyB070", "tss03_demo_ShantyB050", "tss03_demo_ShantyA070", "tss03_demo_ShantyA090", "tss03_demo_ShantyD050", "tss03_demo_ShantyB060"} 
  28. Num_tss03_demo_shanties						= sizeof_table(Tss03_demo_shanties) 
  29. Tss03_demo_shanty_destroyed_count		= 0 
  30.  
  31. Tss03_demo_compliment						= {"gml1_bs_sd_comp_a.animx", 
  32. 														"gml1_bs_sd_comp_b.animx", 
  33. 														"gml1_bs_sd_comp_c.animx", 
  34. 														"gml1_bs_sd_comp_d.animx"} 
  35. Num_tss03_demo_compliment					= sizeof_table(Tss03_demo_compliment) 
  36.  
  37. Tss03_demo_taunt								= {"gml1_bs_sd_insult_a.animx", 
  38. 														"gml1_bs_sd_insult_b.animx", 
  39. 														"gml1_bs_sd_insult_c.animx", 
  40. 														"gml1_bs_sd_insult_d.animx"} 
  41. Num_tss03_demo_taunt							= sizeof_table(Tss03_demo_taunt) 
  42.  
  43. Tss03_bumaga_yell_voice_id					= -1 
  44. Tss03_bumaga_yell_type_id					= -1 
  45.  
  46. IN_COOP									= false 
  47. CAN_TAUNT_PLAYER						= true 
  48. PERFORMING_COMPLIMENT				= false 
  49.  
  50. INVALID_LUA_THREAD					= 65535 
  51. PATROL_THREAD							= INVALID_LUA_THREAD 
  52. SEES_PLAYER_THREAD					= INVALID_LUA_THREAD 
  53. MOLOTOVS_THREAD						= INVALID_LUA_THREAD 
  54.  
  55. LOCATION_START							= "mission_start_sr2_city_$tss03_demo" 
  56. LOCATION_START_GAT					= "tss03_demo_$gat" 
  57. LOCATION_START_PLAYER_2				= "tss03_demo_$trig_entry" 
  58.  
  59. GROUP_START								= "tss03_demo_$group_start" 
  60. GROUP_ENTRYWAY							= "tss03_demo_$group_entryway" 
  61. GROUP_SAMEDI							= "tss03_demo_$group_samedi" 
  62. GROUP_SAMEDI_COOP						= "tss03_demo_$group_samedi_coop" 
  63. GROUP_BUMS								= "tss03_demo_$group_bums" 
  64. GROUP_BUMS_COOP						= "tss03_demo_$group_bums_coop" 
  65. GROUP_BUMS_RUSH						= "tss03_demo_$group_bumrush" 
  66. GROUP_BUMS_SHANTY						= "tss03_demo_$group_pistoleros" 
  67. GROUP_BUMAGA							= "tss03_demo_$group_bumaga" 
  68. GROUP_BUMAGA_FAKE						= "tss03_demo_$group_bumaga_fake" 
  69.  
  70. CHARACTER_GAT							= "tss03_demo_$gat" 
  71. CHARACTER_SAMEDI_PATROL_01			= "tss03_demo_$samedi006" 
  72. CHARACTER_SAMEDI_PATROL_02			= "tss03_demo_$samedi018" 
  73. CHARACTER_BUMAGA						= "tss03_demo_$bumaga" 
  74. CHARACTER_BUMAGA_GUARD1				= "tss03_demo_$bumaga_guard001" 
  75. CHARACTER_BUMAGA_GUARD2				= "tss03_demo_$bumaga_guard002" 
  76. CHARACTER_BUMAGA_GUARD3				= "tss03_demo_$bumaga_guard003" 
  77. CHARACTER_BUMAGA_GUARD4				= "tss03_demo_$bumaga_guard004" 
  78. --CHARACTER_BUM1							= "tss03_demo_$bum011"		-- Bums that will be forced to attack the player's group 
  79. --CHARACTER_BUM2							= "tss03_demo_$bum012" 
  80. --CHARACTER_BUM3							= "tss03_demo_$bum013" 
  81. CHARACTER_HUMAN_SHIELD				= "tss03_demo_$bum_human_shield" 
  82.  
  83. TRIGGER_ENTRY							= "tss03_demo_$trig_entry" 
  84. TRIGGER_WAYPOINT_1					= "tss03_demo_$t000" 
  85. TRIGGER_WAYPOINT_2					= "tss03_demo_$t001" 
  86. TRIGGER_WAYPOINT_3					= "tss03_demo_$t002" 
  87. TRIGGER_HUMAN_SHIELD					= "tss03_demo_$t003" 
  88. TRIGGER_CHECK							= "tss03_demo_$trig_check" 
  89.  
  90. CHECKPOINT_START_PLAYER				= "tss03_demo_$trig_entry" 
  91. CHECKPOINT_START_GAT					= "tss03_demo_$check_gat_start" 
  92. CHECKPOINT_START_PLAYER_2			= "tss03_demo_$check_player2_start" 
  93.  
  94. BUM_RESPAWN_DIST						= 12.0	-- In meters 
  95. BUM_RESPAWN_TIME						= 6500	-- In milliseconds 
  96.  
  97. -- Functions -- 
  98.  
  99. function tss03_demo_start() 
  100. 	-- Start trigger is hit...the activate button was hit 
  101. 	set_mission_author("Ryan Spencer") 
  102.  
  103. 	-- Check for coop being active 
  104. 	if (coop_is_active()) then 
  105. 		IN_COOP	= true 
  106.  
  107. 		-- In coop we want to change some values 
  108. 		Total_tss03_demo_samedi_characters	= (Num_tss03_demo_samedi_characters + Num_tss03_demo_samedi_characters_coop) 
  109. 		Total_tss03_demo_bum_characters		= (Num_tss03_demo_bum_characters + Num_tss03_demo_bum_characters_coop) 
  110. 	end 
  111.  
  112. 	-- The total bum characters that will need to be eliminated include the rush group of characters 
  113. 	Total_tss03_demo_bum_characters = Total_tss03_demo_bum_characters + Num_tss03_demo_bum_characters_rush 
  114.  
  115. 	-- Play the intro cutscene 
  116. 	cutscene_in() 
  117.  
  118. 	-- Disable the controls so the player can't move 
  119. 	player_controls_disable(LOCAL_PLAYER) 
  120. 	if (IN_COOP) then 
  121. 		player_controls_disable(REMOTE_PLAYER) 
  122. 	end 
  123.  
  124. --	cutscene_play("Fuzz_Suburbs_Fame", GROUP_START) 
  125. 	group_create(GROUP_START, true) 
  126.  
  127. 	-- Put Johnny Gat in player's party 
  128. 	party_dismiss_all() 
  129. 	party_add(CHARACTER_GAT, LOCAL_PLAYER) 
  130.  
  131. 	-- Turn spawning off 
  132. 	spawning_vehicles(false) 
  133. 	spawning_pedestrians(false) 
  134.  
  135. 	-- Teleport the player(s) to where they will need to be 
  136. --	if (Tss03_demo_checkpoint_01_hit == false) then 
  137. --		teleport(LOCAL_PLAYER, LOCATION_START) 
  138. --		teleport(CHARACTER_GAT, LOCATION_START_GAT) 
  139. --		if (IN_COOP) then 
  140. --			teleport(REMOTE_PLAYER, LOCATION_START_PLAYER_2) 
  141. --		end 
  142. --	else 
  143. 		-- We hit the checkpoint so we need to start from there 
  144. --		teleport(LOCAL_PLAYER, CHECKPOINT_START_PLAYER) 
  145. --		teleport(CHARACTER_GAT, CHECKPOINT_START_GAT) 
  146. --		if (IN_COOP) then 
  147. --			teleport(REMOTE_PLAYER, CHECKPOINT_START_PLAYER_2) 
  148. --		end 
  149. --	end 
  150.  
  151. 	teleport(LOCAL_PLAYER, TRIGGER_CHECK) 
  152.  
  153. 	-- Put Johnny Gat in player's party 
  154. --	party_dismiss_all() 
  155. --	party_add(CHARACTER_GAT, LOCAL_PLAYER) 
  156.  
  157. 	-- Get the Bumaga voice id for playback 
  158. 	Tss03_bumaga_yell_voice_id, Tss03_bumaga_yell_type_id = audio_get_id("BUMAGA_TSSP03_ATTACK", "voice") 
  159.  
  160. 	-- When Johnny Gat dies 
  161. 	on_death("tss03_demo_failure", CHARACTER_GAT) 
  162. 	-- When Johnny Gat is dismissed as a follower 
  163. 	on_dismiss("tss03_demo_abandon_gat", CHARACTER_GAT) 
  164.  
  165. 	-- Lets give the player and gat some weapons 
  166. 	inv_item_remove_all(LOCAL_PLAYER) 
  167. 	inv_item_add("beretta", 1, LOCAL_PLAYER) 
  168. 	inv_item_add("as14", 1, LOCAL_PLAYER) 
  169. 	inv_item_add("pipe_bomb", 1, LOCAL_PLAYER) 
  170. 	inv_item_add_ammo(LOCAL_PLAYER, "beretta", 200) 
  171. 	inv_item_add_ammo(LOCAL_PLAYER, "as14", 200) 
  172. 	inv_item_add_ammo(LOCAL_PLAYER, "pipe_bomb", 10) 
  173.  
  174. 	inv_item_add("Holt_55", 1, CHARACTER_GAT) 
  175.  
  176. 	-- Setup other demo data 
  177. 	set_time_of_day(19, 0) 
  178.  
  179. 	-- Show our initial group (Vehicle and Gat) 
  180. 	group_show(GROUP_START) 
  181.  
  182. 	-- Checkpoint or not...we need this to be set 
  183. 	on_trigger("tss03_demo_waypoint1", TRIGGER_WAYPOINT_1) 
  184. 	on_trigger("tss03_demo_waypoint2", TRIGGER_WAYPOINT_2) 
  185. 	on_trigger("tss03_demo_waypoint3", TRIGGER_WAYPOINT_3) 
  186. 	on_trigger("tss03_demo_checkpoint", TRIGGER_CHECK) 
  187.  
  188. 	if (IN_COOP) then 
  189. 		on_trigger("tss03_demo_human_shield_coop", TRIGGER_HUMAN_SHIELD) 
  190. 	else 
  191. 		on_trigger("tss03_demo_human_shield_sp", TRIGGER_HUMAN_SHIELD) 
  192. 	end 
  193.  
  194. --	if (Tss03_demo_checkpoint_01_hit == false) then 
  195. 		-- Add the objective destination 
  196. --		marker_add_trigger(TRIGGER_ENTRY, MINIMAP_ICON_LOCATION, INGAME_EFFECT_VEHICLE_LOCATION, SYNC_ALL) 
  197. --		mission_waypoint_add(TRIGGER_ENTRY) 
  198.  
  199. 		-- We need to remove and add another destination 
  200. --		on_trigger("tss03_demo_entrypoint", TRIGGER_ENTRY) 
  201. --		trigger_enable(TRIGGER_ENTRY, true)	 
  202.  
  203. 		--Prompt the user to drive to the location 
  204. --		mission_help_table("tss03_drive") 
  205. --	else 
  206. 		-- We hit the checkpoint so we need to start from there 
  207. 		tss03_demo_entrypoint()	-- Run this script so we have the objects we need... 
  208. 		tss03_demo_checkpoint()	-- Run this script so that we are in the state we want to be in... 
  209. --	end 
  210.  
  211. 	-- DEMO 
  212. 	follower_make_independent(CHARACTER_GAT, true) 
  213. 	turn_to_char(CHARACTER_GAT, LOCAL_PLAYER) 
  214. 	follower_make_independent(CHARACTER_GAT, false) 
  215.  
  216. 	-- Re-enable the controls so the player can move 
  217. 	player_controls_enable(LOCAL_PLAYER) 
  218. 	if (IN_COOP) then 
  219. 		player_controls_enable(REMOTE_PLAYER) 
  220. 	end 
  221.  
  222. 	-- Fade back into the game... 
  223. 	cutscene_out() 
  224. end 
  225.  
  226. function tss03_demo_cleanup() 
  227. 	-- Cleanup mission here... 
  228.  
  229. 	-- Reset the spawning 
  230. 	spawning_vehicles(true) 
  231. 	spawning_pedestrians(true) 
  232.  
  233. 	-- Release the vehicle to the world 
  234. 	release_to_world("tss03_demo_$vehicle") 
  235.  
  236. 	-- Reset the respawn distance 
  237. 	npc_respawn_dist_reset() 
  238.  
  239. 	-- Invalidate the deaths 
  240. 	on_death("", CHARACTER_GAT) 
  241. 	on_death("", CHARACTER_BUMAGA) 
  242.  
  243. 	-- Invalidate Gat being dismissed 
  244. 	on_dismiss("", CHARACTER_GAT) 
  245. 	party_dismiss_all() 
  246. 	group_destroy(GROUP_START) 
  247.  
  248. 	-- Invalidate the triggers 
  249. 	on_trigger("", TRIGGER_ENTRY) 
  250. 	on_trigger("", TRIGGER_WAYPOINT_1) 
  251. 	on_trigger("", TRIGGER_WAYPOINT_2) 
  252. 	on_trigger("", TRIGGER_WAYPOINT_3) 
  253. 	on_trigger("", TRIGGER_HUMAN_SHIELD) 
  254. 	on_trigger("", TRIGGER_CHECK) 
  255.  
  256. 	-- Remove icons and waypoint...they might still exist 
  257. 	marker_remove_trigger(TRIGGER_ENTRY, SYNC_ALL) 
  258. 	marker_remove_trigger(TRIGGER_CHECK, SYNC_ALL) 
  259. 	mission_waypoint_remove(SYNC_ALL) 
  260.  
  261. 	-- Remove the icons from the Samedi characters 
  262. 	for i = 1, Num_tss03_demo_samedi_characters, 1 do 
  263. 		on_death("", Tss03_demo_samedi_characters[i]) 
  264. 		marker_remove_npc(Tss03_demo_samedi_characters[i], SYNC_ALL) 
  265. 	end 
  266.  
  267. 	-- Remove the icons from the Samedi characters coop 
  268. 	for i = 1, Num_tss03_demo_samedi_characters_coop, 1 do 
  269. 		on_death("", Tss03_demo_samedi_characters_coop[i]) 
  270. 		marker_remove_npc(Tss03_demo_samedi_characters_coop[i], SYNC_ALL) 
  271. 	end 
  272.  
  273. 	-- Remove the icons from the Bum characters 
  274. 	for i = 1, Num_tss03_demo_bum_characters, 1 do 
  275. 		on_death("", Tss03_demo_bum_characters[i]) 
  276. 		on_respawn("", Tss03_demo_bum_characters[i]) 
  277. 		marker_remove_npc(Tss03_demo_bum_characters[i], SYNC_ALL) 
  278. 	end 
  279.  
  280. 	-- Remove the icons from the Bum characters coop 
  281. 	for i = 1, Num_tss03_demo_bum_characters_coop, 1 do 
  282. 		on_death("", Tss03_demo_bum_characters_coop[i]) 
  283. 		on_respawn("", Tss03_demo_bum_characters_coop[i]) 
  284. 		marker_remove_npc(Tss03_demo_bum_characters_coop[i], SYNC_ALL) 
  285. 	end 
  286.  
  287. 	on_death("", CHARACTER_BUMAGA) 
  288. 	-- Remove the icon from the Bumaga and his posse 
  289. 	marker_remove_group(GROUP_BUMAGA, SYNC_ALL) 
  290.  
  291. 	-- Restore spawning 
  292. --	notoriety_force_no_spawn("Samedi", false) 
  293. 	notoriety_force_no_spawn("Brotherhood", false) 
  294. end 
  295.  
  296. function tss03_demo_success() 
  297. 	-- Called when the mission has ended with success 
  298. --	if (not IN_COOP) then 
  299. --		tutorial_start("territory_income", 2000, true) 
  300. --	end 
  301.  
  302. 	-- Reset the checkpoint hit flags 
  303. --	Tss03_demo_checkpoint_01_hit = false 
  304. end 
  305.  
  306. function tss03_demo_complete() 
  307. 	-- Don't show the success screen right away 
  308. 	delay(2) 
  309. 	 
  310. 	-- End the mission with success 
  311. 	mission_end_success("tss03_demo") 
  312. end 
  313.  
  314. function tss03_demo_failure() 
  315. 	-- End the mission since Gat was killed 
  316. 	mission_end_failure("tss03_demo", "tss03_gat_died") 
  317. end 
  318.  
  319. function tss03_demo_abandon_gat() 
  320. 	-- End the mission since Gat was abandoned 
  321. 	mission_end_failure("tss03_demo", "tss03_gat_abandoned") 
  322. end 
  323.  
  324. function tss03_demo_entrypoint() 
  325. 	-- Release the vehicle to the world 
  326. 	release_to_world("tss03_demo_$vehicle") 
  327.  
  328. 	-- TODO: Add checkpoint capability 
  329. --	Tss03_demo_checkpoint_01_hit = true 
  330.  
  331. 	-- Disable the entry trigger and enable the first waypoint trigger 
  332. 	trigger_enable(TRIGGER_ENTRY, false) 
  333. 	trigger_enable(TRIGGER_WAYPOINT_1, true) 
  334.  
  335. 	-- Remove the objective destination 
  336. 	marker_remove_trigger(TRIGGER_ENTRY, SYNC_ALL) 
  337. 	mission_waypoint_remove(SYNC_ALL) 
  338.  
  339. 	-- Add the objective destination 
  340. --	marker_add_trigger(TRIGGER_WAYPOINT_1, MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION, SYNC_ALL) 
  341. --	mission_waypoint_add(TRIGGER_WAYPOINT_1) 
  342.  
  343. 	-- Create our first group of enemies 
  344. 	group_create_hidden(GROUP_SAMEDI) 
  345. 	group_create_hidden(GROUP_BUMS) 
  346. 	group_create_hidden(GROUP_BUMS_SHANTY) 
  347. --	group_create_hidden(GROUP_ENTRYWAY) 
  348.  
  349. 	-- If we are in coop create the coop groups too 
  350. 	if (IN_COOP) then 
  351. 		group_create_hidden(GROUP_SAMEDI_COOP) 
  352. 		group_create_hidden(GROUP_BUMS_COOP) 
  353. 	end 
  354.  
  355. 	-- Prompt the user to enter the underground 
  356. --	mission_help_table("tss03_enter") 
  357.  
  358. 	-- Show the entry way bums 
  359. --	group_show(GROUP_ENTRYWAY) 
  360. end 
  361.  
  362. function tss03_demo_waypoint1() 
  363. 	-- Disable the waypoint trigger and enable the next waypoint trigger 
  364. 	trigger_enable(TRIGGER_WAYPOINT_1, false) 
  365. 	trigger_enable(TRIGGER_WAYPOINT_2, true) 
  366.  
  367. 	-- Remove the objective destination 
  368. 	marker_remove_trigger(TRIGGER_WAYPOINT_1, SYNC_ALL) 
  369. 	mission_waypoint_remove(SYNC_ALL) 
  370.  
  371. 	-- Add the objective destination 
  372. 	marker_add_trigger(TRIGGER_WAYPOINT_2, MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION, SYNC_ALL) 
  373. 	mission_waypoint_add(TRIGGER_WAYPOINT_2) 
  374.  
  375. 	-- FIXME: Allow waypoint 2 to be skipped 
  376. --	tss03_demo_waypoint2() 
  377. end 
  378.  
  379. function tss03_demo_waypoint2() 
  380. 	-- Disable the waypoint trigger and enable the next waypoint trigger 
  381. 	trigger_enable(TRIGGER_WAYPOINT_2, false) 
  382. 	trigger_enable(TRIGGER_WAYPOINT_3, true) 
  383.  
  384. 	-- Remove the objective destination 
  385. 	marker_remove_trigger(TRIGGER_WAYPOINT_2, SYNC_ALL) 
  386. 	mission_waypoint_remove(SYNC_ALL) 
  387.  
  388. 	-- Add the objective destination 
  389. 	marker_add_trigger(TRIGGER_WAYPOINT_3, MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION, SYNC_ALL) 
  390. 	mission_waypoint_add(TRIGGER_WAYPOINT_3) 
  391. end 
  392.  
  393. function tss03_demo_waypoint3() 
  394. 	-- Disable the waypoint trigger and enable the checkpoint trigger 
  395. 	trigger_enable(TRIGGER_WAYPOINT_3, false) 
  396. 	trigger_enable(TRIGGER_CHECK, true) 
  397.  
  398. 	-- Remove the objective destination 
  399. 	marker_remove_trigger(TRIGGER_WAYPOINT_3, SYNC_ALL) 
  400. 	mission_waypoint_remove(SYNC_ALL) 
  401.  
  402. 	-- Add the objective destination 
  403. 	marker_add_trigger(TRIGGER_CHECK, MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION, SYNC_ALL) 
  404. 	mission_waypoint_add(TRIGGER_CHECK) 
  405. end 
  406.  
  407. function tss03_demo_patrol_01(name) 
  408. 	local	i = 1 
  409.  
  410. 	SEES_PLAYER_THREAD = thread_new("tss03_demo_patrol_sees_player", name) 
  411. 	MOLOTOVS_THREAD = thread_new("tss03_demo_molotovs", "tss03_demo_$samedi001") 
  412.  
  413. 	-- Walk this path until the character attacks or is dead 
  414. 	while (1) do 
  415. 		-- Yields until path is completed 
  416. 		move_to(name, Tss03_demo_samedi_patrol_01[i]) 
  417.  
  418. 		if (Tss03_demo_samedi_patrol_01[i] == "tss03_demo_$n005") then 
  419. 			PERFORMING_COMPLIMENT = true 
  420. 			 
  421. --			npc_go_idle(name) 
  422. 			turn_to_char(name, CHARACTER_SAMEDI_PATROL_02) 
  423. 			action_play_custom(name, Tss03_demo_compliment[rand_int(1, Num_tss03_demo_compliment)]) 
  424. 			 
  425. 			PERFORMING_COMPLIMENT = false 
  426.  
  427. --			action_play_custom(CHARACTER_SAMEDI_PATROL_02, Tss03_demo_compliment[rand_int(1, Num_tss03_demo_compliment)]) 
  428. 		end 
  429.  
  430. 		i = i + 1 
  431. 		if (i > Num_tss03_demo_samedi_patrol_01) then 
  432. 			i = 1 
  433. 		end 
  434. 	end 
  435. end 
  436.  
  437. function tss03_demo_patrol_sees_player(name) 
  438. 	while (not character_check_resource_loaded(name)) do 
  439. 		thread_yield() 
  440. 	end 
  441.  
  442. 	while (CAN_TAUNT_PLAYER) do 
  443. 		if (character_is_dead(name)) then 
  444. 			return 
  445. 		end 
  446.  
  447. 		if (not PERFORMING_COMPLIMENT and (fov_check(name, LOCAL_PLAYER) > 0.0) and los_check(name, LOCAL_PLAYER)) then 
  448. 			patrol_pause(PATROL_THREAD) 
  449. 			npc_go_idle(name) 
  450. 			turn_to_char(name, LOCAL_PLAYER) 
  451. 			action_play_custom(name, Tss03_demo_taunt[rand_int(1, Num_tss03_demo_taunt)]) 
  452. 			patrol_unpause(PATROL_THREAD) 
  453. 		end 
  454. 		delay(8) 
  455. 	end 
  456. end 
  457.  
  458. function tss03_demo_checkpoint() 
  459. 	-- Reset the movers in case they were destroyed before this sequence 
  460. 	for i = 1, Num_tss03_demo_shanties, 1 do 
  461. 		mesh_mover_reset(Tss03_demo_shanties[i]) 
  462. 	end 
  463.  
  464. 	-- Disable the trigger...the action starts now! 
  465. 	trigger_enable(TRIGGER_CHECK, false) 
  466.  
  467. 	-- Release the entry way bums to the world 
  468. 	release_to_world(GROUP_ENTRYWAY) 
  469.  
  470. 	-- Remove the objective destination 
  471. 	marker_remove_trigger(TRIGGER_CHECK, SYNC_ALL) 
  472. 	mission_waypoint_remove(SYNC_ALL) 
  473.  
  474. 	-- No notoriety spawning 
  475. --	notoriety_force_no_spawn("Samedi", true) 
  476. 	notoriety_force_no_spawn("Brotherhood", true) 
  477.  
  478. 	-- Show our first group of enemies 
  479. 	group_show(GROUP_SAMEDI) 
  480. 	-- Add markers to the Samedi 
  481. 	marker_add_group(GROUP_SAMEDI, MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  482.  
  483. 	-- Add an on death function to the Samedi NPCs... 
  484. 	for i = 1, Num_tss03_demo_samedi_characters, 1 do 
  485. 		on_death("tss03_demo_samedi_killer", Tss03_demo_samedi_characters[i]) 
  486. 	end 
  487.  
  488. 	-- Force a character to patrol 
  489. 	PATROL_THREAD = patrol("tss03_demo_patrol_01", CHARACTER_SAMEDI_PATROL_01) 
  490.  
  491. 	-- If we are in coop then show the coop group too 
  492. 	if (IN_COOP) then 
  493. 		-- Show our first group of enemies 
  494. 		group_show(GROUP_SAMEDI_COOP) 
  495. 		-- Add markers to the Samedi 
  496. 		marker_add_group(GROUP_SAMEDI_COOP, MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  497.  
  498. 		-- Add an on death function to the Samedi NPCs... 
  499. 		for i = 1, Num_tss03_demo_samedi_characters_coop, 1 do 
  500. 			on_death("tss03_demo_samedi_killer", Tss03_demo_samedi_characters_coop[i]) 
  501. 		end 
  502. 	end 
  503.  
  504. 	-- Setup the Shanties...we need to keep track of shanties destroyed before the player is instructed to do so 
  505. 	for i = 1, Num_tss03_demo_shanties, 1 do 
  506. 		on_mover_destroyed("tss03_demo_shanty_destroyed", Tss03_demo_shanties[i]) 
  507. 	end 
  508.  
  509. 	-- Setup the barkeeper to attack on fire... 
  510. 	on_weapon_fired("tss03_demo_attack_now", LOCAL_PLAYER) 
  511.  
  512. 	-- Prompt the user to kill the Samedi 
  513. 	mission_help_table("tss03_samedi") 
  514.  
  515. 	-- Lets do some persona override here... 
  516. 	persona_override_character_stop_all(CHARACTER_GAT) 
  517. 	persona_override_character_start(CHARACTER_GAT, "threat - alert (group attack)", "GAT_TSSP03_ATTACK") 
  518. 	persona_override_character_start(CHARACTER_GAT, "threat - alert (solo attack)", "GAT_TSSP03_ATTACK") 
  519. 	persona_override_character_start(CHARACTER_GAT, "threat - damage received (firearm)", "GAT_TSSP03_ATTACK") 
  520. 	persona_override_character_start(CHARACTER_GAT, "threat - damage received (melee)", "GAT_TSSP03_ATTACK") 
  521. 	persona_override_character_start(CHARACTER_GAT, "threat - knocked down npc/pc", "GAT_TSSP03_ATTACK") 
  522. end 
  523.  
  524. function tss03_demo_attack_now(human, weapon, name) 
  525. 	-- Only do this when a weapon is fired 
  526. 	if (name ~= "firearm") then 
  527. 		return 
  528. 	end 
  529. 	 
  530. 	-- Do not allow this callback to happen again 
  531. 	on_weapon_fired("", human) 
  532.  
  533. 	CAN_TAUNT_PLAYER = false 
  534.  
  535. 	attack(CHARACTER_SAMEDI_PATROL_01) 
  536. 	attack(CHARACTER_SAMEDI_PATROL_02) 
  537. end 
  538.  
  539. function tss03_demo_molotovs(human) 
  540. 	inv_item_remove_all(human) 
  541. 	inv_item_add("molotov", 1, human) 
  542.  
  543. 	while (1) do 
  544. 		if (character_is_dead(human)) then 
  545. 			return 
  546. 		end 
  547.  
  548. 		if ((get_dist_char_to_char(human, LOCAL_PLAYER) < 25.0) and los_check(human, LOCAL_PLAYER)) then 
  549. 			npc_go_idle(human) 
  550. 			turn_to_char(human, LOCAL_PLAYER) 
  551. 			npc_go_idle(human) 
  552. 			force_throw_char(human, LOCAL_PLAYER) 
  553.  
  554. 			delay(rand_int(3, 8)) 
  555. 		else 
  556. 			thread_yield() 
  557. 		end 
  558. 	end 
  559. end 
  560.  
  561. function tss03_demo_throw_kill_tutorial(name) 
  562. 	-- Wait until the character has a human shield 
  563. 	while (not character_has_human_shield(name)) do 
  564. 		thread_yield() 
  565. 	end 
  566.  
  567. 	-- Show the human shield throw/kill tutorial 
  568. --	tutorial_start("throw_kill", 200, true) 
  569.  
  570. 	-- We only want to show this message if the shanties weren't destroyed before hand 
  571. 	if (Tss03_demo_shanty_destroyed_count < Num_tss03_demo_shanties) then 
  572. 		-- Prompt the user to destroy the Shanties 
  573. 		mission_help_table("tss03_toss") 
  574. 	end 
  575. end 
  576.  
  577. function tss03_demo_human_shield_sp(name) 
  578. 	-- Disable the human shield trigger 
  579. 	trigger_enable(TRIGGER_HUMAN_SHIELD, false) 
  580.  
  581. 	-- Remove the objective destination 
  582. 	marker_remove_trigger(TRIGGER_HUMAN_SHIELD, SYNC_ALL) 
  583. 	mission_waypoint_remove(SYNC_ALL) 
  584.  
  585. 	-- Show the human shield tutorial 
  586. --	tutorial_start("human_shield", 200, true) 
  587.  
  588. 	thread_new("tss03_demo_throw_kill_tutorial", name) 
  589. end 
  590.  
  591. function tss03_demo_human_shield_coop(name) 
  592. 	-- Disable the human shield trigger 
  593. 	trigger_enable(TRIGGER_HUMAN_SHIELD, false) 
  594.  
  595. 	-- Remove the objective destination 
  596. 	marker_remove_trigger(TRIGGER_HUMAN_SHIELD, SYNC_ALL) 
  597. 	mission_waypoint_remove(SYNC_ALL) 
  598.  
  599. 	-- We only want to show this message if the shanties weren't destroyed before hand 
  600. 	if (Tss03_demo_shanty_destroyed_count < Num_tss03_demo_shanties) then 
  601. 		-- Prompt the user to destroy the Shanties 
  602. 		mission_help_table("tss03_toss") 
  603. 	end 
  604. end 
  605.  
  606. function tss03_demo_samedi_killer(name) 
  607. 	-- Remove the marker 
  608. 	marker_remove_npc(name, SYNC_ALL) 
  609. 	Tss03_demo_samedi_kill_count = Tss03_demo_samedi_kill_count + 1 
  610.  
  611. 	if (name == CHARACTER_SAMEDI_PATROL_01) then 
  612. 		thread_kill(SEES_PLAYER_THREAD) 
  613. 	end 
  614.  
  615. 	if (name == "tss03_demo_$samedi001") then 
  616. 		thread_kill(MOLOTOVS_THREAD) 
  617. 	end 
  618.  
  619. 	-- If all the Samedi are killed activate the bum sequence and destroy the shanties 
  620. 	if (Tss03_demo_samedi_kill_count == Total_tss03_demo_samedi_characters) then 
  621. 		-- Delay for a moment before this is setup 
  622. 		delay(1) 
  623. 		tss03_demo_destroy_the_shanties() 
  624. 	end 
  625. end 
  626.  
  627. function tss03_demo_shanty_destroyer(mover, human) 
  628. 	-- Remove the marker 
  629. 	marker_remove_mover(mover, SYNC_ALL) 
  630. 	Tss03_demo_shanty_destroyed_count = Tss03_demo_shanty_destroyed_count + 1 
  631.  
  632. 	-- Remove the on death callback for this shanty 
  633. 	on_mover_destroyed("", mover) 
  634.  
  635. 	-- Check to see if a human destroyed it 
  636. 	if (not (human == nil) and not (human == CHARACTER_GAT)) then 
  637. 		-- We know the human is valid and is not Gat 
  638. 		if (not (human == LOCAL_PLAYER) and not (human == REMOTE_PLAYER)) then 
  639. 			-- The human is not either the local or remote player so kill him! 
  640. 			character_kill(human) 
  641. 		end 
  642. 	end 
  643.  
  644. 	objective_text(0, "tss03_shanties_left", Tss03_demo_shanty_destroyed_count, Num_tss03_demo_shanties) 
  645.  
  646. 	-- Do not show the tutorial if we are in coop 
  647. 	if ((not IN_COOP) and (Tss03_demo_shanty_destroyed_count == 1)) then 
  648. 		-- Show the human shield throw/kill tutorial 
  649. --		tutorial_start("push_throw", 500, true) 
  650.  
  651. 		-- Disable the human shield trigger...it is possible to skip it 
  652. 		trigger_enable(TRIGGER_HUMAN_SHIELD, false) 
  653. 	end 
  654.  
  655. 	-- If all the shanties are destroyed activate the bum sequence 
  656. 	if (Tss03_demo_shanty_destroyed_count == Num_tss03_demo_shanties) then 
  657. 		-- Delay for a moment before this is setup 
  658. 		delay(1) 
  659. 		tss03_demo_eliminate_bums() 
  660. 	end 
  661. end 
  662.  
  663. function tss03_demo_shanty_destroyed(name) 
  664. 	-- Decrease the shanty count left to destroy 
  665. 	Tss03_demo_shanty_destroyed_count = Tss03_demo_shanty_destroyed_count + 1 
  666.  
  667. 	-- Remove the on death callback for this shanty 
  668. 	on_mover_destroyed("", name) 
  669. end 
  670.  
  671. function tss03_demo_bum_killer(name) 
  672. 	-- Remove the marker 
  673. 	marker_remove_npc(name, SYNC_ALL) 
  674. 	Tss03_demo_bum_kill_count = Tss03_demo_bum_kill_count + 1 
  675.  
  676. 	objective_text(0, "tss03_bums_left", Tss03_demo_bum_kill_count, Total_tss03_demo_bum_characters) 
  677.  
  678. 	if (Tss03_demo_bum_kill_count == 1) then 
  679. 		-- Disable the human shield trigger...it is possible to skip it and the shanty portion 
  680. 		trigger_enable(TRIGGER_HUMAN_SHIELD, false) 
  681. 	end 
  682.  
  683. 	-- If all the Bums are killed activate the bumaga sequence 
  684. 	if (Tss03_demo_bum_kill_count == Total_tss03_demo_bum_characters) then 
  685. 		tss03_demo_bumaga_showdown() 
  686. 	end 
  687. end 
  688.  
  689. function tss03_demo_bum_died(name) 
  690. 	-- Only increase the kill count when the bums are not the target 
  691. 	Tss03_demo_bum_kill_count = Tss03_demo_bum_kill_count + 1 
  692.  
  693. --	minimap_icon_remove_npc(name, SYNC_ALL) 
  694. end 
  695.  
  696. function tss03_demo_bum_respawn(name) 
  697. 	-- Only decrease the kill count when the bums are not the target 
  698. 	Tss03_demo_bum_kill_count = Tss03_demo_bum_kill_count - 1 
  699.  
  700. 	-- Force the bums to attack your party 
  701. 	if (mod(Tss03_demo_bum_kill_count, 2) == 0) then 
  702. 		attack(name, LOCAL_PLAYER) 
  703. 	else 
  704. 		if (IN_COOP) then 
  705. 			if (Tss03_demo_bum_kill_count > (Total_tss03_demo_bum_characters / 2)) then 
  706. 				attack(name, REMOTE_PLAYER) 
  707. 			else 
  708. 				attack(name, CHARACTER_GAT) 
  709. 			end 
  710. 		else 
  711. 			attack(name, CHARACTER_GAT) 
  712. 		end 
  713. 	end 
  714.  
  715. 	-- The icon is removed on death so we need to add one when the bum respawns 
  716. --	minimap_icon_add_npc(name, "map_other_blip_human", false, "", SYNC_ALL) 
  717.  
  718. 	-- Some data gets reset so we just need to set this data each time the bum respawns 
  719. 	npc_respawn_after_death(name, true) 
  720. 	npc_respawn_after_death_time_override(name, BUM_RESPAWN_TIME, true) 
  721.  
  722. 	-- TEMP: remove all the weapons for the bums 
  723. 	inv_item_remove_all(name) 
  724. end 
  725.  
  726. function tss03_demo_destroy_the_shanties() 
  727. 	-- Release any Samedi bodies to the world 
  728. 	release_to_world(GROUP_SAMEDI) 
  729. 	marker_remove_group(GROUP_SAMEDI, SYNC_ALL) 
  730.  
  731. 	-- Show our second group of enemies 
  732. 	group_show(GROUP_BUMS) 
  733. 	group_show(GROUP_BUMS_SHANTY) 
  734. --	minimap_icon_add_group(GROUP_BUMS, "map_other_blip_human", false, "", SYNC_ALL) 
  735.  
  736. 	-- Add an on death function to the Bum NPCs... 
  737. 	for i = 1, Num_tss03_demo_bum_characters, 1 do 
  738. 		on_death("tss03_demo_bum_died", Tss03_demo_bum_characters[i]) 
  739. 		on_respawn("tss03_demo_bum_respawn", Tss03_demo_bum_characters[i]) 
  740. 		npc_respawn_after_death(Tss03_demo_bum_characters[i], true) 
  741. 		npc_respawn_after_death_time_override(Tss03_demo_bum_characters[i], BUM_RESPAWN_TIME, true) 
  742.  
  743. 		-- TEMP: remove all the weapons for the bums 
  744. 		inv_item_remove_all(Tss03_demo_bum_characters[i]) 
  745. 	end 
  746.  
  747. 	-- If we are in coop then do this for the coop group 
  748. 	if (IN_COOP) then 
  749. 		-- Release any Samedi coop bodies to the world 
  750. 		release_to_world(GROUP_SAMEDI_COOP) 
  751. 		marker_remove_group(GROUP_SAMEDI_COOP, SYNC_ALL) 
  752.  
  753. 		-- Show our second group of enemies for coop 
  754. 		group_show(GROUP_BUMS_COOP) 
  755. --		minimap_icon_add_group(GROUP_BUMS_COOP, "map_other_blip_human", false, "", SYNC_ALL) 
  756. 		 
  757. 		-- Add an on death function to the coop Bum NPCs... 
  758. 		for i = 1, Num_tss03_demo_bum_characters_coop, 1 do 
  759. 			on_death("tss03_demo_bum_died", Tss03_demo_bum_characters_coop[i]) 
  760. 			on_respawn("tss03_demo_bum_respawn", Tss03_demo_bum_characters_coop[i]) 
  761. 			npc_respawn_after_death(Tss03_demo_bum_characters_coop[i], true) 
  762. 			npc_respawn_after_death_time_override(Tss03_demo_bum_characters_coop[i], BUM_RESPAWN_TIME, true) 
  763. 		end 
  764. 	end 
  765.  
  766. 	-- Override the respawn distance 
  767. 	npc_respawn_dist_override(BUM_RESPAWN_DIST) 
  768.  
  769. 	-- Setup the Shanties 
  770. 	for i = 1, Num_tss03_demo_shanties, 1 do 
  771. 		if (not mesh_mover_destroyed(Tss03_demo_shanties[i])) then 
  772. 			marker_add_mover(Tss03_demo_shanties[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  773. 			on_mover_destroyed("tss03_demo_shanty_destroyer", Tss03_demo_shanties[i]) 
  774. 			set_current_hit_points(Tss03_demo_shanties[i], 2) 
  775. 		end 
  776. 	end 
  777.  
  778. 	-- Force a couple of bums to attack 
  779. --	attack(CHARACTER_BUM1, LOCAL_PLAYER) 
  780. --	attack(CHARACTER_BUM2, CHARACTER_GAT) 
  781. --	if (IN_COOP) then 
  782. --		attack(CHARACTER_BUM3, REMOTE_PLAYER) 
  783. --	else 
  784. --		attack(CHARACTER_BUM3, LOCAL_PLAYER) 
  785. --	end 
  786.  
  787. 	-- Enable the human shield trigger if not in coop 
  788. --	if (not IN_COOP) then 
  789. 		-- This will run the human shield tutorial 
  790. --		trigger_enable(TRIGGER_HUMAN_SHIELD, true) 
  791. --	else 
  792. 		-- Attack the closest player...the default is "#PLAYER#" 
  793. 		attack(CHARACTER_HUMAN_SHIELD) 
  794. --	end 
  795.  
  796. 	-- Add the objective destination 
  797. 	marker_add_trigger(TRIGGER_HUMAN_SHIELD, MINIMAP_ICON_LOCATION, INGAME_EFFECT_LOCATION, SYNC_ALL) 
  798. 	mission_waypoint_add(TRIGGER_HUMAN_SHIELD) 
  799.  
  800. 	-- If all the Shanties were killed before hand, activate the bum sequence 
  801. 	if (Tss03_demo_shanty_destroyed_count == Num_tss03_demo_shanties) then 
  802. 		tss03_demo_eliminate_bums() 
  803. 	else 
  804. 		-- Prompt the user to destroy the Shanties 
  805. 		mission_help_table("tss03_shanties") 
  806. 		-- Show the objective text on the HUD 
  807. 		objective_text(0, "tss03_shanties_left", Tss03_demo_shanty_destroyed_count, Num_tss03_demo_shanties) 
  808. 	end 
  809.  
  810. 	-- Create the Bumaga 
  811. --	group_create_hidden(GROUP_BUMAGA) 
  812. 	group_create_hidden(GROUP_BUMAGA_FAKE) 
  813. end 
  814.  
  815. function tss03_demo_eliminate_bums() 
  816. 	-- Create the bum rush group 
  817. 	group_create_hidden(GROUP_BUMS_RUSH) 
  818.  
  819. 	-- Remove any icons from the bum group 
  820. --	minimap_icon_remove_group(GROUP_BUMS, SYNC_ALL) 
  821. 	-- If we are in coop then do this for the coop group 
  822. --	if (IN_COOP) then 
  823. --		minimap_icon_remove_group(GROUP_BUMS_COOP, SYNC_ALL) 
  824. --	end 
  825.  
  826. 	-- Reset the respawn distance 
  827. 	npc_respawn_dist_reset() 
  828.  
  829. 	-- Add markers to the bums 
  830. 	for i = 1, Num_tss03_demo_bum_characters, 1 do 
  831. 		npc_respawn_after_death(Tss03_demo_bum_characters[i], false) 
  832. 		if (not character_is_dead(Tss03_demo_bum_characters[i])) then 
  833. 			marker_add_npc(Tss03_demo_bum_characters[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  834. 			on_death("tss03_demo_bum_killer", Tss03_demo_bum_characters[i]) 
  835. 		end 
  836. 	end 
  837.  
  838. 	-- If we are in coop then do this for the coop bums 
  839. 	if (IN_COOP) then 
  840. 		-- Add markers to the coop bums 
  841. 		for i = 1, Num_tss03_demo_bum_characters_coop, 1 do 
  842. 			npc_respawn_after_death(Tss03_demo_bum_characters_coop[i], false) 
  843. 			if (not character_is_dead(Tss03_demo_bum_characters_coop[i])) then 
  844. 				marker_add_npc(Tss03_demo_bum_characters_coop[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  845. 				on_death("tss03_demo_bum_killer", Tss03_demo_bum_characters_coop[i]) 
  846. 			end 
  847. 		end 
  848. 	end 
  849.  
  850. 	-- Show the bum rush group 
  851. 	group_show(GROUP_BUMS_RUSH) 
  852. 	-- Add markers to the rush bums 
  853. 	for i = 1, Num_tss03_demo_bum_characters_rush, 1 do 
  854. 		marker_add_npc(Tss03_demo_bum_characters_rush[i], MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  855. 		on_death("tss03_demo_bum_killer", Tss03_demo_bum_characters_rush[i]) 
  856. 		attack(Tss03_demo_bum_characters_rush[i]) 
  857. 	end 
  858.  
  859. 	-- If all the Bums were killed before hand activate the bumaga sequence 
  860. 	if (Tss03_demo_bum_kill_count == Total_tss03_demo_bum_characters) then 
  861. 		tss03_demo_bumaga_showdown() 
  862. 	else 
  863. 		-- Prompt the user to kill the bums 
  864. 		mission_help_table("tss03_bums") 
  865. 		-- Show the objective text on the HUD 
  866. 		objective_text(0, "tss03_bums_left", Tss03_demo_bum_kill_count, Total_tss03_demo_bum_characters) 
  867. 	end 
  868. end 
  869.  
  870. function tss03_demo_bumaga_showdown() 
  871. 	-- Clear the objective text 
  872. 	objective_text_clear(0) 
  873.  
  874. 	-- Release any Bum bodies to the world 
  875. 	release_to_world(GROUP_BUMS) 
  876. 	marker_remove_group(GROUP_BUMS, SYNC_ALL) 
  877.  
  878. 	-- If we are in coop then do this for the coop group 
  879. 	if (IN_COOP) then 
  880. 		-- Release any Bum coop bodies to the world 
  881. 		release_to_world(GROUP_BUMS_COOP) 
  882. 		marker_remove_group(GROUP_BUMS_COOP, SYNC_ALL) 
  883. 	end 
  884.  
  885. 	-- Show our second group of enemies 
  886. --	group_show(GROUP_BUMAGA) 
  887. 	delay(2.0) 
  888. 	cutscene_play("tss_03_demo_boss") 
  889.  
  890. 	-- Add markers to the bums 
  891. 	marker_add_npc(CHARACTER_BUMAGA, MINIMAP_ICON_KILL, INGAME_EFFECT_KILL, SYNC_ALL) 
  892. 	-- Add an on death function to the Bumaga 
  893. 	on_death("tss03_demo_complete", CHARACTER_BUMAGA) 
  894. 	-- Set the bumaga hit points 
  895. 	set_max_hit_points(CHARACTER_BUMAGA, 2500, true) 
  896. 	-- Don't allow bumaga to flinch 
  897. 	character_prevent_flinching(CHARACTER_BUMAGA, true) 
  898.  
  899. 	-- Give player help text 
  900. 	mission_help_table("tss03_bumaga") 
  901.  
  902. 	-- The bumaga has a couple of body guards 
  903. --	minimap_icon_add_npc(CHARACTER_BUMAGA_GUARD1, "map_other_blip_human", false, "", SYNC_ALL) 
  904. --	minimap_icon_add_npc(CHARACTER_BUMAGA_GUARD2, "map_other_blip_human", false, "", SYNC_ALL) 
  905. 	 
  906. 	mesh_mover_reset("tss03_demo_ShantStreetB010") 
  907. 	-- Force the bumaga to wield the stop sign 
  908. 	mesh_mover_wield("tss03_demo_ShantStreetB010", CHARACTER_BUMAGA, true) 
  909. 	-- We need to release the stop sign to the world 
  910. 	release_to_world("tss03_demo_ShantStreetB010") 
  911.  
  912. 	attack(CHARACTER_BUMAGA_GUARD1, LOCAL_PLAYER, false) 
  913. 	attack(CHARACTER_BUMAGA_GUARD3, LOCAL_PLAYER, false) 
  914. 	if (IN_COOP) then 
  915. 		attack(CHARACTER_BUMAGA_GUARD2, REMOTE_PLAYER, false) 
  916. 		attack(CHARACTER_BUMAGA_GUARD4, REMOTE_PLAYER, false) 
  917. 	else 
  918. 		attack(CHARACTER_BUMAGA_GUARD2, CHARACTER_GAT, false) 
  919. 		attack(CHARACTER_BUMAGA_GUARD4, CHARACTER_GAT, false) 
  920. 	end 
  921.  
  922. 	-- Add an on weapon fire function to the Bumaga 
  923. 	on_weapon_fired("tss03_demo_bumaga_attack", CHARACTER_BUMAGA) 
  924.  
  925. 	-- Wait to send the bumaga after the player 
  926. 	delay(2) 
  927.  
  928. 	-- Move the Bumaga down the hall way to attack the player 
  929. 	attack(CHARACTER_BUMAGA, "#PLAYER#", false) 
  930. end 
  931.  
  932. function tss03_demo_bumaga_attack(human, weapon, tag) 
  933. 	-- If the Bumaga is attacking with a havok weapon we want to play some audio for him 
  934. 	if ((weapon == "havok") and (tag == "melee")) then 
  935. 		audio_play_id_for_character(human, Tss03_bumaga_yell_voice_id, Tss03_bumaga_yell_type_id) 
  936. 	end 
  937. end