md1_1.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. EntityContainer = {}
  2. EntityContainer[ "Director" ] = {
  3. on_start = function( self )
  4. background2d:play_animation_looped( "Light1" )
  5. background2d:play_animation_looped( "Light2" )
  6. background2d:play_animation_looped( "Fan" )
  7. background2d:autoscroll_to_entity( entity_manager:get_entity( "Cloud" ) )
  8. --03a6 (end 03a6): [UNREVERSED] BTLMD(20, 00);
  9. --03a9 (end 03a9): music:execute_akao( 10, pointer_to_field_AKAO_0 ); -- play field music
  10. --03ab (end 03ab): field:map_name(1);
  11. while true do
  12. if FFVII.Data.progress_game >= 7 then
  13. break
  14. end
  15. if EntityContainer[ "Cloud" ].cloud ~= nil then
  16. local triangle_id = EntityContainer[ "Cloud" ].cloud:get_move_triangle_id()
  17. if ( FFVII.Data.progress_game < 7 ) and ( triangle_id == 62 ) then
  18. player_lock( true )
  19. background2d:scroll_to_position( -288, 180, Background2D.SMOOTH, 1.06667 )
  20. script:request( Script.ENTITY, "Cloud", "scene_part_1", 6 )
  21. FFVII.Data.progress_game = 7
  22. script:request_end_sync( Script.ENTITY, "Biggs", "scene_part_2", 6 )
  23. script:wait( 0.2 )
  24. script:request_end_sync( Script.ENTITY, "Jessie", "scene_part_3", 6 )
  25. script:wait( 0.333333 )
  26. script:request_end_sync( Script.ENTITY, "Biggs", "scene_part_4", 5 )
  27. script:wait( 0.266667 )
  28. script:request_end_sync( Script.ENTITY, "Cloud", "scene_part_6", 6 )
  29. script:wait( 0.266667 )
  30. script:request_end_sync( Script.ENTITY, "Barret", "scene_part_8", 6 )
  31. script:wait( 0.4 )
  32. --03f5 (end 043e): music:execute_akao( 20, 00000040, 00000034 ); -- play sound
  33. script:wait( 0.266667 )
  34. --03fd (end 043e): music:execute_akao( 20, 00000040, 00000020 ); -- play sound
  35. script:request( Script.ENTITY, "DoorLeft", "open", 6 )
  36. script:request( Script.ENTITY, "DoorRight", "open", 6 )
  37. script:wait( 0.333333 )
  38. script:request( Script.ENTITY, "Jessie", "scene_part_10", 6 )
  39. script:wait( 1 )
  40. script:request( Script.ENTITY, "Biggs", "scene_part_11", 6 )
  41. script:wait( 0.2 )
  42. script:request( Script.ENTITY, "Wedge", "scene_part_12", 6 )
  43. script:wait( 0.5 )
  44. script:request_end_sync( Script.ENTITY, "Barret", "scene_part_13", 6 )
  45. --0420 (end 043e): [UNREVERSED] PMJMP(76, 00);
  46. script:request( Script.ENTITY, "Barret", "scene_part_15", 6 )
  47. script:wait( 1 )
  48. --0429 (end 043e): field:movie_set( 20 );
  49. EntityContainer.Movie.movie_check = true
  50. --042f (end 043e): field:play_movie();
  51. --0430 (end 043e): field:jump_to_map(118, 3549, 30574, 60, 180);
  52. --player_lock( false )
  53. end
  54. end
  55. script:wait( 0 )
  56. end
  57. return 0
  58. end,
  59. }
  60. EntityContainer[ "Cloud" ] = {
  61. cloud = nil,
  62. on_start = function( self )
  63. set_entity_to_character( "Cloud", "Cloud" )
  64. self.cloud = entity_manager:get_entity( "Cloud" )
  65. self.cloud:set_solid( true )
  66. self.cloud:set_visible( true )
  67. return 0
  68. end,
  69. --[[ Move Cloud to talk position for the scene. ]]
  70. scene_part_1 = function( self )
  71. self.cloud:set_move_auto_speed( 1.875 )
  72. self.cloud:move_to_position( 4.48438, 5.30469 )
  73. self.cloud:move_sync()
  74. self.cloud:set_rotation( 174.375 )
  75. return 0
  76. end,
  77. --[[ Cloud reply his name to Avalanche. ]]
  78. scene_part_5 = function( self )
  79. self.cloud:play_animation_stop( "LookAtPeople", 0, 0.233333 )
  80. self.cloud:animation_sync()
  81. message:show_dialog( "0", "md1_1_05",100, 150 )
  82. message:sync( "0" )
  83. self.cloud:play_animation_stop( "LookAtPeople", 0.266667, 0.466667 )
  84. self.cloud:animation_sync()
  85. return 0
  86. end,
  87. --[[ Cloud tells Biggs that he didn\t care about names. ]]
  88. scene_part_6 = function( self )
  89. self.cloud:play_animation( "TalkNo" )
  90. self.cloud:animation_sync()
  91. script:request( Script.ENTITY, "Biggs", "scene_part_7", 6 )
  92. self.cloud:play_animation_stop( "LookAtPeople", 0, 0.233333 )
  93. self.cloud:animation_sync()
  94. message:show_dialog( "0", "md1_1_07", 30, 150 )
  95. message:sync( "0" )
  96. self.cloud:play_animation_stop( "LookAtPeople", 0.233333, 0.466667 )
  97. self.cloud:animation_sync()
  98. return 0
  99. end,
  100. scene_part_9 = function( self )
  101. script:wait( 0.333333 )
  102. self.cloud:play_animation_stop( "LookAtPeople", 0.466667, 0.733333 )
  103. self.cloud:animation_sync()
  104. return 0
  105. end,
  106. scene_part_14 = function( self )
  107. self.cloud:play_animation_stop( "LookAtPeople", 0.733333, 0.966667 )
  108. self.cloud:animation_sync()
  109. return 0
  110. end,
  111. --[[ look at reactor and run after Barret and others. ]]
  112. scene_part_16 = function( self )
  113. self.cloud:set_animation_speed( 0.5 )
  114. script:wait( 0.6 )
  115. self.cloud:play_animation_stop( "LookUp" )
  116. self.cloud:animation_sync()
  117. self.cloud:set_move_auto_speed( 1.17187 )
  118. self.cloud:set_default_animation( "Idle" )
  119. self.cloud:play_animation( "Idle" )
  120. self.cloud:move_to_position( 5.02344, 11.4141 )
  121. self.cloud:move_sync()
  122. return 0
  123. end,
  124. }
  125. EntityContainer[ "Barret" ] = {
  126. barret = nil,
  127. on_start = function( self )
  128. set_entity_to_character( "Barret", "Barret" )
  129. self.barret = entity_manager:get_entity( "Barret" )
  130. if FFVII.Data.progress_game < 7 then
  131. self.barret:set_position( 8.84375, 4.82812, 5.07031 )
  132. end
  133. self.barret:set_solid( false )
  134. self.barret:set_visible( false )
  135. return 0
  136. end,
  137. scene_part_8 = function( self )
  138. self.barret:set_solid( true )
  139. self.barret:set_visible( true )
  140. self.barret:set_move_auto_speed( 1.17187 )
  141. script:request( Script.ENTITY, "Cloud", "scene_part_9", 6 )
  142. self.barret:move_to_position( 5.96094, 5.08594 )
  143. self.barret:move_sync()
  144. self.barret:set_rotation( 241.875 )
  145. message:show_dialog( "3", "md1_1_08", 25, 140 )
  146. message:sync( "3" )
  147. message:show_dialog( "3", "md1_1_09", 8, 150 )
  148. message:sync( "3" )
  149. return 0
  150. end,
  151. scene_part_13 = function( self )
  152. self.barret:set_move_auto_speed( 1.17187 )
  153. script:request( Script.ENTITY, "Cloud", "scene_part_14", 6 )
  154. self.barret:move_to_position( 4.39844, 7.3125 )
  155. self.barret:move_sync()
  156. script:wait( 1 )
  157. self.barret:turn_to_direction( 16.875, Entity.CLOSEST, Entity.SMOOTH, 0.333333 )
  158. self.barret:turn_sync()
  159. script:wait( 0.666667 )
  160. message:show_dialog( "0", "md1_1_10", 30, 20 )
  161. message:sync( "0" )
  162. script:wait( 0.266667 )
  163. --0532 (end 0532): [UNREVERSED] MENU(00, 06, 01);
  164. script:wait( 0.666667 )
  165. message:show_dialog( "0", "md1_1_11", 10, 137 )
  166. message:sync( "0" )
  167. return 0
  168. end,
  169. scene_part_15 = function( self )
  170. self.barret:move_to_position( 5.29297, 13.1875 )
  171. self.barret:move_sync()
  172. self.barret:set_solid( false )
  173. self.barret:set_visible( false )
  174. return 0
  175. end,
  176. }
  177. EntityContainer[ "Biggs" ] = {
  178. biggs = nil,
  179. on_start = function( self )
  180. self.biggs = entity_manager:get_entity( "Biggs" )
  181. self.biggs:set_position( 3.91406, 6.07812, 5.07031 )
  182. self.biggs:set_rotation( 174.375 )
  183. if FFVII.Data.progress_game >= 7 then
  184. self.biggs:set_solid( false )
  185. self.biggs:set_visible( false )
  186. else
  187. self.biggs:set_solid( true )
  188. self.biggs:set_visible( true )
  189. end
  190. return 0
  191. end,
  192. --[[ Turn to Cloud and start talk to him. ]]
  193. scene_part_2 = function( self )
  194. self.biggs:turn_to_direction( 39.375, Entity.CLOSEST, Entity.SMOOTH, 0.333333 )
  195. self.biggs:turn_sync()
  196. script:wait( 0.0333333 )
  197. self.biggs:play_animation_stop( "TalkGesture", 0, 0.3 )
  198. self.biggs:animation_sync()
  199. message:show_dialog( "1", "md1_1_00", 8, 8 )
  200. message:sync( "1" )
  201. self.biggs:play_animation( "TalkGesture", 0.333333, 0.633333 )
  202. self.biggs:animation_sync()
  203. return 0
  204. end,
  205. --[[ Dialog with Jessie and Cloud. We input Cloud name during this scene and call Cloud reply. ]]
  206. scene_part_4 = function( self )
  207. message:show_dialog( "1", "md1_1_03", 30, 10 )
  208. message:sync( "1" )
  209. self.biggs:play_animation_stop( "TalkGesture", 0, 0.466667 )
  210. self.biggs:animation_sync()
  211. message:show_dialog( "1", "md1_1_04", 50, 10 )
  212. message:sync( "1" )
  213. self.biggs:play_animation( "TalkGesture", 0.333333, 0.633333 )
  214. self.biggs:animation_sync()
  215. script:wait( 0.1 )
  216. --05be (end 05be): [UNREVERSED] MENU(00, 06, 00);
  217. script:wait( 0.1 )
  218. script:request_end_sync( Script.ENTITY, "Cloud", "scene_part_5", 6 )
  219. script:wait( 0.2 )
  220. self.biggs:play_animation_stop( "TalkGesture", 0, 0.466667 )
  221. self.biggs:animation_sync()
  222. message:show_dialog( "1", "md1_1_06", 50, 20 )
  223. message:sync( "1" )
  224. return 0
  225. end,
  226. scene_part_7 = function( self )
  227. self.biggs:play_animation( "TalkGesture", 0.333333, 0.633333 )
  228. self.biggs:animation_sync()
  229. return 0
  230. end,
  231. scene_part_11 = function( self )
  232. self.biggs:set_move_auto_speed( 1.17187 )
  233. self.biggs:move_to_position( 4.57422, 6.82812 )
  234. self.biggs:move_sync()
  235. self.biggs:move_to_position( 5.29297, 13.1875 )
  236. self.biggs:move_sync()
  237. self.biggs:set_solid( false )
  238. self.biggs:set_visible( false )
  239. return 0
  240. end,
  241. }
  242. EntityContainer[ "Jessie" ] = {
  243. jessie = nil,
  244. on_start = function( self )
  245. self.jessie = entity_manager:get_entity( "Jessie" )
  246. self.jessie:set_position( 4.51953, 6.32422, 5.07031 )
  247. self.jessie:set_rotation( 174.375 )
  248. self.jessie:set_default_animation( "BreakUp" )
  249. self.jessie:play_animation( "BreakUp" )
  250. if FFVII.Data.progress_game >= 7 then
  251. self.jessie:set_solid( false )
  252. self.jessie:set_visible( false )
  253. else
  254. self.jessie:set_solid( true )
  255. self.jessie:set_visible( true )
  256. end
  257. return 0
  258. end,
  259. --[[ Stop breaking gate for a while and talk. ]]
  260. scene_part_3 = function( self )
  261. self.jessie:play_animation_stop( "BreakUpLookBack" )
  262. self.jessie:animation_sync()
  263. message:show_dialog( "2", "md1_1_01", 155, 8 )
  264. message:sync( "2" )
  265. message:show_dialog( "2", "md1_1_02", 120, 8 )
  266. message:sync( "2" )
  267. script:wait( 0.266667 )
  268. self.jessie:set_default_animation( "BreakUp" )
  269. self.jessie:play_animation( "BreakUp" )
  270. return 0
  271. end,
  272. scene_part_10 = function( self )
  273. self.jessie:set_move_auto_speed( 1.17187 )
  274. self.jessie:play_animation( "BreakUpGetUp" )
  275. self.jessie:animation_sync()
  276. self.jessie:move_to_position( 5.29297, 13.1875 )
  277. self.jessie:move_sync()
  278. self.jessie:set_solid( false )
  279. self.jessie:set_visible( false )
  280. return 0
  281. end,
  282. }
  283. EntityContainer[ "Wedge" ] = {
  284. wedge = nil,
  285. on_start = function( self )
  286. self.wedge = entity_manager:get_entity( "Wedge" )
  287. self.wedge:set_position( 5.94141, 5.875, 5.07031 )
  288. self.wedge:set_rotation( 16.875 )
  289. self.wedge:set_default_animation( "LookAround" )
  290. self.wedge:play_animation( "LookAround" )
  291. if FFVII.Data.progress_game >= 7 then
  292. self.wedge:set_solid( false )
  293. self.wedge:set_visible( false )
  294. else
  295. self.wedge:set_solid( true )
  296. self.wedge:set_visible( true )
  297. end
  298. return 0
  299. end,
  300. scene_part_12 = function( self )
  301. self.wedge:set_move_auto_speed( 1.17187 )
  302. self.wedge:move_to_position( 4.57422, 6.82812 )
  303. self.wedge:move_sync()
  304. self.wedge:move_to_position( 5.29297, 13.1875 )
  305. self.wedge:move_sync()
  306. self.wedge:set_solid( false )
  307. self.wedge:set_visible( false )
  308. return 0
  309. end,
  310. }
  311. EntityContainer[ "DoorLeft" ] = {
  312. door = nil,
  313. on_start = function( self )
  314. self.door = entity_manager:get_entity( "DoorLeft" )
  315. self.door:set_position( 4.25, 7.20703, 5.07031 )
  316. self.door:set_rotation( 354.375 )
  317. if FFVII.Data.progress_game >= 7 then
  318. self.door:set_visible( false )
  319. else
  320. self.door:set_visible( true )
  321. end
  322. self.door:set_solid( false )
  323. return 0
  324. end,
  325. open = function( self )
  326. self.door:offset_to_position( -0.789062, 0, 0, Entity.LINEAR, 1.66667 )
  327. self.door:offset_sync()
  328. self.door:set_visible( false )
  329. return 0
  330. end,
  331. }
  332. EntityContainer[ "DoorRight" ] = {
  333. door = nil,
  334. on_start = function( self )
  335. self.door = entity_manager:get_entity( "DoorRight" )
  336. self.door:set_position( 4.93359, 7.125, 5.07031 )
  337. self.door:set_rotation( 174.375 )
  338. if FFVII.Data.progress_game >= 7 then
  339. self.door:set_visible( false )
  340. else
  341. self.door:set_visible( true )
  342. end
  343. self.door:set_solid( false )
  344. return 0
  345. end,
  346. open = function( self )
  347. self.door:offset_to_position( 0.71875, 0, 0, Entity.LINEAR, 1.66667 )
  348. self.door:offset_sync()
  349. self.door:set_visible( false )
  350. return 0
  351. end,
  352. }
  353. EntityContainer[ "Movie" ] = {
  354. movie_check = false,
  355. on_start = function( self )
  356. while true do
  357. if self.movie_check == true then
  358. --0717 (end 0729): temp6_09 = field:get_movie_frame();
  359. --071a (end 0729): if ( temp6_09 > 30 ) then continue else jumpto(0729);
  360. script:request( Script.ENTITY, "Cloud", "scene_part_16", 6 )
  361. break
  362. end
  363. script:wait( 0 )
  364. end
  365. return 0
  366. end,
  367. }
  368. EntityContainer[ "Gateway0" ] = {
  369. on_start = function( self )
  370. return 0
  371. end,
  372. on_enter_line = function( self, entity )
  373. return 0
  374. end,
  375. on_move_to_line = function( self, entity )
  376. return 0
  377. end,
  378. on_cross_line = function( self, entity )
  379. if entity == "Cloud" then
  380. load_field_map_request( "ffvii_md1stin", "Spawn_md1_1" )
  381. end
  382. return 0
  383. end,
  384. on_leave_line = function( self, entity )
  385. return 0
  386. end,
  387. }
  388. EntityContainer[ "Gateway1" ] = {
  389. on_start = function( self )
  390. return 0
  391. end,
  392. on_enter_line = function( self, entity )
  393. return 0
  394. end,
  395. on_move_to_line = function( self, entity )
  396. return 0
  397. end,
  398. on_cross_line = function( self, entity )
  399. if entity == "Cloud" then
  400. load_field_map_request( "ffvii_md1_2", "Spawn_md1_1" )
  401. end
  402. return 0
  403. end,
  404. on_leave_line = function( self, entity )
  405. return 0
  406. end,
  407. }