nrthmk.lua 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. EntityContainer = {}
  2. EntityContainer[ "Director" ] = {
  3. on_start = function( self )
  4. if FFVII.Data.progress_game >= 27 then
  5. background2d:scroll_to_position( -29, 40, Background2D.NONE, 0 )
  6. --0322 (end 0332): music:execute_akao( 29, 40, 0, 0, 0, 1000, 7206 );
  7. else
  8. --0332 (end 0337): [UNREVERSED] BTLMD(20, 00);
  9. --0335 (end 0337): music:execute_akao( 10, pointer_to_field_AKAO_0 ); -- play field music
  10. --0337 (end 0337): field:map_name(3);
  11. end
  12. if FFVII.Data.progress_game < 27 then
  13. --0342 (end 0349): script:request( "l_door", "script_1", 6 )
  14. walkmesh:lock_walkmesh( 11, true )
  15. end
  16. return 0
  17. end,
  18. on_update = function( self )
  19. local triangle_id = EntityContainer[ "Cloud" ].cloud:get_move_triangle_id() -- temp6_00
  20. local x, y, z = EntityContainer[ "Cloud" ].cloud:get_position() -- temp6_0b temp6_0d
  21. return 0
  22. end,
  23. script_3 = function( self )
  24. --[[
  25. 0355 (end 0355): field:movie_camera_enable( false );
  26. 0357 (end 0357): field:movie_set( 21 );
  27. 0359 (end 0359): temp5_14 = 1;
  28. 035d (end 035d): game:variable_set("progress_game", 33);
  29. 0362 (end 0362): game:variable_set("act1_1_flags1", (game:variable_get( "act1_1_flags1" ) | (1 << 0)));
  30. 0366 (end 0366): field:play_movie();
  31. 0367 (end 0367): field:movie_camera_enable( true );
  32. 0369 (end 0369): if ( game:variable_get( "act1_1_flags1" ) & (1 << 7) ) then continue else jumpto(0370);
  33. 036f (end 0370): [OPCODE ff]
  34. 0370 (end 0370): music:execute_akao( 29, 40, 0, 0, 0, f000, f201 );
  35. 037e (end 037e): music:execute_akao( 10, pointer_to_field_AKAO_1 ); -- play field music
  36. 0380 (end 0380): music:execute_akao( a1, 7f, 0, 0, 0, f200, 0 );
  37. 038e (end 038e): music:execute_akao( c1, 0, 0, 0, 0, 6000, 88 );
  38. 039c (end 039c): field:jump_to_map(136, 65515, 156, 2, 0);
  39. 03a6 (end 03a6): return
  40. ]]
  41. return 0
  42. end,
  43. }
  44. EntityContainer[ "Cloud" ] = {
  45. cloud = nil,
  46. on_start = function( self )
  47. set_entity_to_character( "Cloud", "Cloud" )
  48. self.cloud = entity_manager:get_entity( "Cloud" )
  49. self.cloud:set_solid( true )
  50. self.cloud:set_visible( true )
  51. if FFVII.Data.progress_game == 27 then
  52. player_lock( true )
  53. end
  54. --[[
  55. 03b8 (end 03b8): if ( game:variable_get( "progress_game" ) == 27 ) then continue else jumpto(03e3);
  56. 03c0 (end 03e3): if ( game:variable_get( "act1_1_flags1" ) & (1 << 7) ) then continue else jumpto(03e3);
  57. 03c6 (end 03e3): cl:set_talkable( false );
  58. 03c8 (end 03e3): cl:set_solid( false )
  59. 03ca (end 03e3): cl:set_visible( false )
  60. 03cc (end 03e3): script:wait( 0.266667 )
  61. 03cf (end 03e3): script:request( "dir", "script_3", 6 )
  62. 03d2 (end 03e3): script:wait( 0.666667 )
  63. 03d5 (end 03e3): music:execute_akao( 29, 40, 0, 0, 0, 1200, 0 );
  64. 03e3 (end 03e3): jumpto( 03e3 );
  65. ]]
  66. return 0
  67. end,
  68. script_3 = function( self )
  69. --[[
  70. 03e6 (end 03e6): cl:set_solid( false )
  71. 03e8 (end 03e8): cl:set_position( 0, -7.82031, 3.83594 ) -- triangle_id=1
  72. 03f3 (end 03f3): cl:set_move_speed( 4.21875 )
  73. 03f7 (end 03f7): script:wait( 1.83333 )
  74. 03fa (end 03fa): cl:move_to_position( 0.4375, -23.5 )
  75. cl:move_sync()
  76. 0400 (end 0400): cl:move_to_position( -4, -23.5 )
  77. cl:move_sync()
  78. 0406 (end 0406): -- set speed of entity animation to "2"
  79. 040a (end 040a): cl:set_move_speed( 7.5 )
  80. 040e (end 040e): cl:set_direction( 0 )
  81. 0411 (end 0411): cl:play_animation_stop( "3" ) -- speed=1
  82. cl:animation_sync()
  83. 0414 (end 0414): return
  84. script_4:
  85. 0415 (end 0415): cl:play_animation( "4" ) -- speed=1
  86. cl:animation_sync()
  87. 0418 (end 0418): cl:move_to_position( -9.67969, -24.1875 )
  88. cl:move_sync()
  89. 041e (end 041e): music:execute_akao( 29, 40, 0, 0, 0, 0, 1a1 );
  90. 042c (end 042c): return
  91. ]]
  92. return 0
  93. end,
  94. }
  95. EntityContainer[ "Barret" ] = {
  96. barret = nil,
  97. on_start = function( self )
  98. --[[
  99. 042d (end 042d): -- assosiate entity with model (CHAR) argument doesn't matter
  100. 042f (end 042f): set_entity_to_character( "ba", 1 );
  101. 0431 (end 0431): if ( game:variable_get( "progress_game" ) == 27 ) then continue else jumpto(0450);
  102. 0439 (end 0450): if ( !(game:variable_get( "act1_1_flags1" ) & (1 << 7)) ) then continue else jumpto(0450);
  103. 043f (end 0450): ba:set_position( -0.28125, -7.42969, 3.83594 ) -- triangle_id=10
  104. 044a (end 0450): ba:set_talkable( true );
  105. 044c (end 0450): ba:set_solid( true )
  106. 044e (end 0450): ba:set_visible( true )
  107. 0450 (end 0450): return
  108. 0451 (end 0451): if ( game:variable_get( "progress_game" ) == 27 ) then continue else jumpto(0474);
  109. 0459 (end 0474): if ( !(game:variable_get( "act1_1_flags1" ) & (1 << 7)) ) then continue else jumpto(0474);
  110. 045f (end 0474): ba:set_move_speed( 3.75 )
  111. 0463 (end 0474): ba:set_solid( false )
  112. 0465 (end 0474): script:wait( 0.133333 )
  113. 0468 (end 0474): ba:move_to_position( 0.046875, -23.6797 )
  114. ba:move_sync()
  115. 046e (end 0474): ba:move_to_position( -9.67969, -23.7656 )
  116. ba:move_sync()
  117. 0474 (end 0474): jumpto( 0474 );
  118. ]]
  119. return 0
  120. end,
  121. }
  122. EntityContainer[ "Biggs" ] = {
  123. biggs = nil,
  124. on_start = function( self )
  125. --[[
  126. 0477 (end 0477): -- assosiate entity with model (CHAR) argument doesn't matter
  127. 0479 (end 0479): av_b:set_direction( 247.5 )
  128. 047c (end 047c): av_b:set_position( 1.5, -23.3594, 3.83594 ) -- triangle_id=5
  129. 0487 (end 0487): if ( game:variable_get( "progress_game" ) >= 10 ) then continue else jumpto(0495);
  130. 048f (end 0495): av_b:set_talkable( false );
  131. 0491 (end 0495): av_b:set_solid( false )
  132. 0493 (end 0495): av_b:set_visible( false )
  133. 0495 (end 0495): if ( game:variable_get( "progress_game" ) >= 27 ) then continue else jumpto(04ae);
  134. 049d (end 04ae): av_b:set_position( 0.296875, -8.08594, 3.83594 ) -- triangle_id=1
  135. 04a8 (end 04ae): av_b:set_talkable( true );
  136. 04aa (end 04ae): av_b:set_solid( true )
  137. 04ac (end 04ae): av_b:set_visible( true )
  138. 04ae (end 04ae): if ( game:variable_get( "act1_1_flags1" ) & (1 << 7) ) then continue else jumpto(04ba);
  139. 04b4 (end 04ba): av_b:set_talkable( false );
  140. 04b6 (end 04ba): av_b:set_solid( false )
  141. 04b8 (end 04ba): av_b:set_visible( false )
  142. 04ba (end 04ba): return
  143. 04bb (end 04bb): av_b:set_default_animation( "2" ) -- speed=1
  144. av_b:play_animation( "2" )
  145. 04be (end 04be): av_b:set_move_speed( 4.21875 )
  146. 04c2 (end 04c2): if ( game:variable_get( "progress_game" ) >= 27 ) then continue else jumpto(04d6);
  147. 04ca (end 04d6): av_b:move_to_position( 0.046875, -23.6797 )
  148. av_b:move_sync()
  149. 04d0 (end 04d6): av_b:move_to_position( -9.67969, -23.7656 )
  150. av_b:move_sync()
  151. 04d6 (end 04d6): if ( game:variable_get( "progress_game" ) < 10 ) then continue else jumpto(04f0);
  152. 04de (end 04f0): av_b:move_to_position( -0.21875, -22.4219 )
  153. av_b:move_sync()
  154. 04e4 (end 04f0): av_b:move_to_position( 0.117188, -6.33594 )
  155. av_b:move_sync()
  156. 04ea (end 04f0): av_b:set_talkable( false );
  157. 04ec (end 04f0): av_b:set_solid( false )
  158. 04ee (end 04f0): av_b:set_visible( false )
  159. 04f0 (end 04f0): jumpto( 04f0 );
  160. ]]
  161. return 0
  162. end,
  163. }
  164. EntityContainer[ "Jessie" ] = {
  165. jessie = nil,
  166. on_start = function( self )
  167. --[[
  168. av_c
  169. script_0:
  170. 04f3 (end 04f3): -- assosiate entity with model (CHAR) argument doesn't matter
  171. 04f5 (end 04f5): av_c:set_position( 2.85156, -24.1328, 3.83594 ) -- triangle_id=5
  172. 0500 (end 0500): av_c:set_direction( 247.5 )
  173. 0503 (end 0503): if ( game:variable_get( "progress_game" ) >= 10 ) then continue else jumpto(0511);
  174. 050b (end 0511): av_c:set_talkable( false );
  175. 050d (end 0511): av_c:set_solid( false )
  176. 050f (end 0511): av_c:set_visible( false )
  177. 0511 (end 0511): if ( game:variable_get( "progress_game" ) >= 27 ) then continue else jumpto(052a);
  178. 0519 (end 052a): av_c:set_position( 0.234375, -8.27344, 3.83594 ) -- triangle_id=1
  179. 0524 (end 052a): av_c:set_talkable( true );
  180. 0526 (end 052a): av_c:set_solid( true )
  181. 0528 (end 052a): av_c:set_visible( true )
  182. 052a (end 052a): if ( game:variable_get( "act1_1_flags1" ) & (1 << 7) ) then continue else jumpto(0536);
  183. 0530 (end 0536): av_c:set_talkable( false );
  184. 0532 (end 0536): av_c:set_solid( false )
  185. 0534 (end 0536): av_c:set_visible( false )
  186. 0536 (end 0536): return
  187. 0537 (end 0537): if ( game:variable_get( "progress_game" ) >= 27 ) then continue else jumpto(056c);
  188. 053f (end 056c): av_c:set_solid( false )
  189. 0541 (end 056c): script:wait( 1.66667 )
  190. 0544 (end 056c): av_c:set_move_speed( 5.39062 )
  191. 0548 (end 056c): av_c:move_to_position( 0.5, -24 )
  192. av_c:move_sync()
  193. 054e (end 056c): av_c:move_to_position( -2, -23.875 )
  194. av_c:move_sync()
  195. 0554 (end 056c): av_c:set_default_animation( "3" ) -- speed=1
  196. av_c:play_animation( "3" )
  197. 0557 (end 056c): av_c:move_to_position( "-448, -3056, false );
  198. 055d (end 056c): av_c:set_move_speed( 1.875 )
  199. 0561 (end 056c): av_c:move_to_position( "-512, -3056, false );
  200. 0567 (end 056c): av_c:play_animation_stop( "3", 0.633333, 0.633333 ) -- speed=1
  201. av_c:animation_sync()
  202. 056c (end 056c): if ( game:variable_get( "progress_game" ) < 10 ) then continue else jumpto(058a);
  203. 0574 (end 058a): av_c:set_move_speed( 3.98437 )
  204. 0578 (end 058a): av_c:move_to_position( -0.148438, -23.0078 )
  205. av_c:move_sync()
  206. 057e (end 058a): av_c:move_to_position( 0.117188, -6.33594 )
  207. av_c:move_sync()
  208. 0584 (end 058a): av_c:set_talkable( false );
  209. 0586 (end 058a): av_c:set_solid( false )
  210. 0588 (end 058a): av_c:set_visible( false )
  211. 058a (end 058a): jumpto( 058a );
  212. script_3:
  213. 058d (end 058d): av_c:set_move_speed( 7.5 )
  214. 0591 (end 0591): -- set speed of entity animation to "2"
  215. 0595 (end 0595): av_c:play_animation_stop( "4" ) -- speed=1
  216. av_c:animation_sync()
  217. 0598 (end 0598): av_c:set_default_animation( "0" ) -- speed=1
  218. av_c:play_animation( "0" )
  219. 059b (end 059b): av_c:move_to_position( -9.67969, -24 )
  220. av_c:move_sync()
  221. 05a1 (end 05a1): return
  222. ]]
  223. return 0
  224. end,
  225. }
  226. EntityContainer[ "Wedge" ] = {
  227. wedge = nil,
  228. on_start = function( self )
  229. self.wedge = entity_manager:get_entity( "Wedge" )
  230. self.wedge:set_position( 4.51563, -23.2109, 3.83594 )
  231. self.wedge:set_interactable( true )
  232. self.wedge:set_solid( true )
  233. self.wedge:set_visible( true )
  234. if FFVII.Data.progress_game < 10 then
  235. self.wedge:set_move_auto_speed( 3.51562 )
  236. self.wedge:move_to_position( -6.97656, -23.7344 )
  237. self.wedge:move_sync()
  238. self.wedge:set_rotation( 247.5 )
  239. self.wedge:set_default_animation( "LookAround" ) -- speed=1
  240. self.wedge:play_animation( "LookAround" )
  241. FFVII.Data.progress_game = 10
  242. elseif FFVII.Data.progress_game >= 10 then
  243. self.wedge:set_position( -6.97656, -23.7344, 3.83594 )
  244. self.wedge:set_rotation( 247.5 )
  245. self.wedge:set_default_animation( "LookAround" )
  246. self.wedge:play_animation( "LookAround" )
  247. elseif FFVII.Data.progress_game >= 27 then
  248. script:wait( 4.66667 )
  249. self.wedge:set_move_auto_speed( 2.34375 )
  250. self.wedge:move_to_position( -10.0938, -23.6719 )
  251. self.wedge:move_sync()
  252. elseif FFVII.Data.act1_1_flags1_80 == true then
  253. self.wedge:set_talkable( false )
  254. self.wedge:set_solid( false )
  255. self.wedge:set_visible( false )
  256. end
  257. return 0
  258. end,
  259. on_interact = function( self )
  260. player_lock( true )
  261. message:show_dialog( "1", "nrthmk_00", 15, 10 )
  262. message:sync( "1" )
  263. message:show_dialog( "1", "nrthmk_01", 20, 10 )
  264. message:sync( "1" )
  265. player_lock( false )
  266. return 0
  267. end,
  268. }
  269. --[[
  270. unnamed_6
  271. script_0:
  272. 062c (end 062c): return
  273. 062d (end 062d): if ( game:variable_get( "progress_game" ) >= 27 ) then continue else jumpto(0651);
  274. 0635 (end 0651): if ( game:variable_get( "act1_1_flags1" ) & (1 << 7) ) then continue else jumpto(0640);
  275. 063b (end 0651): script:wait( 2 )
  276. 063e (end 0651): jumpto( 0643 );
  277. 0640 (end 0651): script:wait( 6 )
  278. 0643 (end 0651): music:execute_akao( c2, 7f, 0, 0, 0, 1200, 0 );
  279. 0651 (end 0651): jumpto( 0651 );
  280. unnamed_7
  281. script_0:
  282. 0654 (end 0654): return
  283. 0655 (end 0655): if ( game:variable_get( "progress_game" ) >= 27 ) then continue else jumpto(0669);
  284. 065d (end 0669): if ( !(game:variable_get( "act1_1_flags1" ) & (1 << 7)) ) then continue else jumpto(0669);
  285. 0663 (end 0669): script:request_end_sync( "cl", "script_3", 6 )
  286. 0666 (end 0669): script:request( "dir", "script_3", 6 )
  287. 0669 (end 0669): jumpto( 0669 );
  288. moviec
  289. script_0:
  290. 066c (end 066c): return
  291. 066d (end 066d): if ( game:variable_get( "progress_game" ) >= 27 ) then continue else jumpto(06ae);
  292. 0675 (end 06ae): if ( temp5_14 == 1 ) then continue else jumpto(06ae);
  293. 067b (end 06ae): if ( !(game:variable_get( "act1_1_flags1" ) & (1 << 7)) ) then continue else jumpto(06ae);
  294. 0681 (end 06ae): temp6_10 = field:get_movie_frame();
  295. 0684 (end 06ae): if ( temp5_12 == 0 ) then continue else jumpto(0699);
  296. 068a (end 06ae): if ( temp6_10 > 13 ) then continue else jumpto(0699);
  297. 0692 (end 06ae): temp5_12 = 1;
  298. 0696 (end 06ae): script:request( "av_c", "script_3", 6 )
  299. 0699 (end 06ae): if ( temp5_13 == 0 ) then continue else jumpto(06ae);
  300. 069f (end 06ae): if ( temp6_10 > 18 ) then continue else jumpto(06ae);
  301. 06a7 (end 06ae): temp5_13 = 1;
  302. 06ab (end 06ae): script:request( "cl", "script_4", 6 )
  303. 06ae (end 06ae): jumpto( 066d );
  304. l_door
  305. script_0:
  306. 06b1 (end 06b1): field:background_clear( "1" ); -- turns off all layer of background animation with given id
  307. 06b4 (end 06b4): field:background_off( "1", 0 ); -- turns off layer of background animation with given id
  308. 06b8 (end 06b8): return
  309. 06b9 (end 06b9): return
  310. script_1:
  311. 06ba (end 06ba): field:background_on( "1", 0 ); -- turns on layer of background animation with given id
  312. 06be (end 06be): return
  313. ]]
  314. EntityContainer[ "Gateway0" ] = {
  315. on_start = function( self )
  316. return 0
  317. end,
  318. on_enter_line = function( self, entity )
  319. return 0
  320. end,
  321. on_move_to_line = function( self, entity )
  322. return 0
  323. end,
  324. on_cross_line = function( self, entity )
  325. if entity == "Cloud" then
  326. load_field_map_request( "ffvii_md1_2", "Spawn_nrthmk" )
  327. end
  328. return 0
  329. end,
  330. on_leave_line = function( self, entity )
  331. return 0
  332. end,
  333. }
  334. EntityContainer[ "Gateway1" ] = {
  335. on_start = function( self )
  336. return 0
  337. end,
  338. on_enter_line = function( self, entity )
  339. return 0
  340. end,
  341. on_move_to_line = function( self, entity )
  342. return 0
  343. end,
  344. on_cross_line = function( self, entity )
  345. if entity == "Cloud" then
  346. --load_field_map_request( "ffvii_nrthmk", "Spawn_md1_2" )
  347. end
  348. return 0
  349. end,
  350. on_leave_line = function( self, entity )
  351. return 0
  352. end,
  353. }
  354. EntityContainer[ "Gateway2" ] = {
  355. on_start = function( self )
  356. return 0
  357. end,
  358. on_enter_line = function( self, entity )
  359. return 0
  360. end,
  361. on_move_to_line = function( self, entity )
  362. return 0
  363. end,
  364. on_cross_line = function( self, entity )
  365. if entity == "Cloud" then
  366. --load_field_map_request( "ffvii_nrthmk", "Spawn_md1_2" )
  367. end
  368. return 0
  369. end,
  370. on_leave_line = function( self, entity )
  371. return 0
  372. end,
  373. }