Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

socket-colors-chance

kenany26MIT4.0.0

Get the chances of rolling specific socket colors on an item

path of exile

readme

socket-colors-chance

Get the chances of getting specific socket colors on a Path of Exile item.

This was extracted out of chromatic-orb since the math also applies to Vorici's recipes. Formula is based on Siveran's calculator, which is based on Lawphill's calculator.

Example

var socketColorsChance = require('socket-colors-chance');

socketColorsChance({
  sockets: 3,
  red: 1,
  green: 1,
  blue: 1
});
// => 0.2222222222222222

Installation

$ npm install socket-colors-chance

API

var socketColorsChance = require('socket-colors-chance');

socketColorsChance(opts)

Given opts, an Object, returns the probability of rolling the desired socket colors as a Number.

  • opts.sockets: number of sockets
  • opts.strength: strength requirement
  • opts.dexterity: dexterity requirement
  • opts.intelligence: intelligence requirement
  • opts.red: desired number of red sockets
  • opts.green: desired number of green sockets
  • opts.blue: desired number of blue sockets

opts.sockets and at least one of opts.{red,green,blue} are the only required parameters.

changelog

4.0.0 (2023-09-04)

⚠ BREAKING CHANGES

  • Node.js v14 and v16 are no longer supported.

Features

  • drop Node.js v14 and v16 (cfda30e)

3.0.0 (2022-12-26)

⚠ BREAKING CHANGES

  • Node.js v12 is no longer supported.

Features

  • drop Node.js v12 support (113254e)

2.0.0 (2021-12-21)

⚠ BREAKING CHANGES

  • ci: Node.js v10 is no longer supported.

Features

  • ci: drop Node.js v10 support (9b20854)

1.1.1 (2021-12-21)

Bug Fixes