Licence
MIT
Version
5.0.0
Deps
1
Size
12 kB
Vulns
0
Weekly
0
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
import { socketColorsChance } from 'socket-colors-chance';
socketColorsChance({
sockets: 3,
red: 1,
green: 1,
blue: 1
});
// => 0.2222222222222222
Installation
$ npm install socket-colors-chance
API
import { socketColorsChance } from '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 socketsopts.strength: strength requirementopts.dexterity: dexterity requirementopts.intelligence: intelligence requirementopts.red: desired number of red socketsopts.green: desired number of green socketsopts.blue: desired number of blue sockets
opts.sockets and at least one of opts.{red,green,blue} are the only required
parameters.