pool = [40, 55, 122, 345, 531];
loot = pool[Math.floor(Math.random() * pool.length)];
$gameParty.gainItem($dataItems[loot], 1);
Apparently, array is static and can't be changed. Stack overflow told me to use arraylist since it is dynamic, except that I don't know how to implementpool = [40, 55, 122, 345, 531];
loot = pool[Math.floor(Math.random() * pool.length)];
$gameParty.gainItem($dataItems[loot], 1);
pool.remove(loot);
next = loot + 1;
pool.add(next);