Getting Started with Diablo 2 Modding

In this tutorial I will teach you how to make a simple item that can be found on a vendor's "Misc" tab.
What you will need:
- A copy of Diablo 2, patched to 1.10 or higher.
- An MPQ archive viewer.
- A listfile for the MPQ Viewer.
- A spreadsheet viewer, I recommend AFJ's Sheet Ediror as it is free.
- A .TBL file editor.
- Knowledge of how to work spreadsheets, like in MS Excel.
Getting Started:
Before you can get started, you need to open the listfile with MPQ View. Here's how you do this:
- Open MPQView.exe
- Go to File > Open Data File
- Navigate to your listfile, the one that you downloaded (The .txt file)
Next, we need to make a few folders:
- Navigate to your installation of Diablo 2. If you used the default path, it should be under
C:\Program Files\Diablo II. - Create a folder in here called 'data'.
- Then create two folders inside 'data', one called 'local' and the other called 'global'.
- Go into the 'Local' folder, and create a folder called 'LNG'
- Go into 'Local' and create a folder called 'ENG'
- Go back to 'data', and open 'global'.
- Create a folder in 'global', called 'excel'.
Now, lets open up the game's MPQ files to get the files we need:
- Open MPQView.exe
- Click the 'Open Archive' button.
- Navigate to your Diablo 2 directory, and select 'patch_d2.mpq'
- If you followed the first part of the tutorial correctly, then you should have a long list. If not, try again.
- Find this file in the list: 'data\global\excel\ItemTypes.txt'.
- Select the file, and click on the Save button.
- Navigate to your Diablo 2 directory, and open 'data', then 'global', then 'excel'. Save the file in here.
- Repeat steps 6-7 on 'data\global\excel\misc.txt'
- Find 'data\local\lng\eng\patchstring.tbl'. Click save, navigate to your Diablo 2 directory, then go to 'data', then 'local', then 'lng', then 'eng', and save it here.
Now, lets make the item:
- Open AFJ's Sheet Edit.
- Click File > Open
- Navigate to your Diablo 2 directory, then to your data\global\excel folders that you made earlier
- Open misc.txt.
- This will probably confuse you. So pay attention. On the upper toolbar, click both of the buttons to the right of the yellow question mark. When you hover over them, they should say 'Fix First Column' and 'Fix First Row'. Now if you move your spreadsheet around, the first row and first column will follow you.
- Right click (anywhere), and go to Row Operations > Add Row. This should bring up a text box. Just click OK for now, because we only want to make one item.
- Click on 'Fix first column' to unfix the first column.
- Scroll down to the last row.
- On the very first box of the last row, type 'Test Item' and click on 'Fix First Column' again.
- Now fill in these fields on your row:
*name: Test Item
compactsave: 1
version: 100
level: 1
levelreq: 1
rarity: 1
spawnable: 1
speed: 0
nodurability: 1
cost: (Insert any amount, this is how much the item sells for)
code: stw0
alternategfx: brz
namestr: stw0
component: 16
invwidth: 1
invheight: 1
hasinv: 0
gemsockets: 0
gemapplytype: 0
flippyfile: flphrb
invfile: invhrb
transmogrify: 0
tmogtype: xxx
useable: 0
throwable: 0
type: junk
dropsound: item_herb
dropsfxframe: 14
usesound: item_herb
unique: 0
transparent: 0
transtbl: 5
lightradius: 0
belt: 0
autobelt: 0
stackable: 0
minstack: 0
maxstack: 0
spawnstack: 0
missiletype: 0
spellicon: -1
durwarning: 0
qntwarning: 0
gemoffset: 0
bettergem: non
bitfield1: 0
CharsiMagicLvl, GheedMagicLvl, AkaraMagicLvl, FaraMagicLvl, LysanderMagicLvl, DrognanMagicLvl, HraltiMagicLvl, AlkorMagicLvl, OrmusMagicLvl, ElzixMagicLvl, AshearaMagicLvl, CainMagicLvl, HalbuMagicLvl, MalahMagicLvl, LarzukMagicLvl, DrehyaMagicLvl and JamellaMagicLvl: 255
AkaraMin: 1
Akaramax: 1
Transform: 0
Invtrans: 0
Skipname: 0
NightmareUpgrade: xxx
Hellupgrade: xxx
*eol: 1
Leave all the other columns blank.
Heres an explanation for each of the fields:
- Name: This field isn't loaded, its just used in reference by the user.
- *name: This field isn't loaded either.
- compactsave: When 1, the item cannot be magic, rare, set, unique, crafted, or socketed.
- version: When 0, this item only loads in classic d2. When 1, it loads in both classic and the expansion set. When it is 100, it only loads in the expansion.
- level: Each item has its own, undisplayed 'Item Level'. Its used by the monster drop schematics, I won't go much into it. This is NOT the item's level requirement, levelreq is.
- levelreq: The item's level reqirement to be used, as in armor and potions
- rarity: The higher this is, the more likely it is to drop.
- spawnable: If you want your item to show up ingame, put a 1 here.
- nodurability: If 1, the item has no durability.
- cost: Vender cost.
- code: Each item has its own unique code. Every single item must have its own code or else it won't work properly. Codes can be 3 or 4 characters long, and can use numbers, letters, and they are case sensitive.
- alternategfx: This column is useless in misc.txt. Its only used for armor and weapons. Put something here to avoid issues though.
- namestr: This is the string that is loaded for the name. Use the same thing you put in your code column to avoid conflicts.
- component: What part of the body the item equips to, put 16 for an unequipable item.
- invwidth: The width of the item, in inventory squares.
- invheight: The height of the item, in inventory squares. Note, invheight and invwidth must follow the picture correctly, or else it'll look weird in your inventory.
- hasinv: If 1, this item can have sockets. Other than that, this column appears to do nothing.
- gemsockets: The maximum number of sockets this item can spawn with.
- gemapplytype: Determines what category this item falls into when socketing.
0: Weapons
1: Armor
2: Shields
- flippyfile: The animation file that is used when the item is flipping around in the air, before you pick it up.
- invfile: The image file that is used on the inventory screen.
- transmogrify: This is an unused feature from Diablo 2 alpha that still works. If this is 1, and TMogType is set to an item code, you can right click on this item and it will turn into the item that uses TMogType's itemcode.
- TMogType: See 'transmogrify'.
- useable: Whether this item can be used with Right Click. Turn this on for Transmogrify Items.
- throwable: Whether this item can be thrown.
- type: Each item belongs to an 'itemtype', or a classification. Itemtypes are used to set properties to items belonging to a category.
- dropsound: The sound file that the item uses when dropped or fooled around with in the inventory.
- dropsfxframe: What frame of the flippyfile animation to play the sound.
- usesound: The sound used when used via right click.
- unique: Whether this item is unique. Example: The Jade Figurine in Act 3.
- transparent: Unknown. All have 0 (except Torch)
- transtbl: When set to 5, gems tocketed in this item will turn the item the appropriate color.
- lightradius: The light radius that this item gives off when equipped.
- belt: Whether this item can be placed in a belt slot.
- autobelt: Whether this item automatically appears in your belt when you pick it up off the ground.
- stackable: Whether this item can stack.
- minstack: Minimum stack sold from vendors
- maxstack: The highest this item can stack up to.
- spawnstack: How high the stack will be when the character picks this off a monster drop ~ approximate.
- missiletype: What missile this item will spawn when thrown.
- SpellIcon: Im not sure. Probably has to do with throwing items.
- durwarning: What icon is used when you are low on durability.
- qntwarning: How low the durability can go before you are warned.
- gemoffset: Unknown, believed to be involved with the way the gem is positioned or how the sockets are alligned.
- bettergem: What gem to upgrade to when used by a gem shrine.
- bitfield1: Related to Iron Golem in some way.
- {Vendor}MagicLvl: How strong the magic prefixes can be from magic items this vendor sells.
- {Vendor}Min/Max: How many items of this type (minimum/maximum) that this vendor can sell.
- {Vendor}MagicMin/MagicMax: How many magic items of this type (minimum/maximum) that this vendor can sell.
- Transform: Unknown.
- InvTrans: Unknown.
- Skipname: Unknown.
- NightmareUpgrade: The Exceptional variant of this item
- HellUpgrade: The Elite variant of this item
- *eol: End of Line. Always put a 0 here to avoid errors.
Here's a fileguide, just in case you want info on the other stuff (by the way, it was written for 1.09x, so some columns may be missing).
11. Now save misc.txt
Making the ItemType:
- Open ItemTypes.txt in your excel folder.
- Add a new row to the end of the file.
- In the first column of the last row, put 'Junk'.
- Fix the columns and rows.
- Put these fields in:
Code: Junk
Equiv1: misc
Repair: 0
Body: 0
Throwable: 0
Reload: 0
Reequip: 0
Autostack: 0
Normal: 0
Charm: 0
Beltable: 0
MaxSock1: 0
MaxSock25: 0
MaxSock40: 0
TreasureClass: 0
Rarity: 3
Costformula: 0
VarInvGFX: 0
StorePage: 0
*eol: 0
Leave all other columns blank.
Heres a file guide, in case you need it.
Now lets take a look at what these rows do:
- Code: What code this goes by, uses the same rules as misc.txt codes
- Equiv1: What item type is the same as this.
- Repair: Whether items in this category can be repaired.
- Body: Whether items in this category can be equipped.
- Throwable: Whether items in this category are throwable.
- Reequip: Whether items can replenish their quantity by dragging another item of the same code over them. Like Javelins, arrows, etc.
- AutoStack: Whether items automatically stack when picked up in this category.
- Normal: Whether these items always spawn as normal.
- Charm: Whether these items are a charm (Used for the
stub)
- Gem: Whether these items are gems.
- Beltable: Whether items in this category can be belted
- MaxSock1: Maximum Sockets at Item Level 1
- MaxSock25: Maximum Sockets at Item Level 25
- MaxSock40: Maximum sockets at Item Level 40
- TreasureClass: Whether these items use an auto-generated Treasure Class (I will be discussing Treasure Classes in a next lesson, they deal with how items are dropped.)
- Rarity: How rare items from this category are dropped.
- VarInvGfx: This is used for charms. When true, items in this category use multiple different graphics. I will be discussing this in another lesson.
- Storepage: What page of the vendor's store these items go into.
- *Eol: Put a 0 here, always.
6: Save Itemtypes.txt and close AFJ Sheet
Making a new string:
Since you have made a new item, you need a new string to go with it as well. Not making a string for your item will cause the name of your item to be 'An Evil Force'
Lets hop to it then! This is fast.
- Open Darkstorm's TBL Editor.
- Go to File > Open
- Navigate to your Diablo 2 directory, then to 'data/local/lng/eng'.
- Open 'patchstring.tbl'.
- Lets take a minute to examine what we see. On the left pane, you can see the strings, in String ID form. On the right, you can see the actual ingame string.
If you go down to a string which uses multiple lines for its ingame version, you may notice something odd. The strings are read backwards sort of. Thats the way the game reads them, it
reads the bottom row and then the top row.
So this in the TBL editor...
to see a brighter future
We must push on if we hope
Will look like this ingame...
We must push on if we hope
to see a brighter future
5. Now lets make a new string. Click on the plus sign, and you will be prompted to type in the String Id. Type in stw0.
6. On the right pane (the ingame one), type in 'Test Item'.
7. Save patchstring.tbl.
Setting the game up to suit your mod
Now that we have made the item, we need to set the game up in order to read our mod correctly:
- Create a new shortcut to Diablo 2.
- Right click on it, and select Properties from the box.
- In the "Target:" text input, add "-direct -txt" (without quotes) after everything. So like this:TARGET: "C:\Program Files\Diablo II\Diablo II.exe" -direct -txt
Congratulations!
You have made your first mod. You can now run the game, and see your item in Akara's Misc. tab.

