Last update: 19/04/2004

Introduction

This documentation contains almost all the specifications of Warcraft III maps files (*.w3m and *.w3x). This was made without any help from Blizzard Entertainement and did not involve "reverse engineering" of the Warcraft III engine. The specification of each kind of file depend of its version. I did document here the current version used by Warcraft III Retail (initial version); make sure the file you're looking at or modifying are using the same version/format as describbed. I'm French so please, forgive my English! Finally, use this documentation at your own risks: I take no responsability if you corrupt your maps.

1) Things you need to know first to mod' a map!

1.1) Your environment

You'll need Warcraft III Retail installed let's say in "C:\Program Files\Warcraft III\". I'll talk about files of Warcraft 3 Retail (initial version) here, that's why some files format can vary depending which version you're using; you may have to figure out some differences in the file formats. If your Warcraft III installation is clean, you should have these files (of course, there are other files in there but I'll uses these for exemples):
in your "C:\Program Files\Warcraft III\":
   - war3.mpq
and in your "C:\Program Files\Warcraft III\Maps\":
   - (4)Lost Temple.w3m
   (and many other w3m of course...)

"W3M" map files can be opened with any MPQ editor that supports Warcraft 3.
You'll need one. I suggest WinMPQ (ShadowFlare), you can get it here:
   http://shadowflare.ancillaediting.net/dwnload.html#WinMPQ
   Read the documentation and installation notes.
You can also use MPQView and do the following:
   - get MPQView there:
        http://war3pub.net/upload/index.php?action=downloadfile&filename=mpqview11b.zip
   - then put the storm.dll that comes with Warcraft 3 Retail in your MPQView directory.
   - then create a text file called "list.txt" that contains the single line :

(listfile)
   - run MPQView and set the "data file" to your "list.txt".
   - open the mpq/w3m you want to read. You should see only one file called (listfile).
   - extract this file somewhere using "save" and set this new file as your "data file" for MPQView.
   - then you're supposed to have all the files displayed.
If you want to "play" with the map files, you'll also need a hexadecimal editor. My favorite one is HexWorkshop (http://www.bpsoft.com/).

1.2) Warcraft 3 Files

1.2.1) About  MPQ Files

MPQ are like "zip" or "rar" files as they contain a directory structure with compressed files.
I'll not talk about the MPQ format here since Quantam did it already. If you want to know more about it I suggest you go there:
http://www.campaigncreations.com/starcraft/inside_mopaq/

1.2.2) Warcraft III File Structure

When it's looking for a file, Warcraft III looks first in the "real" directories (the one you see in Windows Explorer) if you set up a specific registery key which is:
   Path: HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\
   Key name: "Allow Local Files"
   Key type: dword
   Key value: 1
If the registery key is not set or the file was not found in the "real" directories, then it looks in your map (w3m file), then in the last patch mpq (War3Patch.mpq) and finally in the main mpq (War3.mpq).
It means that you don't need to modify official MPQs (DON'T modify your War3.mpq!), you just need to use the same directory/file structure in your "C:\Program Files\Warcraft III\".
Adding files in a map (.w3m file) works with most of the files but not all.
It Works (for example) for:
   Units\unitUI.slk
   Units\UnitMetadata.slk
   Units\HumanUnitFunc.txt
   Units\HumanUnitStrings.txt
   Units\HumanAbilityFunc.txt
   Units\HumanAbilityStrings.txt
   Units\HumanUpgradeFunc.txt
   Units\HumanUpgradeStrings.txt

But it doesn't work for:
   Units\AbilityData.slk
   Units\MiscData.txt

When you really need to change a file that have to be loaded outside or before a map is loaded, I recommand you backup your "war3patch.mpq" and create a new one, add the files of the original war3patch.mpq and then add your modified files to that new "war3patch.mpq" you just created.
Don't forget to make a backup of your original war3patch.mpq! You may need to put it back when playing with other people (to avoid desync problems) or when you need to update your war3.

Example:
You have a file called "UI\MiscData.txt" in both "War3Patch.mpq" and "War3.mpq". Warcraft will use the one in "War3Patch.mpq". If you want to modify it, just create in your "C:\Program Files\Warcraft III\" diectory a "UI\" directory and extract the file "MiscData.txt" of your "War3Patch.mpq" there (you'll have: "C:\Program Files\Warcraft III\UI\MiscData.txt"). The set the registery key described above with regedit.
You can now modify it and next time you'll start War3, it'll use it instead of the original ones.

Warning!
  
- In some cases, if you play with others, everybody will need to have the same modified files or you'll get an error (like "netsync error").
   - Some files have a "special" format and if you modify them, you could "falsify" this format. In some cases it will work, in some others it won't. Be aware of that 'cause War3 will try to find a "standard file" instead (the ones of the MPQs instead of yours and you'll think it didn't try your stuff).
   - Some files outside both War3.mpq and War3Patch.mpq will not be used by Warcraft 3. These are exceptions.

1.2.3) Map files (W3M Files)

To edit a map, you'll have to unpack the files of the "w3m" somewhere, then modify them and finally put them back in a "w3m" file (usually a new one). Since retail, W3M are a little bit different from simple MPQ files: they got a header and a footer. I'll talk more about the W3M format in the "W3M Files Format" section and the other files inside W3Ms in the following sections.

1.3) Warcraft 3 Data Format

Blizzard uses several way to store data in its files. However they often use generic types.
-Integers

