War2.ru Slogan
News: Back by popular demand, the SMF Arcade!!!
PLAY NOW!!!!!!!!!!!!!!!!!!!!!!!!

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Welcome to the forums! We're glad to have you here! :) You can register your account here, then feel free to introduce yourself in the Server.War2.ru board & let us know who you are on the server.

Tons of information to help you MODIFY war2! 1782  3

Death Knight Posts: 2580 Karma: +83/-4 *********


  • Death Knight
  • *********
  • *
  • Posts: 2580
    • View Profile
Tons of information to help you MODIFY war2!
« on: May 24, 2015, 02:12:55 PM »
Edit game saved .sav
Warcraft 2: Tides of Darkness and Beyond The Dark Portal - Offset List
By Mordor  mailto:mordor@opnt.optimus.wroc.pl
v1.00 ENGLISH (01/18/97)
You will need any hex editor to perform these cheats. With editor load open savegame file (*.sav).


2F4h RED
2F5h BLUE (default for human)
2F9h BLACK (default for orc)
Status :
00h Human
01h Computer
02h In prison
03h None
OBJECTS (132 bytes):

368882 (5A0F2h) First object
289650 (46B72h) Last object (numbering starts from -1 and goes down)

Offs Name Type Max Description

+1E Energy WORD (FF FF)
+21 Type BYTE (00h - 68h) in new scenarios bigger values are used
+22 Magic BYTE (FF)
+23 Bitmap BYTE (FF) in original version equal to type
+27 Menu BYTE (FF) in original version equal to type
+28 Side BYTE (00h - 07h, 0Fh - neutral)
+29 Color BYTE (00h - 07h)
+7E Resources WORD (FF FF) value * 100
UNIT TYPES (BE - Beyond the Dark Portal):

00h Footman
01h Grunt
02h Peasant
03h Peon
04h Ballista
05h Catapult
06h Knight
07h Ogre
08h Elven Archer
09h Troll Axethrower
0ah Mage
0bh Death Knight
0ch Paladin
0dh Ogre-Mage
0eh Dwarven Demolition Squad
0fh Goblin Sappers
10h Peasant
11h Peon
12h Ranger
13h Berserker
14h Alleria (BE)
15h Teron Gorefiend (BE)
16h Kurdran (BE)
17h Dentorg (BE)
18h Khadgar (BE)
19h Grom Hellscream (BE)
1ah Oil Tanker
1bh Oil Tanker
1ch Transport
1dh Transport
1eh Elven Destroyer
1fh Troll Destroyer
20h Battleship
21h Ogre Juggernaught
23h Deathwing (BE)
26h Gnomish Submarine
27h Giant Turtle
28h Gnomish Flying Machine
29h Goblin Zeppelin
2ah Gryphon Rider
2bh Dragon
2ch Turalyon (BE)
2dh Eye Of Kilrogg
2eh Danath (BE)
2fh Korgath Bladefist (BE)
31h Cho'gall
32h Lothar
33h Gul'dan
34h Uther Lightbringer
35h Zuljin
37h Skeleton
38h Daemon
39h Critter
3ah Farm
3bh Pig Farm
3ch Barracks
3dh Barracks
3eh Church
3fh Altar Of Storms
40h Scout Tower
41h Watch Tower
42h Stables
43h Ogre Mound
44h Gnomish Inventor
45h Goblin Alchemist
46h Gryphon Aviary
47h Dragon Roost
48h Shipyard
49h Shipyard
4ah Town Hall
4bh Great Hall
4ch Elven Lumber Mill
4dh Troll Lumber Mill
4eh Foundry
4fh Foundry
50h Mage Tower
51h Temple Of The Damned
52h Blacksmith
53h Blacksmith
54h Refinery
55h Refinery
56h Oil Platform
57h Oil Platform
58h Keep
59h Stronghold
5ah Castle
5bh Fortress
5ch Gold Mine
5dh Oil Patch
5eh Entry Point
5fh Entry Point
60h Guard Tower
61h Guard Tower
62h Cannon Tower
63h Cannon Tower
64h Circle Of Power
65h Dark Portal
66h Runestone
67h Wall
68h Wall

Savegame editor is available as FREEWARE. All above information is used to write it. It was tested with Beyond the Dark Portal expansion.
If you know something to make this document better please send your comments to: mordor@opnt.optimus.wroc.pl


Edit puds .pud
WarCraft II PUD Specs

This information was compiled by Daniel Lemberg, with a trusty hex editor
and a copy of WarCraft II. If you find out what any of the unknown
sections are, let me know at lemberg@bayserve.net, and I'll add your name
and accomplishments to Appendix E. The most recent version of this file
can be obtained at http://www.bayserve.net/~lemberg

In the context of this doc, a byte is an 8 bit unsigned value, a word is a
16 bit unsigned value, and a long is a 32 bit unsigned value.


   4 bytes      header
   long      length
   ...      data

0: Section 'TYPE', identifies as a PUD file

   9 bytes      null terminated type ('WAR2 MAP')
   7 bytes      id tag

1: Section 'VER ', identifies PUD version

   word      version ($11)

2: Section 'DESC', PUD description

   32 bytes   null terminated description

3: Section 'OWNR', identifies controller of each side

   8 bytes      the 8 player slots
   7 bytes      nobody, set to $03
   byte      neutral, set to $02

   should be:

   $02      neutral
   $03      nobody
   $04      computer
   $05      human
   $06      rescue (passive)
   $07      rescue (active)

4: Section 'ERA ', terrain type

   word      terrain

   should be:

   $00      forest
   $01      winter
   $02      wasteland
   $03      swamp

5: Section 'DIM ', map dimensions

   word      x
   word      y

6: Section 'UDTA', Unit Data (this section is optional)

   word      use default data (0 no, 1 yes)
   110 bytes   first construction frame
   110 bytes   second construction frame
   127 words   terrain independent unit graphics (obsolete)
   127 words   summer unit graphics (obsolete)
   127 words   winter unit graphics (obsolete)
   127 words   wasteland unit graphics (obsolete)
   110 longs   sight range
   110 words   hit points
   110 bytes   magic (0 no, 1 yes)
   110 bytes   build time
   110 bytes   1/10 gold cost
   110 bytes   1/10 lumber cost
   110 bytes   1/10 oil cost
   110 longs   unit size (x then y)
   110 longs   box size (x then y)
   110 bytes   attack range
   110 bytes   reaction range
   110 bytes   unknown
   110 bytes   armor
   110 bytes   selectable via rectangle (0 no, 1 yes)
   110 bytes   priority (the higher, the fewer)
   110 bytes   basic damage
   110 bytes   piercing damage
   110 bytes   weapons upgradable (0 no, 1 yes)
   110 bytes   armor upgradable (0 no, 1 yes)
   110 bytes   missile weapon

      0x00   lightning
      0x01   griffon hammer
      0x02   dragon breath
      0x03   flame shield
      0x04   flame shield (self)
      0x05   blizzard
      0x06   death and decay
      0x07   big cannon
      0x08   black powder
      0x09   heal effect
      0x0a   touch of death
      0x0b   rune
      0x0c   tornado
      0x0d   catapult rock
      0x0e   ballista bolt
      0x0f   arrow
      0x10   axe
      0x11   submarine missile
      0x12   turtle missile
      0x13   dark flame
      0x14   bright flame
      0x15   blood
      0x16   more black powder
      0x17   explosion
      0x18   small cannon
      0x19   metal spark
      0x1a   mini-explosion
      0x1b   demon fire
      0x1c   green cross
      0x1d   none

   110 bytes   unit type (0 land, 1 fly, 2 naval)
         only changes appearance
   110 bytes   decay rate (dies in rate * 6 secs time, 0 never decays)
         only applies to units you build or create via spell
   110 bytes   unknown
   58 bytes   (1: can move, 2: peasant, 4: sapper)
         only the first 58 units, sometimes crashes if wrong
   110 words   point value for killing unit
   110 bytes   can target (1 land, 2 sea, 4 air, OR together)
         note: some missiles can't hit air units
   110 longs   flags

   bit     1               2               4               8
   0       unused (?)
   1       deposit oil     sapper          mage            hits back
   2       big tower       oil well        gold mine       hero
   3       shore building  spells          deposit wood    attack
   4       deposit gold                    can bombard     is undead
   5       peaasant        tanker          transport       oil well
   6       critter         building        is sub          sees subs
   7       land            fly             corpse explodes naval

   See Appendix A for correct order of units inside the 110 values.

7: Section 'UGRD', Upgrade Data, (this section is optional)

   byte      use default data (0 no, 1 yes)
   52 bytes   upgrade time
   52 words   gold cost
   52 words   lumber cost
   52 words   oil cost
   52 words   upgrade icon
   52 words   group applies to
   52 longs   unknown

   See Appendix B for correct order of upgrades inside the 52 values.

8: Section 'SIDE', Identifies race of each player

   8 bytes      the 8 player slots
   7 bytes      garbage, set  to $00
   1 byte      nuetral, set to $02

   should be:

   $00      human
   $01      orc
   $02      neutral

9: Section 'SGLD', Starting gold

   8 words      gold for the 8 players
   7 words      garbage
   1 word      gold for neutral

10: Section 'SLBR', Starting lumber

   8 words      lumber for the 8 players
   7 words      garbage
   1 word      lumber for neutral

11: Section 'SOIL', Starting oil

   8 words      oil for the 8 players
   7 words      garbage
   1 word      oil for neutral

12: Section 'AIPL', AI of each player

   8 bytes      ai for the 8 players
   7 bytes      garbage ($00)
   1 byte      ai for neutral ($00)

   See Appendix C for the known AIs.

13: Section 'MTXM', tiles map

   X*Y words   tile

   See Appendix D for general info on map tiles.

14: Section 'SQM ', movement map

   X*Y words

   should be:

   $0001      land
   $0002      coast (corner?)
   $0011      dirt
   $0040      water
   $0081      forest and mountains
   $0082      coast
   $008d      walls (crashes if not really a wall)

   Other good values:

   $0000      bridge (land, navy, air)
   $0fxx      space (nothing)
   $02xx      cave (no birds)

15: Section 'OILM', obsolete oil map

   X*Y bytes   just set it all to $00

16: Section 'REGM', action map

   X*Y words

   should be:

   $0000      water
   $4000      land
   $faff      island (no trans, no land)
   $fbff      wall
   $fdff      mountains
   $feff      forest

17: Section 'UNIT', Units

   length/8 units, where a unit is:

   word      x coord
   word      y coord
   byte      type
   byte      owner
   word      if gold mine or oil well, contains 2500 * this
         otherwise 0 passive 1 active

Appendix A: Unit Types

   00      infantry
   01      grunt
   02      peasant
   03      peon
   04      ballista
   05      catapult
   06      knight
   07      ogre
   08      archer
   09      axethrower
   0a      mage
   0b      death knight
   0c      paladin
   0d      ogre-mage
   0e      dwarves
   0f      goblin sapper
   10      attack peasant
   11      attack peon
   12      ranger
   13      berserker
   14      alleria
   15      teron gorefiend
   16      kurdan and sky'ree
   17      dentarg
   18      khadgar
   19      grom hellscream
   1a      human tanker
   1b      orc tanker
   1c      human transport
   1d      orc transport
   1e      elven destroyer
   1f      troll destroyer
   20      battleship
   21      juggernaught
   23      deathwing
   26      gnomish submarine
   27      giant turtle
   28      gnomish flying machine
   29      goblin zepplin
   2a      gryphon rider
   2b      dragon
   2c      turalyon
   2d      eye of kilrogg
   2e      danath
   2f      khorgath bladefist
   31      cho'gall
   32      lothar
   33      gul'dan
   34      uther lightbringer
   35      zuljin
   37      skeleton
   38      daemon
   39      critter
   3a      farm
   3b      pig farm
   3c      human barracks
   3d      orc barracks
   3e      church
   3f      altar of storms
   40      human scout tower
   41      orc scout tower
   42      stables
   43      ogre mound
   44      gnomish inventor
   45      goblin alchemist
   46      gryphon aviary
   47      dragon roost
   48      human shipyard
   49      orc shipyard
   4a      town hall
   4b      great hall
   4c      elven lumber mill
   4d      troll lumber mill
   4e      human foundry
   4f      orc foundry
   50      mage tower
   51      temple of the damned
   52      human blacksmith
   53      orc blacksmith
   54      human refinery
   55      orc refinery
   56      human oil well
   57      orc oil well
   58      keep
   59      stronghold
   5a      castle
   5b      fortress
   5c      gold mine
   5d      oil patch
   5e      human start
   5f      orc start
   60      human guard tower
   61      orc guard tower
   62      human cannon tower
   63      orc cannon tower
   64      circle of power
   65      dark portal
   66      runestone
   67      human wall
   68      orc wall

Appendix B: Upgrade types

   00      sword 1
   01      sword 2
   02      axe 1
   03      axe 2
   04      arrow 1
   05      arrow 2
   06      spear 1
   07      spear 2
   08      human shield 1
   09      human shield 2
   0a      orc shield 1
   0b      orc shield 2
   0c      human ship cannon 1
   0d      human ship cannon 2
   0e      orc ship cannon 1
   0f      orc ship cannon 2
   10      human ship armor 1
   11      human ship armor 2
   12      orc ship armor 1
   13      orc ship armor 2
   14      catapult 1
   15      catapult 2
   16      ballista 1
   17      ballista 2
   18      train rangers
   19      longbow
   1a      ranger scouting
   1b      ranger marksmanship
   1c      train berserkers
   1d      lighter axes
   1e      berserker scouting
   1f      berserker regeneration
   20      train ogre-mages
   21      train paladins
   22      holy vision
   23      healing
   24      exorcism
   25      flame shield
   26      fireball
   27      slow
   28      invisibility
   29      polymorph
   2a      blizzard
   2b      eye of kilrogg
   2c      bloodlust
   2d      raise dead
   2e      death coil
   2f      whirlwind
   30      haste
   31      unholy armor
   32      runes
   33      death and decay

Appendix C: Computer AIs

   $00      land attack
   $01      passive
   $02      Orc 3
   $03      Human 4
   $04      Orc 4
   $05      Human 5
   $06      Orc 5
   $07      Human 6
   $08      Orc 6
   $09      Human 7
   $0A      Orc 7
   $0B      Human 8
   $0C      Orc 8
   $0D      Human 9
   $0E      Orc 9
   $0F      Human 10
   $10      Orc 10
   $11      Human 11
   $12      Orc 11
   $13      Human 12
   $14      Orc 12
   $15      Human 13
   $16      Orc 13
   $17      Human 14 (Orange)
   $18      Orc 14 (Blue)
   $19      sea attack
   $1a      air attack
   $1b      Human 14 (Red)
   $1c      Human 14 (White)
   $1d      Human 14 (Black)
   $1e      Orc 14 (Green)
   $1f      Orc 14 (White)
   $20      Expansion 1
   $52      Expansion 51

Appendix D: General map tiles

   solid tiles

   001x      light water
   002x      dark water
   003x      light coast
   004x      dark coast
   005x      light ground
   006x      dark ground
   007x      forest
   008x      mountains
   009x      human wall
   00ax      orc walls
   00bx      human walls
   00cx      orc walls

   boundry tiles

   09..      orc wall
   08..      human wall
   07..      forest and grass
   06..      dark grass and grass
   05..      coast and grass
   04..      mount and coast
   03..      dark coast and coast
   02..      water and coast
   01..      dark water and water

   where .. is:

   filled   clear
   0x   Dx   upper left
   1x   Cx   upper right
   2x   Bx   upper half
   3x   Ax   lower left
   4x   9x   left half
   7x   6x   lower right
   8x   5x   upper left, lower right

   Black Plague tiles: these tiles have no swamp terrain
   counterpart and must be remapped.

   $003a   $003b   $004a   $004b

Appendix E: Contributers

   Scorpions (guyg2512@ele.etsmtl.ca)

      Found the extended missile types, such as the flame shield
      and blizzard missiles.

   Alexander Cech (e8900070@student.tuwien.ac.at)

      Discovered the construction frames, and the unit graphics.

    Mark Kinkead (mok@mars.superlink.net)

      Identified the reaction range section of the UDTA.
Death Knight Posts: 2580 Karma: +83/-4 *********


  • Death Knight
  • *********
  • *
  • Posts: 2580
    • View Profile
Re: Tons of information to help you MODIFY war2!
« Reply #1 on: May 24, 2015, 02:16:13 PM »
Edit exe .exe

EXE version 1.33 File Format

03:7FF1-03:81F4   L Offsets for 129 fixup table entries
        Value+381F5=place of fixup record
03:81F5-05:C2A3   L Fixup table,entry record like this

        Index :   Feature :

        00 B      Should be 07
        01 B      If 00 , then entry lenght=7
            If 10 , then entry length=9
        02 W      12 bit offset to location of code
            in the page
            *Real location =
            = this_offset+5C2A4+(1000h*entry#),
        04 B      1 = code segment
            2 = data segment
        05 W/L   Depends on section length
            Call value , the same value is on
            place pointed by Real_location
            computed like above
            This value is frequently offset to
            code section,so Value+5C2A4=asm code
07:7B34-07:7BA1   B A byte for first 106 units , unknown ???
07:7B9E-07:7C07   B Identity flag for each unit ,
        if false War2 could crash
0C:DFD8-0C:E18F   L Function Z , sets various variables
        based on the number of units of this
        type you have. Sets number of different
        types of units , number of buildings ,
        amount of produced food .
0C:E22D-0C:E286   B After death animation for first 58 units
        0=nothing,1=human corp , 2=orcish corp , 3=sink
0C:E2D0-0C:E39F   L 52 dwords victory conditions , record like this

        Index :   Meaning :

        00 B      Victory condition level

            00=own 4 farms and 1 barracks
              01=own 4 oil platforms and 1 shipyard
            02=any oil refineries in game
            03=kill attack peasants,build castle,
               destroy enemy
            04=never used
             05=free mages and peasants,destroy
            06=destroy transports,oil platforms and
            07=never used
            08=destroy dark portal
            09=destroy castle,have runestone at end
            0A=build shipyard and fortress by circle
               of power
            0B=destroy death knights and their
               temple , Grom must survive
            0C=get violet player units,destory green,
               rescue white and have all heroes
            0D=destroy all,Teron must survive
            0E=capture dragons,capture dragon roost
            0F=destroy all enemy ships,have
               5 shipyards
            10=kill daemon
            11=destroy human buildings,rescue mage,
               return him to circle of power
            12=destroy all mage towers,destroy
               violet player
            13=destroy all humans,capture dark portal
            14=rescue X units , Alleria , Danath ,
               Turalyon must survive
            15=destroy all,Danath must survive
            16=destroy all strongholds and fortresses,
               Turalyon must survive,rescue X units
            17=destroy enemy,have castle
            18=destroy enemy shipyards , have 3 owns
            19=destroy orange,bring Turalyon and
               Danath to circle
            1A=Kill Deathwing,Khadgar , Alleria ,
               Kurdran must survive
            1B=destroy black fortress,raze altar
            1C=play until retreat,heroes must survive
            1D=destroy enemy,heroes must survive
            1E=destroy dark prtal,only Khadgar can
               do this,must survive

        01 B      1=kill all
            2=rescue by contitions below
        02 W      Always set to 0000 ???

0C:E3A0-0C:E46F   L 52 dwords rescue numbers

        Index :   Meaning :

        00 B      Number of units to rescue
        01 B      00=rescue any units
            10=rescue hero-flag units
        02 W      Region flag ???

0C:E470-0C:E53F   L Unit and buildings allowed
        flags , for 1 player for 52 levels

        b00:   Footman/Grunt
        b01:   Peasant/Peon
        b02:   Ballista/Catapult
        b03:   Knight/Ogre
        b04:   Archer/Axe Thrower
        b05:   Mage/Death Knight
        b06:   Tanker
        b07:   Destroyer
        b08:   Transport
        b09:   Battleship/Juggernaught
        b0A:   Submarine/Giant Turtle
        b0B:   Flying Machine/Gobblin Zeppelin
        b0C:   Gryphon/Dragon
        b0D:   Unused       
        b0E:   Dwarves/Sappers
        b0F:   Aviary/Roost
        b10:   Farm
        b11:   Barracks
        b12:   Lumber Mill
        b13:   Stables/Mound
        b14:   Mage Tower/Temple
        b15:   Foundry
        b16:   Refinery
        b17:   Inventor/Alchemists
        b18:   Church/Altar of Storms
        b19:   Tower
        b1A:   Town Hall/Great Hall
        b1B:   Keep/Stronghold
        b1C:   Castle/Fortress
        b1D:   Blacksmith
        b1E:   Shipyard
        b1F:   Wall in multiplayer

0C:E540-0C:E60F   L Upgrade allowed flags , 52 levels

        b00   Arrow 1
        b01   Arrow 2
        b02   Sword 1
        b03   Sword 2
        b04   Shield 1
        b05   Shield 2
        b06   Ship Cannon 1
        b07   Ship Cannon 2
        b08   Ship Armor 1
        b09   Ship Armor 2
        b0A   Unused
        b0B   Unused
        b0C   Ballista 1
        b0D   Ballista 2
        b0E   Unused
        b0F   Unused
        b10   Elven Rangers
        b11   Longbow
        b12   Scouting
        b13   Ranger Markmanship
        b14   Paladins
        b15   Unused
        :   Unused
        b1F   Unused

0C:E610-0C:E6DF   L Spells allowed flags,52 levels
        b00:   Holy Vision
        b01:   Healing
        b02:   Unused
        b03:   Exorcism
        b04:   Flame Shield
        b05:   Fireball
        b06:   Slow
        b07:   Invisibility
        b08:   Polymorph
        b09:   Blizzard
        b0A:   Eye of Killrog
        b0B:   Bloodlust
        b0C:   Unused
        b0D:   Raise Dead
        b0E:   Death Coil
        b0F:   Whirlwind
        b10:   Haste
        b11:   Unholy Armor
        b12:   Runes
        b13:   Death and Decay
        b14:   Unused
        :   Unused
        b1F:   Unused
0C:E728-0C:E9D9   W Human Sound Table 345 sounds with
        references to entry number in which
        is sound stored , respect archive offsets
        Highest 3 bits are flags

        b07   ???
        b06   ???
        b05   Repeat , first unit which uses the
         same sound don't have it,others must
         or the game will crash on exit

0C:E9DA-0C:E9DB   W Just for dword align ???

0C:E9DC-0C:EC8D   W Orc Sound Table , 345 references,see above
0C:EF4C-0C:EFBF   W First 58 units number of attack
        sound in sound table for its race
0C:EFC0-0C:F0A7   L First 58 unit acknowledge function number
        Plays random acknowledge sound
0C:F0A8-0C:F11B   W First 58 units number of ready
        sound in sound table for its race
0C:F11C-0C:F203   L First 58 units selected function number
        Plays appropriate random selected or annoyed
0C:F204-0C:F23D   W Sound played when missile hits target
        *Missile types order
        00   Lightning
        01   Griffon Hammer
        02   Dragon Breath and Fireball
        03   Fireball by Flame Shield
        04   Flame Shield
        05   Blizzard
        06   Death and Deacy
        07   Big Cannon
        08   Exorcism
        09   Heal Effect
        0A   Touch of Death
        0B   Rune
        0C   Whirlwind
        0D    Catapult Rock
        0E   Ballista Bolt
        0F   Arrow
        10   Axe
        11   Submarine Missile
        12   Turtle Missile
        13   Small Fire
        14   Big Fire
        15   Ballista and Catapult impact
        16   Normal Spell
        17   Explosion
        18    Small Cannon
        19   Cannon Explosion
        1A   Cannon Tower Explosion
        1B   Daemon Fire
        1C   Green Cross
        1D    None
0D:061C-0D:070F   L Action function A calls , action legal target ???
0D:0710-0D:0803   L Action function B calls , action to take ???
        *All spells have the same
0D:0804-0D:08F7   L Action function C calls , for spells action to
        take when casting , for other actions set to 0
0D:08F8-0D:0934   B A byte for each action , various numbers from 0 to 6
0D:0935-0D:0971   B A byte for each action , from 0 to 2
0D:0972-0D:09EB W Word for each action , action flags ???
0D:09EC-0D:0A28   B Action range , for action order see Action mana

0D:2304-0D:237D   W Action mana cost , used for spells
        *Action offsets
        00   Unkonown
        01   Unknown
        02   Stop
        03   Move
        04   Unknown
        05   Patrol
        08   Attack
        0D   Stand Ground
        11   Attack Ground
        12   Unknown
        13   Demolish
        17   Harvest
        18   Return with Goods
        1B   Repair
        1C   Unknown
        1D   Unload Passengers
        26   Holy Vision
        27   Healing
        28   Unknown
        29   Exorcism
        2A   Flame Shield
        2B   Fireball
        2C   Slow
        2D   Invisibility
        2E   Polymorph
        2F   Blizzard
        30   Eye of Kilrogg
        31   Bloodlust
        32   Raise Dead
        33   Death Coil
        34   Whirlwind
        35   Haste
        36   Unholy Armor
        37   Runes
        38   Death and Decay
        3C   Unknown
0D:2380-0D:3CEF   R12 Unit commands , command offsets point here

      Index :      Meaning :

      00 W      Position of icon , 0=left upper
            9 = right down , from left to right
      02 W      Picture index , icon number
      04 L      Req Fn , requirements function
            for icon to appear
      08 L      Act Fn , what action to perform call
      0C B      Requirement fuction variable
            (for example 0,1,2 for upgrade levels)
      0D B      Action function variable
            (for example unit nr. for barracks)
      0E W      Showed string index
      10 W      Unknown , some flags
0D:3CF0-0D:3FBF   R06 Extended unit data (110 units,10 specials)

      Index :      Meaning :

      00 W      Number of commands
      02 L      Call to command data section
            of first command
            *Change command following this proc:
            Fup_tbl_entr=(file_pos-5C2A4) div 1000h
            Srch_offs=(file_pos-5C2A4) mod 1000h
            Get offset of section Fup_tbl_entr in
            fixup table and begin search for Srch_offs
            If You find it , change in Fixup Table
            record (see Fixup table ) command value
            on offset 5 of fixup record

        *Units order

        00   Footman
        01   Grunt
        02   Peasant
        03   Peon
        04   Ballista
        05   Catapult
        06   Knight
        07   Ogre
        08   Archer
        09   Axethrower
        0A   Mage
        0B   Death Knight
        0C   Paladin
        0D   Ogre Mage
        0E   Dwarves
        0F   Goblin Sappers
        10   Attack Peasant
        11   Attack Peon
        12   Ranger
        13   Berserker
        14   Alleria
        15   Teron Gorefiend
        16   Kurdan and Sky'ree
        17   Dentarg
        18   Khadgar
        19   Grom Hellscream
        1A   Tanker H
        1B   Tanker O
        1C   Transport H
        1D   Transport O
        1E   Elven Destroyer
        1F   Troll Destroyer
        20   Battleship
        21   Juggernaught
        22   Nothing
        23   Deathwing
        24   Nothing
        25   Nothing
        26   Gnomish Submarine
        27   Giant Turtle
        28   Gnomish Flying Machine
        29   Goblin Zeppelin
        2A   Gryphon Rider
        2B   Dragon
        2C   Turalyon
        2D   Eye of Kilrogg
        2E   Danath
        2F   Korgath Bladefist
        30   Nothing
        31   Cho'gall
        32   Lothar
        33   Gul'dan
        34   Uther Lightbringer
        35   Zuljin
        36   Nothing
        37   Skeleton
        38   Daemon
        39   Critter
        3A   Farm
        3B   Pig Farm
        3C   Barracks H
        3D   Barracks O
        3E   Church
        3F   Altar of Storms
        40   Scout Tower H
        41   Scout Tower O
        42   Stables
        43   Ogre Mound
        44   Gnomish Inventor
        45   Goblin Alchemist
        46   Gryphon Aviary
        47   Dragon Roost
        48   Shipyard H
        49   Shipyard O
        4A   Town Hall
        4B   Great Hall
        4C   Elven lumber mill
        4D   Troll Lumber Mill
        4E   Foundry H
        4F   Foundry O
        50   Mage Tower
        51   Temple of the Damned
        52   Blacksmith H
        53   Blacksmith O
        54   Refinery H
        55   Refinery O
        56   Oil Platform H
        57   Oil Platform O
        58   Keep
        59   Stronghold
        5A   Castle
        5B   Fortress
        5C   Gold Mine
        5D   Oil Patch
        5E   Start Location H
        5F   Start Location O
        60   Guard Tower H
        61   Guard Tower O
        62   Cannon Tower H
        63   Cannon Tower O
        64   Circle of Power
        65   Dark Portal
        66   Runestone
        67   Wall H - not yet build
        68   Wall O - not yet build
        69   Dead Body
        6A   1x1 Destroyed Place
        6B   2x2 Destroyed Place
        6C   3x3 Destroyed Place
        6D   4x4 Destroyed Place
        6E   Blank
        6F   Human Basic Build
        70   Human Advanced Build
        71   Orc Basic Build
        72   Orc Advanced Build
        73   Cancel
        74   Cancel #2 ???
        75   Cancel Group
        76   Command Group of Humans
        77   Command Group of Orcs

0D:3FC0-0D:45C3   R0E Unit data (110 units) , record like this
          *For units order see above

        Index :      Meaning :

        00 W      Unit Icon number
        02 W      Unknown , but
            0 = Dead body,start loc,destr site
            1 = Live units,farms,mine,circle,
                runestone but no magiks
            2 = Mage,D.Knight,Paladin,Ogre Mage
            3 = Other buildings??
        04 W      Unit name string number
        06 L      Function A,right click ???
        0A L      Function B,stats which are
            shown on the bar(food usage..)

Edit tiles
How the map tile graphics are stored

In maindat.war there is a section for each terrain-type, consisting of 7 entries.
I will refer to these entries as "entry A" ... "entry G"

For summer these are entry 2-8, wasteland: 10-16, winter: 18-24 and swamp: 438-444.

I will use the expressions
   - "minitile" for 8x8 pixel raw graphic data
   - "megatile" for 32x32 pixel graphics, composed out of 16 minitiles
   - "map tile" for the values used in the MTXM section in PUDs

Entry A: Color palette for the terrain type (256 * 3 bytes [RGBRGBRGB... and so on])
Entry B: Information about how to find the "minitiles" (8x8) for "megatiles" (32x32)
Entry C: Contains 16 masks (32x32) for the fog of war, followed by the minitile-data
Entry D: Information about how to find the "megatiles" for "map tiles" (the values in MTXM)
Entry E-G: Still unknown.

Confused by now ? Well, it isn't too complicated:
Each megatile is composed out of 16 minitiles in this order:

        01 02 03 04
        05 06 07 08
        09 10 11 12
        13 14 15 16

Entry B contains 16 words for each mega-tile; the last two bits of this word are mirror-flags.
if bit #0 is set you have to flip the minitile about its Y-axis, if bit #1 is set, the X-axis.
The rest of the word (word AND $FFFC) has to be multiplied by 16 to get an offset into entry C:
there you find the respective mini-tile data.

Entry D contains a chunk of 42 bytes for each unique map tile ($000x - $09Dx).
The first 16 words of this chunk contain tile-numbers for the variations of this map tile (the "x" above).
If one of these words is zero, that means the respective tile-number is not used.
(to get the correct offset just use this formula: ((map tile >> 4) * 42 + (map tile AND 15) * 2)
Then come 8 bytes and 1 word; these are still unknown.

Ok, I think an example will make this *much* clearer:
Suppose we find map tile $0052 (light grass) in MTXM.
This means we need the third (counting starts with 0) word in the fifth chunk of entry D:
5 * 42 + 2 * 2 = 214, so we read the word at offset 214 in entry D. (This is 356 for summer)
Now we have the tile-number. We need to multiply this by 32, because entry B contains 32 bytes (16 words)
for each tile-number: 356 * 32 = 11392. We go to offset 11392 in entry B; there we find an array of
16 words: $1288, $10F8, $1104, ...., $114F, $11F8.
                                         ^__ notice this one ! (see text below)

Each of these (words AND $FFFC) is the file-offset into entry C, divided by 16.
So to read the data for the first mini-tile we go to offset $12880 (= $1288 * 16) in entry C and read
64 bytes of data (64, because each minitile is size 8x8). This minitile goes directly (because neither
bit #0 or #1 is set) into the upper left corner, of the megatile.
Now the next minitile: go to offset $10F80 (= $10F8 * 16) in entry C, read 64 bytes,
place it into the second "column" in the first "row" (see illustration above). And so on...
We eventually reach the word $114F - this has both bit #0 and #1 set, meaning the tile we find at
offset $114C0 (= ($114F AND $FFFC) * 16) has to be X-flipped AND Y-flipped before copying it into
position 15 (according to the diagram above).
Continue, until we have read the last minitile at offset $11F80 and placed it into the lower right corner.

Note that there are a lot of zeroes in entry D, because not all theoretically possible map tiles are used.

If you find that there is something wrong with the above explanation, please let me know.

Alexander Cech <e8900070@student.tuwien.ac.at>


The tilenumbers 0-15 are reserved for the masks; the first "real" tilenumber is 16.
Entry B contains the following data in its first 16 chunks (each 32 bytes long):
(Offset) (Data)
$0000    $0000, 15 x $0000
$0020    $0004, 15 x $0000
$0040    $0008, 15 x $0000
$0060    $000C, 15 x $0000
$01E0    $003C, 15 x $0000

The 8 unknown bytes for each megatile in entry B are used by the map editor to
set the surroundings of a placed tile.
Death Knight Posts: 2580 Karma: +83/-4 *********


  • Death Knight
  • *********
  • *
  • Posts: 2580
    • View Profile
Re: Tons of information to help you MODIFY war2!
« Reply #2 on: May 24, 2015, 02:23:05 PM »
Edit campaigns manually.
Get a MPQ editor.


Open Ladik's MPQ Editor for example. Click the tools tab > click add > navigate to the path where you downloaded the ATTACHED list file below > click ok


Time to edit WarCraft II!

File > Open MPQ > Go to where WarCraft II is installed > Open war2dat.mpq


You can extract these maps and change them and place them back. BOOM done. Go play your custom campaigns. If you would like to change other things such as text, you would need a .bin editor.
List files http://www.zezula.net/download/listfiles.zip
(ง︡'-'︠)ง "Bitchin!" ®©℗™ Dragon Posts: 6059 Karma: +135/-70 "It's going to be Legen-(wait for it......)-DARY!" **********


  • (ง︡'-'︠)ง "Bitchin!" ®©℗™
  • Dragon
  • **********
  • *
  • Posts: 6059
  • "It's going to be Legen-(wait for it......)-DARY!"
    • View Profile
    • Clan EviL Official Page
Re: Tons of information to help you MODIFY war2!
« Reply #3 on: June 01, 2015, 01:22:05 AM »