-
Notifications
You must be signed in to change notification settings - Fork 0
/
SetPrices.js
34 lines (32 loc) · 1012 Bytes
/
SetPrices.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const WEEKS = 1
let dice = (die, mod) => Math.floor(Math.random() * die) + 1 + mod
let non = () => dice(0, -1)
let common = () => dice(51, 49)
let uncommon = () => dice(400, 100)
let rare = () => dice(4500, 500)
let veryRare = () => dice(45000, 5000)
game.actors.get("q9l283Uwu4Q8eSkH").items.filter(i => i.system.price.value == 0).forEach(j => {
//console.log(j)
let rarity = j.system.rarity
let func = non
switch (rarity) {
case "common":
func = common
break;
case "uncommon":
func = uncommon
break;
case "rare":
func = rare
break;
case "veryRare":
func = veryRare
break;
default:
func = non
console.log(j)
}
var NuP = Math.max(...Array.from({ length: WEEKS }, () => func()))
console.log(NuP)
j.update({"system.price.value": NuP, "system.quantity": 99999})
})