mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-14 10:33:47 -05:00
Merge pull request #193 from Crowns3bc/Allow-a-quantity-of-items-to-drop-from-chests
Allow a quantity of items to drop from chests
This commit is contained in:
+2
-2
@@ -1903,13 +1903,13 @@ function drop_item_logic(drop, def, pvp) {
|
|||||||
} else if (def[1] == "open") {
|
} else if (def[1] == "open") {
|
||||||
chest_exchange(drop, def[2]);
|
chest_exchange(drop, def[2]);
|
||||||
} else {
|
} else {
|
||||||
var item = create_new_item(def[1]);
|
var item = create_new_item(def[1], def[2]);
|
||||||
if (pvp) {
|
if (pvp) {
|
||||||
item.v = new Date();
|
item.v = new Date();
|
||||||
}
|
}
|
||||||
for (var i = 0; i < drop.items.length; i++) {
|
for (var i = 0; i < drop.items.length; i++) {
|
||||||
if (can_stack(drop.items[i], item)) {
|
if (can_stack(drop.items[i], item)) {
|
||||||
drop.items[i].q += 1;
|
drop.items[i].q += def[2] ?? 1;
|
||||||
added = true;
|
added = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3566,7 +3566,7 @@ function chest_exchange(chest, name) {
|
|||||||
} else if (drop[1] == "open") {
|
} else if (drop[1] == "open") {
|
||||||
chest_exchange(chest, drop[2]);
|
chest_exchange(chest, drop[2]);
|
||||||
} else {
|
} else {
|
||||||
chest.items.push(create_new_item(drop[1]));
|
chest.items.push(create_new_item(drop[1], drop[2]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user