NPCs Taxis and Crafters now checks properly
Fixed taxis that wouldn't check for mesos upon travel. Fixed crafters that wouldn't check for inventory slots available before crafting items.
This commit is contained in:
@@ -165,8 +165,14 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (status == 4 && mode == 1) {
|
||||
var complete = true;
|
||||
var recvItem = item, recvQty;
|
||||
|
||||
if (item == 4003000)//screws
|
||||
recvQty = 15 * qty;
|
||||
else
|
||||
recvQty = qty;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(recvItem, recvQty)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -186,27 +192,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/*
|
||||
if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++)
|
||||
{
|
||||
if (matQty[i] * qty == 1) {
|
||||
if (!cm.haveItem(mats[i]))
|
||||
{
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (!cm.haveItem(mats[i],matQty[i]*qty)) complete=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!cm.haveItem(mats,matQty)) complete=false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if (!complete)
|
||||
@@ -223,10 +208,7 @@ function action(mode, type, selection) {
|
||||
if (cost > 0)
|
||||
cm.gainMeso(-cost * qty);
|
||||
|
||||
if (item == 4003000)//screws
|
||||
cm.gainItem(4003000, 15 * qty);
|
||||
else
|
||||
cm.gainItem(item, qty);
|
||||
cm.gainItem(recvItem, recvQty);
|
||||
cm.sendOk("Did that come out right? Come by me again if you have anything for me to practice on.");
|
||||
}
|
||||
cm.dispose();
|
||||
|
||||
Reference in New Issue
Block a user