Intergers are stored using 4 bytes in "Little Endian" order. It means that the first byte read is the lowest byte.
They are just like the C++ "int" (signed) type. In some other documentation of this kind you may see them named "long".
Size: 4 bytes
Example: 1234 decimal = [00 00 04 D2]h will be stored in this order: [D2 04 00 00]h
-Short Integers
Short Integers are stored using 2 bytes in "Little Endian" order.
They are close to the C++ signed short but their range is from -16384 to 16383. It means the 2 highest bit are free of use for a flag for example.
Size: 2bytes
-Floats
Floats are using the standard IEEE 32bit float format. They are stored using 4 bytes and the "Little Endian" order.
They are just like the C++ "float" type.
Size: 4 bytes
Example: 7654.32 decimal, this number can't be stored using this format so the system will take the closest value that can be represented using binary digits. The closest one is: 7654.319824 decimal = [45 EF 32 8F]h and will be stored as [8F 32 EF 45]h
-Chars and Array of Chars
They are just stored like standard chars (1 char = 1 byte) and array of chars (no null terminating char needed).
Size (chars): 1 byte
Size (array of chars): usually 4 bytes
-Trigger Strings and Strings
Strings are just arrays of chars terminated with a null char (C++ '\0'). However Blizzard sometimes use special control codes to change the displayed color for the string. These codes are like "|c00BBGGRR" where "BB", "GG" and "RR" are hexadecimal values (using 2 digits each) for the blue, the green and the red values. If a string starts with "TRIGSTR_" (case sensitive), it's considered as a trigger string. A trigger string is kept in memory as is ("TRIGSTR_***") and is only changed when Warcraft 3 needs to display it. Instead of just writing "TRIGSTR_000" on the user screen, War3 will look in its trigger string table created when the map was loaded and display the corresponding trigger string instead. Trigger strings only work for files inside a w3m (Jass, w3i, ...) except for the WTS which is used to define the trigger string table itself. If the number following "TRIGSTR_" is negative the trigger string will refer to a null (empty) string, if "TRIGSTR_" is followed by text, it'll be considered as trigger string #0 ( = "TRIGSTR_000").
"TRIGSTR_7", "TRIGSTR_07", "TRIGSTR_007" and "TRIGSTR_7abc" are all representing trigger string #7. "TRIGSTR_ab7", "TRIGSTR_abc" and "TRIGSTR_" refer to trigger string #0. "TRIGSTR_-7" is negative and will not refer to a trigger string; it'll be displayed as "". By convention, "TRIGSTR_" is followed by 3 digits and the null char that ends the string.
Example 1: your got the string "blah |c000080FFblah", War3 will display "blah blah" but the second "blah" will be orange (blue=00 + green=80 + red=FF ==> orange)
Example 2: you got "TRIGSTR_025" and trigger string 25 is defined (in the .wts file) as "blah|c000080FFblah", it'll display the same result as the previous example.
Size (string): vary. String length + 1 (null terminating char)
Size (Trigger string): 12 bytes
-Flags
Flags are boolean values (true or false, 1 or 0). They can be stored using 4 bytes. Each bit is a flag (4 bytes = 32 bit = 32 flags). Blizzard uses integers to store its flags.
Size: usually 4 bytes
-Custom Types
Sometimes, an integer and one or several flags can share bytes. This is the case in the W3E file format: the water level and 2 flags are using the same group of 4 bytes. How? the 2 highest bit are used for the flags, the rest is reserved for the water level (the value range is just smaller). Sometimes a byte can contain two or more different data.
-Structures:
Warcraft 3 also uses structured types of various size.
 

2) W3M Files Format

A W3M file is a Warcraft III Map file (AKA Warcraft III Scenario in the World Editor). It's just a MPQ (using a "new" compression format) with a 512bytes header. Sometimes, for official W3M files, it uses a footer of 260 bytes for authentification purposes.

Here is the header format (fixed size = 512 bytes):
char[4]: file ID (should be "HM3W")
int: unknown
string: map name
int: map flags (these are exactly the same as the ones in the W3I file)
0x0001: 1=hide minimap in preview screens
0x0002: 1=modify ally priorities
0x0004: 1=melee map
0x0008: 1=playable map size was large and has never been reduced to medium
0x0010: 1=masked area are partially visible
0x0020: 1=fixed player setting for custom forces
0x0040: 1=use custom forces
0x0080: 1=use custom techtree
0x0100: 1=use custom abilities
0x0200: 1=use custom upgrades
0x0400: 1=map properties menu opened at least once since map creation
0x0800: 1=show water waves on cliff shores
0x1000: 1=show water waves on rolling shores
int: max number of players
followed by 00 bytes until the 512 bytes of the header are filled.

Here is the footer format (optionnal):
char[4]: footer sign ID (should be "NGIS" == 'sign' reversed)
byte[256]: 256 data bytes for authentification. I don't know how they are used at the moment.

The MPQ part can contain the following files:
(listfile)
(signature)
(attributes)
war3map.w3e
war3map.w3i
war3map.wtg
war3map.wct
war3map.wts
war3map.j
war3map.shd
war3mapMap.blp
war3mapMap.b00
war3mapMap.tga
war3mapPreview.tga
war3map.mmp
war3mapPath.tga
war3map.wpm
war3map.doo
war3mapUnits.doo
war3map.w3r
war3map.w3c
war3map.w3u
war3map.w3s
war3map.imp
war3mapImported\*.* (wave files, and other kind of files saved by the world editor)
We'll see now what these files stand for.

3) "war3map.j" The JASS2 Script

This is the main map script file. It's a text file and you can open it with notepad.
The language used is called JASS2 and has been developped by Blizzard. It's a case sensitive language.
When you play a map, the jass script is loaded and executed. To run it, Warcraft III looks for the function called "main".
The language uses several keywords as described here:

Key word Meaning
function used to define a new fonction
takes used to define the number of arguments for a fontction 
returns sets the type of the value returned by a function
return makes a function leaves and returns a value
endfunction ends a function definition
call used to call a function that returns nothing
globals used to define the list of global variables
endglobals ends the list of global variables definition
local defines a local variable
set assigns a value to a variable
if, elseif, else, then, endif if (...) then ...
elseif (...) then ...
else ...
endif

Just an "if-then-else-endif" chain like in Basic.

loop, exitwhen, endloop used to make loops in the script
constant defines a constant
type defines a new type/class
extends says what the mother type is
native defines a function header of an external built-in function implemented in Game.DLL

Only two "native types" exists: "nothing" and "handle". All the other types are derived (keyword "extends") from "handle". You can get the full list of types and native functions from the file called "Scripts\Common.j" in your War3.mpq file. You can assign several types of constant values to the handle type:  a generic null value called "null", any interger, any float, any string or trigger string, "true" and "false".

Here is the lis of operators recognized by the language:
Operator meaning
( ) parenthesis for priorities
+ addition (concatenation for strings)
- substraction
* multiplication
/ division
= assignation
= =, <, <=, >, >=, != comparison (equal, lighter, lighter or equal, greater, greater or equal, different)
not invert a boolean value 


The functions used by the World Editor are defined in "Scripts\Blizzard.j".
Example of a function definition:

function myfunction takes nothing returns integer
   local string str = "blah blah blah"
   local integer i
   // comments line
   set i = 0
   loop
      set i = i + 1
      if (i == 27) then
         call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, str)
      endif
      exitwhen i == 30
   endloop
   return i
endfunction 
 

4) "war3map.w3e" The environment

This is the tileset file. It contains all the data about the tilesets of the map. Let's say the map is divided into squares called "tiles". Each tile has 4 corners. In 3D, we define surfaces using points and in this case tiles are defined by their corners. I call one tile corner a "tilepoint". So if you want a 256x256 map, you'll have 257x257 tilepoints. That's also why a tile texture is defined by each of its four tilepoints. A tile can be half dirt, one quarter grass and one quarter rock for example. The first tilepoint defined in the file stands for the lower left corner of the map when looking from the top, then it goes line by line (horizontal). Tilesets are the group of textures used for the ground.
Here is the file format:
Header:
char[4]: file ID = "W3E!"
int: w3e format version [0B 00 00 00]h = version 11
char: main tileset [TS]

