local weapon_value = {
  [1001001] = {
    [-1] = -1,
    [-2] = {
      [2001] = -2
    }
  },
  [1001002] = {
    [-1] = -3,
    [-2] = {
      [2001] = -4
    }
  },
  [1001003] = {
    [-1] = -5,
    [-2] = {
      [2001] = -6
    }
  },
  [1001004] = {
    [-1] = -7,
    [-2] = {
      [2001] = -8
    }
  },
  [1001005] = {
    [-1] = -9,
    [-2] = {
      [2001] = -10
    }
  },
  [1001006] = {
    [-1] = -11,
    [-2] = {
      [2001] = -12
    }
  },
  [1001007] = {
    [-1] = -13,
    [-2] = {
      [2001] = -14
    }
  },
  [1001008] = {
    [-1] = -15,
    [-2] = {
      [2001] = -16
    }
  },
  [1001009] = {
    [-1] = -17,
    [-2] = {
      [2001] = -18
    }
  },
  [1001010] = {
    [-1] = -19,
    [-2] = {
      [2001] = -20
    }
  },
  [1002001] = {
    [-1] = -21,
    [-2] = {
      [2001] = -2,
      [2003] = -22
    }
  },
  [1002002] = {
    [-1] = -23,
    [-2] = {
      [2001] = -4,
      [2003] = -24
    }
  },
  [1002003] = {
    [-1] = -25,
    [-2] = {
      [2001] = -6,
      [2003] = -26
    }
  },
  [1002004] = {
    [-1] = -27,
    [-2] = {
      [2001] = -8,
      [2003] = -28
    }
  },
  [1002005] = {
    [-1] = -29,
    [-2] = {
      [2001] = -10,
      [2003] = -30
    }
  },
  [1002006] = {
    [-1] = -31,
    [-2] = {
      [2001] = -12,
      [2003] = -32
    }
  },
  [1002007] = {
    [-1] = -33,
    [-2] = {
      [2001] = -14,
      [2003] = -34
    }
  },
  [1002008] = {
    [-1] = -35,
    [-2] = {
      [2001] = -16,
      [2003] = -36
    }
  },
  [1002009] = {
    [-1] = -37,
    [-2] = {
      [2001] = -18,
      [2003] = -38
    }
  },
  [1002010] = {
    [-1] = -39,
    [-2] = {
      [2001] = -20,
      [2003] = -40
    }
  },
  [1003001] = {
    [-1] = -41,
    [-2] = {
      [2001] = -2,
      [2003] = -22,
      [2004] = -22
    }
  },
  [1003002] = {
    [-1] = -42,
    [-2] = {
      [2001] = -4,
      [2003] = -24,
      [2004] = -24
    }
  },
  [1003003] = {
    [-1] = -43,
    [-2] = {
      [2001] = -6,
      [2003] = -26,
      [2004] = -26
    }
  },
  [1003004] = {
    [-1] = -44,
    [-2] = {
      [2001] = -8,
      [2003] = -28,
      [2004] = -28
    }
  },
  [1003005] = {
    [-1] = -45,
    [-2] = {
      [2001] = -10,
      [2003] = -30,
      [2004] = -30
    }
  },
  [1003006] = {
    [-1] = -46,
    [-2] = {
      [2001] = -12,
      [2003] = -32,
      [2004] = -32
    }
  },
  [1003007] = {
    [-1] = -47,
    [-2] = {
      [2001] = -14,
      [2003] = -34,
      [2004] = -34
    }
  },
  [1003008] = {
    [-1] = -48,
    [-2] = {
      [2001] = -16,
      [2003] = -36,
      [2004] = -36
    }
  },
  [1003009] = {
    [-1] = -49,
    [-2] = {
      [2001] = -18,
      [2003] = -38,
      [2004] = -38
    }
  },
  [1003010] = {
    [-1] = -50,
    [-2] = {
      [2001] = -20,
      [2003] = -40,
      [2004] = -40
    }
  },
  [1004001] = {
    [-1] = -51,
    [-2] = {
      [2001] = -2,
      [2003] = -22,
      [2004] = -22,
      [2005] = -52
    }
  },
  [1004002] = {
    [-1] = -53,
    [-2] = {
      [2001] = -4,
      [2003] = -24,
      [2004] = -24,
      [2005] = -54
    }
  },
  [1004003] = {
    [-1] = -55,
    [-2] = {
      [2001] = -6,
      [2003] = -26,
      [2004] = -26,
      [2005] = -56
    }
  },
  [1004004] = {
    [-1] = -57,
    [-2] = {
      [2001] = -8,
      [2003] = -28,
      [2004] = -28,
      [2005] = -58
    }
  },
  [1004005] = {
    [-1] = -59,
    [-2] = {
      [2001] = -10,
      [2003] = -30,
      [2004] = -30,
      [2005] = -60
    }
  },
  [1004006] = {
    [-1] = -61,
    [-2] = {
      [2001] = -12,
      [2003] = -32,
      [2004] = -32,
      [2005] = -62
    }
  },
  [1004007] = {
    [-1] = -63,
    [-2] = {
      [2001] = -14,
      [2003] = -34,
      [2004] = -34,
      [2005] = -64
    }
  },
  [1004008] = {
    [-1] = -65,
    [-2] = {
      [2001] = -16,
      [2003] = -36,
      [2004] = -36,
      [2005] = -66
    }
  },
  [1004009] = {
    [-1] = -67,
    [-2] = {
      [2001] = -18,
      [2003] = -38,
      [2004] = -38,
      [2005] = -68
    }
  },
  [1004010] = {
    [-1] = -69,
    [-2] = {
      [2001] = -20,
      [2003] = -40,
      [2004] = -40,
      [2005] = -70
    }
  }
}
local key_to_index_map = {id = -1, baseAttribute = -2}
local index_to_key_map = {}
for k, v in pairs(key_to_index_map) do
  index_to_key_map[v] = k
end
local value_to_index_map = {
  [1001001] = -1,
  [100.0] = -2,
  [1001002] = -3,
  [101.0] = -4,
  [1001003] = -5,
  [102.0] = -6,
  [1001004] = -7,
  [103.0] = -8,
  [1001005] = -9,
  [104.0] = -10,
  [1001006] = -11,
  [105.0] = -12,
  [1001007] = -13,
  [106.0] = -14,
  [1001008] = -15,
  [107.0] = -16,
  [1001009] = -17,
  [108.0] = -18,
  [1001010] = -19,
  [109.0] = -20,
  [1002001] = -21,
  [50.0] = -22,
  [1002002] = -23,
  [51.0] = -24,
  [1002003] = -25,
  [52.0] = -26,
  [1002004] = -27,
  [53.0] = -28,
  [1002005] = -29,
  [54.0] = -30,
  [1002006] = -31,
  [55.0] = -32,
  [1002007] = -33,
  [56.0] = -34,
  [1002008] = -35,
  [57.0] = -36,
  [1002009] = -37,
  [58.0] = -38,
  [1002010] = -39,
  [59.0] = -40,
  [1003001] = -41,
  [1003002] = -42,
  [1003003] = -43,
  [1003004] = -44,
  [1003005] = -45,
  [1003006] = -46,
  [1003007] = -47,
  [1003008] = -48,
  [1003009] = -49,
  [1003010] = -50,
  [1004001] = -51,
  [200.0] = -52,
  [1004002] = -53,
  [201.0] = -54,
  [1004003] = -55,
  [202.0] = -56,
  [1004004] = -57,
  [203.0] = -58,
  [1004005] = -59,
  [204.0] = -60,
  [1004006] = -61,
  [205.0] = -62,
  [1004007] = -63,
  [206.0] = -64,
  [1004008] = -65,
  [207.0] = -66,
  [1004009] = -67,
  [208.0] = -68,
  [1004010] = -69,
  [209.0] = -70
}
local index_to_value_map = {}
for k, v in pairs(value_to_index_map) do
  index_to_value_map[v] = k
end

local function SetReadonlyTable(t)
  for k, v in pairs(t) do
    if type(v) == "table" then
      t[k] = SetReadonlyTable(v)
    end
  end
  local mt = {
    __data = t,
    __index_to_key_map = index_to_key_map,
    __key_to_index_map = key_to_index_map,
    __index_to_value_map = index_to_value_map,
    __index = function(t, k)
      local tmt = getmetatable(t)
      local data = tmt.__data
      local value_index
      if tmt.__key_to_index_map[k] ~= nil then
        value_index = data[tmt.__key_to_index_map[k]]
      else
        value_index = data[k]
      end
      if type(value_index) == "table" then
        return value_index
      else
        return tmt.__index_to_value_map[value_index]
      end
    end,
    __newindex = function(t, k, v)
      errorf("attempt to modify a read-only talbe!", 2)
    end,
    __pairs = function(t, k)
      return function(t, k)
        local tmt = getmetatable(t)
        local data = tmt.__data
        local nk, nv
        if tmt.__key_to_index_map[k] ~= nil then
          local iter_key = tmt.__key_to_index_map[k]
          nk, nv = next(data, iter_key)
        else
          nk, nv = next(data, k)
        end
        local key, value
        if tmt.__index_to_key_map[nk] ~= nil then
          key = tmt.__index_to_key_map[nk]
        else
          key = nk
        end
        if type(nv) == "table" then
          value = nv
        else
          value = tmt.__index_to_value_map[nv]
        end
        return key, value
      end, t, nil
    end,
    __len = function(t)
      local tmt = getmetatable(t)
      local data = tmt.__data
      return #data
    end
  }
  t = setmetatable({}, mt)
  return t
end

weapon_value = SetReadonlyTable(weapon_value)
return weapon_value
