nmkin_2.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. EntityContainer = {}
  2. EntityContainer[ "Director" ] = {
  3. on_start = function( self )
  4. background2d:autoscroll_to_entity( entity_manager:get_entity( "Cloud" ) )
  5. --0288 (end 0288): temp6_02 = 29;
  6. --028d (end 028d): temp6_04 = 166;
  7. if FFVII.Data.progress_game == 27 then
  8. --029a (end 02af): music:execute_akao( 29, 40, 0, 0, 0, 7200, 22 );
  9. --02a8 (end 02af): [UNREVERSED] BTLMD(22, 00);
  10. --02ab (end 02af): [UNREVERSED] BMUSC(0);
  11. end
  12. --02af (end 02c1): music:execute_akao( 2a, 40, 0, 0, 0, f000, f601 );
  13. --02bd (end 02c1): music:execute_akao( 10, pointer_to_field_AKAO_1 ); -- play field music
  14. --02bf (end 02c1): [UNREVERSED] BMUSC(2);
  15. if FFVII.Data.progress_game > 27 then
  16. --02c9 (end 02cf): field:map_name(4);
  17. --02cb (end 02cf): field:set_battle_table(1);
  18. end
  19. --02cf (end 02d1): field:map_name(3);
  20. script:request( Script.ENTITY, "Director", "main", 6 )
  21. return 0
  22. end,
  23. main = function( self )
  24. if FFVII.Data.progress_game == 27 then
  25. --script:request( Script.ENTITY, "Time", "display_time", 6 )
  26. --02dd (end 02dd): temp6_00 = cl:get_move_triangle_id();
  27. end
  28. return 0
  29. end,
  30. }
  31. EntityContainer[ "Cloud" ] = {
  32. cloud = nil,
  33. on_start = function( self )
  34. set_entity_to_character( "Cloud", "Cloud" )
  35. self.cloud = entity_manager:get_entity( "Cloud" )
  36. self.cloud:set_solid( true )
  37. self.cloud:set_visible( true )
  38. -- [[ When skipping to this field from menu, ensure player is able to move ]]
  39. if FFVII.Data.field_skip == true then
  40. FFVII.set_party( "Cloud", nil, nil );
  41. self.cloud:play_animation( "Idle" )
  42. self.cloud:set_position( -2.67, 1.74, 12.37 )
  43. self.cloud:set_rotation( 67.7647 )
  44. FFVII.Data.progress_game = 12
  45. player_lock( false )
  46. end
  47. return 0
  48. end,
  49. --[[ Climb up ladder at top of reactor. ]]
  50. script_3 = function( self )
  51. player_lock( true )
  52. --0334 (end 0334): field:menu_lock(true);
  53. --0336 (end 0336): music:execute_akao( 20, 40, 15 ); -- play sound
  54. self.cloud:set_solid_range( 1 );
  55. self.cloud:move_to_position( 1.3125, 1.10938 )
  56. self.cloud:move_sync()
  57. self.cloud:set_solid_range( 30 );
  58. player_lock( false )
  59. --0349 (end 0349): field:menu_lock(false);
  60. self.cloud:linear_to_position( 166, 248, 1805, 102, Entity.DOWN_TO_UP ); -- direction needs to be seted to "180" and animation during climbing is "3" with speed "1"
  61. return 0
  62. end,
  63. --[[ Climb down ladder at top of reactor. ]]
  64. script_4 = function( self )
  65. player_lock( true )
  66. --035d (end 035d): field:menu_lock(true);
  67. --035f (end 035f): music:execute_akao( 20, 40, 15 ); -- play sound
  68. self.cloud:set_solid_range( 1 );
  69. self.cloud:move_to_position( 1.29688, 1.9375 )
  70. self.cloud:move_sync()
  71. self.cloud:set_solid_range( 30 );
  72. player_lock( false )
  73. --0372 (end 0372): field:menu_lock(false);
  74. self.cloud:linear_to_position( 168, 142, 1582, 79, Entity.UP_TO_DOWN ); -- direction needs to be seted to "180" and animation during climbing is "3" with speed "1"
  75. return 0
  76. end,
  77. --[[ Unknown cloud sitting down scene ]]
  78. script_5 = function( self )
  79. self.cloud:set_default_animation( "SittingDown" ) -- speed=1
  80. self.cloud:play_animation( "SittingDown" )
  81. --0387 (end 0387): music:execute_akao( 20, 40, 104 ); -- play sound
  82. self.cloud:move_to_position( 913, 1638, false );
  83. self.cloud:set_move_speed( 3.75 )
  84. self.cloud:move_to_position( 904, 562, false );
  85. self.cloud:set_move_speed( 0.9375 )
  86. self.cloud:play_animation( "5", 0.466667, 1.7, 1, true );
  87. --03a5 (end 03a5): music:execute_akao( 20, 40, 3e ); -- play sound
  88. self.cloud:jump_to_position( 957, 708, 34, 0.566667 );
  89. script:wait( 0.666667 )
  90. self.cloud:set_default_animation( "Idle" ) -- speed=1
  91. self.cloud:play_animation( "Idle" )
  92. return 0
  93. end,
  94. }
  95. EntityContainer[ "Jessie" ] = {
  96. jessie = nil,
  97. on_start = function( self )
  98. self.jessie = entity_manager:get_entity( "Jessie" )
  99. -- assosiate entity with model (CHAR) argument doesn't matter
  100. self.jessie:set_position( -3.83594, -0.414063, 11.7188 ) -- triangle_id=72
  101. if FFVII.Data.progress_game >= 13 then
  102. self.jessie:set_talkable( false );
  103. self.jessie:set_solid( false )
  104. self.jessie:set_visible( false )
  105. end
  106. self.jessie:set_solid( false )
  107. script:request( Script.ENTITY, "Jessie", "main", 6 )
  108. return 0
  109. end,
  110. --[[ Run down the stairs. ]]
  111. main = function( self )
  112. if FFVII.Data.progress_game < 13 then
  113. self.jessie:set_move_auto_speed( 2.8125 )
  114. self.jessie:move_to_position( 2.97656, -0.257813 )
  115. self.jessie:move_sync()
  116. self.jessie:move_to_position( 5.37969, 6.43906 )
  117. self.jessie:move_sync()
  118. self.jessie:move_to_position( 6.34063, 6.39063 )
  119. self.jessie:move_sync()
  120. self.jessie:set_move_auto_speed( 3.75 )
  121. FFVII.Data.progress_game = 13
  122. self.jessie:move_to_position( 6.22313, -1.27 )
  123. self.jessie:move_sync()
  124. self.jessie:set_move_auto_speed( 2.8125 )
  125. self.jessie:move_to_position( -6.375, -1.96875 )
  126. self.jessie:move_sync()
  127. self.jessie:set_talkable( false );
  128. self.jessie:set_solid( false )
  129. self.jessie:set_visible( false )
  130. end
  131. return 0
  132. end,
  133. }
  134. EntityContainer[ "Wedge" ] = {
  135. wedge = nil,
  136. on_start = function( self )
  137. self.wedge = entity_manager:get_entity( "Wedge" )
  138. self.wedge:set_position( 5.94141, 5.875, 5.07031 )
  139. self.wedge:set_rotation( 16.875 )
  140. self.wedge:set_default_animation( "LookAround" )
  141. self.wedge:play_animation( "LookAround" )
  142. if FFVII.Data.progress_game >= 7 then
  143. self.wedge:set_solid( false )
  144. self.wedge:set_visible( false )
  145. else
  146. self.wedge:set_solid( true )
  147. self.wedge:set_visible( true )
  148. end
  149. return 0
  150. end,
  151. scene_part_12 = function( self )
  152. self.wedge:set_move_auto_speed( 1.17187 )
  153. self.wedge:move_to_position( 4.57422, 6.82812 )
  154. self.wedge:move_sync()
  155. self.wedge:move_to_position( 5.29297, 13.1875 )
  156. self.wedge:move_sync()
  157. self.wedge:set_solid( false )
  158. self.wedge:set_visible( false )
  159. return 0
  160. end,
  161. }
  162. EntityContainer[ "DoorLeft" ] = {
  163. door = nil,
  164. on_start = function( self )
  165. self.door = entity_manager:get_entity( "DoorLeft" )
  166. self.door:set_position( 4.25, 7.20703, 5.07031 )
  167. self.door:set_rotation( 354.375 )
  168. if FFVII.Data.progress_game >= 7 then
  169. self.door:set_visible( false )
  170. else
  171. self.door:set_visible( true )
  172. end
  173. self.door:set_solid( false )
  174. return 0
  175. end,
  176. open = function( self )
  177. self.door:offset_to_position( -0.789062, 0, 0, Entity.LINEAR, 1.66667 )
  178. self.door:offset_sync()
  179. self.door:set_visible( false )
  180. return 0
  181. end,
  182. }
  183. EntityContainer[ "DoorRight" ] = {
  184. door = nil,
  185. on_start = function( self )
  186. self.door = entity_manager:get_entity( "DoorRight" )
  187. self.door:set_position( 4.93359, 7.125, 5.07031 )
  188. self.door:set_rotation( 174.375 )
  189. if FFVII.Data.progress_game >= 7 then
  190. self.door:set_visible( false )
  191. else
  192. self.door:set_visible( true )
  193. end
  194. self.door:set_solid( false )
  195. return 0
  196. end,
  197. open = function( self )
  198. self.door:offset_to_position( 0.71875, 0, 0, Entity.LINEAR, 1.66667 )
  199. self.door:offset_sync()
  200. self.door:set_visible( false )
  201. return 0
  202. end,
  203. }
  204. EntityContainer[ "Movie" ] = {
  205. movie_check = false,
  206. on_start = function( self )
  207. while true do
  208. if self.movie_check == true then
  209. --0717 (end 0729): temp6_09 = field:get_movie_frame();
  210. --071a (end 0729): if ( temp6_09 > 30 ) then continue else jumpto(0729);
  211. script:request( Script.ENTITY, "Cloud", "scene_part_16", 6 )
  212. break
  213. end
  214. script:wait( 0 )
  215. end
  216. return 0
  217. end,
  218. }
  219. --[[
  220. fan
  221. script_0:
  222. 072c (end 072c): field:background_clear( "2" ); -- turns off all layer of background animation with given id
  223. 072f (end 072f): return;
  224. 0730 (end 0730): script:wait( 0.1 )
  225. 0733 (end 0733): field:background_on( "2", 0 ); -- turns on layer of background animation with given id
  226. 0737 (end 0737): script:wait( 0.133333 )
  227. 073a (end 073a): field:background_off( "2", 0 ); -- turns off layer of background animation with given id
  228. 073e (end 073e): field:background_on( "2", 1 ); -- turns on layer of background animation with given id
  229. 0742 (end 0742): script:wait( 0.133333 )
  230. 0745 (end 0745): field:background_off( "2", 1 ); -- turns off layer of background animation with given id
  231. 0749 (end 0749): jumpto( 0730 );
  232. light
  233. script_0:
  234. 074b (end 074b): temp5_16 = 66;
  235. 074f (end 074f): return;
  236. 0750 (end 0750): [UNREVERSED] STPAL( 00, 0d, 00, ff );
  237. 0755 (end 0755): if ( temp5_16 < 62 ) then continue else jumpto(0775);
  238. 075b (end 0775): temp5_16 = temp5_16 + 2;
  239. 075f (end 0775): [UNREVERSED] MPPAL2( 00, 55, 50, 00, 10, 16, 16, 16, ff );
  240. 0769 (end 0775): [UNREVERSED] CPPAL( 00, 00, 10, 00 );
  241. 076e (end 0775): [UNREVERSED] LDPAL( 00, 10, 0d, ff );
  242. 0773 (end 0775): jumpto( 0755 );
  243. 0775 (end 0775): if ( temp5_16 > 32 ) then continue else jumpto(0795);
  244. 077b (end 0795): temp5_16 = temp5_16 - 2;
  245. 077f (end 0795): [UNREVERSED] MPPAL2( 00, 55, 50, 00, 10, 16, 16, 16, ff );
  246. 0789 (end 0795): [UNREVERSED] CPPAL( 00, 00, 10, 00 );
  247. 078e (end 0795): [UNREVERSED] LDPAL( 00, 10, 0d, ff );
  248. 0793 (end 0795): jumpto( 0775 );
  249. 0795 (end 0795): jumpto( 0755 );
  250. light2
  251. script_0:
  252. 0797 (end 0797): temp5_17 = 66;
  253. 079b (end 079b): return;
  254. 079c (end 079c): script:wait( 0.666667 )
  255. 079f (end 079f): [UNREVERSED] STPAL( 00, 0e, 20, ff );
  256. 07a4 (end 07a4): if ( temp5_17 < 62 ) then continue else jumpto(07c4);
  257. 07aa (end 07c4): temp5_17 = temp5_17 + 1;
  258. 07ae (end 07c4): [UNREVERSED] MPPAL2( 00, 55, 50, 20, 30, 17, 17, 17, ff );
  259. 07b8 (end 07c4): [UNREVERSED] CPPAL( 00, 20, 30, 00 );
  260. 07bd (end 07c4): [UNREVERSED] LDPAL( 00, 30, 0e, ff );
  261. 07c2 (end 07c4): jumpto( 07a4 );
  262. 07c4 (end 07c4): if ( temp5_17 > 16 ) then continue else jumpto(07e4);
  263. 07ca (end 07e4): temp5_17 = temp5_17 - 1;
  264. 07ce (end 07e4): [UNREVERSED] MPPAL2( 00, 55, 50, 20, 30, 17, 17, 17, ff );
  265. 07d8 (end 07e4): [UNREVERSED] CPPAL( 00, 20, 30, 00 );
  266. 07dd (end 07e4): [UNREVERSED] LDPAL( 00, 30, 0e, ff );
  267. 07e2 (end 07e4): jumpto( 07c4 );
  268. 07e4 (end 07e4): jumpto( 07a4 );
  269. ]]
  270. EntityContainer[ "Gateway0" ] = {
  271. on_start = function( self )
  272. return 0
  273. end,
  274. on_enter_line = function( self, entity )
  275. return 0
  276. end,
  277. on_move_to_line = function( self, entity )
  278. return 0
  279. end,
  280. on_cross_line = function( self, entity )
  281. if entity == "Cloud" then
  282. load_field_map_request( "ffvii_elevtr1", "Spawn_elevtr1_1f" )
  283. end
  284. return 0
  285. end,
  286. on_leave_line = function( self, entity )
  287. return 0
  288. end,
  289. }
  290. EntityContainer[ "Gateway1" ] = {
  291. on_start = function( self )
  292. return 0
  293. end,
  294. on_enter_line = function( self, entity )
  295. return 0
  296. end,
  297. on_move_to_line = function( self, entity )
  298. return 0
  299. end,
  300. on_cross_line = function( self, entity )
  301. if entity == "Cloud" then
  302. load_field_map_request( "ffvii_nmkin_3", "Spawn_nmkin_2" )
  303. end
  304. return 0
  305. end,
  306. on_leave_line = function( self, entity )
  307. return 0
  308. end,
  309. }