Tileset Meaning
A Ashenvale
Barrens
C Felwood
D Dungeon
Lordaeron Fall
G Underground
L Lordaeron Summer
N Northrend
Q Village Fall
V Village
W Lordaeron Winter
X Dalaran
Y Cityscape


int: custom tilesets flag (1 = using cutom, 0 = not using custom tilesets)
int: number a of ground tilesets used (Little Endian) (note: should not be greater than 16 because of tilesets indexing in tilepoints definition)
char[4][a]: ground tilesets IDs (tilesets table)
   Example: "Ldrt" stands for "Lordaeron Summer Dirt"
   (refer to the files "TerrainArt\Terrain.slk" located in your war3.mpq for more details)
int: number b of cliff tilesets used (Little Endian) (note: should not be greater than 16 because of tilesets indexing in tilepoints definition)
char[4][b]: cliff tilesets IDs (cliff tilesets table)
   Example: "CLdi" stands for Lordaeron Cliff Dirt
   (refer to the files "TerrainArt\CliffTypes.slk" located in your war3.mpq for more details)
int: width of the map + 1 = Mx
int: height of the map + 1 = My
   Example: if your map is 160x128, Mx=A1h and My=81h
float: center offeset of the map X
float: center offeset of the map Y
   These 2 offsets are used in the scripts files, doodads and more.
   The orginal (0,0) coordinate is at the bottom left of the map (looking from the top) and it's easier to work with (0,0) in the middle of the map so usually, these offsets are :
      -1*(Mx-1)*128/2 and -1*(My-1)*128/2
   where:
      (Mx-1) and (My-1) are the width and the height of the map
      128 is supposed to be the size of tile on the map
      /2 because we don't want the length but the middle.
      -1* because we're "translating" the center of the map, not giving it's new coordinates

Data:
Each tilepoint is defined by a block of 7 bytes.
The number of blocks is equal to Mx*My.
short: ground height
C000h: minimum height (-16384)
2000h: normal height (ground level 0)
3FFFh: maximum height (+16383)
short: water level + map edge boundary flag*(see notes)
4bit: flags*(see notes)
4bit: ground texture type (grass, dirt, rocks,...)
1byte: texture details (of the tile of which the tilepoint is the bottom left corner) (rocks, holes, bones,...). It appears that only a part of this byte is used for details. It needs more investigations
4bit: cliff texture type
4bit: layer height

*flags notes:
Flags values (shown as big endian):
   0x4000 --> boundary flag 1 (shadow generated by the world editor on the edge of the map)
   0x0010 --> ramp flag (used to set a ramp between two layers)
   0x0020 --> blight flag (ground will look like Undead's ground)
   0x0040 --> water flag (enable water)
   0x0080 --> boundary flag 2 (used on "camera bounds" area. Usually set by the World Editor "boundary" tool.)

Water level:
Water level is stored just like ground height. The highest bit (bit 15) is used for the boundary flag 1.

Tilepoint data example:
51 21 00 62 56 84 13
51 21 --(little endian)--> 0x2151 --(hex-->dec)--> height = 8529
00 62 --(little endian)--> 0x6200
   (extract boundary flag)--> (0x6200 & 0xC000) = 0x4000 boundary flag set
   (extract water data)--> (0x6200 & 0x3FFF) = 0x2200 --(hex-->dec)--> water level = 8704
56 --> 5 sets both water flag and ramp flag, 6 means tilepoint is using ground type #6 in the tilesets table
84 --> means tilepoint is using detail texture #132 (=0x084)
13 --> 1 means cliff type #1 (cliff tilesets table), 3 means tilepoint on layer "3"
The tilepoint "final height" you see on the WE is given by:
(ground_height - 0x2000 + (layer - 2)*0x0200)/4
where "0x2000" is the "ground zero" level, 2 the "layer zero" level and "0x0200" the layer height
   = (0x2151 - 0x2000 + 1*0x0200)/4
   = (8529 - 8192 + 512)/4
   = 212,25

The tilepoint "water level" you see on the WE is given by:
(water_level - 0x2000)/4 - 89.6
where "0x2000" is the "ground zero" level, -89.6 is the water zero level (given by the water.slk file height = -0,7 --> water_zero_level = -0,7*128):
   = 8704/4 - 89,6
   = 38,4

In this case, water flag is set and water level is below the ground level so we will not see the water. This is just an example and I don't think you can find such a tilepoint on a map. It was just here for demonstration purpose.

5) "war3map.shd" The Shadow Map File

This file has no header, only raw data.
Size of the file = 16*map_width*map_height
1byte can have 2 values:
00h = no shadow
FFh = shadow
Each byte set the shadow status of 1/16 of a tileset.
It means that each tileset is divided in 16 parts (4*4).

6) "war3mapPath.tga" The Image Path file and/or "war3map.wpm" The Path Map File

Only one of these two file is used for pathing. Old War3 beta versions (<=1.21) use the "war3mapPath.tga".
Since beta 1.30, Warcraft 3 uses a new file format instead: "war3map.wpm".

6.1) "war3mapPath.tga" The Image Path file

It's an standard 32bits RGB TGA file with no compression and a black alpha channel. The TGA format is really important because if Warcraft III doesn't recognise the file format, it'll do weird things on the tilesets (like put blight everywhere)! Don't forget the alpha channel! Each tile of the map is divided in 16 pixels (4*4 like in the shadow file), so the TGA width is 4*map_width and its height is 4*map_height and each pixel on the TGA affects a particular part of a tileset on the map. The color of a pixel sets the rules for that part. The top left corner of the image is the upper left corner on the map.

Header format (18 bytes):
byte: ID Length = 0
byte: Color Map Type = 0
byte: Image Type = 2 (uncompressed RGB)
-- Color Map Specification (5 bytes) --
byte[2]: First Entry Index = 0
byte[2]: Color Map Length = 0
byte: Color Map Entry Size = 0
-- Image Spec (10 bytes) --
byte[2]: X origin = 0
byte[2]: Y origin = 0
byte[2]: image width (little endian)
byte[2]: image height (little endian)
byte: Pixel depth = 32 (=0x20)
byte: Image Descriptor = 0x28 (0x20=image starts from top left, 0x08=8bit for alpha chanel)
Example (where "XX XX" is a width and "YY YY" a height):
00 00 02 00 00 00 00 00 00 00 00 00 XX XX YY YY 20 28

