4.0.0 • Published 8 months ago

socket-colors-chance v4.0.0

Weekly downloads
39
License
MIT
Repository
github
Last release
8 months ago

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.

4.0.0

8 months ago

3.0.0

1 year ago

1.1.1

2 years ago

2.0.0

2 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago