ItemType.dat

This file is loaded when the client starts. It defines every item in the game such as equipment, weapons, consumables, mounts, soul/purification, garments, crafting materials, and more.

Records in itemtype.dat are the default values for the item, MsgItemInfo can be used to supply some of the dynamic values (such as the socketed gems, expiration time, durability and more)

See Item ID for the full breakdown of how Item IDs encodes information such category, weapon type, item level & quality for equipment.

Table of Contents

Patch 5517

In Patch 5517, this file is encrypted with TQ File Cipher with seed: 9527 (0x2537).

File Format

After decryption, the file is plain-text with an item record-per-line. Each field is separated by @@ and ends with a trailing @@\r\n.

~ is used as space characters and backticks (`) used as apostrophe in fields such as item name and description.

Record Structure

FieldNameTypeDescription
1iduint32Item ID
2namestringItem Name
3req_professionuint8Required Hero Profession
4req_weaponskilluint8Required Weapon Proficiency level
5req_leveluint8Minimum character level required to equip or use
6req_sexuint8Hero gender restriction (0=any, 1=Male , 2=Female)
7req_forceuint16Required Strength attribute amount
8req_speeduint16Required Agility attribute amount
9req_healthuint16Required Vitality attribute amount
10req_souluint16Required Spirit attribute amount
11monopolyuint8Bitmask trade, warehouse, bound, lock & drop restrictions
12weightuint16Used on a few event item tooltips
13priceint32NPC buy price in silver
14id_actionint32Script or action ID to trigger on use or equip (0 = none)
15attack_maxuint16Maximum physical attack
16attack_minuint16Minimum physical attack
17defenseuint16Physical defense bonus
18agilityuint16Agility bonus
19dodgeuint16Dodge bonus
20lifeuint16HP bonus
21manauint16MP bonus
22durabilityuint16Default durability. In the item tooltip this is displayed as floor(value / 100)
23durability_limituint16Maximum durability. In the item tooltip this is displayed as floor(value / 100)
24identifieduint8Unused
25gem1uint8Socket 1 Gem Item ID (0 = empty socket)
26gem2uint8Socket 2 Gem Item ID (0 = empty socket)
27magic1int32Unused, set via MsgItemInfo
28magic2uint8Unused, set via MsgItemInfo
29n_amountuint8+N item value & +N item stones
30dataint32Unused, set via MsgItemInfo for additional attributes (socket progress, container amount)
31magic_atkuint16Magic attack bonus
32magic_defuint16Magic defense bonus
33atk_rangeuint16Attack range
34atk_speeduint16Attack speed
35fray_modeuint8Unknown 0 on all normal equipment. 2 on garments & mount armor. (Suspected: Different durability algorithm for garments)
36repair_modeuint8Unknown 0 on normal equipment. 2 on garments & mount armor. 3 on gourds. (Suspected: Different repair mechanic for garments / gourds)
37type_maskuint8Is set to 1 on Cosmetic Equipment (Garments / Mounts) appears client uses it in Character Pose Actions (Unknown purpose)
38emoney_priceint32Conquer Points (CP) shop price. 0 = not sold for CP
39emoney_bound_priceint32Bound Conquer Points (CP) Shop Price. 0 = not sold for Bound CP
40expiry_timeint32Item duration in minutes. Used on some mounts, cosmetics & quest items
41soul_atk_1int32Soul - Critical Strike percentage bonus (value / 100)%
42soul_atk_2int32Soul - Skill Critical Strike percentage bonus (value / 100)%
43soul_def_1int32Soul - Immunity percentage bonus (value / 100)%
44soul_atk_3int32Soul - Penetration percentage bonus (value / 100)%
45soul_def_2int32Soul - Block percentage bonus (value / 100)%
46soul_atk_4int32Soul - Breakthrough percentage bonus (value / 10)%
47soul_def_3int32Soul - Counteraction percentage bonus (value / 10)%
48max_stack_sizeint32Maximum amount the same item can be stacked in same item slot
49elem_res_metalint32Metal element resistance bonus (unused)
50elem_res_woodint32Wood element resistance bonus
51elem_res_waterint32Water element resistance bonus
52elem_res_fireint32Fire element resistance bonus
53elem_res_earthint32Earth element resistance bonus
54item_typestringTooltip description of the item type
55descriptionstringTooltip long description about the item
56quality_colorint32For non-equipment, the item name color. Quality value same as Equipment Quality
57dragonsoul_phaseuint16Dragonsoul phase number (1-6)
58dragonsoul_reqint32Dragonsoul requirement to reach next phase
59crop_qualityint32Only used by item Riding Crop quality (1=Unique, 2=Elite, 3=Super)

Parsing Script (To CSV)

You must first decrypt itemtype.dat using TQ File Cipher with seed: 9527 (0x2537). Then you can use this python script to parse the file and output it as a CSV file.

Pass the decrypted itemtype.dat path as the first arg & it will output a csv called itemtype.csv. This script has no error handling, checks or dependencies as it is intentionally kept minimal for readability.

Example: python3 itemtype_decode.py itemtype_decrypted.dat

import csv, sys

# NOTE: This script has only been tested on client 5517 itemtype.dat. Other patches may have a different amount of fields so this script will not work
FIELDS_PATCH_5517 = [
    "id", "name", "req_profession", "req_weaponskill", "req_level", "req_sex",
    "req_force", "req_speed", "req_health", "req_soul", "monopoly", "weight",
    "price", "id_action", "attack_max", "attack_min", "defense", "agility",
    "dodge", "life", "mana", "durability", "durability_limit", "identified",
    "gem1", "gem2", "magic1", "magic2", "n_amount", "data", "magic_atk",
    "magic_def", "atk_range", "atk_speed", "fray_mode", "repair_mode", "type_mask",
    "emoney_price", "emoney_bound_price", "expiry_time", "soul_atk_1", "soul_atk_2",
    "soul_def_1", "soul_atk_3", "soul_def_2", "soul_atk_4", "soul_def_3",
    "max_stack_size", "elem_res_metal", "elem_res_wood", "elem_res_water",
    "elem_res_fire", "elem_res_earth", "item_type", "description",
    "quality_color", "dragonsoul_phase", "dragonsoul_req", "crop_quality",
]

input_path  = sys.argv[1]
output_path = sys.argv[2] if len(sys.argv) > 2 else "itemtype.csv"

# Some items have chinese characters (gbk encoding) & mark unknown characters with '?'
with open(input_path, "r", encoding="gbk", errors="replace") as f_in, \
     open(output_path, "w", newline="", encoding="utf-8") as f_out:

    writer = csv.writer(f_out)
    writer.writerow(FIELDS_PATCH_5517)
    skipped = 0
    rows_extracted = 0

    for line in f_in:
        line = line.strip()
        if not line:
            continue
        parts = line.split("@@")
        if parts[-1] == "":
            parts = parts[:-1]
        if len(parts) != len(FIELDS_PATCH_5517):
            skipped += 1
            continue
        writer.writerow(parts)
        rows_extracted += 1

    if skipped > 0:
        print(f"Warning: {skipped} rows were skipped as they had an incorrect amount of fields.")

print(f"Completed {rows_extracted} extracted from {input_path} to {output_path}")