Data:
One pixel is defined by 4 bytes:
BB GG RR AA
Where:
BB is the blue value (0 or 255)
GG is the green value (0 or 255)
RR is the red value (0 or 255)
AA is the alpha chanel value (set to 0)
There are 4*4 pixels for 1 tileset.
The TGA width is map_width*4.
The TGA height is map_height*4.

Here is the color code:

Color Build state Walk state Fly state
White  no build no walk no fly
Red  build ok no walk fly ok
Yellow build ok no walk no fly
Green  build ok walk ok no fly
Cyan  no build walk ok no fly
Blue  no build walk ok fly ok
Magenta  no build no walk fly ok
Black  build ok fly ok walk ok

To sum up, when red is set it means "no walk", when green is set "no fly" and when blue is set "no build".
The alpha channel is used to set where blight is (black = normal, white = blight).

6.2) "war3map.wpm" The Path Map File

Header:
char[4]: file ID = 'MP3W'
int: file version = 0
int: path map width (=map_width*4)
int: path map height (=map_height*4)

Data:
Each byte of the data part is a part of a tileset exactly like for the TGA.
Data size: (map_height*4)*(map_with*4) bytes
Flags table:
0x01: 0 (unused)
0x02: 1=no walk, 0=walk ok
0x04: 1=no fly, 0=fly ok
0x08: 1=no build, 0=build ok
0x10: 0 (unused)
0x20: 1=blight, 0=normal
0x40: 1=no water, 0=water
0x80: 1=unknown, 0=normal

Exmaple:
value: use:
00 bridge doodad
08 shallow water
0A deep water
40 normal ground
48 water ramp, unbuildable grounds, unbuildable parts of doodads
CA cliff edges, solid parts of doodads (no build and no walk)
CE edges of the map (boundaries)

7) "war3map.doo" The doodad file for trees

The file contains the trees definitions and positions.
Here is the Format:
Header:
char[4]: file ID = "W3do"
int: file version = 7
int: unknown (usually set to [09 00 00 00]h, rarely [07 00 00 00]h)
int: number of trees defined
Data:
Each tree is defined by a block of 42 bytes organized like this:
char[4]: Tree ID (can be found in the file "Units\DestructableData.slk")
int: Variation (little endian)
float: Tree X coordinate on the map
float: Tree Y coordinate on the map
float: Tree Z coordinate on the map
float: Tree angle (radian angle value)(degree = radian*180/pi)
float: Tree X scale
float: Tree Y scale
float: Tree Z scale
byte: Tree flags*
byte: Tree life (integer stored in %, 100% is 0x64, 170% is 0xAA for example)
int: Tree ID number in the World Editor (little endian) (each tree has a different one)

*flags:
0= invisible and non-solid tree
1= visible but non-solid tree
2= normal tree (visible and solid)

To sum up how it looks:
tt tt tt tt vv vv vv vv xx xx xx xx yy yy yy yy zz zz zz zz aa aa aa aa xs xs xs xs ys ys ys ys zs
zs zs zs ff ll dd dd dd dd
where:
tt: type
vv: variation
xx: x coordinate
yy: y coordinate
zz: z coordinates
aa: rotation angle
xs: x scale
ys: y scale
zs: z scale
ff: flags
ll: life
dd: doodad number in the editor

Example (this is the second tree of Legend):
4C 54 6C 74 08 00 00 00 00 00 74 45 00 00 70 44 00 10 24 44 E5 CB 96 40 98 85 98 3F 98 85 98 3F 98 85 98 3F 02 64 8D 01 00 00

4C 54 6C 74 --> LTlt (tree type)
08 00 00 00 --> 00000008 = variation #8 (changes the shape of the tree)
00 00 74 45 --> X=3904.
00 00 70 44 --> Y=960.
00 10 24 44 --> Z=656.25
E5 CB 96 40 --> Angle (float value=4.7123895, angle=270°)
98 85 98 3F --> X_Scale=1.191577
98 85 98 3F --> Y_Scale=1.191577
98 85 98 3F --> Z_Scale=1.191577
02 --> tree is solid and selectable
64 --> life=100% of default tree life
8D 01 00 00 --> 0000018D=397, tree number 397

After the last tree definition, there are 4 bytes set to '0' (dunno if it's a version or not).
int: number "s" of "special" doodads ("special" like cliffs,...)
Then "s" times a special doodad structure (16 bytes each):
char[4]: doodad ID
byte[4]: ? (0)
int: X? (w3e coordinates)
int: Y? (w3e coordinates)
 

NEW "Frozen Throne expansion pack beta" format:
Header:
char[4]: file ID = "W3do"
int: file version = 8
int: unknown ([0B 00 00 00]h)
int: number of trees defined
Data
Each tree is defined by a block of 50 bytes organized like this:
char[4]: Tree ID (can be found in the file "Units\DestructableData.slk")
int: Variation (little endian)
float: Tree X coordinate on the map
float: Tree Y coordinate on the map
float: Tree Z coordinate on the map
float: Tree angle (radian angle value)(degree = radian*180/pi)
float: Tree X scale
float: Tree Y scale
float: Tree Z scale
byte: Tree flags*
byte: Tree life (integer stored in %, 100% is 0x64, 170% is 0xAA for example)
int: unknown (-1)
int: unknown (0)
int: Tree ID number in the World Editor (little endian) (each tree has a different one)

*flags:
0= invisible and non-solid tree
1= visible but non-solid tree
2= normal tree (visible and solid)

To sum up how it looks:
tt tt tt tt vv vv vv vv xx xx xx xx yy yy yy yy zz zz zz zz aa aa aa aa xs xs xs xs ys ys ys ys zs
zs zs zs ff ll bb bb bb bb cc cc cc cc dd dd dd dd
where:
tt: type
vv: variation
xx: x coordinate
yy: y coordinate
zz: z coordinates
aa: rotation angle
xs: x scale
ys: y scale
zs: z scale
ff: flags
ll: life
bb: unknown
cc: unknown
dd: doodad number in the editor
 

8) "war3mapUnits.doo" The doodad file for items and such

The file contains the doodad units definitions and positions.
Here is the Format:
Header:
char[4]: file ID = "W3do"
int: file version = 7
int: unknown (often set to [09 00 00 00]h)
int: number of doodad units defined
Data
Each doodad is defined by a block of bytes (vraiable length) organized like this:
char[4]: type ID
int: variation
float: coordinate X
float: coordinate Y
float: coordinate Z
float: rotation angle
float: scale X
float: scale Y
float: scale Z
byte: flags*
int: player number (owner) (player1 = 0, 16=neutral passive)
byte: unknown
byte: unknown
int: hit points (-1 = use default)
int: unknown (usually -1)
int: number "s" of dropped item sets
"s" times dropped item sets structures:
int: number "d" of dropable items
"d" times dropable items structures:
char[4]: item ID ([00 00 00 00]h = none)
if item ID starts with "YYI" followed by a number "num", then random item of level = num
int: % chance to be dropped
int: gold amount (default = 12500)
float: unknown (often set to -1)
int: unknown (often set to 1)
int: unknown
int: unknown
int: random Unit
0 = Any neutral passive building
1 = random unit from random group
2 = random unit from custom table
int: random unit type any neutral passive building of level
int: custom color (-1 = none, 0 = red, 1=blue,...)
int: Waygate: active destination number (-1 = none)
int: creation number
*flags: may be similar to the war3map.doo flags

9) "war3map.w3i" The info file

It contains some of the info displayed when you start a game.

Format:
int: file format version = 18
int: number of saves (map version)
int: editor version (little endian)
String: map name
String: map author
String: map description
String: players recommended
float[8]: "Camera Bounds" as defined in the JASS file
int[4]: camera bounds complements* (see note 1) (ints A, B, C and D)
int: map playable area width E* (see note 1)
int: map playable area height F* (see note 1)
   *note 1:
   map width = A + E + B
   map height = C + F + D
int: flags
   0x0001: 1=hide minimap in preview screens
   0x0002: 1=modify ally priorities
   0x0004: 1=melee map
   0x0008: 1=playable map size was large and has never been reduced to medium (?)
   0x0010: 1=masked area are partially visible
   0x0020: 1=fixed player setting for custom forces
   0x0040: 1=use custom forces
   0x0080: 1=use custom techtree
   0x0100: 1=use custom abilities
   0x0200: 1=use custom upgrades
   0x0400: 1=map properties menu opened at least once since map creation (?)
   0x0800: 1=show water waves on cliff shores
   0x1000: 1=show water waves on rolling shores
char: map main ground type
   Example: 'A'= Ashenvale, 'X' = City Dalaran
int: Campaign background number (-1 = none)
String: Map loading screen text
String: Map loading screen title
String: Map loading screen subtitle
int: Map loading screen number (-1 = none)
String: Prologue screen text
String: Prologue screen title
String: Prologue screen subtitle
int: max number "MAXPL" of players
array of structures: then, there is MAXPL times a player data like described below.
int: max number "MAXFC" of forces
int: Foces Flags
   0x00000001: allied (force 1)
   0x00000002: allied victory
   0x00000004: share vision
   0x00000010: share unit control
   0x00000020: share advanced unit control
int: unknown (usually -1)
array of structures: then, there is MAXFC times a force data like described below.
int: if 0 it means that we reach the end of the w3i
   if it's non-zero, the following bytes define special settings for the map (techtree, upgrades,...)

Players data format:
int: unknown
int: player type
   1=Human, 2=Computer, 3=Neutral, 4=Rescuable
int: player race
   1=Human, 2=Orc, 3=Undead, 4=Night Elf
int: 00000001 = fixed start position
String: Player name
float: Starting coordinate X
float: Starting coordinate Y
int: ally low priorities flags (bit "x"=1 --> set for player "x")
int: ally high priorities flags (bit "x"=1 --> set for player "x")

Forces data format:
String: Force name
int: unknown
int: unknown

NEW "Frozen Throne expansion pack beta" format:
int: file format version = 19 (and 25 thx PitzerMike)
int: number of saves (map version)
int: editor version (little endian)
String: map name
String: map author
String: map description
String: players recommended
float[8]: "Camera Bounds" as defined in the JASS file
int[4]: camera bounds complements* (see note 1) (ints A, B, C and D)
int: map playable area width E* (see note 1)
int: map playable area height F* (see note 1)
   *note 1:
   map width = A + E + B
   map height = C + F + D
int: flags
   0x0001: 1=hide minimap in preview screens
   0x0002: 1=modify ally priorities
   0x0004: 1=melee map
   0x0008: 1=playable map size was large and has never been reduced to medium (?)
   0x0010: 1=masked area are partially visible
   0x0020: 1=fixed player setting for custom forces
   0x0040: 1=use custom forces
   0x0080: 1=use custom techtree
   0x0100: 1=use custom abilities
   0x0200: 1=use custom upgrades
   0x0400: 1=map properties menu opened at least once since map creation (?)
   0x0800: 1=show water waves on cliff shores
   0x1000: 1=show water waves on rolling shores
   0x2000: 1=unknown
   0x4000: 1=unknown
   0x8000: 1=unknown
char: map main ground type
   Example: 'A'= Ashenvale, 'X' = City Dalaran
int: Campaign background number (-1 = none)
String: Map loading screen text
String: Map loading screen title
String: Map loading screen subtitle
String: unknown
int: Map loading screen number (-1 = none)
(v25): String: (? need some investigations, should be the path of the custom loading screen)
String: Prologue screen text
String: Prologue screen title
String: Prologue screen subtitle
String: unknown
float: unknown (fog z start?)
float: unknown (fog z end?)
float: unknown (fog intensity?)
byte[10]: ? (maybe some strings?)
int: unknown (-1)
int: max number "MAXPL" of players
array of structures: then, there is MAXPL times a player data like described below.
int: max number "MAXFC" of forces
int: Foces Flags
   0x00000001: allied (force 1)
   0x00000002: allied victory
   0x00000004: share vision
   0x00000010: share unit control
   0x00000020: share advanced unit control
int: unknown (usually -1)
array of structures: then, there is MAXFC times a force data like described below.
int: if 0 it means that we reach the end of the w3i
   if it's non-zero, the following bytes define special settings for the map (techtree, upgrades,...)

Players data format:
int: unknown
int: player type
   1=Human, 2=Computer, 3=Neutral, 4=Rescuable
int: player race
   1=Human, 2=Orc, 3=Undead, 4=Night Elf
int: 00000001 = fixed start position
String: Player name
float: Starting coordinate X
float: Starting coordinate Y
int: ally low priorities flags (bit "x"=1 --> set for player "x")
int: ally high priorities flags (bit "x"=1 --> set for player "x")

Forces data format:
String: Force name
int: unknown
int: unknown
int: unknown
 

10) "war3map.wts" The trigger string data file

Open it with notepad and you'll figure out how it works. Each trigger string is defined by a number (trigger ID) and a value for this number. When Warcraft meets a "TRIGSTR_***" (where "***" is supposed to be a number), it will look in the trigger string table to find the corresponding string and replace the trigger string by that value. The value for a specific trigger ID is set only once by the first definition encountered for this ID: if you have two times the trigger string 0 defined, only the first one will count. The number following "STRING " must be positive: any negative number will be ignored. If text follows "STRING ", it'll be considered as number 0.

String definition:
It always start with "STRING " followed by the trigger string ID number which is supposed to be different for each trigger string. Then "{" indicates the begining of the string value followed by a string which can contain several lines and "}" that indicates the end of the trigger string definition.

Example:
in the .WTS file you have:

STRING 0
{
Blah blah blah...
}

Then either in the .J, or in the .W3I, Warcraft finds a TRIGSTR_000, it'll look in the table for
trigger string number 0 and it'll find that the value to use is "Blah blah blah" instead of "TRIGSTR_000".

11) "war3mapMap.blp" the minimap image (with the help of BlacKDicK)

The BLP file contain the JPEG header and the JPEG raw data separated.
BLP stands for "Blip" file which I guess is a "BLIzzard Picture".

Header:
char[4]: file ID ("BLP1")
int: 0 for JPGblp, 1 for Paletted
int: 0x00000008 = has alpha, 0x00000000 = no alpha
int: image width
int: image height
int: flag for team colors (usually 3, 4 or 5). If >=5 on 'unit' textures, it won't show the team color.
int: always 0x00000001, if 0x00000000 the model that uses this texture will be messy.
int: mipmap offset (offset from the begining of the file)
int[15]: unknown
int: mipmap size (header size) "h" (usually 0x00000270)
byte[h]: header
followed by 0 bytes until the begining of the jpeg data.
address=mipmap offset: raw jpeg data till the end of the file

12) "war3map.mmp" The menu minimap

Header:
int: unknown (usually 0, maybe the file format)
int: number of datasets

Data:
The size of a dataset is 16 bytes.
int: icon type
   Icons Types:
      00: gold mine
      01: house
      02: player start (cross)
int: X coordinate of the icon on the map
int: Y coordinate of the icon on the map
   Map Coordinates:
      top left: 10h, 10h
      center: 80h, 80h
      bottom right: F0h, F0h
byte[4]: player icon color
   Player Colors (BB GG RR AA = blue, green, red, alpha channel):
      03 03 FF FF : red
      FF 42 00 FF : blue
      B9 E6 1C FF : cyan
      81 00 54 FF : purple
      00 FC FF FF : yellow
      0E 8A FE FF : orange
      00 C0 20 FF : green
      B0 5B E5 FF : pink
      97 96 95 FF : light gray
      F1 BF 7E FF : light blue
      46 62 10 FF : aqua
      04 2A 49 FF : brow
      FF FF FF FF : none

13) "war3map.w3u" The custom units file

Most of the W3U File specifications is from BlacKDicK.
W3U files have a initial long and then comes two tables. Both look the same.
First table is original units table (Original Blizzard Units).
Second table is user-created units table (Units created by the map designer).

Header:
int: W3U Version = 1
x bytes: Original Units table*
y bytes: User-created units table*

Data:
*Table definition:
int: number n of units on this table.
If 0 on original table, then skip default unit table. This is the number of following units. Even if we don't have any changes on original table, this value must be there.
n times a unit definition structure*.

*Unit definition structure:
char[4]: original unit ID (get the IDs from "Units\UnitData.slk" of war3.mpq)
char[4]: new unit ID. If it is on original table, this is 0, since it isn't used.
int: number m of modifications for this unit
m times a modification structure*

*Modification structure:
char[4] modification ID code (get the IDs from "Units\UnitMetaData.slk" of war3.mpq)
int: variable type* t (0=int, 1=real, 2=unreal, 3=String,...)
t type: value (length depends on the type t specified before)
int: end of unit definition (usually 0)

*Variable types:
0=int
1=real
2=unreal
3=string
4=bool
5=char
6=unitList
7=itemList
8=regenType
9=attackType
10=weaponType
11=targetType
12=moveType
13=defenseType
14=pathingTexture
15=upgradeList
16=stringList
17=abilityList
18=heroAbilityList
19=missileArt
20=attributeType
21=attackBits

14) "war3map.wtg" The triggers names file

Header:
char[4]: file ID (WTG!)
int: wtg file format version = 4
int: number "a" of triggers categories
"a" times a category definition structure*
int: number "b" ???
int: number "c" of variables
"c" times a variable definition structure**
int: number "d" of triggers
"d" times a trigger definition structure***

*Category Definition Structure:
int: category index
String: category name

**Variable Definition Structure:
String: variable name
String: variable type
int: number "e" ???
int: array status: 0=not an array, 1=array
int: initialisation status: 0=not initialized, 1=initialized
String: initial value (string)

***Triggers Definiton Structure:
String: trigger name
String: trigger description
int: enable state: 0=disabled, 1=enabled
int: custom text trigger state: 0=not a custom text trigger, 1=custom text trigger (use data in the WCT)
int: initial state: 0=initially on, 1=not initially on
int: ???
int: index of the category the trigger belongs to
int: number "i" of event-condition-action (ECA) function
"i" times an ECA function definition structure*(4) (if it's a custom text trigger i should be 0 so we don't have

this section)

*(4)ECA function definition structure
int: function type: 0=event, 1=condition, 2=action
String: function name
int: enable state: 0=function disabled, 1=function enabled
"x" times a parameter structure*(5). x depends of the function and is hardcoded.

*(5)Parameters Structure:
int: 0=preset, 1=variable, 2=function
String: parameter value
int: ???
int: ???

NEW "Frozen Throne expansion pack beta" format (thanks Ziutek):
Header:
char[4]: file ID (WTG!)
int: wtg file format version = 7
int: number "a" of triggers categories
"a" times a category definition structure*
int: number "b" ???
int: number "c" of variables
"c" times a variable definition structure**
int: number "d" of triggers
"d" times a trigger definition structure***

*Category Definition Structure:
int: category index
String: category name
int: Category type: 0=normal, 1=comment

**Variable Definition Structure:
String: variable name
String: variable type
int: number "e" ???
int: array status: 0=not an array, 1=array
int: array size
int: initialisation status: 0=not initialized, 1=initialized
String: initial value (string)

***Triggers Definiton Structure:
String: trigger name
String: trigger description
int: trigger type: 0=normal, 1=comment
int: enable state: 0=disabled, 1=enabled
int: custom text trigger state: 0=not a custom text trigger, 1=custom text trigger (use data in the WCT)
int: initial state: 0=initially on, 1=not initially on
int: run on map initialization: 0=no, 1=yes
int: index of the category the trigger belongs to
int: number "i" of event-condition-action (ECA) function
"i" times an ECA function definition structure*(4) (if it's a custom text trigger it should be 0 so we don't have this section)

*(4)ECA function definition structure
int: function type: 0=event, 1=condition, 2=action
String: function name
int: enable state: 0=function disabled, 1=function enabled
"x" times a parameter structure*(5). x depends of the function and is hardcoded.
int: ???
int: number "i" of event-condition-action (ECA) function
"i" times an ECA function definition structure*(4)(if this trigger doesn't have multiple actions it should be set to 0 so we don't have this section)

*(5)Parameters Structure:
int: type which can be 0=preset, 1=variable, 2=function, 3=string
String: parameter value
int: begin function (if it is function it should be set to 1 otherwise to 0)
     if begin function is set to 1:
     int: type: 3
     String: the same as parameter value
     int: begin function: 1
     "x" times a parameters structure*(5). x depends on the function and is hardcoded.
int: end function (always set to 0)
 

15) "war3map.w3c" The camera file

Header:
int: file version = 0
int: number "n" of camera definition structures

Camera definition structure:
float: Target X
float: Target Y
float: Z Offset
float: Rotation (angle in degree)
float: Angle Of Attack (AoA) (angle in degree)
float: Distance
float: Roll
float: Field of View (FoV) (angle in degree)
float: Far Clipping (FarZ)
float: ??? (usually set to 100)
String: Cinematic name

16) "war3map.w3r" The triggers regions file

Header:
int: version = 5
int: number "n" of region definition structures*

Data:
"n" times a region definition structure

*Region Definition Structures:
float: left (jass coordinates)
float: right (jass coordinates)
float: bottom (jass coordinates)
float: top (jass coordinates)
String: region name
int: Region index number (creation number)
char[4]: weather effect ID (ex.: "RLlr" for "Rain Lordaeron Light Rain")
If all the chars are set to 0, then weather effect is disabled.
String: ambient sound (a sound ID name defined in the w3s file like "gg_snd_HumanGlueScreenLoop1")
bytes[3]: region color (used by the World Editor) (BB GG RR)
byte: end of the structure

17) "war3map.w3s" The sounds definition file

Header:
int: file format version = 1
int: number "n" of sounds defined

Data:
"n" times a sound definition structure*

*Sound definition structure:
String: sound ID name (like "gg_snd_HumanGlueScreenLoop1")
String: sound file (like "Sound\Ambient\HumanGlueScreenLoop1.wav")
String: EAX effects (like "DefaultEAXON")
   DefaultEAXON=Default
   CombatSoundsEAX=combat
   KotoDrumsEAX=drums
   SpellsEAX=spells
   MissilesEAX=missiles
   HeroAcksEAX=hero speech
   DoodadsEAX=doodads
int: sound flags
   0x00000001=looping
   0x00000002=3D sound
   0x00000004=stop when out of range
   0x00000008=music
   0x00000010=
int: fade in rate
int: fade out rate
int: volume (-1=use default value)
float: pitch
float: ???
int: ??? (-1 or 8)
int: channel:
   0=General
   1=Unit Selection
   2=Unit Acknowledgement
   3=Unit Movement
   4=Unit Ready
   5=Combat
   6=Error
   7=Music
   8=User Interface
   9=Looping Movement
   10=Looping Ambient
   11=Animations
   12=Constructions
   13=Birth
   14=Fire
float: min. distance
float: max. distance
float: distance cutoff
float: ???
float: ???
int: ??? (-1 or 127)
float: ???
float: ???
float: ???

Note:
Floats value can be set or left unset (default value will be used)
When a float is not set, the value [4F800000]h = 4.2949673e+009 is used.

18) "war3map.wct" The custom text trigger file

(with the help of BlackDick)
int: file version (0)
int: number "n" of triggers
"n" times a custom text trigger structure*
Note: Custom text trigger structures are defined using the same order as triggers they belong to in the WTG.
Each trigger must have its custom text part, even if it has not been converted to a custom text trigger; in this case, the custom text size is set to 0 (only 4 bytes for the size int).

*Custom Text Trigger Structure:
int: size "s" of the text (including the null terminating char)
String: custom text trigger string (contains "s chars including the null terminating char)

NEW "Frozen Throne expansion pack beta" format (thanks Ziutek):
int: file version: 1
String: custom script code comment
1 time a custom text trigger structure*
int: number "n" of triggers
"n" times a custom text trigger structure*
Note: Custom text trigger structures are defined using the same order as triggers they belong to in the WTG.
Each trigger must have its custom text part, even if it has not been converted to a custom text trigger; in this case, the custom text size is set to 0 (only 4 bytes for the size int).

*Custom Text Trigger Structure:
int: size "s" of the text (including the null terminating char)
String: custom text trigger string (contains "s chars including the null terminating char)
 

19) "war3map.imp" The imported file list

Header:
int: file format version
int: number "n" of imported files

Data:
1byte: tells if the path is complete or needs "war3mapImported\" (5 or 8= standard path, 10 or 13: custom path) (thx PitzerMike)
String["n"]: the path inside the w3m of each imported file (like "war3mapImported\mysound.wav")

Note: any file added in the W3M file with a path name starting with "war3mapImported\" and added in the .imp
will NOT be removed by the World Editor each time you save your map. Unfortuneately, if your file path name
doesn't start with "war3mapImported\", it will not be saved by the World Editor even if you add it to the
import file. If you add a file with a pathname starting with "war3mapImported\"

20) "war3map.wai" The Artificial Intelligence file

File for the "Frozen Throne expansion pack beta" only (thanks to Ziutek)

int: wai file format version: 2
string: AI name
int: race: 0=Custom, 1=Human, 2=Orc, 3=Undead, 4=Night Elf
int: options
Unless otherwise noted all of the options are contained in HiWord of options integer.
Check for the presence of options by using a mask with following values:

SetPlayerName: 0x2000
Melee: 0x0001
DefendUsers: 0x8000
RandomPaths: 0x4000
TargetHeroes: 0x0002
RepairStructures: 0x0004
HeroesFlee: 0x0008
UnitsFlee: 0x0010
GroupsFlee: 0x0020
HaveNoMercy: 0x0040
IgnoreInjured: 0x0080
RemoveInjuries: 0x1000
TakeItems: 0x0100
BuyItems: 0x0001 LoWord
SlowHarvesting: 0x0200
AllowHomeChanges: 0x0400
SmartAltillery: 0x0800

int: number of following workers and buildings. If there are less than 4 workers and buildings specified, WorldEdit will choose default values. Should be: 4.
char[4]: gold worker
char[4]: wood worker
char[4]: base building
char[4]: mine building (If none, use the same identifer as base building)

int: number "a" of conditions
int: ???: 7
"a" times a conditions definition structure*
char[4]: First Hero Used (if none set these values to null otherwise set it to Unit ID)
char[4]: Second Hero Used (if none set these values to null otherwise set it to Unit ID)
char[4]: Third Hero Used (if none set these values to null otherwise set it to Unit ID)
int: Training Order % Chance(1.FirstHero,2.SecondHero,3.ThirdHero)
int: Training Order % Chance(1.FirstHero,2.ThirdHero,3.SecondHero)
int: Training Order % Chance(1.SecondHero,2.FirstHero,3.ThirdHero)
int: Training Order % Chance(1.SecondHero,2.ThirdHero,3.FirstHero)
int: Training Order % Chance(1.ThirdHero,2.FirstHero,3.SecondHero)
int: Training Order % Chance(1.ThirdHero,2.SecondHero,3.FirstHero)

Skill Selection Order:
char[4*10]: Ten Skill IDs for First Hero(as first hero)
char[4*10]: Ten Skill IDs for First Hero(as second hero)
char[4*10]: Ten Skill IDs for First Hero(as third hero)
char[4*10]: Ten Skill IDs for Second Hero(as first hero)
char[4*10]: Ten Skill IDs for Second Hero(as second hero)
char[4*10]: Ten Skill IDs for Second Hero(as third hero)
char[4*10]: Ten Skill IDs for Third Hero(as first hero)
char[4*10]: Ten Skill IDs for Third Hero(as second hero)
char[4*10]: Ten Skill IDs for Third Hero(as third hero)
int: number "c" of Build Priorities
"c" times build priorities structure***
int: number "d" of Harvest Priorities
"d" times harvest priorities structure *(4)
int: number "e" of Target Priorities
"e" times target priorities structure *(5)
int: repeats waves
int: minimum forces: attack group index(for First Hero Only set this value to char[4]:HAIA)
int: initial delay
int: number "f" of Attack Groups
"f" times attack groups structure *(6)
int: number "g" of Attack Waves
"g" times attack waves structure *(8)
int: ???: 1
int: game options
Unless otherwise noted all of the options are contained in HiWord of options integer.
Check for the presence of options by using a mask with following values:

Disable Fog Of War: 0x0001
Disable Victory/Defeat Conditions: 0x0002

int: regular game speed
string: path to map file
int: number "h" of Players (0-2)
"h" times players structure *(9)
int: ???


*Condition Definition Structure:
int: condition index
String: condition name
int: number "b": 0=none(empty condition), 1=condition
if number "b" = 1
String: operator function name
int: begin function: 1
"x" times a Parameters Structure**. x depends on the function and is hardcoded.
int: end function: 0


**Parameters Structure:
int: type: 0=preset, 1=operator function, 2=function, 3=string
String: parameter value (if it is function and this value is empty, begin function means '(' and end function means ')' )
int: begin function (if it is function or operator function it should be set to 1 otherwise to 0)
if it is function and parameter value is not empty:
int: type: 3
String: the same as parameter value
int: begin function: 1
"x" times a Parameters Structure**. x depends on the function and is hardcoded.
int: end function: 0
if it is operator function:
int: begin function: 1
"x" times a Parameters Structure**. x depends on the function and is hardcoded.
int: end function
int: end function: 0


***Build Priorities Structure:
int: priorities type: 0
int: type: 0=unit, 1=upgrade, 2=expansion town
char[4]: Unit/Upgrade ID(if it is expansion town this value should be set to: XEIA)
int: town: 0=main, 1-9=Expansion #1-9, 0xFFFFFFFD-0xFFFFFFF5=current mine #1-9, 0xFFFFFFFF=any
int: condition index(if none set this value to 0xFFFFFFFF, if custom set this value to 0xFFFFFFFE)
1 time condition definition structure*(without condition index!)


*(4)Harvest Priorities Structure:
int: priorities type: 1
int: harvest type: 0=gold, 1=lumber
int: town: 0=main, 1-9=Expansion #1-9, 0xFFFFFFFD-0xFFFFFFF5=current mine #1-9, 0xFFFFFFFF=any
int: workers: 0-90=fixed value #0-90, 0xFFFFFFFF=all, 0xFFFFFFFE=all not attacking
int: condition index(if none, set this value to 0xFFFFFFFF, if custom, set this value to 0xFFFFFFFE)
1 time condition definition structure*(without condition index!)


*(5)Target Priorities Structure
int: priorities type: 2
int: target: 0=common alliance target, 1=new expansion location, 2=enemy major assault,
3=enemy expansion, 4=enemy any town, 5=creep camp, 6=purchase goblin zeppelin
int: creep min strength(if target is other than 5 set this value to 0xFFFFFFFF)
     if target = 5
     int: creep max strength
     int: allow flyers: 0=no, 1=yes
int: condition index(if none, set this value to 0xFFFFFFFF, if custom, set this value to 0xFFFFFFFE)
1 time condition definition structure*(without condition index!)


*(6)Attack Groups Structure
int: attack group index
string: attack group name
int: number "g" of Current Group
"g" times current group structure *(7)


*(7)Current Group Structure
char[4]: Unit ID (FirstHero: 1HIA, SecondHero: 2HIA, ThirdHero: 3HIA)
int: quantity value: 0-90=quantity #0-90, 0xFFFFFFFF=All
int: maximum quantity: 0-90=quantity #0-90, 0xFFFFFFFF=All(if quantity value is 0xFFFFFFFF, maximum quantity means all except #0-90)
int: condition index(if none, set this value to 0xFFFFFFFF, if custom, set this value to 0xFFFFFFFE)
1 time condition definition structure*(without condition index!)


*(8)Attack Waves Structure
int: attack group index
int: delay


*(9)Players Structure
int: player index
int: team number
int: race: 1=human, 2=orc, 8=undead, 4=night elf, 20=random
int: color: 0=red, 1=blue, 2=teal, 3=purple, 4=yellow, 5=orange, 6=green, 7=pink, 8=gray,
9=light blue, 10=dark green, 11=brown
int: handicap (0-100)
int: ai: 0=standard, 1=user, 4=custom, 12=current
int: ai difficulty: 0=easy, 1=normal, 2=insane
string: path to custom ai script
 

21) The others files

war3mapImported\*.* = files imported and saved by the world editor (they must be also defined in the .imp file)
(signature) = signature of the w3m file
(listfile) = list of files stored in the w3m file
(attributes) = attributes of files in the w3m file

Credits:

Thanks to Justin Olbrantz (Quantam)(Inside MoPaQ), Andrey Lelikov (LMPQ API) and ShadowFlare: they did the tools to allow me to get "inside" w3m (mpq) files.
Special thanks to BlackDick, DJBnJack, PitzerMike, StonedStoopid, Ziutek and a few others who helped me to find some stuff and work on this documentation.
War3Pub Staff and WC3Campaign Staff who hosted my stuff and let me meet interesting people.
Thanks to Blizzard Entertainment for making Warcraft III

-=Zépir oo