Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------
- //--- 010 Editor v6.0.2 Script File
- //
- // File: MapToObject
- // Author:
- // Revision: 1.0
- // Purpose: Imports models on an adt as a doodadset of .wmo.
- //--------------------------------------
- char sFile[], tFile[];
- int sIndex, tIndex;
- sFile = InputOpenFileName("Select source file...");
- tFile = InputOpenFileName("Select destination file...");
- sIndex = FileOpen(sFile);
- if(sIndex < 0)
- return;
- RunTemplate("WoWADT1.bt");
- int i;
- TFindResults r = FindAll( "XDMM" );
- //Printf( "%Ld %Ld\n", r.start[i], r.size[i] );
- int64 st = r.start[i];
- int64 mmdx_ofs = st + 5;
- int64 mmdx_size = 1 * sizeof(ADT_file.filename texture) - 5;
- Printf( "Size of MMDX is %Ld\n", mmdx_size );
- Printf( "MMDX offset is %Ld\n", mmdx_ofs );
- uchar mmdx_buf[mmdx_size];
- ReadBytes( mmdx_buf, mmdx_ofs, mmdx_size );
- FileClose();
- tIndex = FileOpen(tFile);
- if(tIndex < 0)
- return;
- RunTemplate("WoWWMO.bt");
- int z;
- TFindResults r1 = FindAll( "NDOM" );
- //Printf( "%Ld %Ld\n", r1.start[z], r1.size[z] );
- int64 stm = r1.start[z];
- int64 modn_ofs = stm + 5;
- int64 dif_modn = r1.size[z] + 4;
- int64 modn_size = 1 * sizeof(wmo_file.modn) - dif_modn;
- Printf( "Size of MODN is %Ld\n", modn_size );
- Printf( "MODN offset is %Ld\n", modn_ofs );
- uchar modn_buf[modn_size] = 0;
- WriteBytes( modn_buf, modn_ofs, modn_size );
- InsertBytes( modn_ofs, mmdx_size - modn_size);
- WriteBytes(mmdx_buf, modn_ofs, mmdx_size);
- RunTemplate("WoWWMO.bt");
- //FileSave();
- //FileClose();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement