{
  "_doc": "Gear Runes (เวทอุปกรณ์) P0+P1, gear runes design doc (docs/research), section 6. Per-piece fields (character_state inst_save): grade 0-4, opts [{stat, val, tier}], pity. Rolled on the SERVER only (monster drops, treasure gear, steal; crafting hook GearOpts.roll_fields). NPC shop / quest / admin pieces are always white. Nothing here is sold for real money (no P2W). 'reroll', 'lock_mult', 'pity' are data for P2/P3 (not used yet).",
  "version": 1,
  "grades": [
    {"id": "white", "name": "Common", "name_th": "ธรรมดา", "color": "#e9e4da", "lines": 0},
    {"id": "green", "name": "Fine", "name_th": "ดี", "color": "#6fdc6a", "lines": 1},
    {"id": "blue", "name": "Rare", "name_th": "หายาก", "color": "#5cb4ff", "lines": 2},
    {"id": "purple", "name": "Epic", "name_th": "ล้ำค่า", "color": "#c58cff", "lines": 3},
    {"id": "gold", "name": "Legendary", "name_th": "ตำนาน", "color": "#ffc93a", "lines": 4}
  ],
  "_drop_doc": "grade weights (%) white..gold by source. normal = field monsters + silver chests + steal, mini = mini-bosses + gold chests (at least blue), boss = MVP (at least blue, more gold).",
  "drop_weights": {
    "normal": [60, 28, 10, 1.8, 0.2],
    "mini": [0, 0, 80, 17, 3],
    "boss": [0, 0, 55, 35, 10]
  },
  "_low_doc": "pieces below req_lv 20 have at most 2 lines: their grade is capped at blue",
  "low_lv": {"below": 20, "max_lines": 2},
  "tiers": [
    {"id": "C", "color": "#8a8a8a", "w": 45, "lo": 0.20, "hi": 0.40},
    {"id": "B", "color": "#2f8a3a", "w": 32, "lo": 0.40, "hi": 0.60},
    {"id": "A", "color": "#2b6fc4", "w": 16, "lo": 0.60, "hi": 0.80},
    {"id": "S", "color": "#8b3fc8", "w": 6, "lo": 0.80, "hi": 0.95},
    {"id": "SS", "color": "#b57a00", "w": 1, "lo": 0.95, "hi": 1.00}
  ],
  "_band_doc": "level bands of the PIECE (items.json req_lv, none = 1): 1-29 / 30-59 / 60-89 / 90-119 / 120+. 'max' = the SS value of one line in that band. 'total' = cap of the sum over everything worn, read at the CHARACTER's band (keeps the whole layer near +10% power; selftest gearopt checks the worst case).",
  "bands": [1, 30, 60, 90, 120],
  "rules": {"max_same": 2, "strong_per_piece": 1},
  "cap": {"share": 0.10},
  "stats": {
    "str": {"name": "STR", "name_th": "STR", "w": 6, "max": [1, 1, 1, 2, 2], "total": [1, 1, 2, 2, 2]},
    "agi": {"name": "AGI", "name_th": "AGI", "w": 6, "max": [1, 1, 1, 2, 2], "total": [1, 1, 2, 2, 2]},
    "vit": {"name": "VIT", "name_th": "VIT", "w": 6, "max": [1, 1, 1, 2, 2], "total": [1, 1, 2, 2, 2]},
    "int": {"name": "INT", "name_th": "INT", "w": 6, "max": [1, 1, 1, 2, 2], "total": [1, 1, 2, 2, 2]},
    "dex": {"name": "DEX", "name_th": "DEX", "w": 6, "max": [1, 1, 1, 2, 2], "total": [1, 1, 2, 2, 2]},
    "luk": {"name": "LUK", "name_th": "LUK", "w": 6, "max": [1, 1, 1, 2, 2], "total": [1, 1, 2, 2, 2]},
    "batk": {"name": "ATK", "name_th": "พลังโจมตี", "w": 9, "max": [1, 1, 2, 2, 3], "total": [1, 2, 3, 3, 4]},
    "matk": {"name": "MATK", "name_th": "พลังเวท", "w": 9, "max": [1, 1, 2, 2, 3], "total": [1, 2, 3, 3, 4]},
    "hit": {"name": "HIT", "name_th": "ความแม่นยำ", "w": 8, "max": [1, 2, 2, 3, 3], "total": [2, 3, 4, 5, 6]},
    "crit": {"name": "CRI", "name_th": "คริติคอล", "w": 7, "max": [1, 1, 1, 1, 1], "total": [1, 1, 1, 1, 1]},
    "aspd_rate": {"name": "ASPD", "name_th": "ความเร็วโจมตี", "pct": true, "strong": true, "w": 4, "max": [1, 1, 1, 1, 1], "total": [1, 1, 1, 1, 1]},
    "add_race": {"name": "Damage vs %s", "name_th": "ดาเมจต่อเผ่า%s", "pct": true, "strong": true, "keys": "races", "w": 5, "max": [1, 1, 1, 2, 2]},
    "add_ele": {"name": "Damage vs %s element", "name_th": "ดาเมจต่อธาตุ%s", "pct": true, "strong": true, "keys": "elements", "w": 5, "max": [1, 1, 1, 2, 2]},
    "add_size": {"name": "Damage vs %s size", "name_th": "ดาเมจต่อขนาด%s", "pct": true, "strong": true, "keys": "sizes", "w": 5, "max": [1, 1, 1, 2, 2]},
    "def": {"name": "DEF", "name_th": "ป้องกัน", "w": 8, "max": [1, 1, 1, 1, 1], "total": [1, 1, 1, 1, 1]},
    "mdef": {"name": "MDEF", "name_th": "ป้องกันเวท", "w": 7, "max": [1, 2, 2, 3, 4], "total": [2, 3, 4, 5, 6]},
    "flee": {"name": "FLEE", "name_th": "หลบหลีก", "w": 8, "max": [1, 1, 2, 2, 3], "total": [1, 2, 2, 3, 3]},
    "max_hp_rate": {"name": "Max HP", "name_th": "HP สูงสุด", "pct": true, "w": 7, "max": [1, 1, 1, 1, 2], "total": [1, 1, 1, 2, 2]},
    "hp_recov_rate": {"name": "HP regen", "name_th": "ฟื้น HP", "pct": true, "w": 6, "max": [3, 4, 6, 8, 10], "total": [6, 8, 12, 16, 20]},
    "sub_race": {"name": "Damage from %s", "name_th": "ลดดาเมจจากเผ่า%s", "pct": true, "neg": true, "strong": true, "keys": "races", "w": 4, "max": [1, 1, 1, 1, 2], "total": [1, 1, 1, 1, 2]},
    "sub_ele": {"name": "Damage from %s element", "name_th": "ลดดาเมจธาตุ%s", "pct": true, "neg": true, "keys": "elements", "w": 6, "max": [1, 1, 1, 1, 2], "total": [1, 1, 1, 1, 2]}
  },
  "slot_pools": {
    "weapon": ["str", "agi", "vit", "int", "dex", "luk", "batk", "matk", "hit", "crit", "add_race", "add_ele", "add_size"],
    "head": ["str", "agi", "vit", "int", "dex", "luk", "batk", "matk", "hit", "crit", "aspd_rate"],
    "accessory": ["str", "agi", "vit", "int", "dex", "luk", "batk", "matk", "hit", "crit", "aspd_rate", "hp_recov_rate"],
    "armor": ["str", "agi", "vit", "int", "dex", "luk", "def", "mdef", "flee", "max_hp_rate", "sub_race", "sub_ele"],
    "shield": ["str", "agi", "vit", "int", "dex", "luk", "def", "mdef", "flee", "max_hp_rate", "sub_race", "sub_ele"],
    "garment": ["str", "agi", "vit", "int", "dex", "luk", "def", "mdef", "flee", "max_hp_rate", "sub_ele", "hp_recov_rate"],
    "shoes": ["str", "agi", "vit", "int", "dex", "luk", "def", "mdef", "flee", "max_hp_rate", "sub_ele", "hp_recov_rate"]
  },
  "keys": {
    "races": {"brute": "สัตว์", "formless": "ไร้รูป", "plant": "พืช", "demon": "ปีศาจ", "demihuman": "มนุษย์", "undead": "อันเดด", "fish": "ปลา", "insect": "แมลง", "dragon": "มังกร", "angel": "เทวดา"},
    "elements": {"neutral": "ไร้ธาตุ", "water": "น้ำ", "earth": "ดิน", "fire": "ไฟ", "wind": "ลม", "poison": "พิษ", "holy": "ศักดิ์สิทธิ์", "shadow": "มืด", "ghost": "วิญญาณ", "undead": "อมตะ"},
    "sizes": {"small": "เล็ก", "medium": "กลาง", "large": "ใหญ่"}
  },
  "_p2_doc": "P2/P3 (not used yet): Rune Dust per reroll by grade, zeny per reroll by band, lock cost multiplier by locked lines, pity bar thresholds. Rune Dust is account-bound and never sold for real money.",
  "reroll": {"dust": [0, 2, 4, 8, 16], "polish_dust": [0, 1, 2, 4, 8], "zeny": [500, 2000, 6000, 15000, 30000]},
  "lock_mult": [1, 2, 4, 8],
  "pity": {"guarantee_a": 25, "rune_select": 80}
}
