4.0.0 • Published 2 years ago
socket-colors-chance v4.0.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
var socketColorsChance = require('socket-colors-chance');
socketColorsChance({
sockets: 3,
red: 1,
green: 1,
blue: 1
});
// => 0.2222222222222222Installation
$ npm install socket-colors-chanceAPI
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 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.