Advertisement
Guest User

Untitled

a guest
May 29th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. //--------------------------------------
  2. //--- 010 Editor v6.0.2 Script File
  3. //
  4. // File: MapToObject
  5. // Author:
  6. // Revision: 1.0
  7. // Purpose: Imports models on an adt as a doodadset of .wmo.
  8. //--------------------------------------
  9. char sFile[], tFile[];
  10. int sIndex, tIndex;
  11.  
  12.  
  13. sFile = InputOpenFileName("Select source file...");
  14. tFile = InputOpenFileName("Select destination file...");
  15.  
  16. sIndex = FileOpen(sFile);
  17. if(sIndex < 0)
  18. return;
  19.  
  20. RunTemplate("WoWADT1.bt");
  21.  
  22. int i;
  23. TFindResults r = FindAll( "XDMM" );
  24. //Printf( "%Ld %Ld\n", r.start[i], r.size[i] );
  25. int64 st = r.start[i];
  26. int64 mmdx_ofs = st + 5;
  27. int64 dif = r.size[i] + 4;
  28. int64 mmdx_size = 1 * sizeof(ADT_file.filename texture) - 5;
  29.  
  30. Printf( "Size of MMDX is %Ld\n", mmdx_size );
  31. Printf( "MMDX offset is %Ld\n", mmdx_ofs );
  32.  
  33. uchar mmdx_buf[mmdx_size];
  34.  
  35. ReadBytes( mmdx_buf, mmdx_ofs, mmdx_size );
  36.  
  37. FileClose();
  38.  
  39.  
  40. tIndex = FileOpen(tFile);
  41. if(tIndex < 0)
  42. return;
  43.  
  44. RunTemplate("WoWWMO.bt");
  45.  
  46. int z;
  47. TFindResults r1 = FindAll( "NDOM" );
  48. //Printf( "%Ld %Ld\n", r1.start[z], r1.size[z] );
  49. int64 stm = r1.start[z];
  50. int64 modn_ofs = stm + 5;
  51. int64 dif_modn = r1.size[z] + 4;
  52. int64 modn_size = 1 * sizeof(wmo_file.modn) - dif_modn;
  53.  
  54. Printf( "Size of MODN is %Ld\n", modn_size );
  55. Printf( "MODN offset is %Ld\n", modn_ofs );
  56.  
  57. uchar modn_buf[modn_size] = 0;
  58.  
  59.  
  60. WriteBytes( modn_buf, modn_ofs, modn_size );
  61. InsertBytes( modn_ofs, mmdx_size - modn_size);
  62. WriteBytes(mmdx_buf, modn_ofs, mmdx_size);
  63.  
  64. RunTemplate("WoWWMO.bt");
  65.  
  66.  
  67. //FileSave();
  68.  
  69. //FileClose();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement