socket-colors-chance

4.0.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i socket-colors-chance

Weekly Downloads

24

Version

4.0.0

License

MIT

Unpacked Size

37.8 kB

Total Files

12

Last publish

Collaborators

  • kenan