diff --git a/packages/oldschooljs/src/simulation/monsters/low/n-s/SulphurNagua.ts b/packages/oldschooljs/src/simulation/monsters/low/n-s/SulphurNagua.ts index 86b3f7d374..53d7d2af33 100644 --- a/packages/oldschooljs/src/simulation/monsters/low/n-s/SulphurNagua.ts +++ b/packages/oldschooljs/src/simulation/monsters/low/n-s/SulphurNagua.ts @@ -9,7 +9,7 @@ const SulphurNaguaTable = new LootTable() .add('Fire rune', [10, 40], 26) .add('Fire rune', [40, 60], 14) .add('Chaos rune', [40, 60], 11) - .add('Nature rune', [50, 10], 4) + .add('Nature rune', [5, 10], 4) .add('Death rune', [40, 60], 2) .add('Iron ore', [5, 10], 27) diff --git a/packages/oldschooljs/src/structures/LootTable.ts b/packages/oldschooljs/src/structures/LootTable.ts index 880b482d28..9a4d1c5221 100644 --- a/packages/oldschooljs/src/structures/LootTable.ts +++ b/packages/oldschooljs/src/structures/LootTable.ts @@ -168,13 +168,17 @@ export default class LootTable { public add( item: LootTable | number | string, - quantity: number[] | number = 1, + quantity: [number, number] | number = 1, weight = 1, options?: LootTableMoreOptions ): this { if (this.limit && weight + this.totalWeight > this.limit) { throw new Error('Loot table total weight exceeds limit'); } + if (Array.isArray(quantity) && (quantity.length !== 2 || quantity[0] > quantity[1])) { + throw new Error(`Invalid quantity array: ${quantity}`); + } + if (typeof item === 'string') { return this.add(this.resolveName(item), quantity, weight, options); } diff --git a/src/lib/shadesKeys.ts b/src/lib/shadesKeys.ts index 6f3bbb535c..08968dd20f 100644 --- a/src/lib/shadesKeys.ts +++ b/src/lib/shadesKeys.ts @@ -194,7 +194,7 @@ const GoldChest = new LootTable({ limit: 143 }) .add('Redwood logs', [5, 14], 2) .add('Dragonstone', 1, 2) .add('Clue scroll (elite)', 1, 1) - .add('Coins', [1, 3, 160]); + .add('Coins', [1, 3160]); const chests = [ {