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 = [[4010006, 4], [4010007, 4], [4020007, 4]];
function start() {
if (cm.isQuestStarted(2054) && !cm.haveItem(4031028,30)) {
if(!cm.canHold(4031028,30)) {
if (cm.isQuestStarted(2054) && !cm.haveItem(4031028, 30)) {
if (!cm.canHold(4031028, 30)) {
cm.sendNext("Check for a available slot on your ETC inventory.")
cm.dispose();
return;
}
cm.gainItem(4031028,30);
cm.gainItem(4031028, 30);
} 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();
}