Advertisement
Guest User

Untitled

a guest
May 29th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.56 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 mmdx_size = 1 * sizeof(ADT_file.filename texture) - 5;
  28.    
  29.     Printf( "Size of MMDX is %Ld\n", mmdx_size );
  30.     Printf( "MMDX offset is %Ld\n", mmdx_ofs );
  31.  
  32. uchar mmdx_buf[mmdx_size];
  33.  
  34. ReadBytes( mmdx_buf, mmdx_ofs, mmdx_size );
  35.  
  36. FileClose();
  37.  
  38.  
  39. tIndex = FileOpen(tFile);
  40. if(tIndex < 0)
  41.     return;
  42.  
  43. RunTemplate("WoWWMO.bt");
  44.  
  45. int z;
  46.     TFindResults r1 = FindAll( "NDOM" );
  47.     //Printf( "%Ld %Ld\n", r1.start[z], r1.size[z] );
  48. int64 stm = r1.start[z];
  49. int64 modn_ofs = stm + 5;
  50. int64 dif_modn = r1.size[z] + 4;
  51. int64 modn_size = 1 * sizeof(wmo_file.modn) - dif_modn;
  52.    
  53.     Printf( "Size of MODN is %Ld\n", modn_size );
  54.     Printf( "MODN offset is %Ld\n", modn_ofs );
  55.  
  56. uchar modn_buf[modn_size] = 0;
  57.  
  58.  
  59. WriteBytes( modn_buf, modn_ofs, modn_size );
  60. InsertBytes( modn_ofs, mmdx_size - modn_size);
  61. WriteBytes(mmdx_buf, modn_ofs, mmdx_size);
  62.  
  63. RunTemplate("WoWWMO.bt");
  64.  
  65.  
  66. //FileSave();
  67.  
  68. //FileClose();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement