./sr3_city.lua

  1. --SR3 City Lua file  
  2.  
  3.  
  4. -- Gameplay Choice IDs - 
  5. -- these should match values from level_scripts.cpp 
  6. MISSION_06_CHOICE = 0 
  7. MISSION_22_CHOICE = 1 
  8. MISSION_21_CHOICE = 2 
  9.  
  10. M06_CHOICE_BLOWN_TOWER = true; 
  11. M06_CHOICE_BRANDED_TOWER = false; 
  12. M22_CHOICE_KILLBANE_KILL = true; 
  13. M22_CHOICE_KILLBANE_ESCAPE = false; 
  14. M21_CHOICE_KILLBANE_UNMASKED = true; 
  15. M21_CHOICE_KILLBANE_NOT_UNMASKED = false; 
  16.  
  17. function sr3_city_init() 
  18.  
  19. end 
  20.  
  21.  
  22. function sr3_city_main() 
  23.  
  24. end 
  25.  
  26. -- ALL FOLLOWING COOP SKIP FUNCTIONS CALLED FROM CODE (+++MUST RETURN IMMEDIATLY+++) 
  27.  
  28. -- Teleport players to a mission start node 
  29. -- 
  30. -- mission_name:	(string) name of the mission start node (should be same as mission name) 
  31. -- skip_teleport:	(boolean) true to basically skip this whole function, nil or not true will run it 
  32. -- 
  33. function sr3_teleport_mission_start(mission_name, skip_teleport) 
  34. 	if skip_teleport == nil or skip_teleport ~= true then 
  35. 		-- send them to the mission start 
  36. 		local vehicle_exit = true 
  37. 		local offset_x = 0.5 
  38. 		teleport_to_object(LOCAL_PLAYER, mission_name, vehicle_exit, nil, offset_x) 
  39. 		-- remote player not on top of player 
  40. 		offset_x = -0.5 
  41. 		teleport_to_object(REMOTE_PLAYER, mission_name, vehicle_exit, nil, offset_x) 
  42. 	end 
  43. end 
  44.  
  45. function m03_coop_skip( ) 
  46. 	crib_purchasing_unlock( ) 
  47. end 
  48.  
  49. function m06_coop_skip(skip_teleport) 
  50. 	sr3_teleport_mission_start("m06", skip_teleport) 
  51. 	-- Update the world state based on the choice that they made during the mission 
  52. 	if game_choice_get_state( MISSION_06_CHOICE ) == M06_CHOICE_BRANDED_TOWER then 
  53. 		city_zone_swap("tower_saints") 
  54. 	else 
  55. 		city_zone_swap("tower_dmg") 
  56. 	end 
  57. 	-- kill the building interior either way 
  58. 	city_zone_swap("m6") 
  59.  
  60. 	-- Set Hood ('Henry Steel Mills') to Spawn THE BALL from now on as ambient 
  61. 	spawn_override_change_hood_alternate_spawning("HOOD_DT_01", true) 
  62.  
  63. 	if not mission_is_complete( "m07" ) then 
  64. 		-- make sure we unlocked it 
  65. 		mission_unlock( "m07" ) 
  66. 		mission_set_next_mission( "m07" ) 
  67. 	end 
  68. end 
  69.  
  70. function m10_coop_skip(skip_teleport) 
  71. 	sr3_teleport_mission_start("m10", skip_teleport) 
  72. 	set_stag_active(true) 
  73. 	spawn_override_change_hood_alternate_spawning("HOOD_DT_02", true) 
  74. 	 
  75. 	city_zone_swap("thermext1") -- Thermopolye moves to south of DT 
  76. 	city_zone_swap("therm2") -- This swap just the interior trigger and volume for thermext1.  Those two should be consolidated. 
  77. 	city_zone_swap("stag") -- STAG shows up in DT 
  78. 	traffic_disable_drawbridge_area(34, true) -- Disables splines on road through Sunset Park that STAG cordons off 
  79. end 
  80.  
  81. function m13_coop_skip(skip_teleport) 
  82. 	sr3_teleport_mission_start("m13", skip_teleport) 
  83. 	city_zone_swap("hq_dmg") -- HQ is damaged during this mission, swap it in 
  84. end 
  85.  
  86. function m14_coop_skip( ) 
  87. 	-- Set Saints to be 'Hated' following this mission 
  88. 	set_saints_hated(true) 
  89. end 
  90.  
  91. function m17_coop_skip(skip_teleport) 
  92. 	sr3_teleport_mission_start("m17", skip_teleport) 
  93. 	-- Set STAG Lockdown spawning for downtown hoods to True (Hood DT_02 still missing change, waiting on Chris N. solution to having two alternate spawn groups) 
  94. 	spawn_override_change_hood_alternate_spawning("HOOD_DT_02", true) 
  95. 	spawn_override_change_hood_alternate_spawning("HOOD_DT_03", true) 
  96. 	 
  97. 	-- Set STAG Lockdown area as immediate notoriety area 
  98. 	set_stag_notoriety_area_active(true) 
  99. 	 
  100. 	-- Post mission swaps, Thermopolye destroyed and STAG take over downtown 
  101. 	city_zone_swap("thermext1", false) 
  102. 	city_zone_swap("therm2", false) -- This swap just the interior trigger and volume for thermext1.  Those two should be consolidated. 
  103. 	city_zone_swap("therm3_dst") 
  104. 	city_zone_swap("lockdown") 
  105. 	 
  106. 	-- Disable Traffic Splines Over Drawbridges 
  107. 	traffic_disable_drawbridge_area(1, true) 
  108. 	traffic_disable_drawbridge_area(2, true) 
  109. 	traffic_disable_drawbridge_area(7, true) 
  110. 	traffic_disable_drawbridge_area(8, true) 
  111. 	traffic_disable_drawbridge_area(9, true) 
  112. 	traffic_disable_drawbridge_area(10, true) 
  113. 	traffic_disable_drawbridge_area(11, true) 
  114. 	traffic_disable_drawbridge_area(12, true) 
  115. 	traffic_disable_drawbridge_area(13, true) 
  116. 	traffic_disable_drawbridge_area(14, true) 
  117. 	traffic_disable_drawbridge_area(15, true) 
  118. 	traffic_disable_drawbridge_area(16, true) 
  119. 	traffic_disable_drawbridge_area(17, true) 
  120. 	traffic_disable_drawbridge_area(18, true) 
  121. 	traffic_disable_drawbridge_area(19, true) 
  122. 	traffic_disable_drawbridge_area(20, true) 
  123. 	traffic_disable_drawbridge_area(21, true) 
  124. 	traffic_disable_drawbridge_area(22, true) 
  125. 	traffic_disable_drawbridge_area(23, true) 
  126. 	traffic_disable_drawbridge_area(24, true) 
  127. 	traffic_disable_drawbridge_area(25, true) 
  128. 	traffic_disable_drawbridge_area(27, true) 
  129. 	traffic_disable_drawbridge_area(28, true) 
  130. 	traffic_disable_drawbridge_area(29, true) 
  131. 	traffic_disable_drawbridge_area(30, true) 
  132. 	traffic_disable_drawbridge_area(31, true) 
  133. 	traffic_disable_drawbridge_area(32, true) 
  134. 	traffic_disable_drawbridge_area(33, true) 
  135. end 
  136.  
  137. function m18_coop_skip(skip_teleport) 
  138. 	sr3_teleport_mission_start("m18", skip_teleport) 
  139. 	-- Set Hood ('Arapice Island') to Spawn Zombies from now on as ambient 
  140. 	spawn_override_change_hood_alternate_spawning("HOOD_ZOMBIE", true) 
  141. 	 
  142. 	-- Set Drawbridge Traffic Splines to Arapice Island as 'Disabled' 
  143. 	traffic_disable_drawbridge_area(3, true) 
  144. 	traffic_disable_drawbridge_area(4, true) 
  145. 	traffic_disable_drawbridge_area(5, true) 
  146. 	traffic_disable_drawbridge_area(6, true) 
  147. 	traffic_disable_drawbridge_area(26, true) 
  148. 	 
  149. 	-- Swap the Zombie zone 
  150. 	city_zone_swap("chemcrash") 
  151. 	city_zone_swap("zombies") 
  152. end 
  153.  
  154. function m22_coop_skip(skip_teleport) 
  155. 	sr3_teleport_mission_start("m22", skip_teleport) 
  156. 	if game_choice_get_state( MISSION_22_CHOICE ) == M22_CHOICE_KILLBANE_KILL then 
  157. 		mission_unlock( "m23" ) 
  158. 		city_zone_swap("rubble") -- Player went for Killbane, statue got blowed up 
  159. 	else 
  160. 		mission_unlock( "m24" ) 
  161. 	end 
  162. end 
  163.  
  164. function m23_m24_coop_skip(skip_teleport) 
  165. 	sr3_teleport_mission_start("m23", skip_teleport) 
  166. 	 
  167. 	-- Set STAG Inactive 
  168. 	set_stag_active(false) 
  169. 	 
  170. 	-- Remove Lockdown Spawning from Downtown Hoods 
  171. 	spawn_override_change_hood_alternate_spawning("HOOD_DT_02", false) 
  172. 	spawn_override_change_hood_alternate_spawning("HOOD_DT_03", false) 
  173. 	 
  174. 	-- Set Traffic to Be Enabled Across Lockdown Drawbridges Again 
  175. 	traffic_disable_drawbridge_area(7, false) 
  176. 	traffic_disable_drawbridge_area(8, false) 
  177. 	traffic_disable_drawbridge_area(9, false) 
  178. 	traffic_disable_drawbridge_area(10, false) 
  179. 	traffic_disable_drawbridge_area(11, false) 
  180. 	traffic_disable_drawbridge_area(12, false) 
  181. 	traffic_disable_drawbridge_area(13, false) 
  182. 	traffic_disable_drawbridge_area(14, false) 
  183. 	traffic_disable_drawbridge_area(15, false) 
  184. 	traffic_disable_drawbridge_area(16, false) 
  185. 	traffic_disable_drawbridge_area(17, false) 
  186. 	traffic_disable_drawbridge_area(18, false) 
  187. 	traffic_disable_drawbridge_area(19, false) 
  188. 	traffic_disable_drawbridge_area(20, false) 
  189. 	traffic_disable_drawbridge_area(21, false) 
  190. 	traffic_disable_drawbridge_area(22, false) 
  191. 	traffic_disable_drawbridge_area(23, false) 
  192. 	traffic_disable_drawbridge_area(24, false) 
  193. 	traffic_disable_drawbridge_area(25, false) 
  194. 	traffic_disable_drawbridge_area(27, false) 
  195. 	traffic_disable_drawbridge_area(28, false) 
  196. 	traffic_disable_drawbridge_area(29, false) 
  197. 	traffic_disable_drawbridge_area(30, false) 
  198. 	traffic_disable_drawbridge_area(31, false) 
  199. 	traffic_disable_drawbridge_area(32, false) 
  200. 	traffic_disable_drawbridge_area(33, false) 
  201. 	traffic_disable_drawbridge_area(34, false) 
  202. 	 
  203. 	-- Disable Downtown Notoriety Areas 
  204. 	set_stag_notoriety_area_active(false) 
  205. 	 
  206. 	-- Set Saints to be beloved again 
  207. 	set_saints_hated(false) 
  208. 	 
  209. 	-- Perform zone swaps 
  210. 	city_zone_swap("hq_dmg", DISABLE) -- restore saints HQ 
  211. 	 
  212. 	-- Maybe allow you to play through again 
  213. 	mission_maybe_uncomplete_m22() 
  214. end 
  215.  
  216. function sh02_coop_skip(skip_teleport) 
  217. 	sr3_teleport_mission_start("sh02", skip_teleport) 
  218. 	crib_unlock_strongold("Crib_BDSM") 
  219. end 
  220.  
  221. function sh03_coop_skip(skip_teleport) 
  222. 	sr3_teleport_mission_start("sh03", skip_teleport) 
  223. 	crib_unlock_strongold("Crib_Nuke") 
  224. end 
  225.  
  226. function sh04_coop_skip(skip_teleport) 
  227. 	sr3_teleport_mission_start("sh04", skip_teleport) 
  228. 	crib_unlock_strongold("Crib_3Count") 
  229. end 
  230.