Reformat and clean up npc scripts

This commit is contained in:
P0nk
2021-09-09 23:35:02 +02:00
parent 0c1545f81d
commit d893309b4f
665 changed files with 19932 additions and 19046 deletions

View File

@@ -25,26 +25,26 @@
var repeatablePrizes = [[4010000, 3], [4010001, 3], [4010002, 3], [4010003, 3], [4010004, 3], [4010005, 3]];
function start() {
if (cm.isQuestStarted(2052) && !cm.haveItem(4031025,10)) {
if(!cm.canHold(4031025,10)) {
if (cm.isQuestStarted(2052) && !cm.haveItem(4031025, 10)) {
if (!cm.canHold(4031025, 10)) {
cm.sendNext("Check for a available slot on your ETC inventory.");
cm.dispose();
return;
}
cm.gainItem(4031025,10);
cm.gainItem(4031025, 10);
} else {
const InventoryType = Java.type('client.inventory.InventoryType');
if(cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) {
if (cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) {
cm.sendNext("Check for a available slot on your ETC inventory.");
cm.dispose();
return;
}
var itemPrize = repeatablePrizes[Math.floor((Math.random() * repeatablePrizes.length))];
cm.gainItem(itemPrize[0], itemPrize[1]);
}
cm.warp(105040300, 0);
cm.dispose();
}