Downloads containing j2s.html

Downloads
Name Author Game Mode Rating
JJ2 language file editorFeatured Download Violet CLM Utility 8.6 Download file

File preview

  1.  
  2. <!doctype html>
  3.         <meta charset="windows-1252">
  4.         <title>JJ2 language file editor</title>
  5.         <style>
  6.         textarea {
  7.                 white-space: pre;
  8.                 overflow: auto;
  9.                 resize: horizontal;
  10.         }
  11.         </style>
  12. </head>
  13. <h1>JJ2 language file editor</h1>
  14. Open a j2s file to edit:<br>
  15. <input type="file" id="inputfile" accept=".j2s">
  16. <br>
  17. <br>
  18. English for comparison:<br>
  19. <textarea id="original1" cols="37" rows="30" wrap="off" disabled onscroll="document.getElementById('linesarea1').scrollTop = this.scrollTop;">Please Reinstall Jazz2
  20. #New Game
  21. #Load Game
  22. #Save Game
  23. #Options
  24. #Quit
  25. #New Game
  26. #Load Game
  27. #Custom Game
  28. #Options
  29. #Quit
  30. #High Scores
  31. #Main Menu
  32. Shareware
  33. Press Fire
  34. #Welcome Player %i
  35. #Your Name
  36. #Your Character
  37. #Start Game
  38. Type Your Name
  39. Press Enter To Change
  40. First type a name
  41. Press Enter To Start
  42. name:
  43. char:
  44. controls:
  45. Players %u
  46. #Choose Game Type
  47. #Single Player
  48. #Party Mode
  49. #Choose Connection
  50. #Local Play (Splitscreen)
  51. #Internet Play
  52. #Local Network (IPX)
  53. #Modem Play
  54. #Choose Party Game Mode
  55. #Cooperative
  56. #Battle
  57. #Race
  58. #Treasure Hunt
  59. #Battle game
  60. #Number of roasts to win
  61. #Done
  62. #Choose Episode
  63. Episode not available
  64. #Select Difficulty Level
  65. #Easy
  66. #Medium
  67. #Hard
  68. #Choose Character
  69. LEVEL COMPLETE
  70. TOTAL
  71. unfinished
  72. Winner
  73. Loser
  74. %s wins
  75. %s loses
  76. Press Fire To Continue
  77. End of Episode
  78. not done yet
  79. #Set Game Options
  80. #Options
  81. #Controls
  82. #Video
  83. #Sound
  84. #Controls
  85. #Set Controls
  86. #Press Enter To Change
  87. #Press new Key or Button
  88. #key
  89. #joy
  90. #Up
  91. #Down
  92. #Left
  93. #Right
  94. #Fire
  95. #Select
  96. #Jump
  97. #Run
  98.  or
  99. 2#Keyboard 1
  100. 2#Keyboard 2
  101. 2#Joystick 1
  102. 2#Joystick 2
  103. 2#Joystick 3
  104. 2#Joystick 4
  105. Loading...
  106. #Video Options
  107. #Resolution
  108. #Detail
  109. Low
  110. Medium
  111. High
  112. #Sound Options
  113. #Effect Volume
  114. #Music Volume
  115. #Advanced
  116. #Done
  117. 1#Use Left, Right or Fire to Change
  118. #Output Mode
  119. #Sampling Rate
  120. #Mixing Precision
  121. #Interpolation
  122. #Done
  123. On
  124. Off
  125. 2Min
  126. 2Max
  127. Pause
  128. Are you Sure?
  129. yes
  130. no
  131. LETS ROCK
  132. GET READY
  133. KICK SHELL
  134. GET MOVING
  135. SHAKE YOUR TAIL
  136. BUST A MOVE
  137. RABBIT ROAST
  138. TRY AGAIN
  139. BUMMER DUDE
  140. YOU ATE IT
  141. THATS GOTTA HURT
  142. TOASTIED
  143. SEE YA
  144. FRIED RABBIT
  145. roasts %u /%u
  146. Find Exit
  147. need
  148. Extra Life
  149. Lap %u\5
  150. Help
  151. #Cancel
  152. fastfire
  153. 1play the previous episode first
  154. 2press any key to enter next episode
  155. Finished
  156. 1Empty
  157. Cancel
  158. 1Single Player Game
  159. 1%i player %s
  160.  GAME SAVED
  161. GAME OVER
  162. #Sugar  RUSH  %u
  163. #Select Language
  164. #Installed Languages
  165. Menu
  166. Help
  167. Load
  168. Save
  169. Quick Load
  170. Quick Save
  171. Game Info
  172. #You Made It!
  173. #Enter Name!
  174. unknown
  175. a
  176. b
  177. c
  178. d
  179. e
  180. f
  181. g
  182. h
  183. i
  184. j
  185. k
  186. l
  187. m
  188. n
  189. o
  190. p
  191. q
  192. r
  193. s
  194. t
  195. u
  196. v
  197. w
  198. x
  199. y
  200. z
  201. 0
  202. 1
  203. 2
  204. 3
  205. 4
  206. 5
  207. 6
  208. 7
  209. 8
  210. 9
  211. pad up
  212. page up
  213. up
  214. pad down
  215. page down
  216. down
  217. pad left
  218. left
  219. pad right
  220. right
  221. space
  222. enter
  223. backspace
  224. minus
  225. equal
  226. pad plus
  227. pad minus
  228. home
  229. end
  230. ins
  231. del
  232. pad ins
  233. pad del
  234. pad home
  235. pad end
  236. pad pgup
  237. pad pgdn
  238. pad enter
  239. left ctrl
  240. right ctrl
  241. left alt
  242. right alt
  243. shift
  244.  
  245. f1
  246. f2
  247. f3
  248. f4
  249. f5
  250. f6
  251. f7
  252. f8
  253. f9
  254. f10
  255. f11
  256. f12
  257. caps lock
  258. Esc
  259. button %u
  260. NOT CONNECTED
  261. power up
  262. #Setup Network
  263. #Local Network (TCP)
  264. Chat:
  265. Choose Number of Players
  266. Local Players
  267. Players
  268. Setup Local Players
  269. Setup Players
  270. Setup Player %i
  271. #Change Player %i
  272. color:
  273. default
  274. control:
  275. #Hardware Mode
  276. #Textured 3D Background
  277. #MMX Capabilities
  278. #Ambient Lighting
  279. Use the arrow keys to switch pages
  280. Page %u of %u
  281. Game List
  282. Active Game List
  283. Error Connecting to
  284. List Servers
  285. Press any key
  286. Enter Address:
  287. Retrieving Server Lists
  288. Looking for servers...
  289. Looking for local servers...
  290. Game Server Setup
  291. #Number of gems
  292. #Number of laps
  293. #Server Type
  294. Open
  295. Private
  296. User server at
  297. DEMO
  298. Start Multiplayer game
  299. #Join another game
  300. #&lt; Client &gt;
  301. #Start a new game
  302. #&lt; Server &gt;
  303. Players on this computer
  304. #Select a Level
  305. Connecting
  306. Press Esc to abort
  307. #Password:
  308. Downloading
  309. #Capture the Flag
  310. #Number of wins
  311. Capture
  312. Treasure
  313. Blue %i/%i
  314. Red %i/%i
  315. pinging
  316. Network Error
  317. 1Could not start Server
  318. 1Version of server is different
  319. 1Could not connect to server
  320. 1Server denied you
  321. Wrong password
  322. Server wants password
  323. Please visit :
  324. www.jazzjackrabbit.com
  325. for more information
  326. %s captured the flag
  327. %s roasted %s
  328. you got roasted by %s
  329. you killed yourself
  330. %s got roasted
  331. %s ate it
  332. %s joined the game
  333. %s left the game
  334. Server is full
  335. Error during handshaking
  336. Feature not available in shareware
  337. Error downloading file
  338. Connection lost
  339. Winsock error
  340. Connection timed out
  341. Server stopped
  342. Blue Team scored a point
  343. Red Team scored a point
  344. Only in registered version
  345. No User levels available</textarea>
  346. <textarea id="linesarea1" cols="103" rows="30" wrap="off" onscroll="document.getElementById('original1').scrollTop = this.scrollTop;"></textarea>
  347. <br>
  348.  
  349. <textarea id="original2" cols="64" rows="30" wrap="off" disabled onscroll="document.getElementById('linesarea2').scrollTop = this.scrollTop;">@Destroy your enemy @ ten times to win.
  350. @You found a secret area.
  351. @Secret Treasure Room.
  352. @Nothing to see here.
  353. @Destroy your enemy @ ten times to win.
  354. @You found a secret area.
  355. @Secret Treasure Room.
  356. @Nothing to see here.
  357. @Spaz ate the dopefish.
  358. @Find the gopher.
  359. @Dragons live in burbank.
  360. @Mark wears briefs. @Hoo Hah.
  361. @Nick loves shiny.
  362. @Stomp your booty to exit.
  363. @A flame weapon can be @used to melt ice...
  364. @Super dooper secret.
  365. @Shields will give you unlimited @special ammo for a short time.
  366. @Stopwatches will add time to@the life of a shield.
  367. @This schwartzenguard is toast!
  368. @Poles spin you around so@ you can go even faster.
  369. @You found a secret area.
  370. @Secret Treasure Room.
  371. @Nothing to see here.
  372. @Collect coins to activate @bonus warp devices.
  373. @Cheese is green on tuesday.
  374. @Craig is king doofus.
  375. @To beat the queen @shoot her off her ledge.
  376. @      Congratulations! @ You can now exit the castle!
  377. @To kick through these@blocks, press down and jump!
  378. @Press down and jump beneath @these blocks to break them!
  379. @Buttstomp the metal box @to open key blocks!
  380. @This level is not done.
  381. @Spaz ate the dopefish.
  382. @Find the gopher.
  383. @Dragons live in burbank.
  384. @Mark wears briefs. @Hoo Hah!
  385. @Nick loves shiny. @Always has!
  386. @Send Tim new socks.
  387. @Send Nigel a green card.
  388. @Beware of chainsaw schmalz.
  389. @Dont give mark a burrito.
  390. @Long live the ice level.
  391. @This is not over yet!
  392. @Falling boulders can @give you a headache.
  393. @A Flamethrower works@well against bugs.
  394. @@You cannot defeat me!@Prepare to face my superbot!
  395. @@Ack! I'm outta here!
  396. @Beware of falling enemies.
  397. @Craig is still a doofus!
  398. @Smoke rings will @make you dizzy.
  399. @First player to the @finish wins the game.
  400. @First player to the @finish wins the game.
  401. @Poles spin you around so@ you can go even faster.
  402. @You found a secret area.
  403. @Secret Treasure Room.
  404. @Nothing to see here.
  405. @Collect coins to activate @bonus warp devices.
  406. @Spaz ate the dopefish.
  407. @Find the gopher.
  408. @Dragons live in burbank.
  409. @Mark wears briefs. @Hoo Hah.
  410. @Nick loves shiny.
  411. @Shoot these blocks!
  412. @When in the air, press down@to stomp with your butt.
  413. @To pass this area, stomp@the secret metal crate.
  414. @You need twenty coins to pass @through this secret warp!
  415. @Coins give you access to @warps that appear later.
  416. @Stomp in the right place and@you might find a surprise!
  417. @Some crates contain@bombs or baddies!
  418. @You need twenty coins to pass @through this secret warp!
  419. @A flamethrower works well @against nasty bugs.
  420. @Smoke rings will make@you very dizzy!
  421. @Beware the witch! She can@turn you into a frog.
  422. @If you are turned into a frog@Eva Earlong can help!
  423. @You made it! This is the end@ of the shareware version.
  424. @Welcome to Jazz Jackrabbit 2. @ This is a training level.
  425. @Collect goodies for@points and surprises.
  426. @After jumping, press jump@again to do a special move.
  427. @Some walls can be shot.
  428. @When in the air, press down@to stomp with your butt.
  429. @Secrets abound in Jazz 2. @ Check the walls.
  430. @Good job. Remember to@look for secrets.
  431. @Collect gems for @an extra life.
  432. @Red Gems count@as one gem.
  433. @Green gems count@as five gems.
  434. @Blue gems count@as ten gems.
  435. @Carrots give you health.
  436. @Checkpoints save your@spot if you lose a life.
  437. @Collect coins to@unlock bonus rooms.
  438. @Beware of sharp stuff.@It hurts.
  439. @Now youre ready to play.@ Good luck and have fun.
  440. @Smoke rings will @make you dizzy.
  441. @You can't buttstomp@so go up and around!
  442. @No rewards to those@with itchy trigger fingers.
  443. @Todays Forcast: Strong Winds!
  444. @Find the crate@to clear your path.
  445. @Welcome to@Jazz Jackrabbit 2:@The Secret Files!
  446. @Only Spaz can get to@the room up on the left.@He may need something@to stand on.
  447. @Don't beat Nigel at pool.@You've veen warned. :)
  448. @Eating too many chocolate@eggs can make you sick :p
  449. @Sloping Tunnel Entrance
  450. @To access the tunnels above@find the access warp.
  451. @One route leads to riches.@One route leads to battle.
  452. @Only those who can double-jump@can get to the goodies!
  453. @Find the crate to make@your climbing blocks appear
  454. @Stomping this crate also@free's some enemies :)
  455. @Enter the house with caution.....
  456. @Silver Crates can't be broken underwater...
  457. @Water Level control crate above.
  458. @Stomping crates can be good and bad...
  459. @But you need a way to get up there...
  460. @Take to the roof tops!
  461. @The skies above will reward@those who stomp...
  462. @Jump as far over to the@right as you possibly can...
  463. @Didn't make the jump huh? :)
  464. @Well Done!
  465. @Use your Special Moves to get up the air cons!@For Jazz, press Crouch and Jump.@For Spaz, Press Jump Twice!
  466. @Find the crate and the gems are yours!
  467. @Springs Don't Work When Frozen...
  468. @Collecting 20 coins is more rewarding...
  469. @Find the crate to clear the blocks....
  470. @BEWARE! Flocks of Ravens can@be very dangerous.
  471. @The remove the blocks@look to the tallest building.
  472. @Choose a cover and stomp away!
  473. @Hi Geobunny !
  474. @Goto www.project2.com@use@password: BUNNYLOVER</textarea>
  475.  
  476. <textarea id="linesarea2" cols="76" rows="30" wrap="off" onscroll="document.getElementById('original2').scrollTop = this.scrollTop;"></textarea>
  477. <br>
  478.  
  479. <button type="button" id="generate">Save/Download</button>
  480.  
  481. /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
  482. var saveAs=saveAs||(function(h){"use strict";var r=h.document,l=function(){return h.URL||h.webkitURL||h},e=h.URL||h.webkitURL||h,n=r.createElementNS("http://www.w3.org/1999/xhtml","a"),g="download" in n,j=function(t){var s=r.createEvent("MouseEvents");s.initMouseEvent("click",true,false,h,0,0,0,0,0,false,false,false,false,0,null);return t.dispatchEvent(s)},o=h.webkitRequestFileSystem,p=h.requestFileSystem||o||h.mozRequestFileSystem,m=function(s){(h.setImmediate||h.setTimeout)(function(){throw s},0)},c="application/octet-stream",k=0,b=[],i=function(){var t=b.length;while(t--){var s=b[t];if(typeof s==="string"){e.revokeObjectURL(s)}else{s.remove()}}b.length=0},q=function(t,s,w){s=[].concat(s);var v=s.length;while(v--){var x=t["on"+s[v]];if(typeof x==="function"){try{x.call(t,w||t)}catch(u){m(u)}}}},f=function(t,u){var v=this,B=t.type,E=false,x,w,s=function(){var F=l().createObjectURL(t);b.push(F);return F},A=function(){q(v,"writestart progress write writeend".split(" "))},D=function(){if(E||!x){x=s(t)}w.location.href=x;v.readyState=v.DONE;A()},z=function(F){return function(){if(v.readyState!==v.DONE){return F.apply(this,arguments)}}},y={create:true,exclusive:false},C;v.readyState=v.INIT;if(!u){u="download"}if(g){x=s(t);n.href=x;n.download=u;if(j(n)){v.readyState=v.DONE;A();return}}if(h.chrome&&B&&B!==c){C=t.slice||t.webkitSlice;t=C.call(t,0,t.size,c);E=true}if(o&&u!=="download"){u+=".download"}if(B===c||o){w=h}else{w=h.open()}if(!p){D();return}k+=t.size;p(h.TEMPORARY,k,z(function(F){F.root.getDirectory("saved",y,z(function(G){var H=function(){G.getFile(u,y,z(function(I){I.createWriter(z(function(J){J.onwriteend=function(K){w.location.href=I.toURL();b.push(I);v.readyState=v.DONE;q(v,"writeend",K)};J.onerror=function(){var K=J.error;if(K.code!==K.ABORT_ERR){D()}};"writestart progress write abort".split(" ").forEach(function(K){J["on"+K]=v["on"+K]});J.write(t);v.abort=function(){J.abort();v.readyState=v.DONE};v.readyState=v.WRITING}),D)}),D)};G.getFile(u,{create:false},z(function(I){I.remove();H()}),z(function(I){if(I.code===I.NOT_FOUND_ERR){H()}else{D()}}))}),D)}),D)},d=f.prototype,a=function(s,t){return new f(s,t)};d.abort=function(){var s=this;s.readyState=s.DONE;q(s,"abort")};d.readyState=d.INIT=0;d.WRITING=1;d.DONE=2;d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null;h.addEventListener("unload",i,false);return a}(self));
  483. (function () {
  484.         'use strict';
  485.  
  486.         var inputFile = document.getElementById('inputfile');
  487.         var original1 = document.getElementById('original1');
  488.         var original2 = document.getElementById('original2');
  489.         var linesArea1 = document.getElementById('linesarea1');
  490.         var linesArea2 = document.getElementById('linesarea2');
  491.         var generateButton = document.getElementById('generate');
  492.  
  493.         linesarea1.value = original1.textContent;
  494.         linesarea2.value = original2.textContent;
  495.  
  496.         var filename = "Language.j2s";
  497.  
  498.         inputFile.addEventListener('change', function () {
  499.  
  500.                 if (inputFile.files[0]) {
  501.                         filename = inputFile.files[0].name;
  502.                         var fr = new FileReader();
  503.                         fr.onload = function () {
  504.                                 var buffer = fr.result;
  505.                                 var dv = new DataView(buffer);
  506.                                 var i = 0;
  507.                                 var offsetArraySize = dv.getUint32(i, true); i+=4;
  508.                                 var textArraySize = dv.getUint32(i, true); i+=4;
  509.                                 var textArray = new Uint8Array(buffer.slice(i, i+textArraySize)); i+=textArraySize;
  510.                                 var offsetArray = new Uint32Array(buffer.slice(i, i+offsetArraySize*4)); i+=offsetArraySize*4;
  511.  
  512.                                 var texts1 = [];
  513.                                 for (var k = 1; k < offsetArray.length; k++) {
  514.                                         var offset = offsetArray[k];
  515.                                         var str = "";
  516.                                         while (textArray[offset] !== 0) {
  517.                                                 str += String.fromCharCode(textArray[offset++]);
  518.                                         }
  519.                                         texts1.push(str);
  520.                                 }
  521.  
  522.                                 linesArea1.value = texts1.join("\n");
  523.                                
  524.                                
  525.  
  526.                                 var levelEntryCount = dv.getUint32(i, true); i+=4;
  527.                                 //console.log(levelEntryCount);
  528.                                 var levelEntries = [];
  529.                                 var amounts = [];
  530.                                 var offsets = [];
  531.                                 var unknowns = [];
  532.  
  533.                                 var k = 0;
  534.                                 while (k < levelEntryCount) {
  535.                                         var str = "";
  536.                                         for (var j = 0; j < 8; j++) {
  537.                                                 str += String.fromCharCode(dv.getUint8(i++));
  538.                                         }
  539.                                         levelEntries.push(str);
  540.  
  541.                                         unknowns.push(dv.getUint8(i++)); // Always zero..
  542.                                         amounts.push(dv.getUint8(i++));
  543.                                         offsets.push(dv.getUint16(i, true)); i+=2;
  544.  
  545.                                         k++;
  546.                                 }
  547.  
  548.  
  549.                                
  550.                                 var textArray2Size = dv.getUint32(i, true); i+=4;
  551.                                 offsets.push(textArray2Size);
  552.                                 var indices = [];
  553.                                 var texts2 = [];
  554.                                 var k = 0;
  555.                                 for (var l = 0; l < levelEntryCount; l++) { // For each level
  556.                                         var offset = offsets[l+1] || 0;
  557.                                         var amount = amounts[l];
  558.                                         //console.log(levelEntries[l], amount, offset);
  559.                                         var a = 0;
  560.                                         while (k < offset) { // For each helpstring in level
  561.  
  562.                                                 indices.push(dv.getUint8(i+k++));
  563.                                                 var size = dv.getUint8(i+k++);
  564.                                                 var str = "";
  565.                                                 while (str.length < size) {
  566.                                                         str += String.fromCharCode(dv.getUint8(i+k++));
  567.                                                 }
  568.                                                 texts2.push(str);
  569.                                                 a++;
  570.                                         }
  571.                                         amounts[l] = a;
  572.                                 }
  573.                                 i+=k;
  574.  
  575.                                 // End of data
  576.  
  577.                                 var numberOfHelpStrings = texts2.length;
  578.                                 if (numberOfHelpStrings < 126) {  // If the opened .j2s file didn't include enough strings (probably because it was made for 1.23), fill in the rest from English
  579.                                         var originalLines = original2.textContent.split("\n");
  580.                                         while (numberOfHelpStrings < 126) {
  581.                                                 texts2.push(originalLines[numberOfHelpStrings++]);
  582.                                         }
  583.                                 }
  584.                                
  585.                                 linesArea2.value = texts2.join("\n");
  586.                         };
  587.                         fr.readAsArrayBuffer(inputFile.files[0]);
  588.                 }
  589.         }, false);
  590.         generate.addEventListener('click', function () {
  591.                 var texts1 = linesArea1.value.split("\n");
  592.                 var texts2 = linesArea2.value.split("\n");
  593.                 if (texts1.length < 327) {
  594.                         if(confirm("The first box must contain atleast 327 lines. You have "+texts1.length+".\nClick OK to override.")) return;
  595.                 }
  596.                 if (texts2.length !== 126) {
  597.            if(!confirm("The second box must contain exactly 126 lines. You have "+texts2.length+".\nClick OK to override.")) return;
  598.                 }
  599.                 var offsetArraySize = texts1.length + 1;
  600.                 var offsetArray = new Uint32Array(offsetArraySize);
  601.                 var textArray = [0];
  602.                 var offindex = 1;
  603.                 var offset = 1;
  604.                 for (var i = 0; i < texts1.length; i++) {
  605.                         var str = texts1[i];
  606.                         var k = 0;
  607.                         while (k < str.length) {
  608.                                 textArray.push(str.charCodeAt(k++) & 0xFF);
  609.                         }
  610.                         textArray.push(0);
  611.                         offsetArray[offindex++] = offset;
  612.                         offset += str.length+1;
  613.                 }
  614.                 textArray = new Uint8Array(textArray);
  615.                 var textArraySize = textArray.length;
  616.        var names    = ["BATTLE1", "BATTLE3", "BATTLE4", "CARROT1", "CARROT1N", "CASTLE1", "CASTLE1N", "DAMN2", "DIAM1", "DIAM3", "HELL", "JUNG1", "LABRAT2", "MEDIVO1", "PSYCH1", "RACE1", "RACE2", "RACE3", "RACE4", "SHARE1", "SHARE2", "SHARE3", "TRAINER", "TREASUR3", "EASTER1", "EASTER2", "EASTER3", "HAUNTED1", "TOWN1", "TOWN2", "TOWN3"];
  617.        var unknowns   = new Uint8Array([3, 3, 4, 1, 4, 4, 6, 0, 4, 3, 1, 1, 1, 1, 0, 0, 0, 4, 4, 6, 2, 2, 15, 0, 15, 2, 2, 6, 5, 2, 5]);
  618.        var amounts    = new Uint8Array([4, 4, 5, 2, 4, 5, 7, 1, 5, 4, 2, 2, 2, 2, 1, 1, 1, 5, 5, 7, 3, 3, 16, 1, 8, 3, 3, 5, 6, 3, 6]);
  619.        var indices    = new Uint8Array([0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 0, 1, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 0, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 1, 2, 3, 4, 5, 6, 15, 0, 1, 2, 0, 1, 2, 0, 2, 3, 4, 6, 0, 1, 2, 3, 4, 5, 0, 1, 2, 0, 1, 2, 3, 4, 5 ]);
  620.                
  621.                 var offsets = [];
  622.                 var textArray2 = [];
  623.                 var i = 0;
  624.                 var offset = 0;
  625.                 for (var l = 0; l < names.length; l++) {
  626.                         var amount = amounts[l];
  627.                         offsets.push(offset);
  628.                        
  629.                         for (var a = 0; a < amount; a++) {
  630.                                 var str = texts2[i];
  631.                                 var k = 0;
  632.                                 textArray2.push(indices[i] || 0);
  633.                                 textArray2.push(str.length);
  634.                                 while (k < str.length) {
  635.                                         textArray2.push(str.charCodeAt(k++) & 0xFF);
  636.                                 }
  637.                                 i++;
  638.                                 offset += str.length + 2;
  639.                         }
  640.                        
  641.                        
  642.                 }
  643.                
  644.                 textArray2 = new Uint8Array(textArray2);
  645.                 var textArray2Size = textArray2.length;
  646.                 var levelEntryCount = names.length;
  647.                 var levelEntries = new Uint8Array(levelEntryCount*12);
  648.                 var dv = new DataView(levelEntries.buffer);
  649.                 var offset = 0;        
  650.                 for (var i = 0; i < levelEntryCount; i++) {
  651.                         var str = names[i];
  652.                         var k = 0;
  653.                         while (k < 8) {
  654.                                 levelEntries[offset++] = (str.charCodeAt(k++) || 0) & 0xFF;
  655.                         }
  656.                         levelEntries[offset++] = 0;
  657.                         levelEntries[offset++] = unknowns[i];
  658.                         dv.setUint16(offset, offsets[i], true);
  659.                         offset+=2;
  660.                 }
  661.                
  662.                 var blob = new Blob([
  663.                         new Uint32Array([
  664.                                 offsetArraySize,
  665.                                 textArraySize
  666.                         ]),
  667.                         textArray,
  668.                         offsetArray,
  669.                         new Uint32Array([levelEntryCount]),
  670.                         levelEntries,
  671.                         new Uint32Array([textArray2Size]),
  672.                         textArray2
  673.                 ]);
  674.                 saveAs(blob, filename);
  675.         }, false);
  676. }());
  677. </script>
  678. </body>
  679. </html>